/* ============ 基础 ============ */
:root {
  --primary: #3b82f6;
  --primary-deep: #1d4ed8;
  --accent: #f97316;
  --accent-2: #a855f7;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #6b7280;
  --border: #e5e7eb;
  --section-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, .82);
  --header-border: rgba(229, 231, 235, .7);
  --radius: 16px;
  --shadow: 0 6px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .14);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container { width: min(1180px, 92%); margin: 0 auto; }

a { text-decoration: none; color: inherit; }

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

.brand-logo {
  font-size: 26px;
  line-height: 1;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(120deg, var(--primary), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-2);
  border-left: 1px solid var(--border);
  padding-left: 10px;
}

.main-nav { display: flex; gap: 8px; }

.main-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  transition: all .2s;
}

.main-nav a:hover { color: var(--primary); background: rgba(59, 130, 246, .08); }

/* ============ Hero ============ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0b1220 0%, #16213e 55%, #1e1b4b 100%);
  color: #fff;
  padding: 96px 0 80px;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 260px at 15% 20%, rgba(59, 130, 246, .35), transparent 60%),
    radial-gradient(480px 280px at 85% 30%, rgba(168, 85, 247, .28), transparent 60%),
    radial-gradient(420px 240px at 55% 95%, rgba(249, 115, 22, .18), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: auto, auto, auto, 42px 42px, 42px 42px;
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: 1px;
}

.gradient-text {
  background: linear-gradient(90deg, #60a5fa, #c084fc, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  margin: 20px auto 32px;
  max-width: 640px;
  color: rgba(255, 255, 255, .78);
  font-size: 16px;
}

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: transform .2s, box-shadow .2s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(59, 130, 246, .4);
}

.btn-primary:hover { box-shadow: 0 12px 32px rgba(59, 130, 246, .55); }

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
}

.btn-ghost:hover { background: rgba(255, 255, 255, .1); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 56px;
  flex-wrap: wrap;
}

.hero-stats div { text-align: center; }

.hero-stats b {
  display: block;
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(90deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stats span { font-size: 13px; color: rgba(255, 255, 255, .6); }

/* ============ 区块通用 ============ */
.section { padding: 72px 0; }

.section-alt { background: var(--section-bg); }

.section-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
}

.section-sub {
  text-align: center;
  color: var(--text-2);
  margin: 10px 0 32px;
  font-size: 14px;
}

.section-sub b { color: var(--primary); }

/* ============ 云厂商 Tab ============ */
.provider-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.provider-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.provider-tab:hover:not(.disabled) {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.provider-tab.active {
  background: linear-gradient(90deg, var(--primary), var(--primary-deep));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(59, 130, 246, .35);
}

.provider-tab.disabled { cursor: not-allowed; opacity: .62; }

.provider-tab.disabled i {
  font-style: normal;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-2);
}

/* ============ 分类筛选 ============ */
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 36px;
}

.cat-chip {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  transition: all .2s;
}

.cat-chip:hover { border-color: var(--primary); color: var(--primary); }

.cat-chip.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* ============ 卡片网格 ============ */
.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}

.promo-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  animation: fadeUp .5s ease both;
}

.promo-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(59, 130, 246, .45);
}

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

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  background: rgba(59, 130, 246, .12);
}

.card-tag {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  white-space: nowrap;
}

.promo-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-2);
  flex: 1;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.card-highlight {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.card-go {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-go .arrow { transition: transform .2s; }

.promo-card:hover .card-go .arrow { transform: translateX(4px); }

.empty-tip {
  text-align: center;
  color: var(--text-2);
  padding: 48px 0;
  font-size: 15px;
}

/* ============ 关于 ============ */
.about-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto 30px;
}

.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: box-shadow .25s, transform .25s;
}

.about-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.about-card-icon {
  display: inline-flex;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(59, 130, 246, .1);
  align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}

.about-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.about-card p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.85;
}

.about-cta-row {
  text-align: center;
}

.about-cta-row .update-line {
  margin-top: 14px;
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
}

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--section-bg);
  padding: 28px 0;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}

