:root {
  color-scheme: dark;
  --bg: #0f1115;
  --bg-accent: #15171c;
  --surface: #181a1f;
  --surface-elevated: #1d1f25;
  --surface-soft: #202228;
  --field: #24262b;
  --text: #e5eaf3;
  --text-strong: #f2f3f5;
  --muted: #a3a6ad;
  --muted-strong: #c8c9cc;
  --line: #36383f;
  --line-strong: rgba(64,158,255,.48);
  --gold: #409eff;
  --gold-soft: #79bbff;
  --gold-wash: rgba(64,158,255,.13);
  --jade: #67c23a;
  --jade-deep: #529b2e;
  --jade-wash: rgba(103,194,58,.12);
  --danger: #f56c6c;
  --danger-wash: rgba(245,108,108,.12);
  --shadow: 0 24px 64px rgba(0,0,0,.28);
  --shadow-soft: 0 12px 34px rgba(0,0,0,.18);
  --glass: rgba(24,26,31,.88);
  --rail: rgba(24,26,31,.94);
  --wallet-from: #409eff;
  --wallet-to: #6c5ce7;
  --wallet-text: #ffffff;
  --hero-from: #17243a;
  --hero-to: #1b1830;
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fa;
  --bg-accent: #eef1f5;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-soft: #f5f7fa;
  --field: #f5f7fa;
  --text: #303133;
  --text-strong: #1f2329;
  --muted: #909399;
  --muted-strong: #606266;
  --line: #dcdfe6;
  --line-strong: rgba(64,158,255,.42);
  --gold: #409eff;
  --gold-soft: #337ecc;
  --gold-wash: rgba(64,158,255,.1);
  --jade: #67c23a;
  --jade-deep: #529b2e;
  --jade-wash: rgba(103,194,58,.1);
  --danger: #f56c6c;
  --danger-wash: rgba(245,108,108,.1);
  --shadow: 0 22px 60px rgba(34,49,61,.12);
  --shadow-soft: 0 10px 28px rgba(34,49,61,.08);
  --glass: rgba(255,255,255,.88);
  --rail: rgba(255,255,255,.92);
  --wallet-from: #409eff;
  --wallet-to: #6c5ce7;
  --wallet-text: #ffffff;
  --hero-from: #eaf3ff;
  --hero-to: #f1efff;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 0%, var(--gold-wash), transparent 28rem),
    radial-gradient(circle at 100% 12%, var(--gold-wash), transparent 30rem),
    linear-gradient(145deg, var(--bg), var(--bg-accent));
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  transition: background .25s ease, color .25s ease;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(64,158,255,.28); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .56; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }

