/* 爱小荔 —— 纯色、留白、圆角；深大紫为主色，荔枝红/叶绿只做点缀 */

/* 主题由时间决定（scene.js 把 data-scene 设为 day / dusk / night），所有面板都是半透明毛玻璃，透出后面的天空和荔枝林 */
:root {
  --bg: rgba(255, 255, 255, .42);            /* 卡片里的内嵌块 */
  --surface: rgba(255, 255, 255, .74);       /* 主要的玻璃面板（不透明度经全天对比度计算确定） */
  --surface-soft: rgba(255, 255, 255, .40);
  --user: rgba(236, 229, 246, .72);
  --glass-border: rgba(255, 255, 255, .55);
  --glass-blur: blur(18px) saturate(150%);
  --ink: #1E1828;
  --ink-2: #3F3750;
  --muted: #5A5270;
  --line: rgba(30, 24, 40, .10);
  --primary: #3A1E5C;        /* 深大紫：按钮、选中态 */
  --primary-ink: #FFFFFF;
  --accent: #6A3BA8;         /* 浅一档的紫：链接、焦点 */
  --lychee: #E04A5F;
  --lychee-dark: #B8324A;
  --leaf: #4E8F52;
  --stem: #7A5233;
  --shadow: 0 1px 2px rgba(40, 20, 70, .05), 0 12px 32px -18px rgba(40, 20, 70, .28);
  --veil: rgba(255, 255, 255, .06);         /* 磨砂层的底色 */
  --clock-shadow: 0 1px 12px rgba(255, 255, 255, .35);
  --radius: 22px;
  --col: 560px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color-scheme: light;
}

