:root {
  --brand: #22C08A;
  --brand-dark: #0E9A6C;      /* 浅底上的强调文字色 */
  --brand-light: rgba(34, 192, 138, .12);
  --blue: #45A6E5;
  --blue-light: rgba(69, 166, 229, .12);
  --purple: #9A8CF0;
  --purple-light: rgba(154, 140, 240, .13);
  --amber: #F5A623;
  --amber-light: rgba(245, 166, 35, .14);
  --red: #F0655F;
  --red-light: rgba(240, 101, 95, .12);
  --peach: #FF8E6E;
  --peach-light: rgba(255, 142, 110, .14);
  --ink: #22382F;
  --ink-2: #5A7069;
  --ink-3: #8CA098;
  --line: #E3EDE7;
  --bg: #F6FAF8;
  --bg2: #EEF5F1;
  --card: #FFFFFF;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(34, 72, 58, .06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  background-image: radial-gradient(rgba(34, 192, 138, .05) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 700; line-height: 1.4; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-sm { max-width: 760px; margin: 0 auto; padding: 0 20px; }

.topbar {
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar .inner { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; }
.logo .dot {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, #34D89E, #45A6E5);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(34, 192, 138, .35);
}
.logo .dot span { width: 10px; height: 10px; border-radius: 50%; background: #fff; display: block; }
.logo-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { padding: 7px 12px; border-radius: 10px; color: var(--ink-2); font-size: 14px; transition: .15s; }
.nav a:hover { background: var(--brand-light); color: var(--brand-dark); }
.nav a.on { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.nav-user-link { color: var(--ink); font-weight: 600; padding: 5px 10px; border-radius: 9px; }
.nav-user-link:hover { background: var(--brand-light); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  background: linear-gradient(135deg, #2BCF96, #17B37E); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: .15s;
  box-shadow: 0 3px 10px rgba(34, 192, 138, .28);
}
.btn:hover { background: linear-gradient(135deg, #3BD9A2, #22BF88); transform: translateY(-1px); box-shadow: 0 5px 14px rgba(34, 192, 138, .35); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); padding: 7px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer; transition: .15s; }
.btn-ghost:hover { background: var(--brand-light); color: var(--brand-dark); border-color: rgba(34, 192, 138, .35); }
.btn-blue { background: linear-gradient(135deg, #55B1EC, #3B97D8); color: #fff; box-shadow: 0 3px 10px rgba(69, 166, 229, .28); }
.btn-blue:hover { background: linear-gradient(135deg, #63BAF0, #45A6E5); }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 24px; font-size: 16px; border-radius: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }

/* 移动端底部导航栏 */
.tabbar { display: none; }
@media (max-width: 760px) {
  .nav { display: none; }
  .topbar .inner { height: 52px; gap: 10px; flex-wrap: nowrap; }
  .logo { font-size: 15px; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
  .logo .dot { flex: none; }
  .nav-user { font-size: 13px; gap: 6px; flex: none; white-space: nowrap; }
  .nav-user-link { max-width: 5.5em; overflow: hidden; text-overflow: ellipsis; }
  body { padding-bottom: 88px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 5px 0; border-radius: 10px; color: var(--ink-3); font-size: 11px; line-height: 1.3;
  }
  .tabbar a i { font-style: normal; font-size: 19px; line-height: 1.2; }
  .tabbar a.on { color: var(--brand-dark); background: var(--brand-light); font-weight: 600; }
  .tabbar a:active { background: var(--bg2); }
}
@media (max-width: 480px) { .nav-user .badge { display: none; } .nav-user-link { display: none; } .tabbar a { font-size: 10px; } .tabbar a i { font-size: 17px; } }

.task-link { color: var(--brand-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.task-link:hover { color: var(--brand); }
.how { font-size: 12px; color: var(--ink-3); cursor: pointer; margin-top: 4px; user-select: none; }
.how:hover { color: var(--brand-dark); }
.howd { font-size: 13px; color: var(--ink-2); background: var(--bg2); border-radius: 10px; padding: 8px 10px; margin-top: 6px; line-height: 1.6; }

.hero { padding: 46px 0 30px; }
.hero h1 { font-size: 32px; }
.hero .sub { color: var(--ink-2); font-size: 16px; max-width: 620px; }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chip { background: var(--brand-light); color: var(--brand-dark); padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 500; }
.chip.b { background: var(--blue-light); color: #2377B5; }
.chip.p { background: var(--purple-light); color: #6A5BD8; }
.chip.a { background: var(--amber-light); color: #C07A0A; }

.section { padding: 34px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-title h2 { margin: 0; }
.section-title .more { font-size: 14px; color: var(--ink-3); }

.mod { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: .15s; display: block; }
.mod:hover { border-color: rgba(34, 192, 138, .45); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(34, 192, 138, .13); }
.mod .ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 20px; background: var(--brand-light); }
.mod h3 { margin: 0 0 4px; font-size: 16px; }
.mod p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }

.stage-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .stage-pick { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.stage {
  border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; background: #fff; transition: .15s;
}
.stage:hover { border-color: rgba(34, 192, 138, .5); transform: translateY(-2px); }
.stage.on { border-color: var(--brand); background: var(--brand-light); box-shadow: 0 4px 14px rgba(34, 192, 138, .16); }
.stage .nm { font-size: 17px; font-weight: 700; }
.stage .sb { font-size: 13px; color: var(--ink-2); }
.stage .sp { font-size: 12px; color: var(--brand-dark); margin-top: 6px; font-weight: 500; }

label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--ink-2); }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #A9BBB2; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(34, 192, 138, .13); }
textarea { min-height: 120px; resize: vertical; line-height: 1.7; }

.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--ink-2); font-size: 13px; background: var(--bg2); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; background: var(--bg2); color: var(--ink-2); font-weight: 500; }
.badge.ok { background: var(--brand-light); color: var(--brand-dark); }
.badge.warn { background: var(--amber-light); color: #C07A0A; }
.badge.vip { background: var(--purple-light); color: #6A5BD8; }
.badge.red { background: var(--red-light); color: #D5443E; }

.muted { color: var(--ink-3); font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 20px; }
.mb { margin-bottom: 20px; }
.hide { display: none !important; }

.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: #2C443A; color: #fff; padding: 11px 20px; border-radius: 12px; font-size: 14px; font-weight: 500;
  z-index: 999; opacity: 0; transition: .2s; pointer-events: none;
  box-shadow: 0 8px 30px rgba(34, 72, 58, .3);
}
.toast.on { opacity: 1; }

.quiz-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.quiz-item:last-child { border-bottom: none; }
.opts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.opt {
  padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer;
  font-size: 13px; background: #fff; color: var(--ink-2); transition: .12s;
}
.opt:hover { border-color: rgba(34, 192, 138, .45); }
.opt.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(34, 192, 138, .3); }

.game-stage {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; min-height: 340px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; text-align: center;
}
.schulte { display: grid; gap: 6px; }
.schulte div {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  cursor: pointer; font-size: 22px; font-weight: 600; user-select: none; transition: .1s;
}
.schulte div.hit { background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark); }
.schulte div.cur { background: var(--amber-light); border-color: var(--amber); color: #C07A0A; }

.big-num { font-size: 44px; font-weight: 700; letter-spacing: 2px; }
.stat-row { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; }
.stat .v { font-size: 24px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--ink-3); }

.bar { height: 8px; background: var(--bg2); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #2BCF96, #17B37E); border-radius: 5px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 9px 14px; cursor: pointer; font-size: 14px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tab.on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }

.art-body h3 { font-size: 17px; margin-top: 22px; }
.art-body p { color: var(--ink-2); }
.art-body ul { padding-left: 20px; color: var(--ink-2); }
.art-body li { margin-bottom: 8px; }
.art-body strong { color: var(--brand-dark); }

.list-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
.list-item .t { font-weight: 600; font-size: 15px; }
.list-item .d { font-size: 13px; color: var(--ink-2); }

.cards-out {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; max-height: 300px; overflow: auto; white-space: pre-wrap; line-height: 1.9;
}

.day-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 16px; }
.day-card.done { background: var(--brand-light); border-color: rgba(34, 192, 138, .4); }
.task { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; font-size: 14px; }
.task .cb { width: 18px; height: 18px; border: 1.5px solid #C6D6CE; border-radius: 6px; cursor: pointer; flex: none; margin-top: 3px; background: #fff; transition: .12s; }
.task .cb.on { background: var(--brand); border-color: var(--brand); box-shadow: 0 1px 4px rgba(34, 192, 138, .35); }
.task.done .tx { color: var(--ink-3); text-decoration: line-through; }

.footer { border-top: 1px solid var(--line); margin-top: 50px; padding: 26px 0 48px; color: var(--ink-3); font-size: 13px; background: transparent; }
@media (max-width: 760px) { .footer { margin-top: 36px; padding-bottom: 130px; } }

.hero-card {
  background: linear-gradient(135deg, #E7FBF1 0%, #FDF3E7 55%, #E7F2FD 100%);
  border: 1px solid #D9EFE4; border-radius: 22px; padding: 34px 30px;
  box-shadow: 0 6px 24px rgba(34, 192, 138, .1);
}
.hero-side { display: grid; grid-template-columns: 1.35fr .65fr; gap: 26px; align-items: center; }
@media (max-width: 760px) { .hero-side { grid-template-columns: 1fr; } }
.hero-art { display: flex; justify-content: center; }
.kid-badge {
  width: 100%; max-width: 240px; border-radius: 18px; background: #fff;
  border: 1px solid #D9EFE4; padding: 16px; text-align: center;
  box-shadow: 0 6px 18px rgba(34, 192, 138, .12);
}
.kid-badge .num { font-size: 34px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.kid-badge .cap { font-size: 12px; color: var(--ink-3); }

.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 860px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .plans { grid-template-columns: 1fr; } }
.plan {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px;
  position: relative; transition: .18s; text-align: center;
}
.plan:hover { border-color: rgba(34, 192, 138, .5); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(34, 192, 138, .16); }
.plan.hot { border-color: var(--brand); box-shadow: 0 6px 18px rgba(34, 192, 138, .16); }
.plan .tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #FF8E6E, #FF6B9A); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 20px; white-space: nowrap; box-shadow: 0 2px 8px rgba(255, 130, 120, .4); }
.plan .pname { font-size: 16px; font-weight: 700; }
.plan .price { font-size: 30px; font-weight: 700; color: var(--brand); margin: 8px 0 2px; }
.plan .price small { font-size: 14px; color: var(--ink-3); font-weight: 400; }
.plan .pd { font-size: 13px; color: var(--ink-2); min-height: 42px; }

.pay-card { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; }
@media (max-width: 640px) { .pay-card { grid-template-columns: 1fr; } }
.qrbox { width: 200px; height: 200px; border: 1.5px dashed #B9CFC4; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--bg2); color: #7d9088; font-size: 13px; overflow: hidden; }
.qrbox img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 6px; }

.print-area { background: #fff; }
.page-break { page-break-before: always; }
@media print {
  .topbar, .footer, .noprint, .tabs, .tabbar, .sheet, .sheet-mask, .ai-fab, .cs-fab-top, .fab-group { display: none !important; }
  body { background: #fff !important; color: #111 !important; padding-bottom: 0 !important; background-image: none !important; }
  body * { color: #111 !important; }
  .wrap, .wrap-sm { max-width: 100%; padding: 0; }
  .card, .day-card, .mod, .plan, .game-stage, .qrbox, .hero-card, .kid-badge { background: #fff !important; border-color: #ddd !important; box-shadow: none !important; }
  th, td { border-bottom-color: #bbb !important; }
  th { background: #f2f2f2 !important; }
  .bar { background: #eee !important; }
  .bar i { background: #1D9E75 !important; }
  svg text { fill: #333 !important; }
  svg line, svg polyline, svg polygon { stroke: #666 !important; }
  .badge, .chip { background: #f0f0f0 !important; }
  input, select, textarea { background: #fff !important; border-color: #ccc !important; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .page-break { page-break-before: always; }
}

/* 任务详情弹层 */
.sheet-mask { position: fixed; inset: 0; background: rgba(34, 56, 47, .4); z-index: 90; }
.sheet {
  position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: 84vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(34, 72, 58, .22);
}
.sheet-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; border-radius: 18px 18px 0 0; }
.sheet-hd h3 { margin: 0; font-size: 19px; }
.sheet-x { border: 0; background: var(--bg2); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--ink-2); flex: none; }
.sheet-x:hover { background: var(--red-light); color: #D5443E; }
.sheet-bd { padding: 14px 20px 22px; font-size: 14px; line-height: 1.75; }
.tipbox { border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.65; margin-bottom: 8px; }
.tipbox.ok { background: var(--brand-light); color: var(--brand-dark); }
.tipbox.warn { background: var(--amber-light); color: #C07A0A; }
@media (max-width: 640px) {
  .sheet { top: auto; bottom: 0; transform: translate(-50%, 0); width: 100vw; max-height: 88vh; border-radius: 18px 18px 0 0; }
  .sheet-hd { border-radius: 18px 18px 0 0; }
  .sheet-bd { padding-bottom: 90px; }
}

/* 计划页：手机上一天一张，更好点 */
@media (max-width: 560px) { .days-grid { grid-template-columns: 1fr !important; } }

/* 首页大板块 */
.bigmod {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 18px 16px; transition: .18s; text-align: center; color: inherit;
}
.bigmod:hover { border-color: rgba(34, 192, 138, .45); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(34, 192, 138, .15); }
.bigmod .bi { font-size: 30px; line-height: 1; }
.bigmod h3 { margin: 10px 0 4px; font-size: 17px; }
.bigmod p { font-size: 13px; color: var(--ink-2); margin: 0; }
@media (max-width: 560px) { .bigmod { padding: 14px 10px; } .bigmod .bi { font-size: 24px; } .bigmod h3 { font-size: 15px; } .bigmod p { font-size: 12px; } }

/* 初次设置卡 */
.setup-card { border: 1.5px solid rgba(34, 192, 138, .5); background: linear-gradient(180deg, rgba(34, 192, 138, .08), #fff); }

/* ===== App 风格增强 ===== */
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
.btn:active, .btn-ghost:active { transform: scale(.95); }
.mod:active, .bigmod:active, .plan:active, .stage:active { transform: scale(.98); }

@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .hero-card { animation: riseIn .55s cubic-bezier(.2,.7,.3,1) both; }
  .card, .mod, .bigmod, .plan, .day-card { animation: riseIn .5s cubic-bezier(.2,.7,.3,1) both; }
  .grid > *:nth-child(2), .plans > *:nth-child(2) { animation-delay: .06s; }
  .grid > *:nth-child(3), .plans > *:nth-child(3) { animation-delay: .12s; }
  .grid > *:nth-child(4), .plans > *:nth-child(4) { animation-delay: .18s; }
  .grid > *:nth-child(5), .plans > *:nth-child(5) { animation-delay: .24s; }
  .grid > *:nth-child(6) { animation-delay: .3s; }
  .grid > *:nth-child(7) { animation-delay: .36s; }
}

/* 主 CTA 呼吸光效 */
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 3px 10px rgba(34, 192, 138, .28); }
  50% { box-shadow: 0 4px 24px rgba(34, 192, 138, .55); }
}
@media (prefers-reduced-motion: no-preference) {
  .hero .btn-lg:not(.btn-ghost), .hero .btn.btn-lg { animation: ctaGlow 2.6s ease-in-out infinite; }
}

/* tabbar 图标点按弹跳 */
@keyframes tabPop { 0% { transform: scale(1); } 45% { transform: scale(1.3); } 100% { transform: scale(1); } }
.tabbar a:active i { animation: tabPop .32s ease; display: inline-block; }
.tabbar a.on i { text-shadow: 0 2px 8px rgba(34, 192, 138, .4); }

/* 顶栏右侧预留浮窗按钮的位置（客服 + 声音），避免遮住「退出」等按钮 */
.topbar .wrap { padding-right: 100px; }

/* 浮窗：右上角固定客服（与顶栏「退出」同一高度）+ 可拖动 AI 助教 */
.cs-fab-top {
  position: fixed; top: calc(6px + env(safe-area-inset-top)); right: 8px; z-index: 65;
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #55B1EC, #3B97D8); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; font-size: 9px; line-height: 1.2; cursor: pointer;
  box-shadow: 0 4px 14px rgba(69, 166, 229, .45); border: 2px solid #fff;
  transition: .15s; user-select: none;
}
.cs-fab-top b { font-size: 13px; line-height: 1.1; }
.cs-fab-top:active { transform: scale(.9); }
@media (min-width: 761px) {
  .cs-fab-top { top: 8px; right: 14px; width: 44px; height: 44px; }
  .cs-fab-top b { font-size: 15px; }
  .cs-fab-top { font-size: 10px; }
  .topbar .wrap { padding-right: 116px; }
}

.ai-fab {
  position: fixed; right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 66;
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, #2BCF96, #17B37E); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  font-weight: 700; font-size: 10px; line-height: 1.2; cursor: pointer;
  box-shadow: 0 6px 18px rgba(34, 192, 138, .45); border: 3px solid #fff;
  transition: .15s; user-select: none;
  touch-action: none; /* 可拖动：禁掉浏览器手势 */
}
.ai-fab b { font-size: 17px; line-height: 1.1; }
.ai-fab:active { transform: scale(.9); }
.ai-fab-blue { background: linear-gradient(135deg, #55B1EC, #3B97D8); box-shadow: 0 6px 18px rgba(69, 166, 229, .45); }

/* AI 聊天 */
.ai-chat { display: flex; flex-direction: column; gap: 8px; max-height: 44vh; overflow-y: auto; margin-bottom: 12px; }
.ai-msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.65; animation: riseIn .25s ease both; white-space: pre-wrap; word-break: break-word; }
.ai-msg.bot { background: var(--bg2); align-self: flex-start; border-bottom-left-radius: 5px; }
.ai-msg.me { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.ai-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ai-chips .chip { cursor: pointer; }
.ai-chips .chip:active { transform: scale(.95); }
.ai-input { display: flex; gap: 8px; }
.ai-input input { flex: 1; }

/* AI 速测 */
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); position: relative; flex: none; }
.pulse-dot::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 2px solid rgba(34, 192, 138, .5); animation: ping 1.6s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
.aiq-q { font-size: 16px; font-weight: 600; margin: 4px 0 2px; }
.aiq-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.aiq-opt {
  padding: 10px 18px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
  font-size: 14px; background: #fff; color: var(--ink-2); transition: .12s; font-family: inherit;
}
.aiq-opt:hover, .aiq-opt:active { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }
.aiq-step { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.aiq-think { font-size: 13px; color: var(--ink-2); min-height: 22px; }
.aiq-bar { height: 8px; background: var(--bg2); border-radius: 5px; overflow: hidden; margin-top: 10px; }
.aiq-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2BCF96, #45A6E5); border-radius: 5px; transition: width .4s ease; }
.aiq-score-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.aiq-score-num { font-size: 46px; font-weight: 700; color: var(--brand); line-height: 1; }
.aiq-dim { margin-bottom: 8px; font-size: 13px; }

/* 聊天气泡补充 */
.ai-msg .msg-time { font-size: 11px; opacity: .65; margin-top: 3px; }
.ai-msg.typing { animation: typingBlink 1s ease-in-out infinite; }
/* 客服窗口里的图片消息 */
.ai-msg .msg-img { display: block; max-width: 190px; max-height: 240px; border-radius: 10px; margin: 2px 0 4px; cursor: zoom-in; }
.ai-msg.me .msg-img { margin-left: auto; }
.ai-pick {
  flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; font-size: 19px; line-height: 1; cursor: pointer; color: var(--ink-2);
}
.ai-pick:active { transform: scale(.94); }
.ai-pick[disabled] { opacity: .55; }
/* 图片大图预览 */
.img-viewer {
  position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .86);
  display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.img-viewer img { max-width: 100%; max-height: 100%; border-radius: 8px; }
@keyframes typingBlink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* 终身会员促销弹窗 */
.promo-mask {
  position: fixed; inset: 0; z-index: 120; padding: 24px;
  background: rgba(20, 40, 32, .58); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  animation: riseIn .25s ease both;
}
.promo-card {
  position: relative; max-width: 360px; width: 100%;
  background: linear-gradient(165deg, #FFF7EA 0%, #FFEDE4 55%, #E9F6FF 100%);
  border-radius: 24px; padding: 34px 24px 22px; text-align: center;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .3); border: 1px solid #FFE3C2;
}
.promo-ribbon {
  position: absolute; top: 16px; left: -6px;
  background: linear-gradient(135deg, #FF6B9A, #FF8E6E); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 0 14px 14px 0;
  box-shadow: 0 3px 10px rgba(255, 120, 130, .45);
}
.promo-emoji { font-size: 46px; line-height: 1; }
.promo-price-row { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 12px 0 18px; flex-wrap: wrap; }
.promo-old { color: var(--ink-3); font-size: 16px; }
.promo-price { font-size: 46px; font-weight: 800; color: #E8443C; line-height: 1; }
.promo-save {
  background: var(--red-light); color: #D5443E; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}

/* 后台待处理订单行高亮 */
tr.row-pending { background: rgba(255, 176, 32, .14); }
tr.row-pending:hover { background: rgba(255, 176, 32, .2); }