.auth-gate {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 72px 16px 28px;
}
.auth-layout {
  width: min(1060px, 100%);
  min-height: 650px;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-showcase {
  position: relative;
  display: none;
  overflow: hidden;
  padding: 58px;
  background:
    radial-gradient(circle at 15% 10%, rgba(64,158,255,.34), transparent 23rem),
    radial-gradient(circle at 90% 90%, rgba(108,92,231,.25), transparent 22rem),
    linear-gradient(145deg, #14233b 0%, #171b29 56%, #211b35 100%);
  color: #f8f4eb;
}
.auth-showcase::after {
  content: "霸";
  position: absolute;
  right: -22px;
  bottom: -88px;
  color: rgba(255,255,255,.035);
  font-family: KaiTi, STKaiti, serif;
  font-size: 22rem;
  line-height: 1;
}
.showcase-orbit { position: absolute; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.orbit-one { width: 330px; height: 330px; right: -120px; top: -90px; }
.orbit-two { width: 470px; height: 470px; right: -195px; top: -160px; }
.showcase-content { position: relative; z-index: 2; margin: auto 0; }
.showcase-badge {
  display: inline-flex;
  padding: 7px 12px;
  border: 1px solid rgba(121,187,255,.34);
  border-radius: 999px;
  color: #a8d3ff;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .18em;
}
.showcase-content h2 { margin-top: 26px; font-size: clamp(2.2rem, 4vw, 3.5rem); line-height: 1.14; letter-spacing: -.04em; }
.showcase-content > p { max-width: 430px; margin-top: 20px; color: rgba(241,244,242,.68); font-size: .98rem; line-height: 1.8; }
.showcase-features { display: grid; gap: 14px; margin-top: 42px; }
.showcase-features span { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.82); font-size: .85rem; }
.showcase-features i { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; background: rgba(255,255,255,.06); color: #a8d3ff; font-style: normal; }
.showcase-foot { position: absolute; z-index: 2; left: 58px; right: 58px; bottom: 42px; display: flex; align-items: baseline; justify-content: space-between; color: rgba(255,255,255,.42); }
.showcase-foot span { color: rgba(255,255,255,.72); font-family: KaiTi, STKaiti, serif; font-size: 1.15rem; }
.showcase-foot small { font-size: .67rem; letter-spacing: .1em; }

.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 34px 28px 28px; background: var(--surface); }
.auth-brand { display: flex; align-items: center; gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.auth-brand .brand-seal.large { width: 56px; height: 56px; font-size: 1.7rem; }
.auth-brand h1 { font-size: 1.45rem; letter-spacing: -.02em; }
.auth-brand > div > span { display: block; margin-top: 3px; color: var(--muted); font-size: .74rem; }
.auth-view { display: none; }
.auth-view.active { display: block; animation: view-in .24s ease both; }
.auth-heading { margin: 25px 0 20px; }
.auth-heading h2 { color: var(--text-strong); font-size: 1.3rem; }
.auth-heading p { margin-top: 7px; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.auth-view form { display: grid; gap: 14px; }
.auth-view form > label:not(.check-line) { display: grid; gap: 7px; }
.auth-view form > label > span { color: var(--muted-strong); font-size: .75rem; font-weight: 600; }
.auth-view input[type="text"], .auth-view input[type="password"], .auth-view input:not([type]) {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--field);
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.auth-view input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-wash); }
.auth-options { display: flex; align-items: center; justify-content: space-between; margin: -1px 0 1px; }
.check-line { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .72rem; }
.check-line input { accent-color: var(--gold); }
.check-line.agreement { line-height: 1.5; }
.link-button { padding: 3px; border: 0; background: none; color: var(--gold-soft); font-size: .73rem; font-weight: 600; cursor: pointer; }
.auth-switch { margin-top: 19px; color: var(--muted); font-size: .74rem; text-align: center; }
.demo-hint { margin-top: 14px; color: var(--muted); font-size: .69rem; text-align: center; }
.auth-toast { min-height: 18px; margin-top: 13px; color: var(--danger); font-size: .72rem; text-align: center; }
.auth-toast.success { color: var(--jade); }

.shell { width: min(1320px, 100%); min-height: 100vh; margin: 0 auto; }
.app-frame { position: relative; width: 100%; min-height: 100vh; padding: 0 16px calc(88px + var(--safe-bottom)); }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-copy { display: none; }
.mobile-brand, .rail-brand, .rail-account { display: flex; align-items: center; gap: 11px; }
.mobile-brand strong, .rail-brand strong { display: block; font-size: .92rem; }
.mobile-brand small, .rail-brand small, .rail-account small { display: block; margin-top: 2px; color: var(--muted); font-size: .66rem; }
.brand-seal, .avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--gold-wash), var(--jade-wash));
  color: var(--gold-soft);
  font-family: KaiTi, STKaiti, serif;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.avatar { border-radius: 50%; color: var(--jade); }
.avatar.small { width: 36px; height: 36px; font-size: .85rem; }
.player-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--gold-wash), var(--surface-soft));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.player-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.avatar-fallback { color: var(--gold); font-family: KaiTi, STKaiti, serif; font-size: 1rem; font-weight: 700; }
.player-avatar.small { width: 36px; height: 36px; border-radius: 50%; }
.player-avatar.mini { width: 45px; height: 45px; border-radius: 13px; }
.player-avatar.role-avatar { width: 56px; height: 56px; border-radius: 16px; }
.player-avatar.profile-avatar { width: 60px; height: 60px; border-radius: 18px; }
.theme-toggle {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted-strong);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--line-strong); color: var(--text); }
.theme-toggle-icon { color: var(--gold); font-size: 1rem; line-height: 1; }
.theme-toggle-text { font-size: .7rem; font-weight: 700; }
.auth-theme-toggle { position: absolute; z-index: 8; top: 18px; right: 18px; }
.icon-button { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted-strong); cursor: pointer; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.icon-button:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-wash); }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.close { border: 0; background: transparent; font-size: 1.6rem; }
.notice-dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border: 2px solid var(--surface); border-radius: 50%; background: var(--danger); }

