/* 手机版 · 组件库。每个组件一段，类名就是组件名。新页面只拼这些组件，不另起样式。
   清单：seg 分段 · btn 按钮 · card 卡片 · tile 色块卡 · row 列表行 · stats 数字组 · mark 来源标记 · chip 小标签
        · lamp 新变化灯 · sheet 底部弹层 · toast 提示 · skel 骨架 · cover 封面 · switch 开关 · rail 进度轨
        · bar 条形 · src 原文卡 · composer 输入框 · bubble 对话 · receipt 小票 */

/* ── seg 分段控件：轨道 + 白色滑块，滑块弹簧过渡 ── */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: var(--r-pill); background: var(--raised); }
.seg.inline { display: inline-grid; }
.seg button { position: relative; z-index: 1; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: var(--r-pill); color: var(--ink-2); font-size: var(--t-body); white-space: nowrap; transition: color var(--d-mid); }
.seg button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.seg .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: var(--r-pill); background: var(--card); box-shadow: 0 1px 2px rgba(40, 35, 25, .08), 0 4px 12px -4px rgba(40, 35, 25, .14); pointer-events: none; }
.seg .thumb.sliding { transition: transform var(--d-slow) var(--spring), width var(--d-slow) var(--spring); }
.seg.sm button { font-size: var(--t-meta); padding: 0 12px; }
.seg-wrap { display: flex; align-items: center; gap: 8px; }
.seg-wrap .seg { flex: 1; }
.seg.scroll { display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.seg.scroll::-webkit-scrollbar { display: none; }
.seg.scroll button { flex: none; scroll-snap-align: center; }

/* ── btn 按钮：主按钮是墨色胶囊；蓝色按钮只给"我们的方案 / 产品" ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 22px; border-radius: var(--r-pill); font-size: var(--t-body); font-weight: 600; transition: transform var(--d-fast) var(--ease), background var(--d-fast), opacity var(--d-fast); }
.btn:active { transform: scale(.965); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.blue { background: var(--blue); color: var(--card); }
.btn.ghost { background: var(--raised); color: var(--ink); }
.btn.line { border: 1px solid var(--line); background: var(--card); }
.btn.sm { min-height: 44px; min-width: 44px; height: auto; padding: 0 14px; font-size: var(--t-meta); }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { color: var(--blue-ink); font-weight: 600; display: inline-flex; min-height: 44px; min-width: 44px; align-items: center; gap: 2px; }

/* ── card 卡片 ── */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: var(--s-4); }
.card.pad-lg { padding: var(--s-5); }
.card.flat { background: var(--bg-2); border-color: transparent; }
.card.tap { transition: transform var(--d-fast) var(--ease), box-shadow var(--d-mid); display: block; width: 100%; text-align: left; }
.card.tap:active { transform: scale(.98); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: var(--s-3); }
.card-h h3 { font-size: var(--t-title); font-weight: 600; }
.stack { display: grid; gap: var(--s-3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }

/* 洗色英雄卡：右上一团暖光（照 AoE4"我的"卡） */
.hero-card { position: relative; overflow: hidden; border-radius: var(--r-xl); background: var(--bg-2); border: 1px solid var(--line-2); padding: var(--s-5); }
.hero-card::before { content: ""; position: absolute; inset: -40% -30% auto auto; width: 75%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, var(--gold-tint), transparent); pointer-events: none; }
.hero-card > * { position: relative; }

/* ── tile 色块卡：两列网格里的入口卡 ── */
.tile { display: grid; align-content: start; gap: 6px; min-height: 104px; padding: var(--s-4); border-radius: var(--r-lg); background: var(--bg-2); text-align: left; transition: transform var(--d-fast) var(--ease); }
.tile:active { transform: scale(.97); }
.tile .ico { color: var(--blue); }
.tile b { font-size: var(--t-title); font-weight: 600; margin-top: 6px; }
.tile small { color: var(--ink-2); font-size: var(--t-meta); }

