:root {
  --accent: #2b7a6e;
  --accent-strong: #1f5f55;
  --accent-weak: #e7f2ef;
  --accent-line: #c9e2dc;
  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #1d2a28;
  --muted: #687876;
  --line: #e1e8e6;
  --danger: #c2412d;
  --danger-weak: #fdf0ed;
  --na: #8a9593;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 40, 36, .06), 0 2px 10px rgba(20, 40, 36, .04);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); }
[v-cloak] { display: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- layout */
.shell { min-height: 100vh; }
.preview-banner { background: #fff4d6; color: #7a5a00; text-align: center; font-size: 13px; padding: 6px 12px; }
.page { max-width: 880px; margin: 0 auto; padding: 20px 16px 120px; }
.center-box { max-width: 520px; margin: 0 auto; padding: 72px 20px; text-align: center; }
.center-box h1 { font-size: 22px; margin: 12px 0; }
.center-box p { color: var(--muted); }
.btn-col { display: grid; gap: 10px; margin-top: 24px; }
.prompt-lead { font-size: 17px; color: var(--text) !important; margin-top: 28px; }
.prompt-meta { font-size: 14px; }
.done-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--accent); color: #fff; font-size: 34px; line-height: 64px; }
.thank { text-align: center; font-size: 16px; }
.center-box .thank p { color: var(--text); }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.topbar-inner { max-width: 880px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
.step-btn { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; border: 0; background: none; padding: 4px 0; text-align: left; }
.step-num { flex: none; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-weak); border-radius: 999px; padding: 1px 8px; }
.step-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caret { color: var(--muted); font-size: 12px; }
.sync { flex: none; font-size: 12px; color: var(--muted); }
.sync.offline, .sync.error { color: var(--danger); }
.progress { height: 3px; background: var(--line); }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.menu { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); max-height: 70vh; overflow: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 880px; margin: 0 auto; padding: 12px 16px; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line); }
.menu-item.current { background: var(--accent-weak); }
.menu-item:disabled { color: #b5bfbd; cursor: default; }
.menu-no { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--line); font-size: 12px; text-align: center; line-height: 22px; }
.menu-item.current .menu-no { background: var(--accent); color: #fff; }
.menu-title { flex: 1; }
.menu-state { font-size: 12px; color: var(--muted); }
.menu-mask { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, .15); }