.view { display: none; max-width: 1050px; margin: 0 auto; animation: view-in .25s ease both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.eyebrow { color: var(--gold); font-size: .65rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.welcome-row, .page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 9px 0 20px; }
.welcome-row h1, .page-title h1 { margin-top: 3px; color: var(--text-strong); font-size: clamp(1.65rem, 5vw, 2.35rem); letter-spacing: -.04em; }
.welcome-subtitle { display: block; margin-top: 5px; color: var(--muted); font-size: .68rem; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(103,194,58,.24); border-radius: 8px; background: var(--jade-wash); color: var(--jade); font-size: .68rem; }
.status-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px var(--jade-wash); }

.primary, .outline, .logout {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.primary { border: 1px solid transparent; background: linear-gradient(135deg, #409eff, #337ecc); color: #fff; box-shadow: 0 10px 22px rgba(64,158,255,.2); }
.primary:hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(64,158,255,.28); }
.outline { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.outline:hover { border-color: var(--line-strong); background: var(--surface-elevated); }
.primary:active, .outline:active, .logout:active { transform: translateY(1px); }
.wide { width: 100%; }
.compact { min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: .72rem; }
.text-button { padding: 3px 0; border: 0; background: none; color: var(--gold-soft); font-size: .72rem; font-weight: 700; cursor: pointer; }
.text-button b { margin-left: 2px; }

.wallet-card {
  position: relative;
  overflow: hidden;
  min-height: 218px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, var(--gold-wash), transparent 16rem),
    var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.wallet-card::before { content: ""; position: absolute; left: 0; top: 20px; bottom: 20px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.wallet-top, .wallet-bottom { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wallet-heading { display: flex; align-items: center; gap: 10px; }
.wallet-heading > i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--gold-wash); color: var(--gold); font-family: KaiTi, STKaiti, serif; font-style: normal; }
.wallet-heading small, .wallet-heading strong { display: block; }
.wallet-heading small { color: var(--muted); font-size: .58rem; }
.wallet-heading strong { margin-top: 1px; color: var(--text); font-size: .75rem; }
.balance-line { position: relative; z-index: 2; display: flex; align-items: baseline; gap: 8px; margin: 22px 0 20px; }
.balance-line strong { color: var(--text-strong); font-size: clamp(2.35rem, 7vw, 3.35rem); line-height: 1; letter-spacing: -.05em; }
.balance-line span { color: var(--muted); font-size: .72rem; }
.wallet-bottom { padding-top: 15px; border-top: 1px solid var(--line); }
.wallet-bottom small, .selected-copy small, .account-summary small { display: block; color: var(--muted); font-size: .65rem; }
.wallet-bottom strong { display: block; margin-top: 3px; color: var(--muted-strong); font-size: .7rem; }

.home-overview-grid { display: grid; gap: 12px; }
.role-card.dashboard-role-card { min-height: 218px; display: block; padding: 20px; }
.dashboard-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.dashboard-card-heading small, .dashboard-card-heading strong { display: block; }
.dashboard-card-heading small { color: var(--muted); font-size: .58rem; }
.dashboard-card-heading strong { margin-top: 2px; font-size: .73rem; }
.role-overview { display: flex; align-items: center; gap: 12px; padding: 16px 0 13px; }
.dashboard-role-card .role-stats { justify-content: space-between; margin-top: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.dashboard-role-card .role-stats span { display: flex; align-items: center; gap: 5px; }
.dashboard-role-card .role-stats i { font-style: normal; }
.home-section { margin-top: 23px; }
.home-section-heading { margin-bottom: 12px; }
.home-content-grid { display: grid; gap: 12px; margin-top: 22px; }
.home-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-soft); }
.home-panel > .section-heading { margin-top: 0; }
.home-panel .quick-products { grid-template-columns: 1fr; }
.home-panel .quick-product { min-height: 76px; }
.info-panel .announcement-card { margin-top: 10px; }
.shop-preview-section .quick-items { grid-template-columns: 1fr; }

.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.service-grid button {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.service-grid button:hover { border-color: var(--line-strong); background: var(--surface-elevated); transform: translateY(-1px); }
.service-grid button > span:first-child { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--gold-wash); color: var(--gold); font-family: KaiTi, STKaiti, serif; }
.service-grid button > span:nth-child(2) { min-width: 0; }
.service-grid button > b { color: var(--muted); font-size: 1rem; font-weight: 400; }
.service-grid strong, .service-grid small { display: block; }
.service-grid strong { font-size: .75rem; }
.service-grid small { margin-top: 3px; color: var(--muted); font-size: .61rem; line-height: 1.4; }

.announcement-card, .campaign-card, .role-card, .settlement-card, .info-strip, .selected-role, .shop-notice, .account-summary, .menu-card, .record-item {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.announcement-card { padding: 18px; border-radius: 12px; }
.announcement-title { display: flex; align-items: center; gap: 10px; }
.announcement-title > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--gold-wash); color: var(--gold); font-family: KaiTi, STKaiti, serif; }
.announcement-title strong { font-size: .8rem; }
.announcement-title time { margin-left: auto; color: var(--muted); font-size: .64rem; }
.announcement-card p { margin-top: 12px; color: var(--muted); font-size: .72rem; line-height: 1.7; }

.campaign-card { display: flex; align-items: center; gap: 13px; margin-top: 0; padding: 15px; border-radius: 12px; }
.campaign-card.active { border-color: rgba(103,194,58,.28); background: linear-gradient(135deg, var(--jade-wash), var(--surface)); }
.campaign-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px; background: var(--gold-wash); color: var(--gold); font-family: KaiTi, STKaiti, serif; font-size: 1.05rem; }
.campaign-card.active .campaign-mark { background: var(--jade-wash); color: var(--jade); }
.campaign-card > div { min-width: 0; flex: 1; }
.campaign-kicker { color: var(--gold); font-size: .6rem; font-weight: 800; letter-spacing: .08em; }
.campaign-card.active .campaign-kicker { color: var(--jade); }
.campaign-card strong, .campaign-card p { display: block; }
.campaign-card strong { margin-top: 2px; font-size: .78rem; }
.campaign-card p { margin-top: 3px; color: var(--muted); font-size: .64rem; line-height: 1.5; }
.compact-campaign { margin-bottom: 18px; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 25px 0 12px; }
.section-heading.tight { margin-top: 24px; }
.section-heading h2 { margin-top: 3px; font-size: 1rem; }
.role-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 17px; border-radius: 12px; }
.role-emblem { display: grid; place-items: center; width: 56px; height: 56px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 17px; background: linear-gradient(145deg, var(--gold-wash), var(--surface-soft)); color: var(--gold); font-family: KaiTi, STKaiti, serif; font-size: 1.35rem; }
.role-emblem.mini { width: 45px; height: 45px; border-radius: 14px; font-size: 1rem; }
.role-main { min-width: 0; flex: 1; }
.role-name-row { display: flex; align-items: center; gap: 8px; }
.role-name-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.vip-tag, .first-tag { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: .58rem; font-weight: 800; }
.vip-tag { background: var(--gold-wash); color: var(--gold); }
.first-tag { background: var(--jade-wash); color: var(--jade); }
.role-main p { margin-top: 5px; color: var(--muted); font-size: .68rem; }
.role-stats { display: flex; gap: 13px; margin-top: 7px; color: var(--muted); font-size: .64rem; }
.role-stats b { color: var(--text); }

