/* Website theme tokens and light-mode overrides */
:root {
  color-scheme: dark;
  --theme-bg: #050b17;
  --theme-bg-soft: #070f1e;
  --theme-bg-muted: #080d1a;
  --theme-elevated: #0f172a;
  --theme-panel: rgba(15, 23, 42, 0.6);
  --theme-panel-solid: #0f172a;
  --theme-line: rgba(255, 255, 255, 0.1);
  --theme-line-strong: rgba(224, 181, 99, 0.35);
  --theme-text: #f8fafc;
  --theme-text-secondary: #cbd5e1;
  --theme-muted: #94a3b8;
  --theme-soft: #64748b;
  --theme-brand: #e0b563;
  --theme-brand-strong: #c9962f;
  --theme-accent: #e0b563;
  --theme-accent-strong: #f0c978;
  --theme-accent-soft: rgba(224, 181, 99, 0.14);
  --theme-accent-contrast: #0e2036;
  --theme-positive: #34d399;
  --theme-shadow: 0 25px 60px rgba(0, 0, 0, 0.28);
  --theme-shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.28);
  --theme-shadow-hover: 0 30px 70px rgba(0, 0, 0, 0.32);
  --theme-nav-bg: rgba(5, 11, 23, 0.82);
  --theme-mobile-menu: #050b17;
  --theme-hero-overlay: linear-gradient(to bottom, rgba(10, 15, 29, 0.7), rgba(10, 15, 29, 0.9));
}

/* ================================
   LIGHT MODE TOKENS
   "牌桌纸感" — 象牙底 + 藏青文字 + 烫金强调 + 翠绿语义色，呼应品牌 logo
   ================================ */

:root[data-theme="light"] {
  color-scheme: light;

  /* 背景层（三级，与 dark 的 bg/bg-soft/bg-muted 层级一一对应） */
  --theme-bg:         #fafaf7;
  --theme-bg-soft:    #f5f1e6;
  --theme-bg-muted:   #f0e9d8;
  --theme-elevated:   #ffffff;

  /* 面板与边框 */
  --theme-panel:      #ffffff;
  --theme-panel-solid:#ffffff;
  --theme-line:       #e4dcc9;
  --theme-line-strong:rgba(201, 162, 75, 0.4);

  /* 文字 */
  --theme-text:       #0e2036;
  --theme-text-secondary: #1c3350;
  --theme-muted:      #5b6b7d;
  --theme-soft:       #8b99a8;

  /* 品牌色：藏青为主色，烫金为强调色 */
  --theme-brand:      #0e2036;
  --theme-brand-strong:#060f1c;
  --theme-accent:     #b8923d;
  --theme-accent-strong:#967226;
  --theme-accent-soft:#f1e4c0;
  --theme-accent-contrast: #ffffff;

  /* 语义色：正向数据/校验通过 */
  --theme-positive:   #2f7a4d;

  /* 投影（藏青色调，而非中性灰） */
  --theme-shadow:     0 4px 24px rgba(14, 32, 54, 0.08);
  --theme-shadow-lg:  0 12px 40px rgba(14, 32, 54, 0.10);
  --theme-shadow-hover: 0 16px 48px rgba(14, 32, 54, 0.14);

  /* 导航 */
  --theme-nav-bg:     rgba(250, 247, 240, 0.88);
  --theme-mobile-menu:#ffffff;

  /* Hero 遮罩 */
  --theme-hero-overlay: linear-gradient(
    160deg,
    rgba(250, 250, 247, 0.96) 0%,
    rgba(245, 241, 230, 0.90) 50%,
    rgba(240, 233, 216, 0.85) 100%
  );
}

body {
  background:
    radial-gradient(circle at 12% 10%, rgba(34, 211, 238, 0.08), transparent 30%),
    var(--theme-bg);
  color: var(--theme-text);
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 8% 12%, rgba(14, 32, 54, 0.05), transparent 40%),
    radial-gradient(circle at 92% 8%,  rgba(184, 146, 61, 0.06), transparent 35%),
    linear-gradient(180deg, #fafaf7 0%, #f7f3e9 50%, #f0e9d8 100%);
}

/* ================================
   HERO
   ================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-hero {
  min-height: 720px;
  padding-top: 96px;
  padding-bottom: 72px;
  background-color: #050b17;
}

:root[data-theme="light"] .theme-hero {
  background-color: #fafaf7;
}

.theme-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, #050b17 0%, rgba(5, 11, 23, 0.98) 28%, rgba(5, 11, 23, 0.68) 52%, rgba(5, 11, 23, 0) 72%);
  pointer-events: none;
}

:root[data-theme="light"] .theme-hero::after {
  background: linear-gradient(90deg, #fafaf7 0%, rgba(250, 250, 247, 0.98) 28%, rgba(250, 250, 247, 0.7) 52%, rgba(250, 250, 247, 0) 72%);
}

.hero-product-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 100%;
}

.hero-product-layer--mobile,
.hero-product-layer--light {
  display: none;
}

:root[data-theme="light"] .hero-product-layer--dark {
  display: none;
}

:root[data-theme="light"] .hero-product-layer--desktop.hero-product-layer--light {
  display: block;
}

:root[data-theme="light"] .theme-hero h1 span:first-child {
  background: linear-gradient(to bottom, #0e2036, #1c3350);
  -webkit-background-clip: text;
  background-clip: text;
}

:root[data-theme="light"] .theme-hero h1 span:last-child {
  background: linear-gradient(120deg, #8a6a20 0%, #b8923d 55%, #e0c078 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

:root[data-theme="light"] .theme-hero p {
  color: var(--theme-muted);
  font-weight: 400;
}

.hero-content-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.hero-copy {
  width: min(50%, 600px);
  text-align: left;
}

.hero-copy h1 span {
  display: block;
}

.hero-copy > p {
  margin-left: 0;
  margin-right: 0;
}

.hero-copy .hero-download-group {
  justify-content: flex-start;
}

/* ================================
   GLASS CARD
   ================================ */

.glass-card {
  background: var(--theme-panel);
  border-color: var(--theme-line);
  box-shadow: var(--theme-shadow);
}

:root[data-theme="light"] .glass-card {
  backdrop-filter: none;
}

