/* 用户中心：移动优先；≥960px 左侧导航 + 两列卡片 */
:root {
  --bg: #f4f5fb;
  --bg-2: #eceef8;
  --card: #ffffff;
  --card-2: #f7f8fc;
  --text: #16172d;
  --text-2: #55587a;
  --text-3: #9295b0;
  --line: rgba(22, 23, 60, .08);
  --line-2: rgba(22, 23, 60, .05);
  --brand: #6d5efc;
  --brand-2: #8f82ff;
  --brand-ink: #4f3fe0;
  --brand-soft: rgba(109, 94, 252, .1);
  --brand-grad: linear-gradient(135deg, #7b6cff 0%, #5b4cf0 55%, #4636d8 100%);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, .12);
  --orange: #f59e0b;
  --orange-ink: #b86e00;
  --orange-soft: rgba(245, 158, 11, .14);
  --red: #ef4444;
  --red-ink: #d42f2f;
  --red-soft: rgba(239, 68, 68, .11);
  --cyan: #22d3ee;
  --grey-soft: rgba(110, 114, 150, .12);
  --shadow: 0 1px 2px rgba(20, 22, 70, .04), 0 10px 30px -12px rgba(40, 40, 120, .16);
  --shadow-lg: 0 20px 60px -20px rgba(30, 24, 110, .35);
  --radius: 20px;
  --radius-sm: 14px;
  --hero: radial-gradient(110% 90% at 105% -10%, rgba(34, 211, 238, .38) 0, rgba(34, 211, 238, 0) 46%),
    radial-gradient(90% 80% at -10% 110%, rgba(168, 85, 247, .55) 0, rgba(168, 85, 247, 0) 55%),
    linear-gradient(150deg, #11132f 0%, #231d63 45%, #4a3bd6 100%);
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c17;
    --bg-2: #12142a;
    --card: #15172b;
    --card-2: #1b1e36;
    --text: #eceefb;
    --text-2: #a9acc8;
    --text-3: #6f7294;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .05);
    --brand-soft: rgba(143, 130, 255, .16);
    --brand-ink: #a89dff;
    --green-soft: rgba(16, 185, 129, .16);
    --orange-soft: rgba(245, 158, 11, .16);
    --orange-ink: #fbbf24;
    --red-soft: rgba(239, 68, 68, .16);
    --red-ink: #f87171;
    --grey-soft: rgba(160, 165, 210, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
  min-height: 100dvh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--brand-ink); text-decoration: none; }
svg { display: block; flex-shrink: 0; }
.num, .money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }

/* ---------------- 启动 ---------------- */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-logo { width: 54px; height: 54px; border-radius: 16px; background: url(/favicon.svg) center/cover; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.94); opacity: .75; } 50% { transform: scale(1); opacity: 1; } }

/* ---------------- 外壳 ---------------- */
.shell { min-height: 100dvh; }
.main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.view { max-width: 560px; margin: 0 auto; animation: viewIn .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page { padding: calc(var(--safe-t) + 14px) 16px 8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 4px 14px; }
.page-title { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin: 0; }
.page-sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.back { width: 40px; height: 40px; margin-left: -8px; border-radius: 12px; display: grid; place-items: center; color: var(--text); }
.back:active { background: var(--grey-soft); }

/* 底部 Tab 栏 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 6px 10px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--card) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.tab {
  position: relative; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .02em; transition: color .2s;
}
.tab .tab-ic { position: relative; width: 44px; height: 28px; display: grid; place-items: center; border-radius: 14px; transition: background .25s, transform .25s; }
.tab.on { color: var(--brand-ink); }
.tab.on .tab-ic { background: var(--brand-soft); transform: translateY(-1px); }
.tab:active .tab-ic { transform: scale(.9); }
.tab-dot { position: absolute; top: 2px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--card); }

/* 桌面：左侧导航 */
.sidenav { display: none; }
@media (min-width: 960px) {
  .tabbar { display: none; }
  .shell { display: grid; grid-template-columns: 248px 1fr; }
  .main { padding-bottom: 40px; min-width: 0; }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 22px 16px;
    background: var(--card); border-right: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; font-weight: 750; font-size: 16.5px; letter-spacing: -.01em; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; background: url(/favicon.svg) center/cover; box-shadow: 0 6px 16px -6px rgba(109, 94, 252, .6); }
  .nav-item {
    display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-weight: 600; font-size: 14.5px;
    transition: background .2s, color .2s;
  }
  .nav-item:hover { background: var(--card-2); color: var(--text); }
  .nav-item.on { background: var(--brand-soft); color: var(--brand-ink); }
  .nav-spacer { flex: 1; }
  .nav-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card-2); }
  .nav-user .avatar { width: 36px; height: 36px; font-size: 15px; }
  .nav-user-name { font-weight: 650; font-size: 14px; }
  .nav-user-sub { font-size: 12px; color: var(--text-3); }
  .view { max-width: 1120px; padding: 0 28px; }
  .page { padding: 30px 0 8px; }
  .page-title { font-size: 28px; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .grid-2 > .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .grid-2 > .col > .card, .grid-2 > .col > .banner, .grid-2 > .col > .plan { margin: 0; }
  .grid-2 > .col > .section-label { margin: 6px 6px -6px; }
  .span-2 { grid-column: 1 / -1; }
}