/* ── row 列表行：标题 + 一行说明 + 右侧数字或箭头；分隔线从文字处开始 ── */
.rows { display: grid; }
.row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 0; position: relative; text-align: left; width: 100%; }
.row + .row::before { content: ""; position: absolute; top: 0; left: var(--row-indent, 0); right: 0; height: 1px; background: var(--line); }
.row .r-main { min-width: 0; display: grid; gap: 3px; }
.row .r-title { font-size: var(--t-title); line-height: 1.35; overflow-wrap: anywhere; }
.row .r-title.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .r-sub { font-size: var(--t-meta); color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.row .r-end { font-size: var(--t-meta); color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.row.tap { transition: background var(--d-fast); border-radius: var(--r-sm); }
.row.tap:active { background: var(--raised); }
.row .r-lead { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--raised); color: var(--ink-2); overflow: hidden; }
.row .r-lead img { width: 100%; height: 100%; object-fit: cover; }
.row .r-num { font-family: var(--f-num); font-size: var(--t-lead); color: var(--ink); }

/* ── stats 数字组：两到四个数字，竖线分隔 ── */
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.stats > * { display: grid; justify-items: start; align-content: start; gap: 2px; padding: 0 12px; position: relative; min-width: 0; text-align: left; }
.stats > *:first-child { padding-left: 0; }
.stats > * + *::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.stats b { font-family: var(--f-num); font-size: var(--t-head); font-weight: 600; line-height: 1.1; white-space: nowrap; }
.stats b small { font-family: var(--f-cn); font-size: var(--t-meta); font-weight: 400; color: var(--ink-2); margin-left: 2px; }
.stats > * > span { font-size: var(--t-meta); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.stats.center > * { justify-items: center; text-align: center; }
.stats button { text-align: left; min-height: 44px; min-width: 44px; }

/* ── mark 来源标记：一个小点 + 一个词。公开资料墨色、推测金色、已核实绿色、示意灰色、估算蓝色 ── */
.mark-t { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-meta); color: var(--ink-2); white-space: nowrap; }
.mark-t::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); flex: none; }
.mark-t.guess { color: var(--gold); } .mark-t.guess::before { background: none; box-shadow: 0 0 0 1.4px var(--gold) inset; }
.mark-t.ok { color: var(--green); } .mark-t.ok::before { background: var(--green); }
.mark-t.demo { color: var(--ink-2); } .mark-t.demo::before { background: var(--ink-3); }
.mark-t.est { color: var(--blue); } .mark-t.est::before { background: var(--blue); }

/* ── chip 小标签：可点的胶囊（推荐问题、快捷说法） ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll > .chip { flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--line); font-size: var(--t-meta); color: var(--ink); white-space: nowrap; transition: transform var(--d-fast) var(--ease), background var(--d-fast); }
.chip:active { transform: scale(.96); background: var(--raised); }
.chip.blue { color: var(--blue-ink); background: var(--blue-tint); border-color: transparent; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: var(--t-meta); background: var(--raised); color: var(--ink-2); white-space: nowrap; }
.tag.blue { background: var(--blue-tint); color: var(--blue-ink); }
.tag.green { background: var(--green-tint); color: var(--ink); }
.tag.gold { background: var(--gold-tint); color: var(--gold); }
.tag.red { background: var(--red-tint); color: var(--ink); }

/* ── lamp 新变化灯 ── */
.lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--red); position: relative; flex: none; display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .lamp.new-once::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--red); animation: lamp-once var(--d-slow) var(--ease) both; }
  .page-hidden .lamp.new-once::after { animation-play-state: paused; }
  @keyframes lamp-once { from { transform: scale(1); opacity: .45; } to { transform: scale(2.8); opacity: 0; } }
}