:root[data-scene="dusk"], :root[data-scene="night"] {
  --bg: rgba(255, 255, 255, .08);
  --surface: rgba(26, 22, 40, .60);
  --surface-soft: rgba(26, 22, 40, .34);
  --user: rgba(92, 72, 128, .55);
  --glass-border: rgba(255, 255, 255, .12);
  --ink: #F5F1FB;
  --ink-2: #D6CEE3;
  --muted: #C4BAD6;
  --line: rgba(255, 255, 255, .12);
  --primary: #EDE4FA;
  --primary-ink: #24183A;
  --accent: #C9A9F2;
  --lychee-dark: #A92A41;
  --leaf: #8BC48E;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 14px 34px -18px rgba(0, 0, 0, .6);
  --veil: rgba(10, 8, 24, .10);
  --clock-shadow: 0 2px 16px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
:root[data-scene="dusk"] { --surface: rgba(40, 30, 58, .70); --veil: rgba(20, 10, 30, .06); }

/* ---------------- 动态背景：只有天空，柔和的云（scene.js 生成结构、下发 --sc-* 变量） ---------------- */
#scene { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--sc-sky-mid, #94bde6); }
#scene > * { position: absolute; }
.sky-grad { inset: 0; background: linear-gradient(180deg, var(--sc-sky-top) 0%, var(--sc-sky-mid) 55%, var(--sc-sky-low) 100%); }
.sky-glow {
  width: 70vmax; height: 70vmax; transform: translate(-50%, -50%); opacity: var(--sc-sun-op, 1);
  background: radial-gradient(circle, rgb(255 252 238 / .9) 0, rgb(255 250 230 / .7) 1.6%,
              rgb(var(--sc-glow) / var(--sc-glow-op)) 7%, rgb(var(--sc-glow) / 0) 50%);
  transition: opacity 3s, left 30s linear, top 30s linear;
}
.sky-moon {
  width: 26px; height: 26px; border-radius: 50%; transform: translate(-50%, -50%);
  background: #f1eeff; filter: blur(1.5px); box-shadow: 0 0 60px 22px rgb(210 205 255 / .22);
}
.sky-stars { inset: 0; opacity: var(--sc-stars, 0); transition: opacity 3s; }
.sky-stars i {
  position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #fff;
  animation: twinkle var(--d, 3s) ease-in-out var(--delay, 0s) infinite alternate;
}
@keyframes twinkle { from { opacity: .2; } to { opacity: .85; } }
.cloud {
  filter: blur(var(--blur)); opacity: var(--sc-cloud-op, 0); will-change: transform;
  animation: drift var(--dur, 300s) ease-in-out var(--delay, 0s) infinite alternate;
  transition: opacity 3s;
}
.cloud.extra { opacity: var(--sc-cloud-extra, 0); }
.cloud span {
  position: absolute; border-radius: 50%;
  /* 上半受光、下半背光，模糊之后就是有体积感的云 */
  background: radial-gradient(ellipse at 50% 38%, rgb(var(--sc-cloud) / var(--a)) 0%, rgb(var(--sc-cloud) / calc(var(--a) * .7)) 38%,
              rgb(var(--sc-cloud-shade) / calc(var(--a) * .45)) 60%, transparent 72%);
}
@keyframes drift { from { transform: translateX(-5vw); } to { transform: translateX(5vw); } }
.sky-haze { inset: 0; background: linear-gradient(180deg, transparent 45%, rgb(var(--sc-haze) / var(--sc-haze-op)) 100%); }
.sky-rain { inset: 0; opacity: var(--sc-rain, 0); transition: opacity 3s; }
.sky-rain i {
  position: absolute; width: 1px; height: var(--l); opacity: 0;
  background: linear-gradient(transparent, rgb(236 241 250 / .75)); transform: rotate(14deg);
}
#scene[data-rain="1"] .sky-rain i { animation: fall var(--d, 1s) linear var(--delay, 0s) infinite; }
@keyframes fall { from { transform: translate(0, -25vh) rotate(14deg); opacity: 0; } 20% { opacity: 1; } to { transform: translate(-7vh, 25vh) rotate(14deg); opacity: 0; } }
#scene.no-transition, #scene.no-transition * { transition: none !important; }
.frost {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-color: var(--veil);
  /* 细颗粒噪点 = 磨砂玻璃的质感 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

/* 玻璃面板的公共样式 */
.icon-btn, .seg, .avatar, .mode-chip, .pill, .bubble.ai, .bubble.me, .step, .board, .confirm, .paycard, .login, .mem,
.composer textarea {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}
/* 直接写在天空上的文字：字色和背后的柔和光晕由 scene.js 按对比度选（data-ink），和玻璃面板的明暗分开 */
:root { --sky-ink: #1E1828; --sky-ink-2: rgba(30, 24, 40, .78); --scrim: rgba(255, 255, 255, .4); }
:root[data-ink="light"] { --sky-ink: #F5F1FB; --sky-ink-2: rgba(245, 241, 251, .82); --scrim: rgba(14, 10, 30, .4); }
.side, .empty { color: var(--sky-ink); position: relative; isolation: isolate; }
/* 下面的柔光向两侧伸出 110px：裁掉横向溢出，否则手机上页面会变宽、整体被缩小（顶栏和输入框错位） */
main { overflow-x: clip; }
.side::before, .empty::before {
  content: ""; position: absolute; inset: -70px -110px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, var(--scrim), transparent);
  transition: background 3s;
}
.side .w-desc, .side .w-sub, .side .w-tip, .side .today h2, .empty p { color: var(--sky-ink-2); }
.side .w-meta { color: var(--sky-ink-2); opacity: .8; }
.side .w-icon { color: var(--sky-ink); }
.side .w-tip.warn { color: var(--lychee); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: transparent;
  color: var(--ink);
  font: 15px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px 20px 28px;
  pointer-events: none;  /* 顶栏本身是透明的一整条，别挡住下面消息的点击和选中；只有按钮可点 */
}
.topbar > * { pointer-events: auto; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: var(--surface-soft); color: var(--ink-2);
  backdrop-filter: blur(12px);
  transition: background .2s;
}
.icon-btn:hover { background: var(--surface); }
.seg {
  display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--surface-soft); backdrop-filter: blur(12px);
  /* 浮在消息上方：平时半透明不挡内容，鼠标移上去 / 键盘聚焦时恢复 */
  opacity: .35; transition: opacity .2s;
}
.seg:hover, .seg:focus-within { opacity: 1; }
@media (hover: none) { .seg { opacity: 1; } }  /* 手机没有悬停，保持不透明 */
.seg button {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: background .2s, color .2s;
}
.seg button.on { background: var(--primary); color: var(--primary-ink); }
.topbar-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
/* 演示站提示条：所有页面都显示（手机上 mode-chip 是隐藏的，曾有人把演示站当成真实服务输入了真实密码） */
.demo-banner {
  margin: 0 auto 16px; padding: 10px 16px; border-radius: 16px;
  font-size: 13.5px; line-height: 1.6; color: var(--ink-2);
  background: var(--surface); box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.demo-banner[hidden] { display: none; }
.demo-banner a { color: var(--accent); font-weight: 600; white-space: nowrap; }
.mode-chip {
  font-size: 12px; color: var(--accent); padding: 5px 12px; border-radius: 999px;
  background: var(--surface-soft);
}
.avatar {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; background: var(--surface);
  box-shadow: var(--shadow);
}
/* 右下角小圆点：灰色=未登录，绿色=已登录 */
.auth-dot {
  position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted); border: 2px solid var(--surface);
}
.avatar.in .auth-dot { background: var(--leaf); }

/* ---------------- 左侧：时钟 + 今日 ---------------- */
.side {
  position: fixed; left: 72px; top: 50%; transform: translateY(-50%);
  width: calc((100vw - var(--col)) / 2 - 120px); max-width: 300px;
}
.clock { font-size: 52px; line-height: 1.12; font-weight: 600; letter-spacing: -.01em; }
.clock .num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.today { margin-top: 36px; }
.weather { display: flex; flex-direction: column; gap: 6px; }
.w-now { display: flex; align-items: center; gap: 10px; }
.w-icon { color: var(--ink); flex: none; }
.w-temp { font-size: 34px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.w-desc { font-size: 15px; color: var(--ink-2); }
.w-sub { font-size: 13px; color: var(--ink-2); }
.w-tip { font-size: 13px; color: var(--ink-2); }
.w-tip.warn { color: var(--lychee); font-weight: 500; }
.w-meta { font-size: 11px; color: var(--muted); }
.today h2 { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .12em; margin: 0 0 10px; }
.today-row {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 14px; color: var(--ink-2); padding: 5px 0;
}
.today-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; transform: translateY(-2px); }
.today-row.warn .dot { background: var(--lychee); }
.today-row.warn strong { color: var(--lychee); }
.today-row button.link {
  border: 0; background: none; padding: 0; color: var(--accent); text-align: left;
}
.today-row button.link:hover { text-decoration: underline; }
.skeleton { display: inline-block; height: 12px; width: 140px; border-radius: 6px; background: var(--line); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@media (max-width: 1180px) { .side { display: none; } }

/* ---------------- 中间对话列 ---------------- */
main { padding: 96px 16px 140px; }
.column { max-width: var(--col); margin: 0 auto; }

.empty { text-align: center; padding-top: 14vh; }
.empty-mark { animation: sway 4s ease-in-out infinite; transform-origin: 50% 20%; }
@keyframes sway { 50% { transform: rotate(-8deg); } }
.empty h1 { font-size: 26px; font-weight: 600; margin: 18px 0 6px; letter-spacing: -.01em; }
.empty p { color: var(--muted); margin: 0 auto 28px; max-width: 26em; }
.suggests { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pill {
  border: 0; border-radius: 999px; padding: 10px 18px;
  background: var(--surface); box-shadow: var(--shadow); font-size: 14px;
  transition: transform .15s;
}
.pill:hover { transform: translateY(-1px); }

.log { display: flex; flex-direction: column; gap: 14px; }
.divider { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0 2px; }

.bubble {
  padding: 14px 20px; border-radius: var(--radius);
  overflow-wrap: anywhere; animation: rise .25s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.bubble.ai { background: var(--surface); box-shadow: var(--shadow); align-self: stretch; }
.bubble.me { background: var(--user); align-self: flex-end; max-width: 80%; white-space: pre-wrap; }
.bubble.err { background: transparent; color: var(--lychee); font-size: 14px; padding: 4px 8px; }

/* markdown */
.bubble.ai > :first-child { margin-top: 0; }
.bubble.ai > :last-child { margin-bottom: 0; }
.bubble.ai p { margin: 0 0 .6em; }
.bubble.ai .h { font-weight: 600; margin: .8em 0 .3em; }
.bubble.ai ul, .bubble.ai ol { margin: .2em 0 .7em; padding-left: 1.3em; }
.bubble.ai li { margin: .15em 0; }
.bubble.ai li::marker { color: var(--accent); }
.bubble.ai strong { font-weight: 600; }
.bubble.ai a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.bubble.ai code { font-size: .9em; padding: .1em .4em; border-radius: 6px; background: var(--bg); }
.bubble.ai table { border-collapse: collapse; width: 100%; font-size: 14px; margin: .3em 0 .8em; }
.bubble.ai th, .bubble.ai td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.bubble.ai th { color: var(--muted); font-weight: 500; }
.table-wrap { overflow-x: auto; }

/* 工具调用步骤 */
.steps { display: flex; flex-wrap: wrap; gap: 6px; }
.step {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px 6px 10px; border-radius: 999px;
  background: var(--surface-soft); color: var(--ink-2); font-size: 13px;
  animation: rise .2s ease-out;
}
.step .st { width: 14px; height: 14px; flex: none; display: grid; place-items: center; }
.step .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.step.ok .st { color: var(--leaf); }
.step.fail .st { color: var(--lychee); }
.step .arg { color: var(--muted); }

/* 思考中 */
.thinking { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 2px 6px; }
.thinking svg { animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-6deg); } }

/* 通知面板 */
.board {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; animation: rise .3s ease-out; display: flex; flex-direction: column; gap: 18px;
}
.board-head { display: flex; gap: 12px; align-items: flex-start; }
.board-head svg { flex: none; margin-top: 2px; }
.board-topic { font-size: 18px; font-weight: 600; }
.board-summary { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.timeline { background: var(--bg); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.tl-title { font-size: 12px; color: var(--muted); letter-spacing: .12em; }
.tl-item { display: grid; grid-template-columns: 10px auto 1fr; gap: 10px; align-items: baseline; font-size: 13px; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.tl-date { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-item.urgent .tl-dot, .due.urgent { background: var(--lychee); }
.tl-item.urgent .tl-date { color: var(--lychee); }
.tl-item.soon .tl-dot { background: #D9932B; }
.tl-item.past { opacity: .5; }
.board-group h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.board-group h3 span { font-size: 11px; background: var(--bg); border-radius: 999px; padding: 1px 8px; font-weight: 500; }
.ncard { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.ncard:last-child { margin-bottom: 0; }
.ncard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.tag { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.tag.k-apply  { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tag.k-result { background: color-mix(in srgb, var(--leaf) 18%, transparent); color: var(--leaf); }
.tag.k-event  { background: color-mix(in srgb, var(--lychee) 14%, transparent); color: var(--lychee); }
.tag.k-remind { background: color-mix(in srgb, #D9932B 18%, transparent); color: #B87A1D; }
.due { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--ink-2); color: var(--surface); margin-left: auto; }
.due.soon { background: #D9932B; color: #fff; }
.due.urgent { color: #fff; }
.due.past { background: var(--bg); color: var(--muted); }
.ncard h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; line-height: 1.45; }
.ncard h4 a { color: inherit; text-decoration: none; }
.ncard h4 a:hover { color: var(--accent); }
.ncard-sum { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.ncard ul { margin: 6px 0; padding-left: 1.2em; font-size: 13px; color: var(--ink-2); }
.ncard li { margin: 2px 0; }
.ncard li::marker { color: var(--accent); }
.ncard-action { font-size: 13px; font-weight: 500; margin-top: 8px; padding: 8px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 9%, transparent); }
.ncard-action::before { content: "下一步 · "; color: var(--accent); }
.ncard-meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.ncard-meta a { color: var(--accent); text-decoration: none; }
.board-tip { margin: 0; font-size: 13px; color: var(--muted); }
.tl-title span { margin-left: 8px; letter-spacing: 0; }

/* 折叠区 */
.board-more > summary {
  list-style: none; cursor: pointer; text-align: center; font-size: 13px; font-weight: 500;
  color: var(--accent); padding: 9px; border-radius: 999px; background: var(--bg);
}
.board-more > summary::-webkit-details-marker { display: none; }
.board-more > summary::after { content: " ▾"; }
.board-more[open] > summary::after { content: " ▴"; }
.board-more .more-close, .board-more[open] .more-open { display: none; }
.board-more[open] .more-close { display: inline; }
.board-more[open] > summary { margin-bottom: 18px; }
.board-more .board-group + .board-group { margin-top: 18px; }

/* 附件 */
.ncard-files { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.files-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.file {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  font-size: 12px; color: var(--ink-2); text-decoration: none;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
}
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.file svg { flex: none; color: var(--accent); }
.file:hover { border-color: var(--accent); color: var(--accent); }

/* 付款卡片 */
.paycard {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
  animation: rise .25s ease-out; border: 1px solid color-mix(in srgb, #D9932B 35%, transparent);
}
.paycard dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0 0 12px; font-size: 14px; }
.paycard dt { color: var(--muted); }
.paycard dd { margin: 0; font-weight: 500; }
.paycard dd.num { font-variant-numeric: tabular-nums; font-weight: 400; color: var(--ink-2); }
.pay-money { font-size: 14px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.pay-urgent { color: var(--lychee); }
.pay-warn { display: inline-block; margin-left: 8px; color: var(--lychee); font-weight: 500; }
.paycard .note { font-size: 13px; color: var(--muted); margin: 12px 0; }
.paycard .btn { text-decoration: none; display: inline-block; }
.pay-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.pay-status .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: #D9932B; animation: spin .8s linear infinite; }
.paycard .actions { align-items: center; }
.btn.danger { background: var(--lychee); color: #fff; }
.pay-cancel-err { margin: 8px 0 0; font-size: 13px; color: var(--lychee); }
.paycard.paid { border-color: color-mix(in srgb, var(--leaf) 45%, transparent); }
.paycard.paid .pay-title { color: var(--leaf); }
.paycard.cancelled { opacity: .7; }

/* 电费充值卡片 */
.rechargecard {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
  animation: rise .25s ease-out;
}
.rc-status { margin: 0 0 12px; font-size: 14px; }
.rc-status.low strong { color: var(--lychee); }
.rc-main { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.rc-options { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.rc-options li { display: flex; gap: 12px; align-items: baseline; padding: 9px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; }
.rc-options li strong { min-width: 52px; }
.rc-options li span { color: var(--ink-2); }
.rc-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rc-qr svg { width: 132px; height: 132px; background: #fff; border-radius: 12px; padding: 6px; }
.rc-steps { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); padding: 8px 12px; border-radius: 12px; background: var(--bg); }
.rechargecard .note { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

/* 校园小巴地图卡片 */
.shuttlecard {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
  animation: rise .25s ease-out;
}
.sc-sub { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.sc-sub b { font-weight: 600; }
.sc-on { color: var(--leaf); }
.sc-off { color: var(--lychee); }
.sc-map { border-radius: 14px; background: var(--bg); padding: 4px; min-height: 120px; display: grid; place-items: center; }
.sc-svg { width: 100%; height: auto; max-height: 460px; display: block; }
.sc-route { fill: none; stroke: color-mix(in srgb, var(--accent) 30%, transparent); stroke-linejoin: round; stroke-linecap: round; }
.sc-ridepath { fill: none; stroke: color-mix(in srgb, var(--leaf) 75%, transparent); stroke-linejoin: round; stroke-linecap: round; }
.sc-stop { fill: var(--surface); stroke: var(--accent); }
.sc-stop.on { fill: var(--leaf); stroke: var(--surface); }
.sc-stop.off { fill: var(--lychee); stroke: var(--surface); }
.sc-labels text { fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: .35em; stroke-linejoin: round; }
.sc-labels text.sc-focus { font-weight: 700; }
.sc-labels text.on { fill: var(--leaf); }
.sc-labels text.off { fill: var(--lychee); }
.sc-landmarks text { fill: var(--muted); opacity: .55; }
.sc-north { fill: var(--muted); opacity: .7; }
.sc-north-t { fill: var(--muted); }
.sc-bus circle { fill: var(--muted); stroke: var(--surface); }
.sc-bus text { fill: #fff; font-weight: 700; }
.sc-bus .sc-heading { fill: var(--muted); }
.sc-bus.cw circle, .sc-bus.cw .sc-heading { fill: var(--lychee); }
.sc-bus.ccw circle, .sc-bus.ccw .sc-heading { fill: var(--accent); }
.sc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 12px; color: var(--ink-2); }
.sc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sc-dot.cw { background: var(--lychee); }
.sc-dot.ccw { background: var(--accent); }
.sc-ride { width: 16px; height: 4px; border-radius: 2px; display: inline-block; background: color-mix(in srgb, var(--leaf) 75%, transparent); }
.shuttlecard .note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.sc-refresh { color: var(--accent); }

/* 确认卡片 */
.confirm {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; animation: rise .25s ease-out;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.confirm-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 12px; }
.confirm dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
.confirm dt { color: var(--muted); }
.confirm dd { margin: 0; font-weight: 500; }
.choice-label { font-size: 13px; color: var(--muted); margin: 14px 0 8px; }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice button {
  text-align: left; font-size: 14px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface-soft, transparent); color: inherit; transition: border-color .15s, background .15s;
}
.choice button:hover:not(:disabled) { border-color: var(--primary); }
.choice button.on { border-color: var(--primary); background: var(--primary); color: var(--primary-ink); }
.choice button:disabled:not(.on) { opacity: .5; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.slot-grid button {
  font-size: 13px; padding: 7px 0; border-radius: 10px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); background: var(--surface-soft, transparent); color: inherit; transition: border-color .15s, background .15s;
}
.slot-grid button:hover:not(:disabled) { border-color: var(--primary); }
.slot-grid button.on { border-color: var(--primary); background: var(--primary); color: var(--primary-ink); }
.slot-grid button:disabled:not(.on) { opacity: .5; }
.confirm .note { font-size: 13px; color: var(--muted); margin: 14px 0 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { border: 0; border-radius: 999px; padding: 10px 22px; font-weight: 500; font-size: 14px; transition: opacity .2s, transform .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.ghost { background: var(--bg); color: var(--ink-2); }
.btn:disabled { opacity: .45; cursor: default; }
.confirm .result, .login .result { font-size: 14px; color: var(--muted); }
.confirm .result.ok, .login .result.ok { color: var(--leaf); }

/* 登录卡片 */
.login {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; animation: rise .25s ease-out; max-width: 380px; align-self: center; width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.login-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg); margin-bottom: 16px; }
.login-tabs button { flex: 1; border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 999px; font-size: 13px; }
.login-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.login-body { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-box { width: 176px; height: 176px; border-radius: 16px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-box .spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.qr-tip { margin: 0; font-size: 13px; color: var(--ink-2); }
.qr-tip button.link, .login .link { border: 0; background: none; color: var(--accent); padding: 0; }
.login form.login-body { align-items: stretch; }
.login input:not([type=checkbox]) {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 14px; padding: 11px 14px; outline: none;
}
.login input:focus-visible { border-color: var(--accent); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { padding: 10px 14px; white-space: nowrap; }
.remember { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.login-err { margin: 0; font-size: 13px; color: var(--lychee); }
.login .note { font-size: 12px; color: var(--muted); margin: 14px 0 0; text-align: center; }

/* ---------------- 记忆 ---------------- */
.mem-section { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .12em; margin: 8px 0 10px; }
.memory-list + .mem-section { margin-top: 24px; }
.memory-head h1 { font-size: 24px; font-weight: 600; margin: 24px 0 4px; }
.memory-head p { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.memory-list { display: flex; flex-direction: column; gap: 10px; }
.mem {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow);
}
.mem .k { color: var(--muted); font-size: 13px; width: 8em; flex: none; }
.mem .v { flex: 1; font-weight: 500; }
.mem button { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 4px 8px; border-radius: 999px; }
.mem button:hover { color: var(--lychee); background: var(--bg); }
.mem-empty { color: var(--muted); text-align: center; padding: 40px 0; }
.mem.thread .v, .mem.thread .k { cursor: pointer; min-width: 0; }
.mem.thread .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem.thread .k { width: auto; text-align: right; }
.mem.thread.current { border-color: var(--primary); }

/* ---------------- 输入框 ---------------- */
.composer {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(calc(var(--col) + 80px), 100vw); padding: 24px 16px max(22px, env(safe-area-inset-bottom));
  background: transparent;
  display: flex; align-items: flex-end; gap: 0;
}
.composer textarea {
  flex: 1; resize: none; border: 0; outline: none;
  max-height: 160px; padding: 14px 58px 14px 22px; border-radius: 26px;
  background: var(--surface); box-shadow: var(--shadow); line-height: 1.5;
}
.composer textarea::placeholder { color: var(--muted); }
/* 每日额度圆环：输入框正下方。整圈 = 今天的额度，用多少退多少；剩两成以下变荔枝红。
   写在天空上，所以垫一层毛玻璃保证看得清 */
.composer.has-quota { padding-bottom: max(42px, calc(env(safe-area-inset-bottom) + 22px)); }
.composer.has-quota .send { bottom: max(48px, calc(env(safe-area-inset-bottom) + 28px)); }
.quota {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: max(14px, calc(env(safe-area-inset-bottom) - 6px));
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 7px; border-radius: 999px;
  font-size: 11.5px; line-height: 16px; color: var(--ink-2); white-space: nowrap;
  background: var(--surface-soft); border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.quota[hidden] { display: none; }
.quota svg { transform: rotate(-90deg); flex: none; }
.quota circle { fill: none; stroke-width: 2.2; }
.quota .track { stroke: var(--line); }
.quota .arc { stroke: var(--leaf); stroke-linecap: round; transition: stroke-dashoffset .6s ease, stroke .3s; }
.quota.low .arc { stroke: var(--lychee); }
.quota.out { color: var(--lychee-dark); }
.composer textarea:focus-visible { box-shadow: var(--shadow), 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.send {
  position: absolute; right: 24px; bottom: max(28px, calc(env(safe-area-inset-bottom) + 6px));
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink);
  transition: opacity .2s;
}
.send:disabled { opacity: .25; cursor: default; }

@media (max-width: 640px) {
  .topbar { padding: 12px 12px 22px; }
  .seg button { padding: 6px 16px; }
  .mode-chip { display: none; }
  main { padding-top: 80px; }
  .bubble { padding: 12px 16px; }
  .bubble.me { max-width: 88%; }
  .empty { padding-top: 8vh; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud, .sky-stars i, .sky-rain i { animation: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
