/* ================== 基础布局 ================== */
body {
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  background: linear-gradient(135deg, #000000 0%, #333333 40%, #000000 100%);
  color: #f1f1f1;
  padding: 20px;
  text-align: center;
}

/* 确保主内容在导航下方 - 防止下拉菜单被遮挡 */
main {
  position: relative;
  z-index: 1;
}

/* ================== 顶部导航 ================== */
/* 导航样式已移至 partials/nav.php 内联样式中 */
/* 避免与 nav.php 中的新样式冲突 */

/* ================== 倒计时样式 ================== */
.next-draw{
  text-align:center;
  margin:40px 0 30px;
}
.next-draw h2{
  font-size:32px;
  font-weight:700;
  letter-spacing:1px;
  margin-bottom:18px;
}
.cd-wrapper{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:18px;
}
.cd-box{
  width:110px;
  padding:14px 6px 10px;
  border-radius:8px;
  background:#111;
  box-shadow:0 0 10px rgba(255,200,0,.4);
  border:2px solid transparent;
  background-image:
    linear-gradient(#111,#111),
    linear-gradient(45deg,#FFAE00 0%,#F65F26 100%);
  background-origin:padding-box,border-box;
  background-clip:padding-box,border-box;
}
.cd-box span{
  display:block;
  font-size:64px;
  font-weight:700;
  line-height:1;
  color:#fff;
}
.cd-box small{
  display:block;
  font-size:14px;
  letter-spacing:.5px;
  color:#FFEB3B;
  margin-top:4px;
  text-transform:uppercase;
}
@media(max-width:480px){
  .cd-box{width:88px;padding:10px 4px 8px;}
  .cd-box span{font-size:48px;}
  .next-draw h2{font-size:26px;}
}

/* ================== 开奖结果卡片 ================== */
#results {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 20px;
}

/* 区块样式 */
.result-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #333;
}
.section-title-bar {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #444;
}
.section-title-bar h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #FFD700;
  font-weight: 600;
  letter-spacing: 1px;
}
.section-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

/* 不同区块的边框颜色 */
.result-section[data-section="west"] {
  border-color: #FFEB3B;
}
.result-section[data-section="east"] {
  border-color: #4CAF50;
}
.result-section[data-section="others"] {
  border-color: #E91E63;
}
.result-card, .company-card {
  width: 360px;
  border-radius: 10px;
  position: relative;
  border: 2px solid transparent;
  background: #111;
  color: #fff;
  font-family: "Noto Sans", sans-serif;
  --brand-color: #444;
  background-image:
    linear-gradient(#111,#111),
    linear-gradient(45deg, var(--brand-color), #111);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 0 16px rgba(255,215,0,0.1);
  overflow: hidden;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.company-card .card-header, .result-card .card-header {
  display: flex;
  align-items: center;
  background: var(--brand-color);
  color: #fff;
  padding: 8px 12px;
}
.card-header img {
  height: 32px;
  width: auto;
  margin-right: 10px;
}
.card-header h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  flex-grow: 1;
}
.card-header .round {
  font-size: 14px;
  font-weight: 600;
}
.card-header small {
  font-size: 12px;
  color: #FFAE00;
  margin-left: 6px;
  font-weight: 600;
  animation: blink 1.2s infinite alternate;
}
@keyframes blink {
  from { opacity: 1; }
  to   { opacity: 0.5; }
}

/* 奖项表格 */
.company-card table.prize, .result-card table.prize {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}
table.prize td {
  border: 1px solid #888;
  padding: 6px 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  background: #000;
  color: #FFEB3B;
}

/* special/consolation 标题 */
.section-title {
  margin: 8px 0 4px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  color: #FFD700;
}

/* 奖号网格 */
.grid-numbers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 0 6px 10px;
  font-size: 15px;
}
.grid-numbers span {
  display: block;
  text-align: center;
  background: #000;
  padding: 4px 0;
  border-radius: 3px;
  box-shadow: inset 0 0 3px rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

/* 新号码闪烁动画 */
.newMain {
  animation: flashMain 1.5s ease-out;
  color: #00FF00 !important;
  text-shadow: 0 0 10px #00FF00, 0 0 20px #00FF00;
}
.grid-numbers span.new {
  animation: flashNumber 1.5s ease-out;
  color: #00FF00 !important;
  text-shadow: 0 0 8px #00FF00;
  background: rgba(0, 255, 0, 0.2) !important;
}

@keyframes flashMain {
  0% {
    transform: scale(1.3);
    color: #FFFF00;
    text-shadow: 0 0 20px #FFFF00, 0 0 40px #FFFF00;
  }
  25% { transform: scale(1.1); }
  50% {
    color: #00FF00;
    text-shadow: 0 0 15px #00FF00, 0 0 30px #00FF00;
  }
  100% {
    transform: scale(1);
    color: #00FF00;
    text-shadow: 0 0 10px #00FF00;
  }
}

@keyframes flashNumber {
  0% {
    transform: scale(1.2);
    background: rgba(255, 255, 0, 0.4);
    color: #FFFF00;
  }
  50% {
    background: rgba(0, 255, 0, 0.3);
    color: #00FF00;
  }
  100% {
    transform: scale(1);
    background: rgba(0, 255, 0, 0.2);
    color: #00FF00;
  }
}

/* 尚未开奖 */
.no-data {
  text-align: center;
  padding: 16px 10px;
  font-size: 16px;
  font-weight: 600;
  color: #FF7777;
  background: rgba(255, 0, 0, 0.08);
  border-top: 1px dashed #FF5555;
}

/* ================== 表单与按钮 ================== */
label { margin-right: 5px; }
input[type="date"], select {
  padding: 6px 10px;
  margin: 0 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #000;
  color: #fff;
}
button {
  background-color: #ffd700;
  color: #000;
  border: none;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: 5px;
  font-weight: bold;
  margin-left: 10px;
  box-shadow: 0 0 8px rgba(255,215,0,0.3);
  transition: box-shadow 0.3s, transform 0.3s;
}
button:hover {
  box-shadow: 0 0 15px rgba(255,215,0,0.5);
  transform: translateY(-2px);
}

/* ================== 响应式 ================== */
@media (max-width: 768px) {
  .result-card, .company-card {
    width: 90vw;
  }
  table.prize td {
    font-size: 15px;
  }
  .grid-numbers {
    font-size: 15px;
  }
  .card-header h4 {
    font-size: 16px;
  }
}