nav.glass-card {
  background: var(--theme-nav-bg);
  border-bottom-color: var(--theme-line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.nav-download-link {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--theme-accent);
  border-radius: 6px;
  color: var(--theme-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-download-link:hover,
.nav-download-link.is-active {
  background: var(--theme-accent);
  color: var(--theme-accent-contrast);
  border-color: var(--theme-accent);
}

.mobile-download-link {
  margin: 10px 12px 4px;
  width: calc(100% - 24px);
}

/* ================================
   DOWNLOAD PAGE
   ================================ */

.download-page {
  background: var(--theme-bg);
  color: var(--theme-text);
}

.download-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.download-platform-section,
.download-guide-section {
  padding: 72px 0;
  background: var(--theme-bg-soft);
}

.download-platform-section {
  padding-top: 0;
}

.download-platform-section .download-section-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.download-guide-section {
  background: var(--theme-bg);
  border-top: 1px solid var(--theme-line);
  scroll-margin-top: 76px;
}

.download-guide-section.is-page-start {
  padding-top: 112px;
  border-top: 0;
}

.download-section-heading {
  text-align: center;
  margin-bottom: 34px;
}

.download-section-heading h2 {
  margin: 0 0 10px;
  color: var(--theme-text);
  font-size: 32px;
  line-height: 1.2;
  font-weight: 800;
}

.download-section-heading p {
  min-height: 22px;
  margin: 0;
  color: var(--theme-muted);
  font-size: 15px;
}

.platform-download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--theme-panel-solid);
  box-shadow: var(--theme-shadow);
}

.platform-download-item {
  min-width: 0;
  padding: 30px 28px 0;
  border-right: 1px solid var(--theme-line);
  position: relative;
}

.platform-download-item:last-child {
  border-right: 0;
}

.platform-download-item.is-recommended {
  box-shadow: inset 0 0 0 2px var(--theme-accent);
  z-index: 1;
}

.platform-download-main {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.platform-download-icon {
  color: var(--theme-accent);
  font-size: 50px;
  flex: 0 0 auto;
}

.platform-download-main h3 {
  margin: 0 0 3px;
  color: var(--theme-text);
  font-size: 22px;
  font-weight: 800;
}

.platform-download-main span {
  color: var(--theme-muted);
  font-size: 14px;
}

.platform-download-item dl {
  display: grid;
  gap: 11px;
  margin: 0 0 24px;
}

.platform-download-item dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.platform-download-item dt,
.platform-download-item dd {
  margin: 0;
  font-size: 14px;
}

.platform-download-item dt { color: var(--theme-muted); }
.platform-download-item dd { color: var(--theme-text-secondary); font-weight: 600; }

.platform-download-action {
  min-height: 58px;
  margin: 0 -28px;
  padding: 0 28px;
  border-top: 1px solid var(--theme-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--theme-accent);
  font-weight: 800;
  transition: background-color 160ms ease;
}

.platform-download-action:hover { background: var(--theme-accent-soft); }
.platform-download-action.is-disabled { color: var(--theme-soft); cursor: not-allowed; }

.download-trust-strip {
  margin-top: 26px;
  padding: 20px 24px;
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--theme-panel);
}

.download-trust-strip > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-right: 1px solid var(--theme-line);
}

.download-trust-strip > div:last-child { border-right: 0; }
.download-trust-strip iconify-icon { color: var(--theme-accent); font-size: 28px; flex: 0 0 auto; }
.download-trust-strip span { display: grid; gap: 2px; min-width: 0; }
.download-trust-strip strong { color: var(--theme-text); font-size: 14px; }
.download-trust-strip small { color: var(--theme-muted); font-size: 11px; line-height: 1.4; }

.download-notice {
  margin-top: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--theme-muted);
  border-left: 3px solid var(--theme-accent);
  background: var(--theme-accent-soft);
}

.download-notice iconify-icon { color: var(--theme-accent); font-size: 20px; flex: 0 0 auto; }
.download-notice p { margin: 0; font-size: 13px; line-height: 1.6; }

.download-guide-tabs {
  width: fit-content;
  margin: 0 auto 34px;
  display: flex;
  border: 1px solid var(--theme-line);
  border-radius: 6px;
  overflow: hidden;
}

.download-guide-tab {
  min-width: 170px;
  min-height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--theme-muted);
  border-right: 1px solid var(--theme-line);
  background: var(--theme-panel);
  font-weight: 700;
  cursor: pointer;
}

.download-guide-tab:last-child { border-right: 0; }
.download-guide-tab.is-active { background: var(--theme-accent); color: var(--theme-accent-contrast); }

.download-guide-panel { display: none; }
.download-guide-panel.is-active { display: block; }

.download-guide-download {
  min-height: 112px;
  margin-bottom: 26px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 0.9fr) auto;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  background: var(--theme-panel-solid);
  box-shadow: var(--theme-shadow);
}