.quick-products { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.quick-product { min-height: 92px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; }
.quick-product:hover { border-color: var(--line-strong); }
.quick-product strong, .quick-product span, .quick-product em { display: block; }
.quick-product strong { font-size: .76rem; }
.quick-product span { margin-top: 3px; color: var(--gold); font-size: .66rem; }
.quick-product em { margin-top: 8px; color: var(--muted); font-size: .57rem; font-style: normal; line-height: 1.35; }
.quick-items { display: grid; gap: 9px; }
.quick-item { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.quick-item > b { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; background: var(--jade-wash); color: var(--jade); font-family: KaiTi, STKaiti, serif; }
.quick-item > span:nth-child(2) { min-width: 0; flex: 1; }
.quick-item strong, .quick-item small { display: block; }
.quick-item strong { font-size: .74rem; }
.quick-item small { margin-top: 3px; color: var(--muted); font-size: .61rem; }
.info-strip { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 15px; border-radius: 12px; }
.info-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: var(--jade-wash); color: var(--jade); }
.info-strip strong, .info-strip p { display: block; }
.info-strip strong { font-size: .72rem; }
.info-strip p { margin-top: 2px; color: var(--muted); font-size: .61rem; line-height: 1.5; }

.mini-balance { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: .65rem; }
.mini-balance small { margin-right: 4px; }
.mini-balance b { color: var(--gold); font-size: .86rem; }
.selected-role { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; text-align: left; cursor: pointer; }
.selected-copy { min-width: 0; flex: 1; }
.selected-copy strong, .selected-copy em { display: block; }
.selected-copy strong { margin-top: 2px; font-size: .82rem; }
.selected-copy em { margin-top: 3px; color: var(--muted); font-size: .64rem; font-style: normal; }
.selected-copy em { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.role-recharge-total { color: var(--muted-strong); }
.role-recharge-total b { color: var(--gold); }
.change-copy { color: var(--gold); font-size: .69rem; font-weight: 700; }
.recharge-heading, .shop-heading { margin-top: 23px; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.product-option { position: relative; min-height: 118px; padding: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; }
.product-option:hover { border-color: var(--line-strong); }
.product-option.selected { border-color: var(--gold); background: linear-gradient(145deg, var(--gold-wash), var(--surface)); box-shadow: inset 0 0 0 1px var(--line-strong); }
.product-option::after { content: ""; position: absolute; width: 62px; height: 62px; right: -35px; bottom: -35px; border-radius: 50%; background: var(--gold-wash); }
.product-option.selected::after { width: 10px; height: 10px; right: 10px; top: 10px; bottom: auto; border: 3px solid var(--surface); background: var(--jade); }
.product-option strong, .product-option span, .product-option small, .product-option i { display: block; }
.product-option strong { font-size: .95rem; }
.product-option span { margin-top: 5px; color: var(--gold); font-size: .75rem; font-weight: 700; }
.product-option small { margin-top: 10px; color: var(--muted); font-size: .6rem; line-height: 1.45; }
.product-option i { color: var(--jade); font-size: .57rem; font-style: normal; }
.settlement-card { margin-top: 18px; padding: 19px; border-radius: 12px; }
.settlement-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.settlement-title strong { font-size: .82rem; }
.settlement-title span { padding: 5px 8px; border-radius: 999px; background: var(--gold-wash); color: var(--gold); font-size: .6rem; font-weight: 800; }
.settlement-card dl { margin: 10px 0 15px; }
.settlement-card dl div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; }
.settlement-card dt { color: var(--muted); font-size: .69rem; }
.settlement-card dd { margin: 0; font-size: .72rem; }
.settlement-card dd.green { color: var(--jade); }
.settlement-card .total { margin-top: 5px; padding-top: 13px; border-top: 1px dashed var(--line); }
.settlement-card .total dt { color: var(--text); font-weight: 700; }
.settlement-card .total dd { color: var(--gold); font-size: 1rem; font-weight: 800; }
.settlement-note { margin-bottom: 14px; color: var(--muted); font-size: .63rem; line-height: 1.55; }

.shop-notice { display: flex; align-items: center; gap: 12px; margin-top: 13px; padding: 15px; border-radius: 12px; }
.shop-notice > span { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; background: var(--gold-wash); color: var(--gold); font-family: KaiTi, STKaiti, serif; }
.shop-notice p { color: var(--muted); font-size: .65rem; line-height: 1.55; }
.shop-notice strong { display: block; margin-bottom: 2px; color: var(--text); font-size: .72rem; }
.item-grid { display: grid; gap: 10px; }
.item-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; }
.item-card:hover { border-color: var(--line-strong); }
.item-card > i { position: absolute; top: 8px; right: 9px; color: var(--jade); font-size: .53rem; font-style: normal; }
.item-seal { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--jade-wash); color: var(--jade); font-family: KaiTi, STKaiti, serif; font-size: 1rem; }
.item-copy { min-width: 0; }
.item-copy strong, .item-copy small, .item-copy em { display: block; }
.item-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.item-copy small { margin-top: 3px; color: var(--muted); font-size: .61rem; }
.item-copy em { margin-top: 5px; color: var(--gold); font-size: .56rem; font-style: normal; }
.item-price { align-self: end; color: var(--muted); font-size: .6rem; }
.item-price b { color: var(--gold); font-size: .88rem; }