/* ---------------- 卡片与通用块 ---------------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 0 0 14px; position: relative; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; margin: 0; }
.card-title .ic-badge { width: 30px; height: 30px; }
.card-link { color: var(--text-3); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; min-height: 32px; }
.card-link:hover { color: var(--brand-ink); }
.section-label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--text-3); margin: 22px 6px 10px; text-transform: uppercase; }
.ic-badge { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex-shrink: 0; }
.ic-badge.green { background: var(--green-soft); color: var(--green); }
.ic-badge.orange { background: var(--orange-soft); color: var(--orange-ink); }
.ic-badge.red { background: var(--red-soft); color: var(--red-ink); }
.ic-badge.grey { background: var(--grey-soft); color: var(--text-2); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 状态胶囊 */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--grey-soft); color: var(--text-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.orange { background: var(--orange-soft); color: var(--orange-ink); }
.pill.red { background: var(--red-soft); color: var(--red-ink); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); }
.pill.live::before { animation: pulse 1.6s ease-out infinite; box-shadow: 0 0 0 0 currentColor; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }

/* 按钮 */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px;
  border-radius: 14px; font-weight: 700; font-size: 15.5px; letter-spacing: .01em; white-space: nowrap;
  background: var(--brand-grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(91, 76, 240, .75);
  transition: transform .15s, box-shadow .2s, opacity .2s, filter .2s; user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.975); }
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.ghost { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }
.btn.soft { background: var(--card-2); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn.white { background: #fff; color: #2a2170; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); }
.btn.glass { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn.danger { background: var(--red-soft); color: var(--red-ink); box-shadow: none; }
.btn.danger-solid { background: linear-gradient(135deg, #f15b5b, #dc2f2f); color: #fff; box-shadow: 0 10px 24px -10px rgba(220, 47, 47, .7); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn.ghost.loading::after, .btn.soft.loading::after, .btn.danger.loading::after, .btn.white.loading::after { border-color: color-mix(in srgb, var(--brand) 25%, transparent); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--grey-soft); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.link-btn { color: var(--brand-ink); font-weight: 650; font-size: 14px; min-height: 36px; display: inline-flex; align-items: center; gap: 4px; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field-label { font-size: 13px; font-weight: 650; color: var(--text-2); padding-left: 2px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card-2);
  font-size: 16px; outline: none; transition: border-color .2s, background .2s, box-shadow .2s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 4px var(--brand-soft); }
.input-wrap .input { padding-left: 46px; }
.input-wrap .input.has-suffix { padding-right: 50px; }
.input-ic { position: absolute; left: 15px; color: var(--text-3); pointer-events: none; }
.input-suffix { position: absolute; right: 6px; }
.field-hint { font-size: 12.5px; color: var(--text-3); padding-left: 2px; }
.field-hint.ok { color: var(--green); }
.field-hint.bad { color: var(--red-ink); }

/* 开关 */
.switch { position: relative; width: 50px; height: 30px; border-radius: 99px; background: var(--grey-soft); transition: background .25s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .25s cubic-bezier(.3, .7, .3, 1.2); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }
.switch.busy { opacity: .6; pointer-events: none; }

/* 分段控件 */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--grey-soft); gap: 2px; }
.seg button { height: 32px; padding: 0 13px; border-radius: 9px; font-size: 13px; font-weight: 650; color: var(--text-2); transition: background .2s, color .2s, box-shadow .2s; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg.full { display: flex; }
.seg.full button { flex: 1; height: 36px; }

/* 列表 */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line-2); min-height: 56px; }
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 650; font-size: 14.5px; }
.li-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.li-amt { font-weight: 700; font-size: 15px; text-align: right; }
.li-amt.pos { color: var(--green); }
.li-amt .li-sub { font-weight: 500; }
a.list-item, button.list-item { color: inherit; width: 100%; text-align: left; }
a.list-item:active, button.list-item:active { background: var(--card-2); }
.list-group-title { font-size: 12.5px; color: var(--text-3); font-weight: 650; padding: 14px 2px 2px; }
.chev { color: var(--text-3); }