.download-guide-app {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.download-guide-app > iconify-icon {
  flex: 0 0 auto;
  color: var(--theme-accent);
  font-size: 44px;
}

.download-guide-app > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.download-guide-app strong {
  overflow: hidden;
  color: var(--theme-text);
  font-size: 18px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-guide-app span {
  color: var(--theme-muted);
  font-size: 13px;
}

.download-guide-meta {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.download-guide-meta > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.download-guide-meta dt,
.download-guide-meta dd {
  margin: 0;
  font-size: 13px;
}

.download-guide-meta dt { color: var(--theme-muted); }
.download-guide-meta dd {
  overflow: hidden;
  color: var(--theme-text-secondary);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-guide-action {
  min-width: 176px;
  min-height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--theme-accent);
  border-radius: 6px;
  background: var(--theme-accent);
  color: var(--theme-accent-contrast);
  font-weight: 800;
  text-align: center;
  transition: transform 160ms ease, background-color 160ms ease;
}

.download-guide-action:hover {
  transform: translateY(-2px);
  background: var(--theme-accent-strong);
}

.download-guide-action.is-disabled {
  border-color: var(--theme-line-strong);
  background: var(--theme-bg-muted);
  color: var(--theme-soft);
  cursor: not-allowed;
}

.download-guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.download-guide-panel[data-guide-panel="h5"] .download-guide-steps {
  max-width: 800px;
  margin: 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.download-guide-step {
  min-width: 0;
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  background: var(--theme-panel-solid);
  overflow: hidden;
}

.download-guide-step header {
  min-height: 128px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.download-guide-step header > span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-accent-contrast);
  background: var(--theme-accent);
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.download-guide-step h3 {
  margin: 2px 0 8px;
  color: var(--theme-text);
  font-size: 17px;
  font-weight: 800;
}

.download-guide-step p {
  margin: 0;
  color: var(--theme-muted);
  font-size: 13px;
  line-height: 1.65;
}

.download-guide-step img {
  width: 100%;
  aspect-ratio: 720 / 980;
  object-fit: cover;
  display: block;
  border-top: 1px solid var(--theme-line);
  background: #08111f;
}

.download-guide-icon-state {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--theme-line);
  color: var(--theme-accent);
  background: var(--theme-bg-muted);
}

.download-guide-icon-state iconify-icon { font-size: 88px; }

.download-help-text {
  margin: 24px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--theme-muted);
  font-size: 13px;
}

.download-help-text iconify-icon { color: var(--theme-accent); font-size: 20px; }

@media (max-width: 1080px) {
  .download-guide-steps { gap: 16px; }
  .download-guide-download {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.85fr) auto;
    gap: 16px;
  }
  .download-guide-action { min-width: 160px; }
}

@media (max-width: 780px) {
  .download-trust-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 0; }
  .download-trust-strip > div:nth-child(2) { border-right: 0; }
  .download-guide-download {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .download-guide-meta { grid-column: 1 / -1; }
  .download-guide-action { grid-column: 2; grid-row: 1; }
}

@media (max-width: 720px) {
  .download-shell { width: min(100% - 32px, 560px); }
  .download-platform-section { padding: 0 0 52px; }
  .download-guide-section { padding: 52px 0; }
  .download-guide-section.is-page-start { padding-top: 96px; }
  .download-section-heading h2 { font-size: 27px; }
  .platform-download-grid { grid-template-columns: 1fr; }
  .platform-download-item { border-right: 0; border-bottom: 1px solid var(--theme-line); }
  .platform-download-item:last-child { border-bottom: 0; }
  .download-trust-strip { grid-template-columns: 1fr; }
  .download-trust-strip > div { min-height: 58px; border-right: 0; border-bottom: 1px solid var(--theme-line); padding: 10px 4px; }
  .download-trust-strip > div:last-child { border-bottom: 0; }
  .download-guide-tabs { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .download-guide-tab { min-width: 0; padding: 0 8px; font-size: 12px; }
  .download-guide-tab iconify-icon { display: none; }
  .download-guide-download {
    padding: 20px;
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .download-guide-app,
  .download-guide-meta,
  .download-guide-action {
    grid-column: 1;
    grid-row: auto;
  }
  .download-guide-action { width: 100%; }
  .download-guide-steps { grid-template-columns: 1fr; }
  .download-guide-panel[data-guide-panel="h5"] .download-guide-steps { grid-template-columns: 1fr; }
  .download-guide-step header { min-height: 0; }
  .download-guide-step img { max-height: 620px; object-fit: contain; }
}

:root[data-theme="light"] nav.glass-card {
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 1px 3px rgba(14, 32, 54, 0.04);
}

/* ================================
   SECTION DIVIDER
   ================================ */

.section-divider {
  background: linear-gradient(to right, transparent, var(--theme-line-strong), transparent);
}

:root[data-theme="light"] .section-divider {
  max-width: 60%;
  opacity: 0.6;
}

/* ================================
   THEME SWITCH
   ================================ */

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 92px;
  justify-content: center;
  border: 1px solid var(--theme-line);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  color: var(--theme-text);
  background: var(--theme-panel);
  font-size: 0.8rem;
  font-weight: 700;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.theme-switch:hover {
  border-color: var(--theme-brand);
  transform: translateY(-1px);
}

.theme-switch iconify-icon {
  color: var(--theme-brand);
  font-size: 1.1rem;
}

:root[data-theme="light"] .theme-switch {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(14, 32, 54, 0.06);
}

:root[data-theme="light"] .theme-switch:hover {
  border-color: var(--theme-accent);
  box-shadow: 0 4px 12px rgba(184, 146, 61, 0.16);
}

:root[data-theme="light"] .theme-switch iconify-icon {
  color: var(--theme-accent);
}

/* ================================
   NAVIGATION (light)
   ================================ */

:root[data-theme="light"] nav .text-white,
:root[data-theme="light"] nav .text-xl.font-bold {
  color: var(--theme-brand);
}

:root[data-theme="light"] nav a {
  color: var(--theme-muted);
  font-weight: 500;
}

:root[data-theme="light"] nav a:hover {
  color: var(--theme-accent);
}

:root[data-theme="light"] nav a.text-cyan-400 {
  color: var(--theme-accent) !important;
  font-weight: 600;
}

:root[data-theme="light"] #mobile-menu {
  background: #ffffff;
  border-top: 1px solid var(--theme-line);
  box-shadow: 0 12px 24px rgba(14, 32, 54, 0.08);
}

/* ================================
   FOOTER (light)
   ================================ */

:root[data-theme="light"] footer {
  background: var(--theme-bg-soft);
  border-top: 1px solid var(--theme-line);
}

:root[data-theme="light"] footer .text-white {
  color: var(--theme-text);
}

:root[data-theme="light"] footer .text-gray-500 {
  color: var(--theme-muted);
}

:root[data-theme="light"] footer a:hover {
  color: var(--theme-accent);
}

/* ================================
   TAILWIND CLASS OVERRIDES (light)
   ================================ */

/* 背景色硬编码覆盖 — 保留 dark 模式原有的三级层次感（hero/base、banner+bento、article 区块） */
:root[data-theme="light"] .bg-\[\#0a0f1d\],
:root[data-theme="light"] .bg-\[\#050B17\] {
  background-color: var(--theme-bg);
}

:root[data-theme="light"] .bg-\[\#070F1E\] {
  background-color: var(--theme-bg-soft);
}

:root[data-theme="light"] .bg-\[\#080d1a\] {
  background-color: var(--theme-bg-muted);
}

/* 文字色覆盖 */
:root[data-theme="light"] .text-white,
:root[data-theme="light"] .text-gray-300 {
  color: var(--theme-text);
}

:root[data-theme="light"] .text-gray-400,
:root[data-theme="light"] .text-gray-500,
:root[data-theme="light"] .text-gray-600 {
  color: var(--theme-muted);
}

/* 边框色覆盖 */
:root[data-theme="light"] .border-gray-800,
:root[data-theme="light"] .border-gray-800\/50,
:root[data-theme="light"] .border-white\/5,
:root[data-theme="light"] .border-white\/10 {
  border-color: var(--theme-line);
}

/* 按钮背景覆盖 */
:root[data-theme="light"] .bg-gray-800,
:root[data-theme="light"] .bg-gray-900 {
  background-color: #ffffff;
  color: var(--theme-text);
  border-color: var(--theme-line);
}

:root[data-theme="light"] .hover\:bg-gray-800:hover,
:root[data-theme="light"] .hover\:bg-white\/5:hover {
  background-color: var(--theme-accent-soft);
}

/* 确保带白字的按钮颜色不被覆盖 */
:root[data-theme="light"] .bg-cyan-500.text-white,
:root[data-theme="light"] .hover\:bg-cyan-400.text-white,
:root[data-theme="light"] .bg-blue-500.text-white,
:root[data-theme="light"] .bg-purple-500.text-white,
:root[data-theme="light"] .text-white[class*="bg-cyan"],
:root[data-theme="light"] .text-white[class*="bg-blue"],
:root[data-theme="light"] .text-white[class*="bg-purple"] {
  color: #ffffff;
}

:root[data-theme="light"] .glass-card.text-white,
:root[data-theme="light"] .glass-card .text-white {
  color: var(--theme-text);
}

:root[data-theme="light"] .glass-card .text-white[class*="bg-cyan"],
:root[data-theme="light"] .glass-card .text-white[class*="bg-blue"],
:root[data-theme="light"] .glass-card .text-white[class*="bg-purple"],
:root[data-theme="light"] .glass-card .text-white[class*="bg-amber"],
:root[data-theme="light"] .glass-card .text-white[class*="bg-green"],
:root[data-theme="light"] .glass-card .text-white[class*="bg-pink"] {
  color: #ffffff;
}

/* ================================
   HERO SPECIFIC (light)
   ================================ */

:root[data-theme="light"] .theme-hero > .max-w-7xl {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

/* Hero badge */
:root[data-theme="light"] .theme-hero .inline-flex.rounded-full {
  background: var(--theme-accent-soft);
  border: 1px solid rgba(184, 146, 61, 0.24);
  color: #8a6a20;
}

/* Hero download buttons — 统一三端按钮的尺寸、层级和交互 */
.hero-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 280px;
  min-height: 80px;
  padding: 0.85rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.hero-download-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(224, 181, 99, 0.52);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.32);
}

.hero-download-btn:focus-visible {
  outline: 3px solid rgba(224, 181, 99, 0.38);
  outline-offset: 3px;
}

.hero-download-btn iconify-icon {
  color: var(--theme-accent);
  font-size: 1.75rem;
  flex: 0 0 auto;
}

.hero-download-btn[data-platform="android"] iconify-icon {
  color: var(--theme-positive);
}

.hero-download-btn[data-platform="h5"] iconify-icon {
  color: #22d3ee;
}

.hero-download-btn p:first-child {
  color: var(--theme-muted);
  font-weight: 700;
}

.hero-download-btn p:last-child {
  color: inherit;
  font-weight: 900;
}

.hero-download-btn--single {
  width: min(100%, 240px);
  min-height: 62px;
  border-color: var(--theme-accent);
  border-radius: 8px;
  background: var(--theme-accent);
  color: var(--theme-accent-contrast);
  box-shadow: 0 16px 38px rgba(224, 181, 99, 0.2);
  font-size: 17px;
}

.hero-download-btn--single iconify-icon {
  color: currentColor;
  font-size: 1.45rem;
}

.hero-download-btn--single:hover {
  border-color: var(--theme-accent-strong);
  background: var(--theme-accent-strong);
}

:root[data-theme="light"] .hero-download-btn {
  color: var(--theme-text);
  background: #ffffff;
  border-color: var(--theme-line);
  box-shadow: 0 10px 28px rgba(14, 32, 54, 0.08);
}

:root[data-theme="light"] .hero-download-btn--single {
  color: var(--theme-accent-contrast);
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  box-shadow: 0 14px 34px rgba(184, 146, 61, 0.2);
}

:root[data-theme="light"] .hero-download-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(184, 146, 61, 0.48);
  background: #fffdf8;
  box-shadow: 0 16px 42px rgba(14, 32, 54, 0.13);
}

:root[data-theme="light"] .hero-download-btn:focus-visible {
  outline-color: rgba(184, 146, 61, 0.38);
}

:root[data-theme="light"] .hero-download-btn p:first-child {
  color: var(--theme-soft);
  font-weight: 700;
}

:root[data-theme="light"] .hero-download-btn p:last-child {
  color: inherit;
  font-weight: 900;
}

@media (min-width: 768px) {
  .hero-download-btn {
    width: 200px;
    max-width: none;
  }
}

/* ================================
   BANNER SECTION (light)
   ================================ */

:root[data-theme="light"] section:has(> .max-w-7xl > a.rounded-3xl),
:root[data-theme="light"] section:has(> .max-w-7xl > div.rounded-3xl) {
  background: var(--theme-bg-soft);
}

:root[data-theme="light"] section .rounded-3xl.overflow-hidden {
  border: 1px solid var(--theme-line);
  box-shadow: var(--theme-shadow-lg);
}

/* ================================
   BENTO GRID (light)
   ================================ */

.bento-product-card {
  min-height: 520px;
  isolation: isolate;
  background: #07101f;
}

.bento-product-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #07101f;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 100%;
  transition: transform 320ms ease;
}

