:root {
  --bg: #f5f4f0;
  --card: #ffffff;
  --ink: #1c1f1d;
  --muted: #6b726e;
  --line: #e4e2db;
  --accent: #1f7a5c;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2ec;
  --danger: #c0392b;
  --danger-soft: #fbeceb;
  --shadow: 0 1px 2px rgba(20, 30, 25, .05), 0 8px 24px rgba(20, 30, 25, .06);
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111412;
    --card: #1a1e1c;
    --ink: #ecefed;
    --muted: #9aa39e;
    --line: #2b312e;
    --accent: #4cc596;
    --accent-ink: #06261a;
    --accent-soft: #183328;
    --danger: #ff7a6b;
    --danger-soft: #3a1d1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang HK", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; width: 100%; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--line);
}
.head-in { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .2px; color: var(--ink); text-decoration: none; }
.logo svg { width: 26px; height: 26px; }
.logo .mark-bg { fill: var(--accent); }
.logo .mark-fg { fill: var(--accent-ink); }

.lang { position: relative; }
.lang-btn, .lang-item {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}
.lang-btn { padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.lang-btn .chev { width: 10px; height: 10px; opacity: .6; }
.flag svg { display: block; width: 22px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(128, 128, 128, .35); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 160px; z-index: 40;
}
.lang-item { width: 100%; padding: 10px; border-radius: 8px; text-align: left; }
.lang-item:hover, .lang-item.on { background: var(--accent-soft); }
.lang-item .tick { margin-left: auto; color: var(--accent); }

.progress { padding: 0 0 8px; }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.prog-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.savestat.error { color: var(--danger); }

/* ---------- main ---------- */
main { flex: 1; padding: 20px 0 32px; }
body.has-nav main { padding-bottom: 110px; }
.page > * + * { margin-top: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; box-shadow: var(--shadow);
}
h1, h2, h3, p { margin: 0; }
.sec-title { font-size: 22px; line-height: 1.3; margin-bottom: 4px; }
.muted { color: var(--muted); }

/* welcome */
.hello { font-size: 15px; color: var(--muted); }
.proj { font-size: 26px; line-height: 1.3; margin: 6px 0 4px; }
.company { color: var(--muted); font-size: 15px; }
.intro {
  margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 10px 10px 0; white-space: pre-wrap; word-break: break-word;
}
.facts { display: grid; gap: 12px; margin-top: 18px; }
.fact { display: flex; gap: 12px; align-items: flex-start; }
.fact .ico {
  flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.fact b { display: block; font-size: 15px; }
.fact span { font-size: 14px; color: var(--muted); }

/* ---------- question ---------- */
.q { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow); scroll-margin-top: 140px; }
.q.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.q-title { font-size: 17px; line-height: 1.45; font-weight: 600; }
.q-title .req { color: var(--danger); margin-left: 4px; }
.q-help { color: var(--muted); font-size: 14px; margin-top: 4px; }
.q-body { margin-top: 12px; }
.q-body > * + * { margin-top: 10px; }
.q-err { color: var(--danger); font-size: 13.5px; margin-top: 8px; }
.sub-label { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }

.input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; appearance: none; -webkit-appearance: none;
}
textarea.input { resize: none; min-height: 96px; line-height: 1.55; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--muted); opacity: .7; }
.contact-grid { display: grid; gap: 10px; }
.contact-grid label { display: block; font-size: 13.5px; color: var(--muted); }
.contact-grid .input { margin-top: 4px; }

.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 48px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer;
}
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.opt span { flex: 1; word-break: break-word; }
.other-in { margin-top: 8px; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-size: 16px; font-weight: 600; min-height: 48px; padding: 0 20px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-block { width: 100%; }
.btn-voice { min-height: 44px; font-size: 15px; background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-voice.rec { background: var(--danger-soft); color: var(--danger); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.icon-btn {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted);
  font-size: 16px; cursor: pointer;
}
.icon-btn:hover { background: var(--line); }

.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--bg); border-top: 1px solid var(--line);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.navbar .wrap { display: flex; gap: 12px; }
.navbar .btn-primary { flex: 1; }
.navbar .btn:not(.btn-primary) { flex: none; min-width: 96px; }

/* ---------- voice ---------- */
.voice { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.voice-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.voice-hint { font-size: 13px; color: var(--muted); }
.rec-panel { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); }
.rec-panel .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--danger); min-width: 38px; }
.wave { flex: 1; min-width: 0; height: 36px; }
.rec-limit { flex: none; font-size: 12px; color: var(--muted); }
@keyframes pulse { 50% { opacity: .25; } }
.notice { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 14px; }
.notice.info { background: var(--accent-soft); color: var(--accent); }