/* 键值 */
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kv.two { grid-template-columns: repeat(2, 1fr); }
.kv-item { background: var(--card-2); border-radius: 14px; padding: 11px 10px 10px 12px; min-width: 0; }
.kv-k { font-size: 12px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.kv-v { font-size: 14.5px; font-weight: 700; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.kv-v small { font-size: 12px; color: var(--text-3); font-weight: 600; margin-left: 2px; }
.lines { display: flex; flex-direction: column; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.line:last-child { border-bottom: 0; }
.line .k { color: var(--text-2); }
.line .v { font-weight: 650; text-align: right; min-width: 0; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.line.total { border-top: 1px solid var(--line); border-bottom: 0; margin-top: 4px; padding-top: 12px; font-size: 15.5px; }
.line.total .v { font-size: 18px; color: var(--brand-ink); }

/* 进度条 */
.bar { height: 8px; border-radius: 99px; background: var(--grey-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand-grad); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar.green > i { background: linear-gradient(90deg, #34d399, #10b981); }
.bar.orange > i { background: linear-gradient(90deg, #fbbf24, #f59e0b); }

/* 横幅 */
.banner { display: flex; gap: 12px; padding: 14px 15px; border-radius: 16px; margin-bottom: 14px; font-size: 14px; line-height: 1.55; align-items: flex-start; }
.banner .b-title { font-weight: 700; margin-bottom: 2px; }
/* 横幅底色不透明（和卡片底色混出来）：放在首页主视觉上也清楚 */
.banner.orange { background: color-mix(in srgb, var(--orange) 13%, var(--card)); color: var(--orange-ink); }
.banner.red { background: color-mix(in srgb, var(--red) 11%, var(--card)); color: var(--red-ink); }
.banner.brand { background: color-mix(in srgb, var(--brand) 10%, var(--card)); color: var(--brand-ink); }
.banner.green { background: color-mix(in srgb, var(--green) 12%, var(--card)); color: var(--green); }
.lift > .grid-2 > .col > .banner, .lift .banner { box-shadow: var(--shadow); }
.banner .btn { margin-top: 10px; }
.banner-body { flex: 1; min-width: 0; }
.banner-body p { margin: 0; color: var(--text-2); }

/* 空状态 */
.empty { text-align: center; padding: 34px 20px 26px; }
.empty-art { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 26px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); position: relative; }
.empty-art::after { content: ""; position: absolute; inset: -10px; border-radius: 32px; border: 1.5px dashed color-mix(in srgb, var(--brand) 30%, transparent); }
.empty-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.empty-text { color: var(--text-2); font-size: 14px; max-width: 300px; margin: 0 auto 18px; }

/* 骨架 */
.sk { background: linear-gradient(90deg, var(--grey-soft) 25%, color-mix(in srgb, var(--grey-soft) 40%, transparent) 50%, var(--grey-soft) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-hero { height: 230px; border-radius: 0 0 30px 30px; margin: 0 0 16px; }
.sk-card { height: 150px; border-radius: var(--radius); margin: 0 16px 14px; }
.sk-line { height: 14px; margin: 8px 0; }

/* ---------------- 首页主视觉 ---------------- */
.hero {
  position: relative; color: #fff; background: var(--hero); padding: calc(var(--safe-t) + 16px) 20px 60px; border-radius: 0 0 30px 30px; overflow: hidden;
}
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.2px); background-size: 18px 18px; mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), transparent 80%); -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), transparent 80%); pointer-events: none; }
.hero-glow { position: absolute; width: 220px; height: 220px; right: -60px; top: 60px; border-radius: 50%; background: radial-gradient(circle, rgba(143, 130, 255, .55), transparent 65%); filter: blur(10px); pointer-events: none; }
.hero-top { position: relative; display: flex; align-items: center; justify-content: space-between; height: 44px; }
.hero-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.hero-brand i { width: 30px; height: 30px; border-radius: 9px; background: url(/favicon.svg) center/cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, .2); }
.hero-hello { position: relative; margin-top: 18px; font-size: 14px; color: rgba(255, 255, 255, .72); }
.hero-label { position: relative; margin-top: 10px; font-size: 13px; color: rgba(255, 255, 255, .7); display: flex; align-items: center; gap: 6px; }
.hero-balance { position: relative; margin-top: 2px; font-size: 44px; line-height: 1.12; font-weight: 750; letter-spacing: -.03em; display: flex; align-items: baseline; }
.hero-balance .cur { font-size: 24px; font-weight: 650; margin-right: 4px; opacity: .85; }
.hero-balance .cents { font-size: 26px; opacity: .75; }
.hero-meta { position: relative; display: flex; gap: 18px; margin-top: 10px; font-size: 13px; color: rgba(255, 255, 255, .72); flex-wrap: wrap; }
.hero-meta b { color: #fff; font-weight: 650; margin-left: 4px; }
.hero-actions { position: relative; display: flex; gap: 10px; margin-top: 20px; }
.hero-actions .btn { flex: 1; height: 46px; }
.lift { margin-top: -38px; position: relative; z-index: 2; padding: 0 16px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; color: #fff; font-size: 16px; background: linear-gradient(135deg, #a78bfa, #6d5efc 55%, #22d3ee); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); flex-shrink: 0; text-transform: uppercase; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; box-shadow: 0 10px 30px -10px rgba(109, 94, 252, .8); }
@media (min-width: 960px) {
  .hero { border-radius: 26px; margin-top: 28px; padding: 26px 30px 58px; }
  .hero-top .avatar { display: none; }
  .hero-balance { font-size: 52px; }
  .hero-actions { max-width: 360px; }
  .lift { margin-top: -40px; padding: 0 18px; }
}

/* 开通引导 */
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 16px; top: 36px; bottom: 2px; width: 2px; background: var(--line); border-radius: 2px; }
.step:last-child::before { display: none; }
.step.done::before { background: linear-gradient(var(--green), color-mix(in srgb, var(--green) 30%, transparent)); }
.step-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 14px; background: var(--card-2); color: var(--text-3); border: 1.5px solid var(--line); flex-shrink: 0; position: relative; z-index: 1; }
.step.done .step-dot { background: var(--green); border-color: var(--green); color: #fff; }
.step.cur .step-dot { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 0 0 5px var(--brand-soft); }
.step.fail .step-dot { background: var(--red); border-color: var(--red); color: #fff; }
.step-body { flex: 1; min-width: 0; padding-top: 5px; }
.step-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step.todo .step-title { color: var(--text-3); }
.step-desc { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.step.todo .step-desc { color: var(--text-3); }
.step .btn { margin-top: 12px; }
.step.cur .step-title .spinner { display: inline-block; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--brand) 25%, transparent); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; }

/* 我的智能体卡 */
.system-card { overflow: hidden; }
.system-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: linear-gradient(135deg, rgba(109, 94, 252, .7), rgba(34, 211, 238, .5), rgba(168, 85, 247, .6)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.system-glow { position: absolute; right: -50px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(109, 94, 252, .22), transparent 70%); pointer-events: none; }
.secret { display: flex; align-items: center; gap: 4px; background: var(--card-2); border: 1px solid var(--line); border-radius: 13px; padding: 4px 4px 4px 14px; min-height: 48px; }
.secret .val { flex: 1; min-width: 0; font-family: var(--mono); font-size: 14px; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secret .val.masked { letter-spacing: .18em; color: var(--text-2); }
.secret-label { font-size: 12.5px; color: var(--text-3); font-weight: 650; margin: 12px 2px 6px; }

/* 服务器状态 */
.srv-head { display: flex; align-items: center; gap: 14px; }
.srv-orb { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #34d399, #0ea371); box-shadow: 0 10px 24px -10px rgba(16, 185, 129, .8); position: relative; flex-shrink: 0; }
.srv-orb.off { background: linear-gradient(135deg, #9ca3af, #6b7280); box-shadow: none; }
.srv-orb.warn { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 10px 24px -10px rgba(245, 158, 11, .8); }
.srv-orb.bad { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 10px 24px -10px rgba(220, 38, 38, .8); }
.srv-orb.busy { background: var(--brand-grad); }
.srv-orb.live::after { content: ""; position: absolute; inset: -4px; border-radius: 20px; border: 2px solid rgba(16, 185, 129, .35); animation: ring 2s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1.12); opacity: 0; } }
.srv-name { font-weight: 750; font-size: 17px; }
.power-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.pa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 72px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 650; color: var(--text-2); transition: background .2s, transform .15s; }
.pa:hover { background: var(--brand-soft); color: var(--brand-ink); }
.pa:active { transform: scale(.96); }
.pa[disabled] { opacity: .38; pointer-events: none; }
.pa .pa-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.pa.go .pa-ic { color: var(--green); }
.pa.stop .pa-ic { color: var(--red-ink); }
.ip-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13.5px; color: var(--text-2); padding: 2px 0; }
.ip-chip button { color: var(--text-3); }
.ip-chip button:hover { color: var(--brand-ink); }

/* 图表 */
.chart { position: relative; margin-top: 8px; user-select: none; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-t { fill: var(--text-3); font-size: 10.5px; font-family: var(--font); }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; background: var(--text); color: var(--card); font-size: 12px; font-weight: 650; padding: 5px 9px; border-radius: 9px; white-space: nowrap; box-shadow: var(--shadow); opacity: 0; transition: opacity .15s; }
.chart-tip.show { opacity: 1; }
.chart-tip small { display: block; font-weight: 500; opacity: .7; font-size: 11px; }
.chart-empty { height: 170px; display: grid; place-items: center; color: var(--text-3); font-size: 13.5px; }
.chart-controls { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; margin-top: 14px; position: relative; }
.bars-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 5px 5px 3px 3px; position: relative; cursor: pointer; min-width: 0; }
.bars-col .seg-ai { background: #6d5efc; }
.bars-col .seg-srv { background: #22c1dc; }
.bars-col .seg-fee { background: #f59e0b; }
.bars-col > i { display: block; width: 100%; }
.bars-col > i:first-child { border-radius: 5px 5px 0 0; }
.bars-col > i:last-child { border-radius: 0 0 3px 3px; }
.bars-col > i:only-child { border-radius: 5px 5px 3px 3px; }
.bars-col.empty-col::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; border-radius: 3px; background: var(--grey-soft); }
.bars-col.over::after { content: ""; position: absolute; left: -2px; right: -2px; top: 14%; height: 5px; background: var(--card); transform: skewY(-12deg); }
.bars-col.sel { filter: brightness(1.12); }
.bars-col.sel::before { content: ""; position: absolute; inset: -4px -1px -4px -1px; border-radius: 8px; background: var(--brand-soft); z-index: -1; }
.bars-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); margin-top: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.bars-info { min-height: 44px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.bars-info b { font-weight: 700; }

.rank { display: flex; flex-direction: column; gap: 12px; }
.rank-item .row { font-size: 14px; }
.rank-item .bar { height: 6px; margin-top: 7px; }

/* 统计三格 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card-2); border-radius: 14px; padding: 12px 10px; text-align: left; min-width: 0; }
.stat-k { font-size: 12px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-k i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.stat-v { font-size: 17px; font-weight: 750; margin-top: 4px; letter-spacing: -.01em; }

/* 充值 */
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.amt {
  height: 64px; border-radius: 16px; background: var(--card-2); border: 1.5px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 750; font-size: 19px; letter-spacing: -.01em; transition: border-color .2s, background .2s, transform .15s, color .2s; position: relative;
}
.amt small { font-size: 11.5px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.amt:active { transform: scale(.97); }
.amt.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.amt.on small { color: var(--brand-ink); opacity: .8; }
.amt .tag { position: absolute; top: -8px; right: 8px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; }
.money-input { position: relative; margin-top: 12px; }
.money-input .cur { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--text-2); font-size: 18px; }
.money-input .input { padding-left: 36px; font-size: 18px; font-weight: 700; }
.channels { display: flex; flex-direction: column; gap: 10px; }
.channel { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card-2); text-align: left; width: 100%; transition: border-color .2s, background .2s; }
.channel.on { border-color: var(--brand); background: var(--brand-soft); }
.channel .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; position: relative; transition: border-color .2s; }
.channel.on .radio { border-color: var(--brand); }
.channel.on .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.pay-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); z-index: 5; margin: 4px -8px 14px; padding: 8px;
  border-radius: 22px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
}
.pay-bar .foot-note { padding: 8px 0 2px; }
@media (min-width: 960px) { .pay-bar { position: static; margin: 0; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; } }

.order-amount { text-align: center; padding: 6px 0 14px; }
.order-amount .big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.order-amount .muted { font-size: 13px; }
.instructions { white-space: pre-wrap; background: var(--card-2); border-radius: 14px; padding: 14px; font-size: 14px; line-height: 1.7; color: var(--text); border: 1px solid var(--line); }
.wait-pay { display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--text-2); font-size: 13.5px; margin-top: 14px; }