/* ── cover 封面：微缩沙盘图，夜间换黄昏版 ── */
.cover { position: relative; overflow: hidden; border-radius: var(--r-md); background: var(--bg-2); aspect-ratio: 4 / 3; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
img[data-cover-state="failed"] { visibility: hidden; }
.cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--t-meta); color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .cover img.cover-peek { animation: fade var(--d-fast) var(--ease) both; }
  @supports (clip-path: inset(0)) {
    .cover img.cover-peek { animation: cover-edge var(--d-mid) var(--ease) both; }
    @keyframes cover-edge { from { clip-path: inset(0 12% 0 0); } to { clip-path: inset(0); } }
  }
  .page-hidden .cover img.cover-peek { animation-play-state: paused; }
}
.cover .cover-lamp { position: absolute; top: 10px; right: 10px; }

/* ── sheet 底部弹层：可下拉关闭 ── */
.sheet-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(20, 18, 14, .40); opacity: 0; transition: opacity var(--d-mid); pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: 0 -1px 0 var(--line), 0 -10px 40px rgba(20, 18, 14, .16); transform: translateY(100%); transition: transform var(--d-slow) var(--ease); pointer-events: auto; padding-bottom: var(--safe-b); }
.sheet.open { transform: none; }
@supports (background: color-mix(in srgb, white 80%, transparent)) and ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .sheet.open {
    background: color-mix(in srgb, var(--card) 97%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .sheet.open { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.sheet.open.dragging { transform: translateY(var(--sheet-pull, 0px)); }
.sheet-scrim.open { opacity: var(--scrim-opacity, 1); }
.sheet.dragging, .sheet-scrim.dragging { transition: none; }
.sheet-grab { flex: none; height: 26px; display: grid; place-items: center; touch-action: none; }
.sheet-grab::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-h { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 var(--gutter) var(--s-3); }
.sheet-h > div { min-width: 0; overflow-wrap: anywhere; }
.sheet-h h3 { font-size: var(--t-lead); font-weight: 600; line-height: 1.3; }
.copy-field { display: block; width: 100%; min-height: 110px; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-2); resize: vertical; }
.sheet-body { overflow-y: auto; padding: 0 var(--gutter) var(--s-6); overscroll-behavior: contain; background: var(--card); }
@media (min-width: 640px) { .sheet { max-width: 430px; margin: 0 auto; } }

/* ── toast 提示 ── */
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--tabbar-h) + var(--tabbar-gap) + var(--safe-b) + 14px); transform: translateX(-50%); max-width: calc(100vw - 48px); padding: 10px 16px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: var(--t-meta); box-shadow: var(--shadow-float); animation: toast-in var(--d-mid) var(--spring); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px) scale(.96); } }

/* ── skel 骨架 ── */
.skel { border-radius: var(--r-sm); background: linear-gradient(100deg, var(--raised) 30%, var(--line-2) 50%, var(--raised) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -300% 0; } }

/* ── switch 开关 ── */
.switch { width: 46px; height: 44px; border-radius: var(--r-pill); position: relative; flex: none; }
.switch::before { content: ""; position: absolute; inset: 8px 0; border-radius: inherit; background: var(--line); transition: background var(--d-mid); }
.switch::after { content: ""; position: absolute; top: 11px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); transition: transform var(--d-mid) var(--spring); }
.switch[aria-checked="true"]::before { background: var(--blue); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch[disabled] { opacity: .5; }

/* ── rail 进度轨：五段（发现 接触 方案 报价 成交） ── */
.rail { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.rail i { height: 5px; border-radius: 3px; background: var(--line); }
.rail i.on { background: var(--ink); }
.rail i.now { background: var(--blue); }
.rail-l { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 6px; font-size: var(--t-meta); color: var(--ink-2); }
.rail-l .now { color: var(--blue); font-weight: 600; }

/* ── bar 条形（比例条，最大的一段最深） ── */
.bar-stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; }
.bar-stack i { display: block; height: 100%; }
.legend { display: grid; gap: 8px; margin-top: 12px; }
.legend li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; font-size: var(--t-meta); }
.legend li i { width: 10px; height: 10px; border-radius: 3px; }
.legend li b { font-family: var(--f-num); font-weight: 600; font-size: var(--t-body); }

