/* 香港六合彩资料站 - 全局样式 */
:root {
  --gold: #D4AF37;
  --gold-light: #F5E6A3;
  --red: #C41E3A;
  --red-dark: #8B0000;
  --green: #228B22;
  --bg-dark: #1a1a2e;
  --bg-card: #16213e;
  --bg-lighter: #0f3460;
  --text: #e8e8e8;
  --text-dim: #a0a0a0;
  --border: #2a2a4a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 导航 */
.site-nav {
  background: linear-gradient(135deg, var(--red-dark), #5c0a0a);
  padding: 0;
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.nav-brand {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--gold-light);
  padding: 0.8rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.8rem 1.2rem;
  color: var(--text);
  font-size: 0.95rem;
  transition: background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  text-decoration: none;
}

/* 主容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* 开奖倒计时 */
.countdown-section {
  background: linear-gradient(135deg, var(--bg-lighter), var(--bg-card));
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.countdown-title {
  color: var(--gold-light);
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

#countdown-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
}

.cd-block {
  background: var(--red-dark);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  min-width: 60px;
  text-align: center;
}

.cd-num {
  display: block;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--gold-light);
  font-family: 'Courier New', monospace;
}

.cd-label {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.cd-sep {
  font-size: 1.5rem;
  color: var(--gold);
  padding: 0 0.2rem;
}

.countdown-open {
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 最新开奖卡片 */
.latest-draw-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-lighter));
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.latest-draw-card h3 {
  color: var(--gold-light);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.draw-date {
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.ball-row {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.ball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  color: #fff;
}

.ball.red {
  background: radial-gradient(circle, var(--red), var(--red-dark));
  box-shadow: 0 2px 8px rgba(196, 30, 58, 0.4);
}

.ball.special {
  width: 56px;
  height: 56px;
  font-size: 1.3rem;
  background: radial-gradient(circle, var(--gold), #B8860B);
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.5);
}

.draw-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.draw-info span {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.draw-info strong {
  color: var(--gold-light);
}

/* 预测网格 */
.pred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pred-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
  transition: transform 0.2s, border-color 0.2s;
}

.pred-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.pred-card.highlight {
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.pred-card h3 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.pred-card .pred-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.pred-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pred-num {
  background: var(--bg-lighter);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--gold-light);
  font-weight: 500;
}

.special-pred {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--gold-light);
  justify-content: center;
  padding: 0.5rem 0;
}

.pred-note {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 1.5rem;
  text-align: center;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

/* 历史记录 */
.search-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.search-input {
  flex: 1;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--gold);
}

.search-btn {
  padding: 0.8rem 1.5rem;
  background: var(--gold);
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.search-btn:hover {
  background: var(--gold-light);
}

.no-result {
  color: var(--red);
  text-align: center;
  padding: 2rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
}

.history-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  transition: background 0.2s;
  width: 100%;
  text-decoration: none;
}

.history-link:hover {
  background: var(--bg-lighter);
  text-decoration: none;
}

.draw-num {
  color: var(--gold);
  font-weight: bold;
  font-size: 1rem;
}

.draw-date {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* 详情弹窗 */
.draw-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.draw-detail-card {
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  text-align: center;
  position: relative;
}

.close-detail {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.close-detail:hover {
  color: var(--red);
}

/* 页脚 */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* 响应式 */
@media (max-width: 768px) {
  .nav-inner {
    flex-direction: column;
    gap: 0;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav-links a {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }

  .pred-grid {
    grid-template-columns: 1fr;
  }

  .ball {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }

  .ball.special {
    width: 48px;
    height: 48px;
  }

  .draw-info {
    gap: 1rem;
  }

  .cd-num {
    font-size: 1.4rem;
  }

  .cd-block {
    min-width: 45px;
    padding: 0.4rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .ball {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .ball.special {
    width: 40px;
    height: 40px;
  }
}