.bento-product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, #07101f 0%, rgba(7, 16, 31, 0.98) 32%, rgba(7, 16, 31, 0.55) 52%, rgba(7, 16, 31, 0) 72%);
  pointer-events: none;
}

.bento-product-media--light { display: none; }

:root[data-theme="light"] .bento-product-media--dark { display: none; }
:root[data-theme="light"] .bento-product-media--light { display: block; }

.bento-product-card:hover .bento-product-media {
  transform: scale(1.015);
}

.bento-product-copy {
  width: min(46%, 560px);
}

:root[data-theme="light"] section:has(.bento-item) {
  background: #f5f1e6;
}

:root[data-theme="light"] .bento-item {
  background: var(--theme-elevated);
  border: 1px solid var(--theme-line);
  box-shadow: var(--theme-shadow);
  transition: all 0.35s ease;
}

:root[data-theme="light"] .bento-product-media {
  background-color: #fafaf7;
}

:root[data-theme="light"] .bento-product-card::after {
  background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.98) 32%, rgba(255, 255, 255, 0.58) 52%, rgba(255, 255, 255, 0) 72%);
}

:root[data-theme="light"] .bento-item:hover {
  transform: translateY(-4px);
  border-color: var(--theme-line-strong);
  box-shadow: var(--theme-shadow-hover);
}