/* 订阅 */
.plan {
  position: relative; overflow: hidden; color: #fff; background: var(--hero); border-radius: 24px; padding: 22px 20px 20px; margin-bottom: 14px; box-shadow: var(--shadow-lg);
}
.plan::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.2px); background-size: 16px 16px; pointer-events: none; }
.plan-tag { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18); }
.plan-name { position: relative; font-size: 22px; font-weight: 750; margin-top: 14px; letter-spacing: -.01em; }
.plan-price { position: relative; display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.plan-price b { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.plan-price span { color: rgba(255, 255, 255, .72); font-size: 14px; }
.plan-feats { position: relative; display: flex; flex-direction: column; gap: 11px; margin: 20px 0 4px; }
.plan-feat { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.plan-feat .ck { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); flex-shrink: 0; margin-top: 1px; }
.plan-feat small { display: block; color: rgba(255, 255, 255, .65); font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.plan .chip { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .16); color: #fff; }

.install { padding: 4px 0; }
.install-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.install-ring { width: 58px; height: 58px; position: relative; flex-shrink: 0; }
.install-ring svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.install-ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 750; font-size: 14px; }
.install-ring circle { fill: none; stroke-width: 6; }
.install-ring .bg { stroke: var(--grey-soft); }
.install-ring .fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }

.danger-zone .list-item { cursor: pointer; }

/* ---------------- 登录注册 ---------------- */
.auth {
  min-height: 100dvh; display: flex; flex-direction: column; background: var(--hero); color: #fff; position: relative; overflow: hidden;
  padding: calc(var(--safe-t) + 20px) 20px calc(var(--safe-b) + 20px);
}
.auth::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.2px); background-size: 20px 20px; mask-image: linear-gradient(180deg, #000, transparent 70%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); pointer-events: none; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(4px); pointer-events: none; }
.auth-orb.a { width: 280px; height: 280px; right: -110px; top: -80px; background: radial-gradient(circle, rgba(34, 211, 238, .45), transparent 65%); }
.auth-orb.b { width: 320px; height: 320px; left: -140px; top: 200px; background: radial-gradient(circle, rgba(168, 85, 247, .5), transparent 65%); }
.auth-top { position: relative; padding: 18px 4px 0; max-width: 420px; width: 100%; margin: 0 auto; }
.auth-logo { width: 52px; height: 52px; border-radius: 15px; background: url(/favicon.svg) center/cover; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .15); }
.auth-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 22px 0 6px; line-height: 1.2; }
.auth-sub { color: rgba(255, 255, 255, .72); font-size: 14.5px; }
.auth-feats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.auth-feats span { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); }
.auth-card {
  position: relative; margin: 26px auto 0; width: 100%; max-width: 420px; background: var(--card); color: var(--text); border-radius: 26px; padding: 22px 20px 20px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6);
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--card-2); border-radius: 14px; padding: 4px; margin-bottom: 20px; position: relative; }
.auth-tabs a { height: 40px; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--text-3); border-radius: 11px; position: relative; z-index: 1; transition: color .2s; }
.auth-tabs a.on { color: var(--text); }
.auth-tabs .ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 11px; background: var(--card); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); transition: transform .3s cubic-bezier(.3, .7, .3, 1); }
.auth-tabs.reg .ind { transform: translateX(100%); }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--text-3); margin-top: 16px; }
.rules { display: flex; flex-direction: column; gap: 5px; margin: -4px 0 16px; padding: 0 2px; }
.rule { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 7px; transition: color .2s; }
.rule .rd { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; }
.rule.ok { color: var(--green); }
.rule.ok .rd { background: var(--green); border-color: var(--green); color: #fff; }
@media (min-width: 960px) {
  .auth { flex-direction: row; align-items: center; justify-content: center; gap: 80px; padding: 40px; }
  .auth-top { margin: 0; max-width: 440px; }
  .auth-title { font-size: 40px; }
  .auth-card { margin: 0; padding: 30px 28px 26px; }
}

/* ---------------- 我的 ---------------- */
.profile { display: flex; align-items: center; gap: 16px; padding: 6px 4px 18px; }
.profile-name { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
.menu { padding: 4px 16px; }
.menu .list-item { gap: 14px; }
.menu .ic-badge { width: 34px; height: 34px; border-radius: 10px; }

/* ---------------- 弹层 ---------------- */
#layer { position: relative; z-index: 100; }
.backdrop { position: fixed; inset: 0; background: rgba(8, 9, 25, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .25s; z-index: 100; }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 101; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 26px 26px 0 0; padding: 10px 20px calc(20px + var(--safe-b)); transform: translateY(100%); transition: transform .34s cubic-bezier(.2, .9, .25, 1);
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .35);
}
.sheet.show { transform: none; }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sheet-title { font-size: 19px; font-weight: 750; letter-spacing: -.01em; flex: 1; padding-top: 6px; }
.sheet-text { color: var(--text-2); font-size: 14.5px; line-height: 1.65; margin: 0 0 16px; }
.sheet-actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 18px; }
.sheet-actions.row2 { flex-direction: row; }
.sheet-actions.row2 .btn { flex: 1; }
.sheet .ic-badge.lg { width: 48px; height: 48px; border-radius: 15px; }
@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 440px; border-radius: 24px; padding: 24px; transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .28s cubic-bezier(.2, .9, .25, 1), opacity .2s; }
  .sheet.show { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
  .sheet-actions { flex-direction: row-reverse; }
  .sheet-actions .btn { flex: 1; }
}