.media-list { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.media-list:empty { display: none; }
.media-list { margin-top: 10px; }
.rec, .file {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg);
}
.rec-head, .file-head { display: flex; align-items: center; gap: 8px; }
.rec, .file, .tr { min-width: 0; }
.rec-audio { flex: 1 1 0; min-width: 0; width: 100%; max-width: 100%; height: 36px; }
.rec-label { flex: 1; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.file-name { flex: 1; min-width: 0; word-break: break-all; font-size: 14.5px; }
.file-size { flex: none; font-size: 12.5px; color: var(--muted); }
.up { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.up .bar { flex: 1; }
.rec-err { margin-top: 6px; font-size: 13.5px; color: var(--danger); display: flex; gap: 10px; align-items: center; }
.tr { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--card); font-size: 14.5px; }
.tr .tr-text { white-space: pre-wrap; word-break: break-word; }
.tr .tr-act { margin-top: 6px; display: flex; gap: 8px; }
.tr.pending, .tr.failed { color: var(--muted); font-size: 13.5px; }
.spin {
  display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- preview ---------- */
.pv-sec { font-size: 15px; font-weight: 700; color: var(--accent); margin: 8px 0 -6px; }
.pv-q { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.pv-q.invalid { border-color: var(--danger); }
.pv-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pv-title { font-size: 15px; font-weight: 600; }
.pv-title .req { color: var(--danger); margin-left: 3px; }
.ans { margin-top: 8px; display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.ans-text { white-space: pre-wrap; word-break: break-word; }
.ans-empty { color: var(--muted); font-size: 14px; }
.ans-line { word-break: break-word; }
.ans-line .lbl { color: var(--muted); font-size: 13.5px; margin-right: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 14.5px;
}
.pv-note { color: var(--muted); font-size: 14.5px; }

/* thanks / error / code */
.center { text-align: center; padding: 28px 20px; }
.big-ico {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.big-ico.warn { background: var(--danger-soft); color: var(--danger); }
.center h1 { font-size: 22px; margin-bottom: 6px; }
.center p { color: var(--muted); }
.center .btn { margin-top: 18px; }
.code-in { text-align: center; font-size: 24px; letter-spacing: 8px; margin-top: 18px; max-width: 260px; margin-left: auto; margin-right: auto; display: block; }
.code-in::placeholder { letter-spacing: 0; font-size: 16px; }
.contact-box { margin-top: 18px; text-align: left; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 6px; }
.contact-box h3 { font-size: 14px; color: var(--muted); font-weight: 600; }
.contact-box a { color: var(--accent); word-break: break-all; }
.contact-box .row { display: flex; gap: 10px; }
.contact-box .k { flex: none; width: 56px; color: var(--muted); font-size: 14px; }
.sub-h { font-size: 15px; font-weight: 700; margin-top: 8px; }

/* footer, toast */
footer { padding: 8px 0 calc(24px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 12.5px; text-align: center; }
body.has-nav footer { padding-bottom: 96px; }
footer p + p { margin-top: 4px; }
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  max-width: 88vw; padding: 10px 16px; border-radius: 10px; background: #222; color: #fff; font-size: 14px; text-align: center;
  box-shadow: var(--shadow);
}
.splash { text-align: center; color: var(--muted); padding: 60px 0; }

@media (min-width: 700px) {
  main { padding-top: 32px; }
  .card { padding: 28px 28px; }
  .q { padding: 22px 22px; }
}

/* ---------- /start 咨询入口 ---------- */
.start-intro { color: var(--muted); font-size: 15px; margin-top: 6px; }
.prod-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.prod {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  color: var(--ink); font: inherit; cursor: pointer; box-shadow: var(--shadow);
}
.prod:hover, .prod:focus-visible { border-color: var(--accent); outline: none; }
.prod .ico {
  flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.prod b { display: block; font-size: 16px; line-height: 1.4; }
.prod span.d { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.prod.alt { border-style: dashed; box-shadow: none; }
.chosen { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 15px; }
.chosen .link { font-weight: 400; }
.f-field > label, .f-field > .lbl { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 6px; }
.f-field .req { color: var(--danger); margin-left: 3px; }
.f-field + .f-field { margin-top: 16px; }
.f-hint { font-size: 13px; color: var(--muted); margin: -2px 0 8px; }
.f-err { color: var(--danger); font-size: 13.5px; margin-top: 6px; }
.start-submit { margin-top: 20px; }
.ts-box { margin-top: 16px; min-height: 0; }
.opts.row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts.row .opt { padding: 10px; justify-content: center; text-align: center; font-size: 15px; }
.opts.row .opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* ---------- 预报价卡片 ---------- */
.quote { padding: 0; overflow: hidden; }
.quote-head { padding: 16px 18px; background: var(--accent-soft); }
.quote-head h2 { font-size: 20px; color: var(--accent); }
.quote-head p { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.quote-body { padding: 6px 18px 16px; }
.qi { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.qi .nm { min-width: 0; }
.qi .nm b { display: block; font-size: 15.5px; line-height: 1.45; }
.qi .nm span { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.qi .amt { flex: none; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px; white-space: nowrap; }
.q-total { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 14px 0 4px; }
.q-total .lab { font-size: 15px; font-weight: 700; }
.q-total .amt { font-size: 20px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; text-align: right; }
.q-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.q-sec { margin-top: 14px; }
.q-sec h4 { margin: 0 0 4px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.q-sec .txt { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.q-sec.note .txt { padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.q-valid { margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.q-disc { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.quote .contact-box { margin-top: 14px; }

@media (min-width: 600px) {
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod.alt { grid-column: 1 / -1; }
}

/* ---------- 项目空间 ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; position: relative; padding: 9px 12px; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab .dot { display: inline-block; min-width: 8px; height: 8px; margin-left: 4px; border-radius: 8px; background: var(--danger); font-style: normal; font-size: 11px; line-height: 16px; color: #fff; vertical-align: 6px; }
.tab .dot:not(:empty) { min-width: 16px; height: 16px; padding: 0 4px; text-align: center; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--line); color: var(--muted); }
.badge.stage-dev, .badge.st-in_progress { background: var(--accent-soft); color: var(--accent); }
.badge.stage-delivered, .badge.st-done { background: var(--accent); color: var(--accent-ink); }
.badge.st-reviewing, .badge.st-scheduled { background: #fff3d6; color: #8a5a00; }
.badge.scope-extra { background: var(--danger-soft); color: var(--danger); }
.badge.scope-in { background: var(--accent-soft); color: var(--accent); }
@media (prefers-color-scheme: dark) { .badge.st-reviewing, .badge.st-scheduled { background: #3a2f12; color: #f0c36a; } }
.space-head .badge { margin-top: 6px; }
.alert { background: #fff3d6; color: #8a5a00; }
@media (prefers-color-scheme: dark) { .alert { background: #3a2f12; color: #f0c36a; } }
.alert .link { color: inherit; font-weight: 600; flex: none; }
.upd-time { font-size: 12.5px; color: var(--muted); }
.upd-body { white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.upd-link { margin-top: 10px; text-decoration: none; }
.req-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.req-no { font-weight: 700; color: var(--muted); }
.req-title { font-size: 17px; margin-top: 8px; }
.req-body { white-space: pre-wrap; word-break: break-word; margin-top: 4px; color: var(--ink); font-size: 15px; }
.req .media-list:empty { display: none; }
.q-actions { margin-top: 16px; }
.q-actions.two { display: flex; gap: 10px; }
.q-actions.two .btn { flex: 1; }
.q-decided { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--line); color: var(--muted); text-align: center; font-weight: 600; font-size: 14.5px; }
.q-decided.ok { background: var(--accent-soft); color: var(--accent); }
.spec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.md { font-size: 15.5px; line-height: 1.7; word-break: break-word; }
.md > * + * { margin-top: 10px; }
.md h3 { font-size: 18px; margin-top: 18px; }
.md h4 { font-size: 16.5px; margin-top: 16px; }
.md h5 { font-size: 15.5px; margin-top: 14px; }
.md ul, .md ol { padding-left: 22px; margin-bottom: 0; }
.md li + li { margin-top: 4px; }
.md code { background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.md pre { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; font-size: 13.5px; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0; padding: 2px 12px; border-left: 3px solid var(--accent); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line); }
.md a { color: var(--accent); }
.md-table { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--bg); }