:root[data-theme="light"] .bento-item h3 {
  color: var(--theme-text);
}

:root[data-theme="light"] .bento-item p,
:root[data-theme="light"] .bento-item li {
  color: var(--theme-muted);
}

:root[data-theme="light"] .bento-item .bg-cyan-500\/20,
:root[data-theme="light"] .bento-item .bg-blue-500\/20,
:root[data-theme="light"] .bento-item .bg-emerald-500\/20,
:root[data-theme="light"] .bento-item .bg-amber-500\/20,
:root[data-theme="light"] .bento-item .bg-purple-500\/20 {
  background: var(--theme-accent-soft);
  border: 1px solid rgba(184, 146, 61, 0.18);
}

:root[data-theme="light"] .bento-item iconify-icon {
  color: #8a6a20;
}

:root[data-theme="light"] section:has(.bento-item) h2 {
  color: var(--theme-text);
}

:root[data-theme="light"] section:has(.bento-item) > div > div:first-child p {
  color: var(--theme-muted);
}

/* ================================
   GRADIENT TEXT (light)
   ================================ */

:root[data-theme="light"] .gradient-text {
  background: linear-gradient(135deg, #0e2036, #b8923d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================================
   ARTICLE CARD HOVER (light)
   ================================ */

:root[data-theme="light"] .bento-item:hover,
:root[data-theme="light"] .article-card:hover,
:root[data-theme="light"] .related-card:hover {
  border-color: rgba(184, 146, 61, 0.35);
  box-shadow: var(--theme-shadow-hover);
}

:root[data-theme="light"] .article-card:hover {
  transform: translateX(4px);
}

/* ================================
   PROSE (light)
   ================================ */

:root[data-theme="light"] .prose p {
  color: var(--theme-text-secondary);
  line-height: 1.8;
}

:root[data-theme="light"] .prose h2 {
  color: var(--theme-text);
  font-weight: 700;
}

:root[data-theme="light"] .prose h3 {
  color: var(--theme-text);
}

:root[data-theme="light"] .prose strong {
  color: var(--theme-text);
}

:root[data-theme="light"] .prose a {
  color: #8a6a20;
  text-decoration: underline;
  text-underline-offset: 3px;
}

:root[data-theme="light"] .prose blockquote {
  border-left: 3px solid var(--theme-accent);
  background: var(--theme-bg-soft);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  color: var(--theme-muted);
}

:root[data-theme="light"] .prose code {
  background: var(--theme-bg-muted);
  color: var(--theme-brand);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

:root[data-theme="light"] .prose pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
}

/* ================================
   TIMELINE (light)
   ================================ */

:root[data-theme="light"] .timeline-item::before {
  background: linear-gradient(to bottom, var(--theme-accent), transparent);
}

:root[data-theme="light"] .timeline-item .bg-cyan-400 {
  background: var(--theme-accent);
  box-shadow: 0 0 8px rgba(184, 146, 61, 0.35);
}

/* ================================
   INDEX PAGE - ARTICLES SECTION (light)
   ================================ */

:root[data-theme="light"] #tech-ecosystem {
  background: var(--theme-bg);
}

:root[data-theme="light"] #tech-ecosystem .absolute.top-0 {
  display: none;
}

:root[data-theme="light"] #tech-ecosystem .glass-card {
  background: var(--theme-elevated);
  border: 1px solid var(--theme-line);
}

:root[data-theme="light"] #tech-ecosystem h3.text-white,
:root[data-theme="light"] #tech-ecosystem .group-hover\:text-cyan-400 {
  color: var(--theme-text);
}

:root[data-theme="light"] #tech-ecosystem .group:hover h3 {
  color: #8a6a20;
}

:root[data-theme="light"] #tech-ecosystem a.text-cyan-400 {
  color: var(--theme-accent);
}

:root[data-theme="light"] #tech-ecosystem a.bg-cyan-500 {
  background: var(--theme-brand);
  box-shadow: 0 8px 24px rgba(14, 32, 54, 0.18);
}

:root[data-theme="light"] #tech-ecosystem a.bg-cyan-500:hover {
  background: var(--theme-brand-strong);
}

:root[data-theme="light"] #tech-ecosystem .bg-cyan-500,
:root[data-theme="light"] #tech-ecosystem .bg-purple-500,
:root[data-theme="light"] #tech-ecosystem .bg-blue-500 {
  background: var(--theme-accent-soft) !important;
  color: #8a6a20 !important;
  font-weight: 600;
}

/* ================================
   ABOUT PAGE (light)
   ================================ */

/* About hero (no .theme-hero class) */
:root[data-theme="light"] body > section:first-of-type {
  background: var(--theme-bg);
}

/* Vision / Mission / Bottom-line cards */
:root[data-theme="light"] section:has(> .max-w-7xl > .grid.grid-cols-1) .glass-card {
  background: var(--theme-elevated);
  border: 1px solid var(--theme-line);
}

:root[data-theme="light"] section:has(> .max-w-7xl > .grid.grid-cols-1) .glass-card:hover {
  border-color: var(--theme-line-strong);
  box-shadow: var(--theme-shadow-hover);
}