/* ---------------------------------------------------------------- page header */
.invite-hello { font-size: 15px; color: var(--accent-strong); margin-bottom: 8px; }
.page-head { margin: 8px 0 20px; }
.eyebrow { font-size: 13px; color: var(--accent); letter-spacing: .04em; margin-bottom: 6px; }
.page-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title-row h1 { font-size: 24px; line-height: 1.35; margin: 0; flex: 1; min-width: 12em; }
.badge { flex: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 18px; border-radius: 10px; padding: 6px 12px; }
.page-meta { flex: none; font-size: 13px; color: var(--muted); }
.page-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- elements */
.elements { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.el { width: 100%; min-width: 0; }
.el.w-half { width: calc(50% - 8px); }
.prose p { margin: 0 0 .7em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0 0 .7em; padding-left: 1.3em; }
.notice { background: var(--accent-weak); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.section-title { font-size: 17px; margin: 14px 0 0; padding-left: 10px; border-left: 4px solid var(--accent); line-height: 1.3; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section-title small { font-size: 12px; font-weight: 400; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: baseline; gap: 6px; }
.stat b { font-size: 24px; color: var(--accent); }
.stat span { font-size: 13px; color: var(--muted); }
.info-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.info-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.info-item h4 { margin: 0 0 4px; font-size: 14px; color: var(--accent-strong); }
.info-item p { margin: 0; font-size: 14px; color: #3b4a48; }

.q { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; transition: border-color .2s, background .2s; }
.q.field { padding: 10px 14px 12px; }
.q-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.q-desc { font-size: 13px; color: var(--muted); margin: -2px 0 8px; }
.q-hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.req { color: var(--danger); margin-left: 3px; }
.input { width: 100%; border: 1px solid #cfd9d7; border-radius: 8px; padding: 9px 11px; background: #fff; outline: none; min-height: 40px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43, 122, 110, .15); }
textarea.input { resize: vertical; line-height: 1.5; }
.missing { border-color: var(--danger) !important; background: var(--danger-weak) !important; }
.q.missing .q-label::after, .rrow.missing .rrow-label::after { content: "请完成此项"; color: var(--danger); font-size: 12px; font-weight: 400; margin-left: 8px; }

.choices { display: grid; gap: 8px; }
.choices.inline { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.choice { display: flex; align-items: center; gap: 10px; border: 1px solid #cfd9d7; border-radius: 8px; padding: 10px 12px; background: #fff; }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.choice.on { border-color: var(--accent); background: var(--accent-weak); }
.other-input { margin-top: 8px; }

/* overview & guide */
.overview { display: grid; gap: 8px; }
.ov-row { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.ov-badge { flex: none; color: var(--accent); font-weight: 700; width: 28px; }
.ov-title { flex: 1; }
.ov-count { flex: none; font-size: 13px; color: var(--muted); }
.guide-intro { margin: 10px 0 12px; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(var(--rows, 3), auto); grid-auto-flow: column; gap: 12px; }
.guide-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.guide-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 6px; }
.guide-head h4 { margin: 0; font-size: 16px; }
.guide-head span { font-size: 12px; color: var(--accent); }
.guide-card ol, .dim-questions { margin: 0; padding-left: 1.4em; font-size: 14px; color: #3b4a48; }
.guide-card li, .dim-questions li { margin: 2px 0; }
.dim-tip { margin: 8px 0 0; font-size: 13px; color: var(--accent-strong); background: var(--accent-weak); border-radius: 6px; padding: 4px 10px; }
.guide-footer { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- rating cards */
.cards { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 12px; position: relative; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-no { flex: none; background: var(--accent-weak); color: var(--accent-strong); font-weight: 700; border-radius: 8px; padding: 2px 9px; font-size: 15px; }
.card-title { flex: 1; margin: 0; font-size: 17px; line-height: 1.35; }
.card-code { flex: none; font-size: 12px; color: var(--muted); }
.card-details { margin: 0 0 10px; font-size: 13px; color: #4a5957; }
.card-details div { display: flex; gap: 2px; margin: 2px 0; }
.card-details dt { flex: none; color: var(--muted); }
.card-details dt:not(:empty)::after { content: "："; }
.card-details dd { margin: 0; }
.rrows { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, auto); grid-auto-flow: column; gap: 6px 24px; }
.rrows.matrix { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
.rrow { border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin: 0 -6px; }
.rrow-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 26px; }
.dim-btn { border: 0; background: none; padding: 0; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.dim-btn:hover, .dim-btn:focus-visible { color: var(--accent); }
.info-dot { display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); font: italic 700 10px/13px Georgia, serif; text-align: center; }
.dim-inline-tip { font-size: 12px; color: var(--accent); }
.row-text { font-size: 14px; font-weight: 600; }
.opts { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 6px; margin-top: 4px; }
.opt { position: relative; display: block; }
.opt input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; justify-content: center; height: 38px; border: 1px solid #cfd9d7; border-radius: 8px; background: #fff; font-weight: 600; font-size: 15px; transition: background .12s, border-color .12s, color .12s; }
.opt.na span { color: var(--na); font-size: 13px; }
.opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(43, 122, 110, .25); }
.opt.on span { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt.na.on span { background: #6f7b79; border-color: #6f7b79; color: #fff; }
.card-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.card-note label { flex: none; font-size: 13px; color: var(--muted); padding-top: 9px; }
.card-note textarea { min-height: 38px; }
.card-status { position: static; margin-top: 8px; font-size: 12px; color: var(--muted); text-align: right; }
.card-status.complete { color: var(--accent); }
.footnote { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- bottom bar */
.navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.navbar-inner { max-width: 880px; margin: 0 auto; padding: 10px 16px; display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; }
.btn { border: 1px solid #cdd8d6; background: #fff; border-radius: 10px; padding: 10px 16px; font-weight: 600; min-height: 44px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-strong); }
.btn.ghost { background: #fff; }
.btn.block { width: 100%; }

/* ---------------------------------------------------------------- dialogs */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 25, 23, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet { width: 100%; max-width: 440px; background: #fff; border-radius: 16px; padding: 18px 18px 16px; max-height: 90vh; overflow: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h3 { margin: 0; font-size: 18px; }
.icon-btn { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); padding: 0 4px; }
.sheet-sub { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.sheet-error { color: var(--danger); font-size: 14px; }
.dim-questions { margin-bottom: 12px; font-size: 15px; }
.sheet .btn.block { margin-top: 14px; }
.save-ok { color: var(--accent-strong); font-weight: 600; margin: 4px 0; }
.link-row { display: flex; gap: 8px; }
.link-row .input { font-size: 13px; }
.link-row .btn { flex: none; white-space: nowrap; }
.qr-wrap { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.qr-wrap img { border: 1px solid var(--line); border-radius: 8px; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; background: rgba(25, 35, 33, .92); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); text-align: center; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .page { padding: 16px 12px 112px; }
  .page-title-row h1 { font-size: 20px; }
  .el.w-half { width: 100%; }
  .rrows, .guide-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
  .card { padding: 12px 12px 10px; }
  .card-title { font-size: 16px; }
  .opt span { height: 40px; }
  .card-note { flex-direction: column; gap: 4px; }
  .card-note label { padding-top: 0; }
  .navbar-inner { padding: 8px 12px; gap: 8px; }
  .sheet { align-self: flex-end; border-radius: 16px 16px 0 0; margin: 0 -16px -16px; max-width: none; width: calc(100% + 32px); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .qr-wrap { display: none; }
}