.segmented { display: grid; grid-template-columns: repeat(2,1fr); gap: 5px; margin-bottom: 15px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.segmented.three { grid-template-columns: repeat(3,1fr); }
.segmented button { min-height: 39px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: .68rem; font-weight: 700; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-soft); }
.record-panel { display: none; }
.record-panel.active { display: block; }
.record-list { display: grid; gap: 9px; }
.record-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 14px; border-radius: 12px; }
.record-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--gold-wash); color: var(--gold); }
.record-copy { min-width: 0; }
.record-copy strong, .record-copy span { display: block; }
.record-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .73rem; }
.record-copy span { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; }
.record-amount { text-align: right; }
.record-amount strong, .record-amount span { display: block; }
.record-amount strong { color: var(--jade); font-size: .75rem; }
.record-amount strong.out { color: var(--gold); }
.record-amount span { margin-top: 3px; color: var(--muted); font-size: .56rem; }
.empty-copy { padding: 34px 12px; color: var(--muted); font-size: .72rem; text-align: center; }

.profile-head { display: flex; align-items: center; gap: 15px; margin: 10px 0 19px; }
.profile-head .avatar { width: 60px; height: 60px; font-size: 1.25rem; }
.profile-head h1 { margin-top: 2px; font-size: 1.45rem; }
.profile-head > div > span { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.account-summary { display: grid; grid-template-columns: repeat(3,1fr); padding: 16px 5px; border-radius: 12px; }
.account-summary div { padding: 2px 11px; }
.account-summary div + div { border-left: 1px solid var(--line); }
.account-summary strong { display: block; margin-top: 5px; font-size: .77rem; }
.menu-card { margin-top: 14px; overflow: hidden; border-radius: 12px; }
.menu-card button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 68px; padding: 11px 15px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.menu-card button:hover { background: var(--surface-soft); }
.menu-card button + button { border-top: 1px solid var(--line); }
.menu-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--gold-wash); color: var(--gold); font-family: KaiTi, STKaiti, serif; }
.menu-card button > span:nth-child(2) { min-width: 0; }
.menu-card strong, .menu-card small { display: block; }
.menu-card strong { font-size: .75rem; }
.menu-card small { margin-top: 3px; color: var(--muted); font-size: .61rem; }
.menu-card b { color: var(--muted); font-size: .95rem; }
.logout { width: 100%; margin-top: 15px; border: 1px solid rgba(236,127,108,.18); background: var(--danger-wash); color: var(--danger); }

