/* ============ 主题变量（金 / 财神配色） ============ */
:root {
  --bg: #f6f1e6;
  --bg-card: #fffdf7;
  --bg-soft: #f3ebd7;
  --text: #2b2116;
  --text-secondary: #8a7a60;
  --border: #e7dbbf;
  --accent: #b8860b;
  --accent-strong: #9a7000;
  --accent-soft: #fcf3d9;
  --gold: #d4af37;
  --success: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
  --glow: rgba(212, 175, 55, 0.10);
  --shadow: 0 2px 6px rgba(139, 106, 30, 0.08);
  --shadow-hover: 0 12px 30px rgba(139, 106, 30, 0.18);
  --topbar-bg: rgba(255, 253, 247, 0.82);
}

[data-theme="dark"] {
  --bg: #17130c;
  --bg-card: #211c12;
  --bg-soft: #2b2416;
  --text: #f1e9d8;
  --text-secondary: #a2937a;
  --border: #3b3322;
  --accent: #e5c15a;
  --accent-strong: #f0cf6a;
  --accent-soft: #33290e;
  --gold: #e5c15a;
  --glow: rgba(229, 193, 90, 0.07);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.65);
  --topbar-bg: rgba(23, 19, 12, 0.82);
}

/* ============ 基础 ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1000px 420px at 85% -10%, var(--glow), transparent 60%),
    radial-gradient(800px 380px at 5% 110%, var(--glow), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8d974, #c9a227);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 2px 10px rgba(201, 162, 39, 0.45);
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.toolbar-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.toolbar-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Telegram 联系按钮 */
.tg-btn svg {
  width: 17px;
  height: 17px;
}

.tg-btn:hover {
  background: #229ed9;
  color: #fff;
  border-color: #229ed9;
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.4);
  transform: translateY(-2px);
}

.toolbar-btn svg {
  width: 18px;
  height: 18px;
}

.theme-toggle:hover {
  transform: rotate(20deg);
}

/* ============ Hero 横幅 ============ */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  color: #fff;
  padding: 52px 24px 46px;
  background:
    radial-gradient(900px 340px at 82% -20%, rgba(255, 215, 0, 0.22), transparent 60%),
    radial-gradient(700px 300px at 12% 130%, rgba(255, 180, 80, 0.16), transparent 55%),
    linear-gradient(135deg, #961838 0%, #66101f 55%, #430b15 100%);
}

.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -120px;
  transform: translateX(-50%);
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.14), transparent 65%);
  pointer-events: none;
}

.hero-eyebrow {
  position: relative;
  font-size: 12px;
  letter-spacing: 6px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
}

.hero-title {
  position: relative;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(115deg, #ffe9a8 0%, #ffd700 45%, #ffb347 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.28));
}

.hero-subtitle {
  position: relative;
  margin-top: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.hero-stats {
  position: relative;
  margin-top: 22px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-pill {
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(6px);
  font-size: 12.5px;
  color: #fff;
}

/* ============ 内容区 ============ */
.container {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 34px 24px 20px;
  flex: 1;
}

.group {
  margin-bottom: 36px;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.group-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft));
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.site-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: cardIn 0.4s ease both;
}

.site-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.site-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--gold);
}

.site-card:hover::before {
  opacity: 1;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.site-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}

.site-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.site-icon .fallback {
  font-weight: 700;
  color: var(--accent);
  font-size: 18px;
}

.site-info {
  flex: 1;
  min-width: 0;
}

.site-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-desc {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}

/* 在线状态点 */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: auto;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.status-dot.checking {
  background: var(--warn);
  animation: dotPulse 1s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ============ 页脚 ============ */
.footer {
  text-align: center;
  padding: 26px 24px 40px;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.footer-tg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.footer-tg svg {
  color: #229ed9;
}

.footer-tg a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.footer-tg a:hover {
  text-decoration: underline;
}

/* ============ 响应式 ============ */
@media (max-width: 600px) {
  .sites-grid {
    grid-template-columns: 1fr;
  }
  .container {
    padding: 24px 16px 16px;
  }
  .hero {
    padding: 40px 16px 36px;
  }
  .hero-title {
    font-size: 30px;
  }
  .brand-name {
    font-size: 15px;
  }
}
