:root {
  color-scheme: light;
  --bg: #f4f8ff;
  --bg-soft: #eaf3ff;
  --panel: rgba(255, 255, 255, .9);
  --panel-strong: #ffffff;
  --line: rgba(37, 83, 126, .16);
  --line-strong: rgba(18, 115, 246, .42);
  --text: #122840;
  --muted: #60758d;
  --accent: #1478ff;
  --accent-2: #684cff;
  --danger: #d9435c;
  --warning: #a96700;
  --success: #00885f;
  --shadow: 0 24px 70px rgba(45, 89, 130, .16);
  --radius: 20px;
  --radius-sm: 13px;
  --max: 1180px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #06101d;
  --bg-soft: #0a1727;
  --panel: rgba(13, 30, 49, .9);
  --panel-strong: #102238;
  --line: rgba(168, 207, 231, .15);
  --line-strong: rgba(72, 239, 194, .38);
  --text: #f3f8fc;
  --muted: #9eb2c8;
  --accent: #49efc2;
  --accent-2: #61a8ff;
  --danger: #ff7b88;
  --warning: #ffc46b;
  --success: #5af0b6;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, rgba(20, 120, 255, .16), transparent 33rem),
    radial-gradient(circle at 95% 8%, rgba(104, 76, 255, .12), transparent 32rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 58%, #eef5ff 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Khmer", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% -10%, rgba(73, 239, 194, .17), transparent 33rem),
    radial-gradient(circle at 95% 8%, rgba(97, 168, 255, .16), transparent 32rem),
    linear-gradient(180deg, #071321 0%, var(--bg) 55%, #050c16 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .32;
  background-image:
    linear-gradient(rgba(30,92,153,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,92,153,.055) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.danger { color: var(--danger); }
.nowrap { white-space: nowrap; }

.shell { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(18px);
}
html[data-theme="dark"] .site-header { background: rgba(6, 16, 29, .84); }
.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: .02em;
  white-space: nowrap;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(73,239,194,.5);
  border-radius: 11px;
  color: #05141e;
  background: linear-gradient(145deg, var(--accent), #8cf4ff);
  box-shadow: 0 0 28px rgba(73,239,194,.23);
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: rgba(20,120,255,.08); }
.nav-link-button {
  min-height: 42px;
  padding: 0 13px;
  color: var(--muted);
  border: 0;
  border-radius: 11px;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
}
.nav-link-button:hover { color: var(--text); background: rgba(20,120,255,.08); }
.header-actions { display: flex; align-items: center; gap: 9px; }
.language-select {
  height: 42px;
  max-width: 118px;
  padding: 0 32px 0 11px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-strong);
}
.icon-control {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  font-size: 19px;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(20, 120, 255, .18);
  font-weight: 850;
  line-height: 1.15;
}
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .52; cursor: not-allowed; transform: none; }
.btn-secondary { color: var(--text); border-color: var(--line); background: var(--panel-strong); box-shadow: none; }
.btn-ghost { color: var(--accent); border-color: rgba(73,239,194,.25); background: rgba(73,239,194,.06); box-shadow: none; }
.btn-danger { color: #fff; border-color: rgba(255,123,136,.27); background: rgba(255,123,136,.12); box-shadow: none; }
.btn-small { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn-block { width: 100%; }

.hero { padding: clamp(54px, 8vw, 100px) 0 44px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 15px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: var(--accent); }
.hero h1, .page-hero h1 {
  margin: 0;
  max-width: 800px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.06;
  letter-spacing: -.045em;
}
.gradient-text { color: transparent; background: linear-gradient(100deg, #0d2d53 0%, #1478ff 48%, #694cff 100%); background-clip: text; }
html[data-theme="dark"] .gradient-text { background-image: linear-gradient(100deg, #fff 0%, #b9fff0 44%, #91c6ff 100%); }
.hero-lead, .page-hero p { max-width: 720px; margin: 22px 0 0; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-card, .panel, .auth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero-card { padding: 22px; }
.search-card-label { margin: 0 0 8px; font-size: 17px; font-weight: 850; }
.search-card-copy { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.search-row { display: flex; gap: 9px; }
.search-row .field { flex: 1; min-width: 0; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 17px; }
.stat {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
}
.stat strong { color: var(--accent); font-size: 23px; line-height: 1; }
.stat span { margin-top: 7px; color: var(--muted); font-size: 11px; }

.section { padding: 42px 0 76px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: clamp(27px, 4vw, 40px); letter-spacing: -.025em; }
.section-head p { max-width: 640px; margin: 8px 0 0; color: var(--muted); }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.category-card {
  min-height: 190px;
  padding: 20px;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(20,45,68,.78), rgba(9,24,40,.75));
  transition: .2s ease;
}
.category-card:hover, .category-card.active { border-color: var(--line-strong); background: linear-gradient(150deg, rgba(32,70,82,.82), rgba(10,28,47,.88)); transform: translateY(-3px); }
.category-card.active { box-shadow: inset 0 0 0 1px rgba(73,239,194,.14), 0 18px 44px rgba(0,0,0,.2); }
.category-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: rgba(73,239,194,.1); font-size: 25px; }
.category-card h3 { margin: 19px 0 7px; font-size: 18px; }
.category-card p { margin: 0; color: var(--muted); font-size: 13px; }
.category-meta { display: block; margin-top: 15px; color: var(--accent); font-size: 12px; font-weight: 800; }
.plans-area { scroll-margin-top: 90px; margin-top: 22px; }
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.plan-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 25, 42, .82);
}
.plan-card:hover { border-color: rgba(97,168,255,.38); }
.plan-tag { width: fit-content; padding: 5px 9px; color: var(--accent); border: 1px solid rgba(73,239,194,.2); border-radius: 999px; background: rgba(73,239,194,.06); font-size: 11px; font-weight: 800; }
.plan-card h3 { margin: 17px 0 5px; font-size: 19px; }
.plan-card p { margin: 0; color: var(--muted); font-size: 13px; }
.price { margin: auto 0 14px; padding-top: 24px; color: var(--accent); font-size: 30px; font-weight: 900; letter-spacing: -.03em; }
.price small { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.loading-card, .empty-state {
  grid-column: 1 / -1;
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 17px;
}

.page-hero { padding: 54px 0 30px; }
.page-hero h1 { font-size: clamp(34px, 5vw, 56px); }
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(10, 26, 43, .78);
}
.toolbar .field { flex: 1; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0 20px; }
.filter-btn {
  min-height: 38px;
  padding: 0 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  font-size: 13px;
  font-weight: 750;
}
.filter-btn.active { color: #06131d; border-color: var(--accent); background: var(--accent); }
.result-meta { display: flex; justify-content: space-between; gap: 16px; margin: 12px 0; color: var(--muted); font-size: 13px; }
.knowledge-list { display: grid; gap: 12px; }
.knowledge-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 25, 42, .83);
}
.knowledge-item[open] { border-color: rgba(73,239,194,.3); }
.knowledge-summary {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 13px;
  align-items: start;
  padding: 18px;
  list-style: none;
  cursor: pointer;
}
.knowledge-summary::-webkit-details-marker { display: none; }
.knowledge-index { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: #06131d; background: var(--accent); font-size: 12px; font-weight: 900; }
.knowledge-title { margin: 0; font-size: 17px; }
.knowledge-excerpt { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.knowledge-arrow { color: var(--accent); font-size: 18px; transition: transform .2s; }
.knowledge-item[open] .knowledge-arrow { transform: rotate(45deg); }
.knowledge-body { padding: 0 18px 20px 62px; }
.knowledge-detail { white-space: pre-wrap; color: #cedbe7; font-size: 14px; line-height: 1.75; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { padding: 4px 8px; border-radius: 999px; color: #a9c4d9; background: rgba(97,168,255,.09); font-size: 11px; }
.knowledge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 16px; }
.source-note { margin-left: auto; color: var(--muted); font-size: 11px; }
.load-more-wrap { display: flex; justify-content: center; padding: 24px 0 0; }

.auth-main { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 40px 0 70px; }
.auth-layout { width: min(100%, 960px); display: grid; grid-template-columns: .9fr 1.1fr; gap: 30px; align-items: center; }
.auth-copy h1 { margin: 0; font-size: clamp(36px, 6vw, 58px); line-height: 1.07; letter-spacing: -.04em; }
.auth-copy p { margin: 18px 0 0; color: var(--muted); font-size: 17px; }
.auth-points { display: grid; gap: 10px; margin-top: 25px; }
.auth-point { display: flex; gap: 10px; align-items: center; color: #c7d7e4; }
.auth-point span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--accent); background: rgba(73,239,194,.09); }
.auth-card { padding: 25px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 5px; border-radius: 13px; background: rgba(255,255,255,.045); }
.auth-helper-row { display: flex; justify-content: center; min-height: 28px; }
.auth-helper-row .text-button { color: var(--accent); font-size: 12px; }
.auth-tab { min-height: 42px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-weight: 800; }
.auth-tab.active { color: #06131d; background: var(--accent); }
.form-stack { display: grid; gap: 15px; margin-top: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-group { display: grid; gap: 7px; }
.form-group label { color: #d8e5ee; font-size: 13px; font-weight: 750; }
.field, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--text);
  outline: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 12, 23, .58);
  font-size: 16px;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}
.field:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(73,239,194,.09);
  font-size: 16px;
}
.field::placeholder, .textarea::placeholder { color: #70869b; }
.textarea { min-height: 160px; resize: vertical; }
.form-help { color: var(--muted); font-size: 11px; }
.form-message { display: none; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; font-size: 13px; }
.form-message.show { display: block; }
.form-message.error { color: #ffd1d6; border-color: rgba(255,123,136,.25); background: rgba(255,123,136,.09); }
.form-message.success { color: #c6ffe8; border-color: rgba(73,239,194,.25); background: rgba(73,239,194,.08); }
.privacy-note { margin: 16px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.session-card { display: none; margin-top: 18px; padding: 16px; border: 1px solid rgba(73,239,194,.2); border-radius: 13px; background: rgba(73,239,194,.06); }
.session-card.show { display: block; }
.session-email { word-break: break-all; color: var(--accent); font-weight: 800; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); gap: 18px; padding: 18px 0 70px; }
.panel { padding: 21px; box-shadow: 0 18px 54px rgba(0,0,0,.18); }
.panel h2 { margin: 0; font-size: 21px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.profile-card { position: sticky; top: 90px; align-self: start; }
.avatar { width: 70px; height: 70px; display: grid; place-items: center; border: 1px solid rgba(73,239,194,.4); border-radius: 21px; color: #06131d; background: linear-gradient(145deg, var(--accent), #87ccff); font-size: 27px; font-weight: 900; }
.profile-name { margin: 15px 0 2px; font-size: 23px; }
.profile-email { margin: 0; color: var(--muted); word-break: break-all; }
.profile-meta { display: grid; gap: 8px; margin: 18px 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.12); }
.meta-row { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.meta-row strong { max-width: 65%; color: #dce8f0; text-align: right; word-break: break-all; }
.dashboard-main { display: grid; gap: 18px; }
.order-list, .material-list { display: grid; gap: 11px; }
.order-card, .material-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(4, 15, 28, .45); }
.order-top, .material-top { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.order-title, .material-title { margin: 0; font-size: 16px; }
.order-number { margin: 3px 0 0; color: var(--muted); font-size: 11px; word-break: break-all; }
.status-badge { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; color: var(--warning); background: rgba(255,196,107,.1); font-size: 11px; font-weight: 850; }
.status-badge.paid, .status-badge.delivered { color: var(--success); background: rgba(90,240,182,.09); }
.status-badge.failed, .status-badge.expired, .status-badge.cancelled { color: var(--danger); background: rgba(255,123,136,.09); }
.order-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }
.order-info div { padding: 9px; border-radius: 10px; background: rgba(255,255,255,.035); }
.order-info span { display: block; color: var(--muted); font-size: 10px; }
.order-info strong { display: block; margin-top: 3px; font-size: 13px; word-break: break-word; }
.order-actions, .material-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.txid-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-top: 12px; }
.material-preview { display: -webkit-box; overflow: hidden; margin: 10px 0 0; color: var(--muted); font-size: 12px; -webkit-line-clamp: 3; -webkit-box-orient: vertical; white-space: pre-wrap; }
.material-form { padding-bottom: 19px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 5, 12, .76);
  backdrop-filter: blur(11px);
}
.modal.show { display: flex; }
.modal-card {
  width: min(100%, 610px);
  max-height: min(90vh, 780px);
  overflow: auto;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #0d1d30;
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
}
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.modal-head h2 { margin: 0; font-size: 23px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.icon-btn { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.04); }
.modal-product { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 14px; border: 1px solid rgba(73,239,194,.18); border-radius: 13px; background: rgba(73,239,194,.055); }
.modal-product h3 { margin: 0; font-size: 16px; }
.modal-product p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.modal-price { color: var(--accent); font-size: 23px; font-weight: 900; white-space: nowrap; }
.modal-step { display: none; margin-top: 17px; }
.modal-step.active { display: block; }
.order-summary { display: grid; gap: 8px; margin: 14px 0; }
.summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.035); font-size: 13px; }
.summary-row span { color: var(--muted); }
.summary-row strong { text-align: right; word-break: break-all; }
.wallet-box { position: relative; padding: 14px 80px 14px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.wallet-box .btn { position: absolute; top: 7px; right: 7px; min-height: 34px; padding: 0 10px; }
.payment-note { margin: 12px 0; padding: 11px 13px; color: #c3d5e3; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: rgba(73,239,194,.055); font-size: 12px; }
.modal-actions { display: flex; gap: 9px; margin-top: 17px; }
.modal-actions .btn { flex: 1; }
.success-view { padding: 18px 0 5px; text-align: center; }
.success-icon { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 50%; color: #04150f; background: var(--success); font-size: 36px; }
.success-view h3 { margin: 0; font-size: 26px; }
.success-view p { color: var(--muted); }
.music-toggle {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 60;
  min-height: 42px;
  min-width: 110px;
  padding: 0 14px;
  color: #eef5ff;
  border: 1px solid rgba(73,239,194,.35);
  border-radius: 999px;
  background: rgba(6,16,29,.94);
  box-shadow: 0 12px 34px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.music-toggle.playing {
  color: #06131d;
  background: var(--accent);
  border-color: var(--accent);
}
.music-toggle:disabled {
  opacity: .7;
  color: #cfe0f5;
  background: rgba(6,16,29,.9);
}
.site-footer { padding: 25px 0 34px; color: var(--muted); border-top: 1px solid var(--line); text-align: center; font-size: 12px; }
.site-footer-icons { padding: 14px 0 88px; border-top: none; background: transparent; }
.footer-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}
.footer-icon-link {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 20px;
  text-decoration: none;
  color: inherit;
  border-radius: 50%;
  border: 1px solid rgba(120, 170, 255, .28);
  background: rgba(8, 20, 45, .75);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
html[data-theme="light"] .footer-icon-link {
  border-color: rgba(20, 120, 255, .22);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 20px rgba(45, 89, 130, .12);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 150;
  width: min(calc(100% - 32px), 460px);
  display: none;
  padding: 12px 15px;
  transform: translateX(-50%);
  color: #dce9f2;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #102238;
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 13px;
}
.toast.show { display: block; }
.toast.error { color: #ffd6da; border-color: rgba(255,123,136,.35); }

@media (max-width: 960px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .hero-grid, .auth-layout { grid-template-columns: 1fr; }
  .hero-card { max-width: 680px; }
  .category-grid, .plan-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .profile-card { position: static; }
}

@media (max-width: 640px) {
  .shell { width: min(calc(100% - 24px), var(--max)); }
  .header-inner { min-height: 62px; gap: 10px; }
  .brand span:last-child { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .language-select { width: 104px; height: 39px; font-size: 12px; }
  .header-actions .btn { min-height: 39px; padding: 0 12px; font-size: 12px; }
  .hero { padding-top: 45px; }
  .hero h1 { font-size: 40px; }
  .hero-grid { gap: 28px; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .search-row, .toolbar { align-items: stretch; flex-direction: column; }
  .search-row .btn, .toolbar .btn { width: 100%; }
  .hero-stats { gap: 7px; }
  .stat { padding: 9px; }
  .stat strong { font-size: 19px; }
  .section { padding: 32px 0 58px; }
  .section-head { align-items: start; flex-direction: column; }
  .category-grid, .plan-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 160px; }
  .plan-card { min-height: 225px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-main { align-items: start; padding-top: 32px; }
  .auth-copy { text-align: center; }
  .auth-points { display: none; }
  .auth-card, .panel, .modal-card { padding: 17px; }
  .dashboard-grid { padding-top: 8px; }
  .order-info { grid-template-columns: 1fr 1fr; }
  .txid-row { grid-template-columns: 1fr; }
  .knowledge-summary { grid-template-columns: auto minmax(0,1fr); }
  .knowledge-arrow { display: none; }
  .knowledge-body { padding-left: 17px; }
  .source-note { width: 100%; margin-left: 0; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-card { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .modal-actions { flex-direction: column-reverse; }
  .music-toggle { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* Smart five-round answer matching */
.match-hero { padding: clamp(38px, 6vw, 72px) 0 70px; }
.match-layout {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(420px, 1.18fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.match-intro h1 { max-width: 720px; font-size: clamp(38px, 5.5vw, 68px); line-height: 1.05; letter-spacing: -.045em; }
.flow-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 30px;
}
.flow-strip div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 12px;
  font-weight: 750;
}
.flow-strip strong {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #06131d;
  border-radius: 8px;
  background: var(--accent);
}
.assistant-card {
  min-height: 520px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(73,239,194,.28);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(15,36,57,.97), rgba(8,23,39,.96)),
    var(--panel);
  box-shadow: 0 28px 90px rgba(0,0,0,.34), 0 0 70px rgba(73,239,194,.07);
}
.assistant-card h2 { margin: 12px 0 7px; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; }
.assistant-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
}
.assistant-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(73,239,194,.8);
}
.problem-form { display: grid; gap: 12px; margin-top: 20px; }
.problem-input {
  width: 100%;
  min-height: 142px;
  resize: vertical;
  padding: 17px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: rgba(3,13,24,.58);
  font-size: 16px;
  line-height: 1.65;
}
.problem-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(73,239,194,.1); }
.btn-large { min-height: 52px; font-size: 16px; }
.example-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.example-chips button, .text-button {
  padding: 0;
  color: var(--accent-2);
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}
.example-chips button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
}
.example-chips button:hover { color: var(--text); border-color: var(--line-strong); }
.quiz-progress-head, .result-topline, .result-price-row, .favorite-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.quiz-progress-head { color: var(--muted); font-size: 13px; font-weight: 800; }
.progress-track {
  height: 7px;
  margin: 11px 0 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}
.progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}
.question-quote {
  margin: 0;
  padding: 10px 12px;
  overflow: hidden;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: rgba(73,239,194,.045);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quiz-options { display: grid; gap: 9px; margin: 18px 0 12px; }
.quiz-option {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.027);
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.quiz-option:hover, .quiz-option:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(73,239,194,.055);
}
.quiz-option.compact { min-height: 56px; }
.quiz-option > span:last-child { min-width: 0; display: grid; gap: 3px; }
.quiz-option strong { display: block; font-size: 14px; line-height: 1.35; }
.quiz-option small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.option-number {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(73,239,194,.32);
  border-radius: 10px;
  background: rgba(73,239,194,.06);
  font-size: 12px;
  font-weight: 900;
}
.result-label, .match-confidence {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.result-label { color: #06131d; background: var(--accent); }
.match-confidence { color: var(--accent-2); border: 1px solid rgba(97,168,255,.3); background: rgba(97,168,255,.07); }
.result-summary { margin: 9px 0 18px; color: var(--muted); }
.result-price-row {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(0,0,0,.13);
}
.result-price-row > div:first-child { display: grid; gap: 3px; }
.result-price-row span { color: var(--muted); font-size: 11px; }
.result-price { display: flex; align-items: baseline; gap: 5px; }
.result-price strong { color: var(--accent); font-size: 30px; line-height: 1; }
.delivery-box { margin-top: 13px; padding: 15px; border-radius: 15px; background: rgba(73,239,194,.045); }
.delivery-box h3 { margin: 0 0 8px; font-size: 13px; }
.delivery-box ul { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.delivery-box li::marker { color: var(--accent); }
.match-details { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); font-size: 12px; }
.match-details summary { cursor: pointer; color: var(--text); font-weight: 800; }
.match-details ol { margin: 9px 0 0; padding-left: 20px; }
.result-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; margin-top: 14px; }
.result-restart { width: 100%; margin-top: 14px; }
.member-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.member-shortcuts a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  font-size: 12px;
  font-weight: 800;
}
.member-shortcuts a:hover { color: var(--text); border-color: var(--line-strong); }
.favorite-list { display: grid; gap: 12px; }
.favorite-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
}
.favorite-card h3 { margin: 0; font-size: 16px; }
.favorite-price { flex: 0 0 auto; color: var(--accent); font-size: 15px; }
.favorite-question {
  margin: 10px 0;
  padding: 9px 11px;
  color: var(--muted);
  border-left: 2px solid var(--accent-2);
  background: rgba(97,168,255,.045);
  font-size: 12px;
}
.favorite-choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 13px; }
.favorite-choices span {
  padding: 4px 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
}
.purchased-answer {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 15px;
  border: 1px solid rgba(73,239,194,.24);
  border-radius: 15px;
  background: rgba(3,13,24,.52);
}
.purchased-answer pre {
  max-height: 560px;
  margin: 0;
  overflow: auto;
  color: #dceaf3;
  font: inherit;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.purchased-answer .btn { justify-self: start; }
.mobile-bottom-nav { display: none; }

@media (max-width: 960px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .match-layout { grid-template-columns: 1fr; }
  .match-intro { text-align: center; }
  .match-intro h1, .match-intro .hero-lead { margin-left: auto; margin-right: auto; }
  .assistant-card { width: min(100%, 720px); margin: 0 auto; }
  .mobile-bottom-nav {
    position: fixed !important;
    top: auto !important;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    z-index: 95;
    width: auto;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 58px;
    padding: 4px;
    border: 1px solid rgba(168,207,231,.2);
    border-radius: 18px;
    background: rgba(8,23,39,.96);
    box-shadow: 0 18px 50px rgba(0,0,0,.42);
    backdrop-filter: blur(18px);
  }
  .mobile-bottom-nav a {
    min-width: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    color: var(--muted);
    border-radius: 13px;
  }
  .mobile-bottom-nav a[aria-current="page"] { color: var(--accent); background: rgba(73,239,194,.065); }
  .mobile-bottom-nav a.nav-home {
    color: #7ec8ff;
    font-weight: 700;
  }
  .mobile-bottom-nav a.nav-home[aria-current="page"] {
    color: #fff;
    background: rgba(30, 120, 255, .22);
  }
  .mobile-bottom-nav span { font-size: 17px; line-height: 1; }
  .mobile-bottom-nav b {
    max-width: 100%;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .music-toggle { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .match-hero { padding: 30px 0 38px; }
  .match-layout { gap: 24px; }
  .match-intro h1 { font-size: 36px; }
  .match-intro .hero-lead { margin-top: 16px; font-size: 15px; }
  .flow-strip { margin-top: 22px; }
  .flow-strip div { justify-content: center; padding: 9px 5px; }
  .flow-strip strong { display: none; }
  .assistant-card { min-height: 500px; padding: 18px; border-radius: 21px; }
  .assistant-card h2 { font-size: 25px; }
  .problem-input { min-height: 132px; }
  .example-chips { display: grid; grid-template-columns: 1fr; }
  .example-chips button { width: 100%; }
  .quiz-option { min-height: 64px; padding: 11px; }
  .result-actions { grid-template-columns: 1fr; }
  .favorite-card-top { align-items: start; }
  .member-shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); }
  .member-shortcuts a { justify-content: center; padding: 0 7px; text-align: center; }
}

/* Reference-inspired responsive home, light mode, support and theme controls */
.trap-field {
  position: fixed !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.reference-hero { position: relative; overflow: hidden; isolation: isolate; }
.reference-hero .planet-glow {
  position: absolute;
  z-index: -1;
  top: 60px;
  left: 50%;
  width: min(1180px, 130vw);
  aspect-ratio: 2.35 / 1;
  transform: translateX(-50%);
  border: 1px solid rgba(20,120,255,.22);
  border-radius: 50% 50% 44% 44%;
  background:
    radial-gradient(ellipse at 50% 104%, rgba(255,255,255,.96) 0 28%, rgba(96,178,255,.24) 29%, rgba(20,120,255,.1) 42%, transparent 61%),
    repeating-radial-gradient(ellipse at 50% 110%, transparent 0 24px, rgba(20,120,255,.045) 25px 26px);
  box-shadow: 0 45px 120px rgba(20,120,255,.18), inset 0 -40px 90px rgba(20,120,255,.1);
  opacity: .9;
}
html[data-theme="dark"] .reference-hero .planet-glow {
  border-color: rgba(73,239,194,.16);
  background:
    radial-gradient(ellipse at 50% 104%, rgba(12,35,61,.95) 0 26%, rgba(35,136,230,.3) 29%, rgba(73,239,194,.11) 43%, transparent 63%),
    repeating-radial-gradient(ellipse at 50% 110%, transparent 0 24px, rgba(97,168,255,.055) 25px 26px);
  box-shadow: 0 45px 130px rgba(27,126,255,.18), inset 0 -40px 90px rgba(0,0,0,.32);
}
.reference-hero .match-layout {
  width: min(calc(100% - 32px), 1040px);
  grid-template-columns: 1fr;
  gap: 26px;
}
.reference-hero .match-intro { max-width: 850px; margin: 0 auto; text-align: center; }
.reference-hero .match-intro h1 { margin: 0 auto; }
.reference-hero .match-intro .hero-lead { margin-left: auto; margin-right: auto; }
.reference-hero .eyebrow { justify-content: center; }
.reference-hero .flow-strip { width: min(100%, 620px); margin: 27px auto 0; }
.reference-hero .assistant-card { width: min(100%, 820px); min-height: 0; margin: 0 auto; }

.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 2px; }
.module-card {
  min-height: 145px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 18px 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(45,89,130,.09);
  text-align: center;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.module-card:hover, .module-card:focus-visible { transform: translateY(-3px); border-color: var(--module-color); box-shadow: 0 20px 48px rgba(45,89,130,.15); }
.module-icon { width: 45px; height: 45px; display: grid; place-items: center; color: var(--module-color); border: 1px solid color-mix(in srgb, var(--module-color) 34%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--module-color) 10%, transparent); font-size: 23px; }
.module-card strong { font-size: 16px; }
.module-card small { color: var(--muted); font-size: 11px; }
.module-blue { --module-color: #1478ff; }
.module-violet { --module-color: #8a43ff; }
.module-green { --module-color: #00a67a; }
.module-gold { --module-color: #d88b00; }

.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 9px 18px; }
.footer-inner a, .footer-support { color: var(--accent); }
.footer-support { padding: 0; border: 0; background: transparent; font-size: inherit; }

.support-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 90;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  color: #fff;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(110deg, #1478ff, #684cff);
  box-shadow: 0 16px 42px rgba(20,120,255,.3);
}
.support-fab span { font-size: 18px; }
.support-fab b { font-size: 12px; }
.support-panel {
  position: fixed;
  right: 16px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 145;
  width: min(calc(100% - 32px), 370px);
  display: grid;
  gap: 11px;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
  box-shadow: 0 30px 90px rgba(22,54,88,.24);
  transition: .18s ease;
}
.support-panel.show { visibility: visible; opacity: 1; transform: none; }
.support-panel .eyebrow { margin-bottom: 0; }
.support-panel h2 { margin: 0 28px 5px 0; font-size: 23px; line-height: 1.22; }
.support-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; padding: 0; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; background: var(--bg-soft); font-size: 23px; line-height: 1; }
.support-link { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); }
.support-link > span { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; border-radius: 13px; background: #1478ff; font-size: 19px; }
.support-link.email > span { background: #7b4dff; }
.support-link div { min-width: 0; display: grid; gap: 2px; }
.support-link small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.music-toggle { left: 16px; right: auto; color: var(--text); border-color: var(--line); background: var(--panel-strong); box-shadow: 0 12px 34px rgba(45,89,130,.18); }
.music-toggle.playing { color: #fff; background: linear-gradient(100deg, var(--accent), var(--accent-2)); }

html[data-theme="light"] .toolbar,
html[data-theme="light"] .knowledge-item,
html[data-theme="light"] .category-card,
html[data-theme="light"] .plan-card,
html[data-theme="light"] .assistant-card,
html[data-theme="light"] .order-card,
html[data-theme="light"] .material-card,
html[data-theme="light"] .favorite-card,
html[data-theme="light"] .purchased-answer { background: var(--panel); }
html[data-theme="light"] .assistant-card { border-color: rgba(20,120,255,.22); box-shadow: 0 28px 90px rgba(45,89,130,.18), 0 0 70px rgba(20,120,255,.06); }
html[data-theme="light"] .field,
html[data-theme="light"] .select,
html[data-theme="light"] .textarea,
html[data-theme="light"] .problem-input { background: var(--panel-strong); }
html[data-theme="light"] .form-group label,
html[data-theme="light"] .auth-point,
html[data-theme="light"] .meta-row strong,
html[data-theme="light"] .knowledge-detail,
html[data-theme="light"] .payment-note,
html[data-theme="light"] .purchased-answer pre { color: var(--text); }
html[data-theme="light"] .auth-tabs,
html[data-theme="light"] .profile-meta,
html[data-theme="light"] .order-info div,
html[data-theme="light"] .summary-row,
html[data-theme="light"] .result-price-row,
html[data-theme="light"] .flow-strip div,
html[data-theme="light"] .quiz-option,
html[data-theme="light"] .example-chips button,
html[data-theme="light"] .member-shortcuts a { background: rgba(20,120,255,.045); }
html[data-theme="light"] .modal-card { background: var(--panel-strong); box-shadow: 0 30px 90px rgba(13,47,82,.3); }
html[data-theme="light"] .icon-btn,
html[data-theme="light"] .wallet-box { background: var(--bg-soft); }
html[data-theme="light"] .form-message.error { color: #a6283d; }
html[data-theme="light"] .form-message.success { color: #006b4c; }
html[data-theme="light"] .auth-tab.active,
html[data-theme="light"] .filter-btn.active,
html[data-theme="light"] .result-label { color: #fff; }
html[data-theme="light"] .avatar,
html[data-theme="light"] .success-icon { color: #fff; }
html[data-theme="light"] .toast { color: var(--text); background: var(--panel-strong); }

@media (max-width: 960px) {
  .support-fab { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .support-panel { bottom: calc(138px + env(safe-area-inset-bottom)); }
  html[data-theme="light"] .mobile-bottom-nav {
    color: #14304b;
    border-color: rgba(31,103,180,.16);
    background: rgba(255,255,255,.95);
    box-shadow: 0 18px 50px rgba(45,89,130,.2);
  }
  html[data-theme="dark"] .mobile-bottom-nav {
    color: #f3f8fc;
    border-color: rgba(168,207,231,.18);
    background: rgba(8,23,39,.96);
    box-shadow: 0 18px 50px rgba(0,0,0,.42);
  }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .music-toggle { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .icon-control { width: 39px; height: 39px; }
  .reference-hero .match-layout { width: min(calc(100% - 24px), 1040px); }
  .reference-hero .planet-glow { top: 80px; width: 160vw; }
  .reference-hero .match-intro h1 { font-size: 34px; }
  .reference-hero .flow-strip { gap: 6px; }
  .module-grid { gap: 9px; }
  .module-card { min-height: 130px; padding: 14px 8px; }
  .support-fab { right: 12px; padding: 0 13px; }
  .support-panel { right: 12px; width: calc(100% - 24px); padding: 20px; }
  .music-toggle { left: 12px; }
}


.order-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.order-filter {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.order-filter.active,
.order-filter:hover {
  color: var(--text);
  border-color: rgba(20,120,255,.35);
  background: rgba(20,120,255,.1);
}
html[data-theme="light"] .order-filter {
  background: rgba(20,120,255,.04);
}


.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field .field {
  padding-right: 64px;
}
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: rgba(20, 120, 255, .1);
  color: var(--accent, #2b6cff);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.password-toggle:active {
  opacity: .8;
}


#orderProductDescription {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted, #6b7c93);
  max-height: 180px;
  overflow-y: auto;
}


/* 语言：小标志，点开再选 */
.lang-compact { position: relative; }
.lang-flag-btn {
  width: 36px; height: 36px; padding: 0;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-strong); color: var(--text);
  font-size: 13px; font-weight: 800; cursor: pointer;
}
.lang-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 80;
  min-width: 132px; padding: 6px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  display: grid; gap: 4px;
}
.lang-dropdown.hidden { display: none; }
.lang-dropdown button {
  border: 0; background: transparent; color: var(--text);
  text-align: left; padding: 10px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.lang-dropdown button:hover { background: rgba(20,120,255,.1); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* 音乐按钮：深色底+亮字，播放时高对比 */
.music-toggle {
  color: #f5f9ff !important;
  background: #0b1a2e !important;
  border: 1px solid rgba(120,180,255,.55) !important;
}
.music-toggle.playing {
  color: #062018 !important;
  background: #3dffa8 !important;
  border-color: #3dffa8 !important;
}
html[data-theme="light"] .music-toggle {
  color: #0b1a2e !important;
  background: #e8f0ff !important;
  border: 1px solid #7aa2e3 !important;
}
html[data-theme="light"] .music-toggle.playing {
  color: #062018 !important;
  background: #2ee6a0 !important;
  border-color: #2ee6a0 !important;
}