.bottom-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(67px + var(--safe-bottom)); display: grid; grid-template-columns: repeat(5,1fr); padding: 7px 8px var(--safe-bottom); border-top: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(18px); box-shadow: 0 -12px 32px rgba(0,0,0,.12); }
.nav-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
.nav-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-button span { font-size: .58rem; }
.nav-button.active { background: var(--gold-wash); color: var(--gold); }
.desktop-rail { display: none; }

.sheet-backdrop, .modal-backdrop { position: fixed; z-index: 40; inset: 0; background: rgba(3,7,11,.62); backdrop-filter: blur(4px); }
.bottom-sheet { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; max-height: 78vh; padding: 10px 18px calc(22px + var(--safe-bottom)); overflow-y: auto; border: 1px solid var(--line); border-radius: 16px 16px 0 0; background: var(--surface-elevated); box-shadow: 0 -24px 60px rgba(0,0,0,.28); animation: sheet-in .24s ease both; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { width: 42px; height: 4px; margin: 1px auto 15px; border-radius: 999px; background: var(--line-strong); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.sheet-header h2 { margin-top: 3px; font-size: 1.05rem; }
.role-list { display: grid; gap: 9px; }
.role-choice { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; cursor: pointer; }
.role-choice.selected { border-color: var(--gold); background: var(--gold-wash); }
.role-choice .role-choice-copy { min-width: 0; flex: 1; }
.role-choice strong, .role-choice small { display: block; }
.role-choice strong { font-size: .73rem; }
.role-choice small { margin-top: 3px; color: var(--muted); font-size: .59rem; }
.role-choice em { color: var(--jade); font-size: .6rem; font-style: normal; }
.sheet-tip { margin-top: 13px; color: var(--muted); font-size: .65rem; line-height: 1.5; }

.confirm-modal { position: fixed; z-index: 55; left: 50%; top: 50%; width: min(390px, calc(100vw - 30px)); padding: 26px 22px 21px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-elevated); box-shadow: var(--shadow); text-align: center; transform: translate(-50%,-50%); animation: modal-in .2s ease both; }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%,-47%) scale(.97); } }
.confirm-seal { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 13px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--gold-wash); color: var(--gold); font-family: KaiTi, STKaiti, serif; font-size: 1.15rem; }
.confirm-modal h2 { font-size: 1.12rem; }
.confirm-modal p { margin: 10px 0 16px; color: var(--muted); font-size: .76rem; line-height: 1.6; }
.confirm-summary { display: flex; justify-content: space-between; margin-bottom: 17px; padding: 13px; border-radius: 12px; background: var(--surface-soft); font-size: .78rem; }
.confirm-summary strong { color: var(--jade); }
.modal-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; }
.password-modal { text-align: left; }
.password-modal .confirm-seal { text-align: center; }
.password-modal h2, .password-modal > p { text-align: center; }
.password-modal form { display: grid; gap: 12px; }
.password-modal form label { display: grid; gap: 6px; color: var(--muted-strong); font-size: .72rem; font-weight: 600; }
.password-modal input { width: 100%; min-height: 47px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: var(--field); color: var(--text); }
.password-modal input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-wash); }
.password-modal .modal-actions { margin-top: 5px; }
.avatar-modal { width: min(460px, calc(100vw - 30px)); text-align: left; }
.avatar-modal h2, .avatar-modal > p { text-align: center; }
.avatar-picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 20px; }
.avatar-option { position: relative; display: grid; place-items: center; min-height: 78px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.avatar-option:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.avatar-option.selected { border-color: var(--gold); background: var(--gold-wash); box-shadow: inset 0 0 0 1px var(--line-strong); }
.avatar-option > span:last-child { position: absolute; right: 6px; top: 5px; display: none; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: var(--gold); color: #fff; font-size: .65rem; font-weight: 800; }
.avatar-option.selected > span:last-child { display: grid; }
.player-avatar.picker-avatar { width: 58px; height: 58px; border: 0; border-radius: 16px; }
.toast { position: fixed; z-index: 70; left: 50%; top: max(16px, env(safe-area-inset-top)); width: max-content; max-width: calc(100vw - 30px); padding: 11px 15px; border: 1px solid rgba(103,194,58,.28); border-radius: 8px; background: var(--surface-elevated); color: var(--jade); box-shadow: var(--shadow); font-size: .75rem; opacity: 0; pointer-events: none; transform: translate(-50%,-12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (min-width: 760px) {
  .auth-gate { padding: 32px; }
  .auth-layout { grid-template-columns: minmax(0,1.25fr) minmax(390px,.75fr); }
  .auth-showcase { display: flex; flex-direction: column; }
  .auth-panel { padding: 46px 42px 36px; }
  .auth-theme-toggle { top: 26px; right: 28px; }
  .shell { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 22px; padding: 24px; }
  .desktop-rail { position: sticky; top: 24px; display: flex; flex-direction: column; height: calc(100vh - 48px); padding: 20px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--rail); box-shadow: var(--shadow-soft); backdrop-filter: blur(18px); }
  .rail-brand { padding: 0 7px 20px; border-bottom: 1px solid var(--line); }
  .rail-nav { display: grid; gap: 7px; margin-top: 20px; }
  .rail-nav .nav-button { min-height: 46px; flex-direction: row; justify-content: flex-start; gap: 11px; padding: 0 13px; border-radius: 12px; }
  .rail-nav .nav-button span { font-size: .74rem; font-weight: 700; }
  .rail-account { margin-top: auto; padding: 15px 7px 0; border-top: 1px solid var(--line); }
  .rail-account > div { min-width: 0; }
  .rail-account strong, .rail-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-account strong { font-size: .72rem; }
  .app-frame { min-height: calc(100vh - 48px); padding: 0 28px 42px; border: 1px solid var(--line); border-radius: 16px; background: var(--glass); box-shadow: var(--shadow-soft); backdrop-filter: blur(14px); }
  .topbar { height: 78px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .mobile-brand { display: none; }
  .topbar-copy { display: flex; flex-direction: column; }
  .topbar-copy strong { font-size: .83rem; }
  .topbar-copy span { margin-top: 2px; color: var(--muted); font-size: .62rem; }
  .bottom-nav { display: none; }
  .view { padding-top: 20px; }
  .view[data-view="home"] { max-width: 1120px; }
  .home-overview-grid { grid-template-columns: minmax(0,1.18fr) minmax(300px,.82fr); }
  .home-overview-grid > * { height: 100%; }
  .service-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .service-grid button { min-height: 78px; }
  .home-content-grid { grid-template-columns: minmax(0,1.08fr) minmax(0,.92fr); align-items: stretch; }
  .home-panel { height: 100%; }
  .shop-preview-section .quick-items { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .item-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .bottom-sheet { left: 50%; right: auto; bottom: 26px; width: min(620px, calc(100vw - 48px)); max-height: 72vh; padding: 14px 24px 24px; border-radius: 16px; transform: translateX(-50%); }
  @keyframes sheet-in { from { opacity: 0; transform: translate(-50%,24px); } to { opacity: 1; transform: translate(-50%,0); } }
  .toast { top: 30px; }
}

@media (min-width: 1080px) {
  .shell { grid-template-columns: 240px minmax(0,1fr); gap: 26px; padding: 28px; }
  .desktop-rail { top: 28px; height: calc(100vh - 56px); }
  .app-frame { min-height: calc(100vh - 56px); padding-left: 38px; padding-right: 38px; }
  .wallet-card { padding: 22px 24px; }
  .announcement-card { padding: 20px; }
}

@media (max-width: 520px) {
  .theme-toggle-text { display: none; }
  .theme-toggle { width: 40px; padding: 0; }
  .auth-panel { padding: 28px 20px 23px; }
  .auth-layout { min-height: 0; border-radius: 16px; }
  .auth-brand { padding-right: 34px; }
  .welcome-row { align-items: center; }
  .welcome-subtitle { display: none; }
  .home-overview-grid, .home-content-grid, .home-section, .home-panel, .wallet-card, .dashboard-role-card { min-width: 0; max-width: 100%; }
  .wallet-card, .dashboard-role-card { min-height: 0; }
  .wallet-top, .wallet-bottom { flex-wrap: wrap; }
  .role-overview { min-width: 0; }
  .dashboard-role-card .role-stats { flex-direction: column; align-items: flex-start; gap: 5px; }
  .service-grid button { min-height: 70px; padding: 10px 11px; }
  .service-grid button > b { display: none; }
  .service-grid small { display: none; }
  .campaign-card .text-button { display: none; }
  .first-tag { position: absolute; top: 12px; right: 12px; }
  .dashboard-role-card .first-tag { position: static; margin-left: auto; }
  .home-panel { padding: 15px; }
  .avatar-picker-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 370px) {
  .app-frame { padding-left: 12px; padding-right: 12px; }
  .service-grid { grid-template-columns: 1fr; }
  .quick-products { grid-template-columns: 1fr; }
  .account-summary { grid-template-columns: 1fr; gap: 10px; }
  .account-summary div + div { border-top: 1px solid var(--line); border-left: 0; padding-top: 10px; }
  .segmented.three button { font-size: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