/* Icon color mappings */
:root[data-theme="light"] iconify-icon.text-cyan-400   { color: var(--theme-accent); }
:root[data-theme="light"] iconify-icon.text-purple-400  { color: #7c3aed; }
:root[data-theme="light"] iconify-icon.text-green-400   { color: var(--theme-positive); }

/* Contact section */
:root[data-theme="light"] section:has(> .max-w-7xl > .flex.flex-col) .glass-card {
  background: var(--theme-elevated);
  border-color: var(--theme-line);
}

/* ================================
   TECH PAGE - ARTICLE LIST (light)
   ================================ */

:root[data-theme="light"] .tech-hero h1 span.text-cyan-400 {
  color: var(--theme-accent);
}

:root[data-theme="light"] .article-card {
  background: var(--theme-elevated);
  border: 1px solid var(--theme-line);
  box-shadow: var(--theme-shadow);
}

:root[data-theme="light"] .article-card h2.text-white,
:root[data-theme="light"] .article-card .group-hover\:text-cyan-400 {
  color: var(--theme-text);
}

:root[data-theme="light"] .article-card:hover h2 {
  color: #8a6a20;
}

:root[data-theme="light"] .article-card [class*="bg-cyan-500\/10"],
:root[data-theme="light"] .article-card [class*="bg-purple-500\/10"],
:root[data-theme="light"] .article-card [class*="bg-amber-500\/10"],
:root[data-theme="light"] .article-card [class*="bg-green-500\/10"],
:root[data-theme="light"] .article-card [class*="bg-pink-500\/10"] {
  background: var(--theme-accent-soft) !important;
  border-color: rgba(184, 146, 61, 0.20) !important;
}

/* Pagination */
:root[data-theme="light"] .glass-card.text-gray-400,
:root[data-theme="light"] a.glass-card.text-gray-400 {
  color: var(--theme-muted);
  background: var(--theme-elevated);
  border: 1px solid var(--theme-line);
}

:root[data-theme="light"] a.glass-card.text-gray-400:hover {
  color: var(--theme-text);
  background: var(--theme-bg-soft);
  border-color: var(--theme-line-strong);
}

:root[data-theme="light"] span.bg-cyan-500 {
  background: var(--theme-brand);
}

/* ================================
   ARTICLE DETAIL PAGE (light)
   ================================ */

:root[data-theme="light"] header.pt-32 {
  background: var(--theme-bg);
}

:root[data-theme="light"] article.glass-card {
  background: var(--theme-elevated);
  border: 1px solid var(--theme-line);
  box-shadow: var(--theme-shadow-lg);
}

/* Tags */
:root[data-theme="light"] .bg-gray-800.rounded-lg {
  background: var(--theme-bg-soft);
  color: var(--theme-muted);
  border: 1px solid var(--theme-line);
}

/* "Next Article" card */
:root[data-theme="light"] .group.relative.glass-card {
  background: var(--theme-elevated);
  border: 1px solid var(--theme-line);
}

:root[data-theme="light"] .group.relative.glass-card:hover {
  border-color: rgba(184, 146, 61, 0.4);
  box-shadow: var(--theme-shadow-hover);
}

/* Related cards */
:root[data-theme="light"] .related-card {
  background: var(--theme-elevated);
  border: 1px solid var(--theme-line);
}

:root[data-theme="light"] .related-card:hover {
  border-color: rgba(184, 146, 61, 0.35);
  box-shadow: var(--theme-shadow-hover);
  transform: translateY(-2px);
}

/* ================================
   DARK MODE ACCENT REMAP (cyan/blue → gold)
   模板里大量硬编码了 text-cyan-400 / bg-cyan-500 等 Tailwind class（不走 CSS 变量），
   之前这些颜色和 logo 的金/藏青/绿完全无关，只是巧合地和旧 light 配色一致。
   这里把它们重新映射到 --theme-accent（暗色下的亮金），让 dark 也贴合品牌色。
   用精确 class 选择器（非子串匹配），避免误伤 hover:/group-hover: 变体。
   ================================ */

:root[data-theme="dark"] .text-cyan-400,
:root[data-theme="dark"] .text-cyan-300,
:root[data-theme="dark"] .text-blue-400 {
  color: var(--theme-accent);
}

:root[data-theme="dark"] .hover\:text-cyan-400:hover,
:root[data-theme="dark"] .hover\:text-cyan-300:hover {
  color: var(--theme-accent);
}

:root[data-theme="dark"] .group:hover .group-hover\:text-cyan-400 {
  color: var(--theme-accent);
}

:root[data-theme="dark"] .bg-cyan-500,
:root[data-theme="dark"] .bg-cyan-400,
:root[data-theme="dark"] .bg-blue-500 {
  background-color: var(--theme-accent);
}

:root[data-theme="dark"] .hover\:bg-cyan-400:hover {
  background-color: var(--theme-accent);
}

/* 金底按钮/标签上的白字改为藏青字，保证可读对比度 */
:root[data-theme="dark"] .text-white.bg-cyan-500,
:root[data-theme="dark"] .text-white.bg-blue-500 {
  color: var(--theme-accent-contrast);
}

/* 徽标/图标底、装饰光斑的半透明底色 */
:root[data-theme="dark"] .bg-cyan-500\/5 {
  background-color: rgba(224, 181, 99, 0.05);
}

:root[data-theme="dark"] .bg-cyan-500\/10 {
  background-color: rgba(224, 181, 99, 0.10);
}

:root[data-theme="dark"] .bg-cyan-500\/20,
:root[data-theme="dark"] .bg-blue-500\/20,
:root[data-theme="dark"] .bg-blue-600\/20 {
  background-color: rgba(224, 181, 99, 0.16);
}

/* 边框 */
:root[data-theme="dark"] .border-cyan-500\/20 {
  border-color: rgba(224, 181, 99, 0.30);
}

:root[data-theme="dark"] .border-cyan-500\/30 {
  border-color: rgba(224, 181, 99, 0.35);
}

:root[data-theme="dark"] .hover\:border-cyan-400\/40:hover {
  border-color: rgba(224, 181, 99, 0.45);
}

:root[data-theme="dark"] .hover\:border-cyan-500\/50:hover {
  border-color: rgba(224, 181, 99, 0.55);
}

/* Hero 标题强调字渐变（from-cyan-400 to-blue-500） */
:root[data-theme="dark"] .from-cyan-400 {
  --tw-gradient-from: #b8923d;
}

:root[data-theme="dark"] .to-blue-500 {
  --tw-gradient-to: #f0d9a3;
}

:root[data-theme="dark"] .from-cyan-500\/5 {
  --tw-gradient-from: rgba(224, 181, 99, 0.06);
}

:root[data-theme="dark"] .to-blue-600\/5 {
  --tw-gradient-to: rgba(224, 181, 99, 0.06);
}

/* 光晕投影 */
:root[data-theme="dark"] .shadow-cyan-950\/20 {
  --tw-shadow-color: rgba(224, 181, 99, 0.12);
}

:root[data-theme="dark"] .shadow-cyan-500\/25 {
  --tw-shadow-color: rgba(224, 181, 99, 0.3);
}

:root[data-theme="dark"] [class*="00C8FF"] {
  box-shadow: 0 0 10px rgba(224, 181, 99, 0.7);
}

:root[data-theme="dark"] [class*="rgba(34,211,238,0.15)"]:hover,
:root[data-theme="dark"] [class*="rgba(34, 211, 238, 0.15)"]:hover {
  box-shadow: 0 0 30px rgba(224, 181, 99, 0.25);
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 767px) {
  section:has(.bento-item) {
    padding-top: 44px;
  }

  .theme-hero {
    min-height: 760px;
    padding-top: 92px;
    padding-bottom: 220px;
    align-items: flex-start;
  }

  .theme-hero::after {
    background: linear-gradient(180deg, #050b17 0%, rgba(5, 11, 23, 0.98) 38%, rgba(5, 11, 23, 0.42) 58%, rgba(5, 11, 23, 0) 74%);
  }

  :root[data-theme="light"] .theme-hero::after {
    background: linear-gradient(180deg, #fafaf7 0%, rgba(250, 250, 247, 0.98) 38%, rgba(250, 250, 247, 0.45) 58%, rgba(250, 250, 247, 0) 74%);
  }

  .hero-product-layer--desktop {
    display: none !important;
  }

  .hero-product-layer--mobile.hero-product-layer--dark {
    display: block;
  }

  :root[data-theme="light"] .hero-product-layer--mobile.hero-product-layer--dark {
    display: none;
  }

  :root[data-theme="light"] .hero-product-layer--mobile.hero-product-layer--light {
    display: block;
  }

  .hero-product-layer--mobile {
    background-position: center calc(100% + 78px);
    background-size: 100% auto;
  }

  .hero-content-wrap {
    justify-content: center;
  }

  .hero-copy {
    width: 100%;
    text-align: center;
    padding-left: 0;
  }

  .hero-copy h1 {
    margin-bottom: 18px;
    font-size: 38px;
    line-height: 1.14;
  }

  .hero-copy > p {
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.7;
  }

  .hero-copy > p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-copy .hero-download-group {
    justify-content: center;
  }

  .bento-product-card {
    min-height: 720px;
    padding: 1.5rem;
  }

  .bento-product-copy {
    width: 100%;
  }

  .bento-product-media {
    background-position: 70% bottom;
    background-size: auto 58%;
  }

  .bento-product-card::after {
    background: linear-gradient(180deg, #07101f 0%, rgba(7, 16, 31, 0.98) 42%, rgba(7, 16, 31, 0.28) 60%, rgba(7, 16, 31, 0) 76%);
  }

  :root[data-theme="light"] .bento-product-card::after {
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.98) 42%, rgba(255, 255, 255, 0.35) 60%, rgba(255, 255, 255, 0) 76%);
  }
}

/* ================================
   FRIEND LINKS（友情链接，双主题）
   ================================ */

.friend-links {
  padding: 40px 16px 8px;
  background: var(--theme-bg);
}

.friend-links-title {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--theme-text);
  letter-spacing: 0.02em;
}

.friend-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.friend-links-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--theme-line);
  border-radius: 999px;
  background: var(--theme-panel);
  color: var(--theme-muted);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.friend-links-item:hover {
  color: var(--theme-accent);
  border-color: var(--theme-line-strong);
  background: var(--theme-accent-soft);
}