/* ============ Toast ============ */
#toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(17, 24, 39, .92);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
  z-index: 200;
}

#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .brand-sub { display: none; }
  .section { padding: 52px 0; }
  .hero { padding: 64px 0 56px; }
  .hero-stats { gap: 28px; margin-top: 40px; }
  .about-card { padding: 22px 18px; }
  .about-card p { font-size: 13.5px; }
}

/* ============ 头部操作按钮 ============ */
.header-actions { display: flex; gap: 8px; }
.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.icon-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
#favCount {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ============ 今日必抢 + 统计墙 ============ */
.hot-strip {
  background: linear-gradient(120deg, #16213e, #1e1b4b);
  color: #fff;
  padding: 16px 0 0;
}
.hot-bar { display: flex; align-items: center; gap: 16px; overflow: hidden; }
.hot-label {
  flex-shrink: 0;
  font-weight: 800; font-size: 14px;
  padding: 7px 14px; border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #f43f5e);
  box-shadow: 0 4px 14px rgba(249, 115, 22, .4);
}
.hot-ticker {
  display: flex; gap: 30px;
  width: max-content;
  padding: 8px 0;
  animation: ticker 38s linear infinite;
}
.hot-ticker:hover { animation-play-state: paused; }
.ticker-item {
  color: rgba(255, 255, 255, .85); font-size: 13.5px;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  transition: color .2s;
}
.ticker-item:hover { color: #fff; text-decoration: underline; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.stats-wall {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 18px 0 8px; margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.stat-item { flex: 1; min-width: 110px; text-align: center; }
.stat-item b {
  display: block; font-size: 24px; font-weight: 800;
  background: linear-gradient(90deg, #60a5fa, #c084fc);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-item span { font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.live-tip { text-align: center; font-size: 13px; color: rgba(255, 255, 255, .75); padding: 4px 0 14px; }
.live-tip b { color: #fb923c; font-weight: 700; }

/* ============ 搜索框 ============ */
.promo-tools { display: flex; justify-content: center; margin-bottom: 20px; }
.search-box { position: relative; width: min(520px, 100%); }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: .65;
}
.search-box input {
  width: 100%;
  padding: 12px 44px 12px 42px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 14px; color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(59, 130, 246, .12); }
#searchClear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: #eef2f7; color: var(--text-2);
  cursor: pointer; font-size: 12px;
}

/* ============ 热门榜单 ============ */
.rank-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.rank-tab {
  padding: 9px 20px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--card);
  font-size: 14px; cursor: pointer; transition: all .2s;
}
.rank-tab:hover { border-color: var(--primary); color: var(--primary); }
.rank-tab.active {
  background: linear-gradient(90deg, var(--primary), var(--primary-deep));
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(59, 130, 246, .3);
}
.rank-row {
  display: flex; gap: 18px; overflow-x: auto;
  padding: 4px 4px 14px;
  scrollbar-width: thin;
}
.rank-row .promo-card { min-width: 290px; }
.rank-row::-webkit-scrollbar { height: 8px; }
.rank-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* ============ 卡片增强 ============ */
.promo-card { position: relative; }
.promo-card.is-hot { border-color: rgba(249, 115, 22, .45); }
.promo-card.is-hot::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, #f97316, #f43f5e);
}
.card-head-left { display: flex; align-items: center; gap: 8px; }
.time-badge {
  font-size: 11px; font-weight: 700; color: #fff;
  padding: 3px 9px; border-radius: 999px;
  background: linear-gradient(135deg, #f43f5e, #f97316);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.card-foot-left { display: flex; align-items: center; gap: 8px; }
.save-chip {
  font-size: 12.5px; font-weight: 800; color: #059669;
  background: rgba(16, 185, 129, .12);
  padding: 4px 10px; border-radius: 999px;
}
.fav-btn, .copy-btn {
  width: 30px; height: 30px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 14px; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.fav-btn:hover, .copy-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.fav-btn.on { color: #f59e0b; border-color: #f59e0b; background: rgba(245, 158, 11, .1); }
.provider-chip {
  display: inline-block;
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: rgba(59, 130, 246, .1);
  border: 1px solid rgba(59, 130, 246, .25);
  padding: 2px 10px; border-radius: 999px;
  margin-bottom: 10px;
  width: max-content;
}

/* ============ 上云攻略 ============ */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.guide-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .25s;
}
.guide-card:hover { box-shadow: var(--shadow-lg); }
.guide-head {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  background: none; border: none; cursor: pointer; text-align: left;
}
.guide-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: rgba(59, 130, 246, .1);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.guide-head-text { flex: 1; }
.guide-head-text h3 { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.4; }
.guide-head-text p {
  font-size: 12.5px; color: var(--text-2); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.guide-arrow { color: var(--text-2); transition: transform .25s; font-size: 14px; }
.guide-card.open .guide-arrow { transform: rotate(180deg); }
.guide-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.guide-card.open .guide-body { max-height: 400px; }
.guide-body p { padding: 0 18px 18px; font-size: 13.5px; color: var(--text-2); line-height: 1.8; }

/* ============ 暗黑模式 ============ */
[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --border: #334155;
  --section-bg: #0b1220;
  --header-bg: rgba(15, 23, 42, .85);
  --header-border: rgba(51, 65, 85, .6);
}
[data-theme="dark"] #searchClear { background: #334155; color: #94a3b8; }
[data-theme="dark"] .save-chip { background: rgba(16, 185, 129, .18); color: #34d399; }
[data-theme="dark"] .cat-chip { background: #1e293b; }
[data-theme="dark"] .provider-tab.disabled i { background: #334155; }
[data-theme="dark"] .rank-row::-webkit-scrollbar-thumb { background: #334155; }

/* ============ SEO / 无障碍 ============ */
section[id] { scroll-margin-top: 76px; }
.noscript-box {
  max-width: 760px;
  margin: 20px auto;
  padding: 20px 24px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 12px;
  color: #431407;
  font-size: 14px;
  line-height: 1.8;
}
.noscript-box strong { font-size: 15px; }
.noscript-box ul { margin: 10px 0 0 18px; }
.noscript-box a { color: #ea580c; text-decoration: underline; }
[data-theme="dark"] .noscript-box { background: #1e293b; border-color: #f97316; color: #fde68a; }

/* ============ 汉堡菜单 ============ */
.hamburger { display: none; }
.mobile-menu { display: none; }

@media (max-width: 1023px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .mobile-menu {
    display: none;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--header-border);
  }
  .mobile-menu.open { display: block; }
  .mobile-nav { padding: 8px 4% 14px; }
  .mobile-nav a {
    display: block;
    padding: 13px 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    border-radius: 12px;
    transition: background .2s;
  }
  .mobile-nav a:active { background: rgba(59, 130, 246, .1); }
}

@media (min-width: 1024px) {
  .mobile-menu { display: none !important; }
  .hamburger { display: none !important; }
}

/* ============ 移动端细节优化 ============ */
@media (max-width: 640px) {
  body { -webkit-tap-highlight-color: transparent; }
  .icon-btn:active, .fav-btn:active, .copy-btn:active { transform: scale(.92); }
  .promo-card { padding: 18px; }
  .stats-wall { display: grid; grid-template-columns: repeat(3, 1fr); row-gap: 16px; }
  .stat-item { min-width: 0; }
  .search-box input { font-size: 16px; } /* 防止 iOS 聚焦自动放大 */
  .rank-row { scroll-snap-type: x mandatory; scroll-padding-left: 4%; }
  .rank-row .promo-card { scroll-snap-align: start; }
  .hero-sub { font-size: 15px; }
  .card-desc { font-size: 13px; }
  .card-foot { flex-wrap: wrap; gap: 10px; }
  .card-go { margin-left: auto; }
  .guide-card.open .guide-body { max-height: 440px; }
  #toast { max-width: 90vw; text-align: center; white-space: normal; }
  .main-nav a { padding: 10px 12px; }
}