/* toast */
#toasts { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 12px); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 440px; padding: 11px 16px 11px 12px; border-radius: 16px; font-size: 14px; font-weight: 600;
  background: color-mix(in srgb, #16172d 92%, transparent); color: #fff; box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: toastIn .35s cubic-bezier(.2, .9, .25, 1.2);
}
.toast.out { animation: toastOut .25s ease forwards; }
.toast .t-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: rgba(255, 255, 255, .14); }
.toast.ok .t-ic { background: var(--green); }
.toast.err .t-ic { background: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.97); } }
@media (prefers-color-scheme: dark) { .toast { background: color-mix(in srgb, #2a2d4d 94%, transparent); } }

/* 时间线 */
.timeline { display: flex; flex-direction: column; }
.tl { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 1.5px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--brand-2); margin-top: 5px; flex-shrink: 0; }
.tl-msg { font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.tl-at { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.more-btn { width: 100%; height: 44px; margin-top: 8px; border-radius: 12px; color: var(--text-2); font-weight: 650; font-size: 14px; background: var(--card-2); }
.more-btn:hover { color: var(--brand-ink); }
.foot-note { text-align: center; color: var(--text-3); font-size: 12px; padding: 18px 0 4px; }

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

/* 「我的系统」里的应用入口：2×2 的方块，点开在用户中心里打开 */
.tone-violet { --tone: linear-gradient(135deg, #7c6cff, #5b3df5); --tone-glow: rgba(109, 94, 252, .5); }
.tone-blue { --tone: linear-gradient(135deg, #38bdf8, #2563eb); --tone-glow: rgba(37, 99, 235, .45); }
.tone-green { --tone: linear-gradient(135deg, #34d399, #059669); --tone-glow: rgba(5, 150, 105, .45); }
.tone-amber { --tone: linear-gradient(135deg, #fbbf24, #f97316); --tone-glow: rgba(249, 115, 22, .45); }
.app-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--tone); box-shadow: 0 6px 14px -6px var(--tone-glow, rgba(15, 23, 42, .35)); }
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; position: relative; }
.app-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 14px 14px 13px; border-radius: 18px;
  background: var(--card-2); border: 1px solid var(--line); color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.app-tile .app-ic { width: 44px; height: 44px; border-radius: 14px; margin-bottom: 9px; }
.app-tile:hover { border-color: rgba(109, 94, 252, .35); box-shadow: 0 8px 22px -12px rgba(76, 58, 220, .45); }
.app-tile:active { transform: scale(.97); }
.app-tile-name { font-weight: 720; font-size: 15px; letter-spacing: -.01em; }
.app-tile-desc { font-size: 12.5px; color: var(--text-3); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- 应用页：服务器上的应用用 iframe 铺满（底部给 iPhone 的横条留位置，键盘弹起时不留） ---------------- */
html.app-open, html.app-open body { overflow: hidden; overscroll-behavior: none; }
.app-layer {
  position: fixed; z-index: 45; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh);
  display: none; flex-direction: column; background: var(--bg);
}
.app-layer.on { display: flex; }
.app-open .tabbar { display: none; }
.app-bar {
  flex: none; display: flex; align-items: center; gap: 4px; padding: calc(var(--safe-t) + 6px) 8px 6px;
  background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.app-back { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text); }
.app-back:active, .app-reload:active { background: var(--grey-soft); }
.app-switch { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.app-switch::-webkit-scrollbar { display: none; }
.app-tab {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 5px; border-radius: 13px;
  color: var(--text-2); font-weight: 680; font-size: 14px; white-space: nowrap; -webkit-tap-highlight-color: transparent; transition: background .2s, color .2s;
}
.app-tab-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grey-soft); color: var(--text-2); transition: background .2s, color .2s, box-shadow .2s; }
.app-tab-name { display: none; }
.app-tab.on { background: var(--brand-soft); color: var(--brand-ink); padding-right: 12px; }
.app-tab.on .app-tab-ic { background: var(--tone); color: #fff; box-shadow: 0 5px 12px -6px var(--tone-glow); }
.app-tab.on .app-tab-name { display: inline; }
.app-tab:not(.on):active .app-tab-ic { transform: scale(.92); }
.app-reload { flex: none; }
.app-stage { flex: 1; min-height: 0; position: relative; background: var(--card); }
.app-frame { position: absolute; inset: 0 0 var(--safe-b); display: none; }
.app-layer.kb .app-frame { bottom: 0; }
.app-frame.on { display: block; }
.app-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--card); opacity: 0; transition: opacity .25s; }
.app-frame.loaded iframe { opacity: 1; }
.app-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.app-loading .app-ic { width: 56px; height: 56px; border-radius: 18px; animation: breathe 1.4s ease-in-out infinite; }
.app-frame.loaded .app-loading { display: none; }
.app-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.app-msg > .spinner { width: 22px; height: 22px; margin-bottom: 12px; }
@media (min-width: 600px) {
  .app-bar { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .app-tab { padding-right: 12px; }
  .app-tab-name { display: inline; }
}
@media (min-width: 960px) {
  .app-layer { left: 248px; }
  .app-open .main { visibility: hidden; }
  .app-bar { padding-top: 10px; padding-bottom: 10px; }
}

/* ---------------- 对话（首页）：智能体的对话页用 iframe 铺在标签栏上面；键盘弹起时铺到键盘上沿、标签栏收起 ---------------- */
html.chat-open, html.chat-open body { overflow: hidden; overscroll-behavior: none; }
.chat-layer {
  position: fixed; z-index: 30; left: 0; right: 0; top: var(--vvt, 0px);
  height: calc(var(--vvh, 100dvh) - var(--tabbar-h) - var(--safe-b));
  padding-top: var(--safe-t); display: none; background: var(--bg);
}
.chat-layer.on { display: block; }
html.kb-open .chat-layer { height: var(--vvh, 100dvh); }
html.kb-open.chat-open .tabbar { display: none; }
.chat-layer iframe { position: absolute; left: 0; right: 0; bottom: 0; top: var(--safe-t); width: 100%; height: calc(100% - var(--safe-t)); border: 0; display: block; opacity: 0; transition: opacity .25s; background: var(--bg); }
.chat-layer.loaded iframe { opacity: 1; }
.chat-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.chat-loading .app-ic { width: 56px; height: 56px; border-radius: 18px; animation: breathe 1.4s ease-in-out infinite; }
.chat-layer.loaded .chat-loading { display: none; }
@media (min-width: 960px) {
  .chat-layer { left: 248px; height: var(--vvh, 100dvh); padding-top: 0; }
  .chat-layer iframe { top: 0; height: 100%; }
  .chat-open .main { visibility: hidden; }
}

/* 还没就绪时的对话页：一段介绍 + 示意对话 */
.chat-intro { display: flex; flex-direction: column; min-height: calc(100dvh - var(--tabbar-h) - var(--safe-b) - 40px); justify-content: center; }
.chat-hero { text-align: center; padding: 20px 8px 10px; max-width: 440px; margin: 0 auto; }
.chat-hero-art { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 26px; display: grid; place-items: center; color: #fff; background: var(--brand-grad); box-shadow: 0 18px 40px -18px rgba(79, 63, 224, .9); }
.chat-hero h1 { font-size: 24px; font-weight: 780; letter-spacing: -.02em; margin: 0 0 8px; }
.chat-hero p { color: var(--text-2); font-size: 14.5px; line-height: 1.65; margin: 0 0 20px; }
.chat-hero-act { display: flex; justify-content: center; }
.chat-demo { margin: 28px auto 0; max-width: 330px; display: flex; flex-direction: column; gap: 8px; opacity: .92; }
.cd-row { display: flex; align-items: flex-end; gap: 7px; }
.cd-row.out { justify-content: flex-end; }
.cd-row span { padding: 9px 13px; border-radius: 17px; font-size: 14px; text-align: left; line-height: 1.45; }
.cd-row.out span { background: var(--brand-grad); color: #fff; border-bottom-right-radius: 6px; }
.cd-row.in span { background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.cd-row.in i { flex: none; width: 26px; height: 26px; border-radius: 9px; background: var(--brand-grad); }
.cd-row:nth-child(1) { animation: viewIn .5s .1s both; }
.cd-row:nth-child(2) { animation: viewIn .5s .5s both; }
.cd-row:nth-child(3) { animation: viewIn .5s .9s both; }