/* ── src 原文卡：出处 + 原句（高亮数字）+ 打开原文 ── */
.src-card { border-radius: var(--r-md); background: var(--bg-2); padding: var(--s-4); display: grid; gap: 10px; }
.src-card .src-t { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--t-meta); color: var(--ink-2); }
.src-card blockquote { font-size: var(--t-body); line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; border-left: 2px solid var(--line); padding-left: 12px; }
.src-card blockquote mark { background: var(--blue-tint); color: var(--blue-ink); border-radius: 3px; padding: 0 2px; }

/* ── composer Agent 输入框 ── */
.composer { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 120px; padding: 9px 0; border: 0; outline: 0; resize: none; background: none; font-size: var(--t-body); line-height: 1.45; }
.composer textarea::placeholder { color: var(--ink-2); opacity: 1; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: var(--card); flex: none; transition: transform var(--d-fast) var(--spring), opacity var(--d-fast); }
.composer .send:active { transform: scale(.9); }
.composer .send[disabled] { opacity: .35; }
.composer .flow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; fill: none; stroke: var(--blue); stroke-width: 1.5px; stroke-linecap: round; stroke-dasharray: 13 87; transition: opacity var(--d-fast); }
.composer.busy-ready { border-color: var(--blue-tint); }

/* ── bubble 对话 ── */
.thread { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.msg-me { justify-self: end; max-width: 82%; padding: 10px 16px; border-radius: 20px 20px 6px 20px; background: var(--raised); font-size: var(--t-body); overflow-wrap: anywhere; }
.msg-ai { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.msg-ai .ai-head { display: flex; align-items: center; gap: 8px; font-size: var(--t-meta); color: var(--ink-2); }
.ai-source-label { margin-inline-start: auto; }
.ai-elapsed { margin-inline-start: auto; }
.public-engine { display: inline-flex; align-items: center; gap: .4em; margin-inline-start: auto; padding: 0 .6em; border-radius: var(--r-pill); color: var(--ink-2); background: var(--raised); font-size: var(--t-meta); line-height: 1.8; white-space: nowrap; }
.public-engine::before { content: ""; inline-size: .45em; block-size: .45em; border-radius: 50%; background: currentColor; }
.public-engine:is([data-public-engine="openai"], [data-public-engine="domestic"]) { color: var(--blue); }
.agent-dock-context { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.agent-dock-context .ctx-pill { min-width: 0; }
.agent-depth { flex: none; padding-inline: var(--s-2); background: var(--raised); }
.agent-depth[aria-pressed="true"] { color: var(--blue-ink); background: var(--blue-tint); border-color: var(--blue-ink); font-weight: 600; }
.agent-hero:has(.public-engine) .ah-top { flex-wrap: wrap; }
.orb { width: 20px; height: 20px; border-radius: 50%; flex: none; background: conic-gradient(from 210deg, var(--blue), #7fd0ff, var(--blue)); position: relative; }
.orb::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg); }
.orb.complete, .orb.interrupted { display: grid; place-items: center; background: var(--blue-tint); color: var(--blue-ink); }
.orb.interrupted { background: var(--raised); }
.orb.complete::after, .orb.interrupted::after { content: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-steps { display: grid; gap: 6px; }
.ai-steps li { display: flex; align-items: center; gap: 8px; font-size: var(--t-meta); color: var(--ink-2); }
.step-icon { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--ink-3); flex: none; display: grid; place-items: center; }
.step-icon svg { visibility: hidden; }
[data-state="active"] > .step-icon { border-color: var(--blue); border-right-color: var(--line); }
[data-state="done"] > .step-icon { border-color: transparent; color: var(--blue-ink); }
[data-state="done"] > .step-icon svg { visibility: visible; }
.agent-tick { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.ai-answer { font-size: var(--t-body); line-height: 1.75; overflow-wrap: anywhere; }
.ai-answer > :is(p, .ai-inline-source) + p { margin-top: var(--s-3); }
.ai-answer b { font-weight: 600; }
.ai-answer .cite { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-block: calc(-1 * var(--s-2)); vertical-align: middle; border-radius: var(--r-pill); }
.ai-answer .cite > span, .ai-inline-head b { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: var(--r-pill); background: var(--blue-tint); color: var(--blue-ink); font: 600 var(--t-meta)/1 var(--f-num); }
.ai-answer .cite[aria-expanded="true"] > span { box-shadow: 0 0 0 1px var(--blue-ink), 0 0 0 4px var(--blue-tint); }
.ai-answer .cite:disabled { cursor: default; }
.ai-cite-group { margin-inline-start: var(--s-1); }
.ai-inline-source { margin-top: var(--s-2); padding: 0 var(--s-3) var(--s-3); border: 1px solid var(--line); border-inline-start: 2px solid var(--blue-ink); border-radius: var(--r-md); background: var(--bg-2); }
.ai-inline-source .src-card { padding: 0; background: transparent; }
.ai-inline-source .src-card .link { display: inline-flex; justify-self: start; align-items: center; gap: var(--s-1); min-height: 44px; }
.ai-inline-head { display: flex; justify-content: space-between; align-items: center; font-size: var(--t-meta); color: var(--ink-2); }
.ai-inline-head > span { display: flex; align-items: center; gap: var(--s-2); }
.ai-inline-head [data-inline-close] { margin-inline-end: calc(-1 * var(--s-2)); }
.ai-srcs { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-ai, .thread > * { min-width: 0; }
.ai-srcs button { overflow: hidden; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; max-width: 100%; padding: var(--s-2) var(--s-3); text-align: start; border-radius: var(--r-pill); background: var(--bg-2); font-size: var(--t-meta); color: var(--ink-2); }
.ai-srcs button span { min-width: 0; overflow-wrap: anywhere; }
.ai-srcs button i { font-style: normal; font-family: var(--f-num); color: var(--blue-ink); font-weight: 600; }
.ai-shape { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.ai-shape div { padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-2); display: grid; gap: 2px; }
.ai-shape dt { font-size: var(--t-meta); color: var(--ink-2); }
.ai-shape dd { font-family: var(--f-num); font-size: var(--t-lead); font-weight: 600; }
.ai-follow.chips.scroll { min-width: 0; margin-inline: 0; padding-inline: 2px; }
.ai-follow:empty { display: none; }
.msg-ai:has(.intent-card:not([hidden])) .ai-steps,
.msg-ai:has(.intent-card:not([hidden])) :is(.ai-answer, .ai-shape, .ai-srcs):empty { display: none; }
.intent-card { display: grid; gap: var(--s-4); min-width: 0; padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); overflow-wrap: anywhere; }
.intent-heading { display: grid; gap: var(--s-2); }
.intent-heading > div { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); color: var(--blue-ink); font-size: var(--t-meta); }
.intent-heading h2 { font-size: var(--t-lead); font-weight: 600; line-height: 1.35; }
.intent-heading p, .intent-block li > span { color: var(--ink-2); }
.intent-block { display: grid; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.intent-block h3, .intent-block p, .intent-block li { font-size: var(--t-body); }
.intent-block h3 { font-weight: 600; }
.intent-block ul { display: grid; gap: var(--s-2); margin: 0; list-style: none; padding: 0; }
.intent-block li { display: grid; gap: var(--s-1); border-inline-start: 2px solid var(--line); padding-inline-start: var(--s-2); }
.intent-block li b { font-weight: 600; }
.intent-risk p { border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); background: var(--gold-tint); color: var(--gold); }
.intent-reply { display: grid; justify-items: start; gap: var(--s-2); border-radius: var(--r-sm); padding: var(--s-3); background: var(--bg-2); }
.intent-reply .btn { justify-self: end; }
@media (prefers-reduced-motion: no-preference) {
  .composer.busy-ready.motion-visible .flow { opacity: .8; }
  .composer.busy-ready.motion-visible .flow rect { animation: agent-beam 2.4s linear infinite; }
  .msg-me { animation: agent-bubble var(--d-mid) var(--ease) both; }
  .orb.spin.motion-visible { animation: spin 1.2s linear infinite; }
  .msg-ai:has(.orb.motion-visible) [data-state="active"] > .step-icon { animation: spin 1.2s linear infinite; }
  .page-hidden .composer .flow rect, .page-hidden .msg-ai .orb, .page-hidden .msg-ai .step-icon { animation-play-state: paused; }
  .ai-phrase, .ai-interrupted .ai-follow { animation: fade var(--d-fast) var(--ease) both; }
  .ai-phrase { animation-delay: calc(var(--i, 0) * 24ms); }
  .ai-srcs button { animation: rise var(--d-mid) var(--ease) both; animation-delay: calc(var(--i, 0) * 36ms); }
  .ai-inline-source:not([hidden]) > * { animation: rise var(--d-mid) var(--ease) both; }
  .orb.complete .agent-tick, [data-state="done"] .agent-tick { animation: agent-check var(--d-mid) var(--ease) both; }
  @keyframes agent-beam { to { stroke-dashoffset: -100; } }
  @keyframes agent-bubble { from { opacity: 0; transform: translateY(16px); } }
  @keyframes agent-check { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .composer.busy-ready { border-color: var(--blue); }
}

/* ── receipt 小票 ── */
.receipt { position: relative; margin: 6px 2px 18px; padding: 22px 20px 26px; background: var(--card); border-radius: 6px 6px 0 0; box-shadow: var(--shadow-card); font-size: var(--t-meta); transform-origin: top; }
.receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: radial-gradient(circle at 7px -2px, transparent 7px, var(--card) 7.5px) 0 0 / 14px 10px repeat-x; filter: drop-shadow(0 3px 2px rgba(40, 35, 25, .06)); }
@media (prefers-reduced-motion: no-preference) {
  .sheet.open .receipt { animation: fade var(--d-mid) var(--ease) both; }
  @supports (clip-path: inset(0)) {
    .sheet.open .receipt { animation: receipt-roll var(--d-slow) var(--ease) 70ms both; }
    @keyframes receipt-roll { from { clip-path: inset(0 -12px 100% -12px); transform: translateY(-10px); } to { clip-path: inset(-12px -12px -20px -12px); } }
  }
}
.receipt h4 { text-align: center; font-size: var(--t-title); font-weight: 600; }
.receipt .rc-sub { text-align: center; color: var(--ink-2); margin-top: 2px; }
.receipt .rc-cut { border-top: 1.5px dashed var(--line); margin: 14px 0; }
.receipt .rc-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 5px 0; }
.receipt .rc-row b { font-weight: 400; font-size: var(--t-body); color: var(--ink); }
.receipt .rc-row .num { font-size: var(--t-body); text-align: right; }
.receipt .rc-row small { color: var(--ink-2); grid-column: 1 / -1; }
.receipt .rc-total { display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 4px 0; }
.receipt .rc-total .num { font-size: var(--t-lead); font-weight: 600; }
.receipt .rc-total.big .num { font-size: var(--t-head); color: var(--blue); }
.receipt .rc-foot { text-align: center; color: var(--ink-2); margin-top: 14px; line-height: 1.6; }

/* ── empty 空状态 ── */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: var(--s-10) var(--s-5); color: var(--ink-2); }
.empty b { color: var(--ink); font-size: var(--t-title); font-weight: 600; }