.friend-links-item:focus-visible {
  outline: 2px solid var(--theme-accent);
  outline-offset: 3px;
}

.friend-links-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}

/* 页脚主网格：预编译 tailwind.css 缺少 md:grid-cols-2 / md:items-center / md:text-right，
   用自定义类补齐（与 tailwind md 断点一致：768px） */
@media (min-width: 768px) {
  .footer-main-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
  }

  .footer-quicklinks-title {
    text-align: right;
  }
}

/* ================================
   PRIVACY, COOKIE CONSENT & LEGAL
   ================================ */

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.privacy-footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.privacy-footer-links a,
.privacy-footer-button {
  color: var(--theme-muted);
  transition: color 160ms ease;
}

.privacy-footer-button {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.privacy-footer-links a:hover,
.privacy-footer-button:hover {
  color: var(--theme-accent);
}

.privacy-footer-links a:focus-visible,
.privacy-footer-button:focus-visible,
.cookie-action:focus-visible,
.cookie-close-button:focus-visible,
.legal-settings-button:focus-visible {
  outline: 2px solid var(--theme-accent);
  outline-offset: 3px;
}

.cookie-banner[hidden],
.cookie-modal[hidden],
.cookie-status[hidden] {
  display: none !important;
}

.cookie-banner {
  position: fixed;
  z-index: 90;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  left: max(24px, env(safe-area-inset-left));
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 22px;
  border: 1px solid var(--theme-line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-panel-solid) 96%, transparent);
  color: var(--theme-text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  animation: cookie-banner-in 220ms ease-out;
}

:root[data-theme="light"] .cookie-banner {
  box-shadow: 0 18px 55px rgba(14, 32, 54, 0.18);
}

.cookie-banner-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.cookie-banner-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--theme-line-strong);
  border-radius: 8px;
  color: var(--theme-accent);
  background: var(--theme-accent-soft);
  font-size: 24px;
}

.cookie-banner h2,
.cookie-dialog h2 {
  margin: 0;
  color: var(--theme-text);
  letter-spacing: 0;
}

.cookie-banner h2 {
  font-size: 17px;
  line-height: 1.35;
}

.cookie-banner p {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--theme-muted);
  font-size: 13px;
  line-height: 1.65;
}

.cookie-policy-links,
.cookie-dialog-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.cookie-policy-links {
  margin-top: 8px;
}

