/* 生意BUDDY 品牌色沿用线上主题；Chat 用天蓝表示只读，Agent 用品牌橙表示可执行 */
:root {
  --bg: #FFFCF8;
  --fg: #302419;
  --card: #FFFFFF;
  --muted: #F7F2EC;
  --muted-fg: #796857;
  --border: #E9DED2;
  --side: #FFF7ED;
  --brand: #FF8109;
  --brand-ink: #A34600;
  --ok: #237C45;
  --danger: #C63131;
  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
}
html[data-mode="chat"] { --acc: #2E9BE6; --acc-ink: #0B5E99; --acc-soft: #E2F2FD; --acc-rgb: 46, 155, 230; --acc-fg: #fff; }
html[data-mode="agent"] { --acc: #FF8109; --acc-ink: #A34600; --acc-soft: #FFE7CB; --acc-rgb: 255, 129, 9; --acc-fg: #301A08; }

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.top { display: flex; align-items: center; justify-content: space-between; max-width: 1240px; margin: 0 auto; padding: 22px 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.top nav a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 14px; }
.top nav a:hover { border-color: var(--brand); color: var(--brand-ink); }

main { max-width: 1240px; margin: 0 auto; padding: 0 24px 96px; }
h1 { font-size: clamp(38px, 6vw, 76px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; text-align: center; margin: 2vh 0 4vh; }
h1 .dot { display: inline-block; width: .16em; height: .16em; margin: 0 .22em; border-radius: 50%; background: var(--acc); vertical-align: .32em; transition: background .5s; }

/* ---------- 应用窗口 ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; height: clamp(600px, calc(100vh - 270px), 820px); background: var(--side); border: 1px solid var(--border); border-radius: 28px; overflow: hidden; box-shadow: 0 40px 90px -40px rgba(120, 70, 20, .35), 0 2px 0 #fff inset; }
.side { display: flex; flex-direction: column; padding: 20px 12px 14px; min-height: 0; }
.side-brand { display: flex; align-items: center; gap: 8px; padding: 0 10px 14px; }
.side-nav { display: grid; gap: 2px; }
.side-nav button, .side-tasks button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; font-size: 14px; text-align: left; }
.side-nav button:hover, .side-tasks button:hover { background: #FFE7CB; }
.side-nav .on { background: #FFE7CB; color: var(--brand-ink); font-weight: 600; }
.side-tasks { margin-top: 20px; flex: 1; min-height: 0; overflow: auto; }
.side-tasks p { padding: 0 12px 6px; font-size: 12px; color: var(--muted-fg); }
.side-tasks button { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 12px; }
.side-tasks span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-tasks em { font-style: normal; font-size: 12px; color: var(--muted-fg); }
.side-foot { border-top: 1px solid var(--border); padding: 12px 10px 0; display: grid; font-size: 14px; }
.side-foot span { font-size: 12px; color: var(--muted-fg); }

.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; margin: 8px 8px 8px 0; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.glow { position: absolute; inset: -30% -10% auto; height: 70%; pointer-events: none; opacity: .9; transition: background 0.6s;
  background: radial-gradient(38% 46% at 34% 36%, rgba(var(--acc-rgb), .42), transparent 70%), radial-gradient(36% 44% at 66% 30%, rgba(255, 205, 0, .34), transparent 70%), radial-gradient(30% 40% at 52% 62%, rgba(255, 80, 14, .16), transparent 70%); filter: blur(30px); }

.bar { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px 8px; }
.state { font-size: 13px; color: var(--acc-ink); display: flex; align-items: center; gap: 6px; transition: color .4s; }

/* ---------- 液态玻璃滑块 ---------- */
.gs { --x: 0px; --sx: 1; --sy: 1; position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 6px; border-radius: 999px; touch-action: none; user-select: none; -webkit-user-select: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .22));
  -webkit-backdrop-filter: blur(18px) saturate(1.7); backdrop-filter: blur(18px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: inset 0 1px 1px #fff, inset 0 -2px 6px rgba(140, 90, 30, .12), 0 14px 40px -10px rgba(var(--acc-rgb), .45), 0 2px 6px rgba(90, 50, 10, .08); transition: box-shadow .5s; }
.gs button { position: relative; z-index: 1; width: 138px; height: 50px; border-radius: 999px; font-size: 17px; font-weight: 700; letter-spacing: .02em; color: rgba(48, 36, 25, .5); transition: color .35s; }
.gs button[aria-selected="true"] { color: var(--acc-ink); }
.gs .thumb { position: absolute; z-index: 2; top: 6px; left: 6px; width: 138px; height: 50px; border-radius: 999px; pointer-events: none;
  transform: translateX(var(--x)) scale(var(--sx), var(--sy)); transition: transform .62s cubic-bezier(.3, 1.55, .45, 1), box-shadow .4s;
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .06) 55%, rgba(255, 255, 255, .28));
  -webkit-backdrop-filter: blur(1.2px) saturate(2) brightness(1.08); backdrop-filter: blur(1.2px) saturate(2) brightness(1.08);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .98), inset 0 -3px 8px rgba(255, 255, 255, .5), inset 0 0 0 1px rgba(255, 255, 255, .55), inset 0 0 22px rgba(var(--acc-rgb), .3), 0 8px 22px -4px rgba(var(--acc-rgb), .55), 0 1px 3px rgba(60, 30, 0, .16); }