.cookie-policy-links a,
.cookie-dialog-links a {
  color: var(--theme-accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.cookie-policy-links a:hover,
.cookie-dialog-links a:hover {
  text-decoration: underline;
}

.cookie-banner-actions,
.cookie-dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-action {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.cookie-action:hover {
  transform: translateY(-1px);
}

.cookie-action:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.cookie-action-primary {
  border: 1px solid var(--theme-accent);
  background: var(--theme-accent);
  color: var(--theme-accent-contrast);
}

.cookie-action-primary:hover {
  border-color: var(--theme-accent-strong);
  background: var(--theme-accent-strong);
}

.cookie-action-secondary {
  border: 1px solid var(--theme-line);
  background: var(--theme-bg-soft);
  color: var(--theme-text-secondary);
}

.cookie-action-secondary:hover {
  border-color: var(--theme-line-strong);
  color: var(--theme-text);
}

.cookie-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.cookie-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 17, 0.72);
  backdrop-filter: blur(8px);
}

:root[data-theme="light"] .cookie-modal-backdrop {
  background: rgba(14, 32, 54, 0.38);
}

body.cookie-modal-open {
  overflow: hidden;
}

.cookie-dialog {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(760px, calc(100dvh - 40px));
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  background: var(--theme-panel-solid);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow-lg);
  animation: cookie-dialog-in 180ms ease-out;
}

.cookie-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.cookie-dialog-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--theme-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cookie-dialog h2 {
  font-size: 24px;
  line-height: 1.25;
}

.cookie-close-button {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--theme-line);
  border-radius: 6px;
  background: var(--theme-bg-soft);
  color: var(--theme-text-secondary);
  font-size: 21px;
  cursor: pointer;
}

.cookie-dialog-intro {
  margin: 14px 0 18px;
  color: var(--theme-muted);
  font-size: 14px;
  line-height: 1.65;
}

.cookie-options {
  border-top: 1px solid var(--theme-line);
}

.cookie-option {
  min-height: 84px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--theme-line);
  cursor: pointer;
}

.cookie-option:first-child {
  cursor: default;
}

.cookie-option strong {
  display: block;
  color: var(--theme-text);
  font-size: 14px;
}

.cookie-option p {
  margin: 4px 0 0;
  color: var(--theme-muted);
  font-size: 12px;
  line-height: 1.55;
}

.cookie-always-on {
  color: var(--theme-positive);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.cookie-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.cookie-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cookie-switch span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--theme-line);
  border-radius: 999px;
  background: var(--theme-bg-muted);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.cookie-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--theme-soft);
  transition: transform 150ms ease, background-color 150ms ease;
}

.cookie-switch input:checked + span {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
}

.cookie-switch input:checked + span::after {
  background: var(--theme-accent-contrast);
  transform: translateX(20px);
}

.cookie-switch input:focus-visible + span {
  outline: 2px solid var(--theme-accent);
  outline-offset: 3px;
}

.cookie-dialog-links {
  margin-top: 16px;
}

.cookie-dialog-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.cookie-dialog-actions .cookie-action {
  min-width: 120px;
}

.cookie-status {
  position: fixed;
  z-index: 110;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  max-width: min(420px, calc(100% - 32px));
  padding: 11px 16px;
  border: 1px solid color-mix(in srgb, var(--theme-positive) 45%, var(--theme-line));
  border-radius: 6px;
  background: var(--theme-panel-solid);
  color: var(--theme-positive);
  box-shadow: var(--theme-shadow);
  font-size: 13px;
  font-weight: 700;
  transform: translateX(-50%);
}

.cookie-status.is-error {
  border-color: rgba(203, 67, 53, 0.45);
  color: #cb4335;
}

.legal-page {
  min-height: 100vh;
  padding: 148px 24px 96px;
  background: var(--theme-bg);
}

.legal-shell {
  width: min(900px, 100%);
  margin: 0 auto;
}

.legal-header {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--theme-line);
}

.legal-header > span {
  color: var(--theme-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.legal-header h1 {
  margin: 10px 0 12px;
  color: var(--theme-text);
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.legal-header p,
.legal-section p {
  color: var(--theme-muted);
}

.legal-header p {
  margin: 0;
  font-size: 14px;
}

.legal-section {
  padding: 30px 0;
  border-bottom: 1px solid var(--theme-line);
}

.legal-section h2 {
  margin: 0 0 12px;
  color: var(--theme-text);
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: 0;
}

.legal-section p {
  max-width: 780px;
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-line;
}

.legal-section a {
  color: var(--theme-accent);
  font-weight: 700;
}

.legal-settings-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  padding: 0 16px;
  border: 1px solid var(--theme-accent);
  border-radius: 6px;
  background: transparent;
  color: var(--theme-accent);
  font-weight: 800;
  cursor: pointer;
}

.legal-settings-button:hover {
  background: var(--theme-accent);
  color: var(--theme-accent-contrast);
}

.cookie-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  background: var(--theme-panel-solid);
}

.cookie-policy-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: var(--theme-text-secondary);
  font-size: 13px;
}

.cookie-policy-table th,
.cookie-policy-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--theme-line);
  text-align: left;
  vertical-align: top;
}

.cookie-policy-table tr:last-child td {
  border-bottom: 0;
}

.cookie-policy-table th {
  background: var(--theme-bg-soft);
  color: var(--theme-text);
  font-weight: 800;
}

.cookie-policy-table code {
  color: var(--theme-accent);
  font-size: 12px;
  white-space: nowrap;
}

@keyframes cookie-banner-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cookie-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 820px) {
  .cookie-banner {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .cookie-banner-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .footer-bottom-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .privacy-footer-links {
    justify-content: flex-start;
    gap: 12px 16px;
  }

  .cookie-banner {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top)));
    margin: 0;
    overflow-y: auto;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .cookie-banner-copy {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
  }

  .cookie-banner-icon {
    width: 36px;
    height: 36px;
    font-size: 21px;
  }

  .cookie-banner-actions {
    grid-template-columns: 1fr;
  }

  .cookie-banner-actions .cookie-action-primary {
    order: -1;
  }

  .cookie-modal {
    align-items: end;
    padding: max(12px, env(safe-area-inset-top)) 0 0;
  }

  .cookie-dialog {
    width: 100%;
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .cookie-dialog h2 {
    font-size: 21px;
  }

  .cookie-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .legal-page {
    padding: 112px 18px 72px;
  }

  .legal-header h1 {
    font-size: 38px;
  }

  .legal-section {
    padding: 24px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-dialog {
    animation: none;
  }
}