.gs.lens .thumb { backdrop-filter: url(#lens) blur(.6px) saturate(2) brightness(1.08); }
.gs .thumb::before { content: ''; position: absolute; inset: 3px 14px auto; height: 42%; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0)); opacity: .7; }
.gs .thumb::after { content: ''; position: absolute; inset: auto 22px 4px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .7); filter: blur(3px); }
.gs.drag .thumb { transition: none; }

/* ---------- 对话区 ---------- */
.thread { position: relative; z-index: 2; flex: 1; min-height: 0; overflow-y: auto; padding: 14px 24px 20px; scroll-behavior: smooth; -webkit-mask-image: linear-gradient(#0000, #000 18px); mask-image: linear-gradient(#0000, #000 18px); }
.thread > * { max-width: 720px; margin-inline: auto; }
.empty { height: 100%; display: flex; align-items: center; justify-content: center; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 560px; }
.chips button { padding: 11px 18px; border-radius: 999px; background: rgba(255, 255, 255, .8); border: 1px solid var(--border); font-size: 15px; box-shadow: 0 1px 2px rgba(90, 50, 10, .05); transition: transform .2s, border-color .2s, box-shadow .2s; animation: rise .5s both; }
.chips button:hover { transform: translateY(-2px); border-color: var(--acc); box-shadow: 0 8px 20px -8px rgba(var(--acc-rgb), .5); }
.chips b { color: var(--acc-ink); font-weight: 600; }

.msg { margin-top: 14px; animation: rise .35s both; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user p { max-width: 82%; padding: 10px 16px; border-radius: 20px 20px 6px 20px; background: var(--acc); color: var(--acc-fg); font-size: 15px; }
.msg.ai p { font-size: 15px; white-space: pre-wrap; }
.at { color: var(--acc-ink); font-weight: 600; background: var(--acc-soft); border-radius: 6px; padding: 1px 6px; }
.msg.user .at { background: rgba(255, 255, 255, .28); color: inherit; }

.tools { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--muted); font-size: 13.5px; color: var(--muted-fg); }
.tools div { display: flex; align-items: center; gap: 8px; animation: rise .3s both; }
.tools .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--acc); animation: spin .7s linear infinite; }
.tools .done { color: var(--fg); }
.tools .done svg { color: var(--ok); }
.tools .ro { margin-left: auto; font-size: 12px; color: var(--acc-ink); background: var(--acc-soft); padding: 0 8px; border-radius: 999px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: 0 10px 30px -18px rgba(120, 70, 20, .35); }
.card h3 { font-size: 16px; margin-bottom: 12px; }
.card.ask.done { opacity: .55; pointer-events: none; }
.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opts button { padding: 10px 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); font-size: 15px; transition: all .18s; }
.opts button:hover { border-color: var(--acc); background: var(--acc-soft); color: var(--acc-ink); }
.opts button.sel { border-color: var(--acc); background: var(--acc); color: var(--acc-fg); }
.opts.tiles { display: grid; grid-template-columns: repeat(4, 1fr); }
.opts.tiles button { padding: 0 0 10px; overflow: hidden; display: grid; gap: 8px; }
.opts.tiles .pic { height: 92px; }
.opts.ratio button { display: grid; justify-items: center; gap: 8px; min-width: 104px; padding: 14px 18px; }
.opts.ratio .shape { border: 2px solid currentColor; border-radius: 5px; opacity: .8; }
.s1 { background: linear-gradient(160deg, #2b1a3a, #a3324f 55%, #f0a35b); }
.s2 { background: radial-gradient(circle at 30% 30%, #fff6 0 18%, transparent 19%), linear-gradient(140deg, #5ec8f2, #7b6cf6); }
.s3 { background: linear-gradient(180deg, #d9c7ad, #8a6a4a); }
.s4 { background: repeating-linear-gradient(45deg, #ffe9c7 0 10px, #ffd59b 10px 20px); }

.p0 { display: grid; gap: 8px; padding: 0; }
.p0 li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #FDF1F0; list-style: none; font-size: 14.5px; }
.p0 li.p1 { background: #FFF6E5; }
.tag { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--danger); color: #fff; }
.p1 .tag { background: #D98A00; }
.p0 em, .groups em { font-style: normal; font-size: 12.5px; color: var(--muted-fg); white-space: nowrap; }
.groups { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.groups div { padding: 10px 12px; border-radius: 12px; background: var(--muted); font-size: 13.5px; }
.groups b { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.groups .rest { display: flex; align-items: center; justify-content: center; color: var(--muted-fg); grid-column: 1 / -1; background: none; border: 1px dashed var(--border); }
.acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn { padding: 10px 20px; border-radius: 12px; background: var(--acc); color: var(--acc-fg); font-weight: 600; font-size: 15px; transition: transform .15s, filter .2s; }
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn.line { background: none; border: 1px solid var(--border); color: var(--fg); font-weight: 500; }
.btn.line:hover { border-color: var(--acc); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.report { border-left: 4px solid var(--acc); }
.report dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14.5px; }
.report dt { color: var(--muted-fg); }

.rows { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14.5px; }
.rows dt { color: var(--muted-fg); }
.confirm { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft), 0 14px 34px -18px rgba(var(--acc-rgb), .6); }
.confirm.ok { border-color: var(--ok); box-shadow: 0 0 0 4px #E2F4E8; }
.okline { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; margin-top: 14px; }

.video { display: flex; gap: 16px; align-items: center; }
.poster { position: relative; flex: none; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #2b1a3a, #a3324f 55%, #f0a35b); display: grid; place-items: center; }
.poster::after { content: ''; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='%23302419'/%3E%3C/svg%3E") center/26px no-repeat; }
.poster i { position: absolute; left: 8px; bottom: 8px; font-style: normal; font-size: 12px; color: #fff; background: rgba(0, 0, 0, .45); padding: 0 6px; border-radius: 6px; }
.bar-p { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; margin-top: 10px; }
.bar-p i { display: block; height: 100%; width: 0; background: var(--acc); border-radius: inherit; transition: width .5s; }

.bind { display: flex; gap: 20px; align-items: center; }
.qr { flex: none; width: 132px; height: 132px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--border); position: relative; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr.ok::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: rgba(255, 255, 255, .92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23237C45' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/54px no-repeat; animation: rise .3s both; }
.jd { padding: 14px 16px; border-radius: 12px; background: var(--muted); font-size: 14.5px; white-space: pre-wrap; min-height: 120px; }
.caret::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 2px; background: var(--acc); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
.people { display: grid; gap: 8px; }
.people div { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--muted); font-size: 14.5px; }
.people span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc-ink); font-weight: 700; flex: none; }
.people em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--acc-ink); }

/* ---------- 输入框 ---------- */
.composer { position: relative; z-index: 4; margin: 0 auto 20px; width: min(720px, calc(100% - 32px)); background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 12px 12px 10px 16px; box-shadow: 0 16px 40px -22px rgba(120, 70, 20, .45); transition: border-color .3s, box-shadow .3s; }
.composer:focus-within { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft), 0 16px 40px -22px rgba(var(--acc-rgb), .5); }
.composer textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; font: inherit; font-size: 16px; color: inherit; background: none; min-height: 28px; max-height: 120px; }
.composer textarea::placeholder { color: #B5A594; }
.composer-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ghost { padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--acc-ink); background: var(--acc-soft); font-weight: 600; transition: background .4s, color .4s; }
.acct { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-fg); margin-right: auto; }
.online { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.send { width: 38px; height: 38px; border-radius: 50%; background: var(--acc); color: var(--acc-fg); display: grid; place-items: center; transition: background .4s, transform .15s; }
.send:hover { transform: scale(1.06); }
.send svg { width: 18px; height: 18px; }
.mention { position: absolute; left: 12px; bottom: calc(100% + 8px); width: 300px; padding: 6px; border-radius: 16px; background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 20px 50px -16px rgba(90, 50, 10, .35), 0 0 0 1px var(--border); animation: rise .2s both; }
.mention button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; font-size: 14.5px; text-align: left; }
.mention button:hover, .mention button.on { background: var(--acc-soft); }
.mention b { color: var(--acc-ink); }
.mention em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted-fg); }

/* ---------- 页面下半 ---------- */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 96px 0 48px; }
.trio h2 { padding: 44px 28px; border-radius: 28px; background: var(--side); border: 1px solid var(--border); font-size: clamp(22px, 2.5vw, 34px); line-height: 1.25; letter-spacing: -0.01em; text-align: center; }
.trio b { color: var(--brand-ink); }
.trio .c { color: #0B5E99; }
.cta { display: block; width: fit-content; margin: 0 auto; padding: 16px 38px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 18px; font-weight: 700; transition: transform .2s; }
.cta:hover { transform: translateY(-2px); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 860px) {
  .top { padding: 16px; }
  main { padding: 0 12px 64px; }
  .app { grid-template-columns: 1fr; height: 78svh; min-height: 540px; border-radius: 22px; }
  .side { display: none; }
  .main { margin: 6px; border-radius: 16px; }
  .gs button, .gs .thumb { width: 116px; height: 46px; }
  .thread { padding: 8px 14px 16px; }
  .opts.tiles { grid-template-columns: repeat(2, 1fr); }
  .groups { grid-template-columns: 1fr; }
  .bind, .video { flex-direction: column; align-items: flex-start; }
  .acct { font-size: 12px; }
  .trio { grid-template-columns: 1fr; margin-top: 56px; }
  .trio h2 { padding: 30px 20px; }
  .p0 li { grid-template-columns: auto 1fr; }
  .p0 em { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; transition-duration: .01s !important; } }

/* ---------- 方案页 ---------- */
.doc { max-width: 860px; margin: 0 auto; padding: 0 24px 96px; }
.doc h1 { text-align: left; font-size: clamp(34px, 5.4vw, 60px); margin: 5vh 0 20px; }
.doc .lead { font-size: 19px; color: var(--muted-fg); margin-bottom: 40px; }
.doc h2 { font-size: 26px; margin: 56px 0 16px; letter-spacing: -0.01em; }
.doc p, .doc li { font-size: 16px; }
.doc ul, .doc ol { padding-left: 22px; display: grid; gap: 8px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: table; }
.doc th, .doc td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.doc tr:last-child td { border-bottom: 0; }
.doc th { background: var(--side); font-weight: 600; white-space: nowrap; }
.doc .wrap { overflow-x: auto; }
.doc code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .88em; background: var(--muted); padding: 1px 6px; border-radius: 6px; }
.doc .verdict { padding: 22px 24px; border-radius: 20px; background: var(--side); border: 1px solid var(--border); font-size: 17px; }
.doc .warn { padding: 18px 22px; border-radius: 16px; background: #FDF1F0; border: 1px solid #F3CFCB; }
.doc .c { color: #0B5E99; font-weight: 700; }
.doc .a { color: var(--brand-ink); font-weight: 700; }
.phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.phases div { padding: 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); }
.phases b { display: block; font-size: 18px; margin-bottom: 8px; }
.phases ul { font-size: 15px; }
@media (max-width: 760px) { .phases { grid-template-columns: 1fr; } }
