/* Colours follow the hospital website's own interface: its greens, white, and its grey text and
   lines (docs/design/pumch-style-draft.html). Red is the one exception, used only to flag
   unanswered questions. */
:root {
  --accent: #01763a;         /* 协和绿：主按钮、选中、强调 */
  --accent-strong: #015128;  /* 深绿：顶栏 */
  --accent-mid: #2e9448;     /* 辅助绿：细边线、小图标 */
  --accent-soft: #c1ded0;    /* 浅绿：深绿底上的文字、进度条 */
  --bg: #ffffff;
  --card: #ffffff;
  --text: #333333;
  --text-2: #474747;
  --muted: #707070;
  --faint: #b2b2b2;
  --line: #cccccc;           /* 输入框、按钮边框 */
  --line-2: #dddddd;
  --line-3: #eeeeee;         /* 细分隔线 */
  --danger: #c0392b;
  --na: #707070;
  --radius: 10px;
  --shadow: 0 0 10px rgba(0, 0, 0, .1);
  --font: "Microsoft YaHei", "微软雅黑", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "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, select { 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: var(--line-3); color: var(--text-2); 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; font-weight: 600; margin: 22px 0 12px; }
.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: 74px; height: 74px; margin: 0 auto; border-radius: 50%; background: var(--accent); color: #fff; font-size: 36px; line-height: 74px;
  box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--accent-soft); }
.thank { text-align: center; font-size: 15px; }
.thank::before { content: ""; display: block; width: 36px; height: 3px; border-radius: 2px; background: var(--accent); margin: 4px auto 16px; }
.center-box .thank p { color: var(--text-2); }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--accent-strong); color: #fff; }
.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; color: #fff; }
.step-num { flex: none; font-size: 12px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; padding: 0 9px; line-height: 20px; }
.step-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caret { color: var(--accent-soft); font-size: 11px; }
.sync { flex: none; font-size: 12px; color: var(--accent-soft); }
.sync.offline, .sync.error { color: #fff; font-weight: 600; }
.progress { height: 3px; background: var(--accent); }
.progress i { display: block; height: 100%; background: var(--accent-soft); transition: width .3s; }
.menu { position: absolute; left: 0; right: 0; top: 100%; background: #fff; color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); 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-3); }
.menu-item.current { color: var(--accent); font-weight: 600; }
.menu-item:disabled { color: var(--faint); cursor: default; }
.menu-no { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 12px; font-weight: 400; text-align: center; line-height: 20px; }
.menu-item.current .menu-no { background: var(--accent); border-color: var(--accent); color: #fff; }
.menu-title { flex: 1; }
.menu-state { font-size: 12px; color: var(--muted); font-weight: 400; }
.menu-mask { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, .2); }

/* ---------------------------------------------------------------- page header */
.invite-hello { font-size: 15px; color: var(--accent); 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; font-weight: 600; margin: 0; flex: 1; min-width: 12em; }
.badge { flex: none; min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-weight: 600; font-size: 16px; border-radius: 8px; padding: 0 8px; }
.page-meta { flex: none; font-size: 13px; color: var(--muted); }
.title-rule { width: 36px; height: 3px; border-radius: 2px; background: var(--accent); margin-top: 14px; }
.page-hint { margin: 12px 0 0; font-size: 13px; color: var(--text-2); border: 1px solid var(--line-3); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 7px 12px; }

/* ---------------------------------------------------------------- elements */
.elements { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.el { width: 100%; min-width: 0; }
.el.w-half { width: calc(50% - 8px); }
.prose { color: var(--text-2); }
.prose p { margin: 0 0 .7em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0 0 .7em; padding-left: 1.3em; }
.prose strong { color: var(--text); }
.notice { border: 1px solid var(--line-3); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 10px 14px; font-size: 14px; }
.section-title { font-size: 17px; font-weight: 600; 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); }
/* Number tiles: deep green, green, white, repeating. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.stat { border-radius: var(--radius); padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff; background: var(--accent-strong); }
.stat:nth-child(3n+2) { background: var(--accent); }
.stat:nth-child(3n) { background: #fff; color: var(--text-2); border: 1px solid var(--line-2); }
.stat b { font: 300 26px/1.2 Arial, var(--font); }
.stat:nth-child(3n) b { color: var(--accent); }
.stat span { font-size: 12.5px; }
.info-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.info-item { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.info-item h4 { margin: 0 0 4px; font-size: 14px; color: var(--accent); }
.info-item p { margin: 0; font-size: 14px; color: var(--text-2); }

.q { background: var(--card); border: 1px solid transparent; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; transition: border-color .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 var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; outline: none; min-height: 40px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
textarea.input { resize: vertical; line-height: 1.5; }
.missing { border-color: var(--danger) !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 var(--line); 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); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.other-input { margin-top: 8px; }

/* dropdowns: native select for short lists, bottom-sheet search for long ones */
.select { display: block; max-width: 460px; text-align: left; cursor: pointer; -webkit-appearance: none; appearance: none; padding-right: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2301763a' stroke-width='1.7'/%3E%3C/svg%3E") no-repeat right 12px center / 12px 8px; }
.select.empty { color: var(--faint); }
select.select option { color: var(--text); }
.picker-btn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.rrow.dd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 4px 12px; padding: 6px; }
.picker-list { display: grid; gap: 6px; margin-top: 10px; max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.picker-item { text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; }
.picker-item.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.picker-item.na { color: var(--na); }
.picker-empty { color: var(--muted); font-size: 14px; text-align: center; margin: 12px 0; }

/* overview & guide */
.overview { display: grid; gap: 8px; }
.ov-row { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); 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; color: var(--text-2); }
.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-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.guide-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line-3); 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: var(--text-2); }
.guide-card li, .dim-questions li { margin: 2px 0; }
.dim-tip { margin: 8px 0 0; font-size: 13px; color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 6px; padding: 3px 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-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; color: var(--accent); font: 300 30px/1 Arial, var(--font); letter-spacing: -1px; }
.card-title { flex: 1; margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.card-code { flex: none; font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 7px; }
.card-details { margin: 0 0 10px; font-size: 13px; color: var(--text-2); border: 1px solid var(--line-3); border-radius: 8px; padding: 6px 10px; }
.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-mid); color: var(--accent); font: italic 700 10px/13px Georgia, serif; text-align: center; }
.dim-inline-tip { font-size: 12px; color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 8px; padding: 0 6px; }
.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 var(--line); border-radius: 8px; background: #fff; color: var(--text-2); font: 600 15px Arial, var(--font); transition: background .12s, border-color .12s, color .12s; }
.opt.na span { color: var(--na); font-size: 13px; }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt.on span { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt.na.on span { background: var(--text-2); border-color: var(--text-2); color: #fff; }
.card-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-3); }
.card-note label { flex: none; font-size: 13px; color: var(--muted); padding-top: 9px; }
.card-note textarea { min-height: 38px; }
.card-status { width: fit-content; margin: 8px 0 0 auto; font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 8px; }
.card-status.complete { color: var(--accent); border-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: #fff; box-shadow: 0 -2px 10px rgba(0, 0, 0, .08); 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 var(--line); background: #fff; color: var(--text); border-radius: 22px; padding: 10px 16px; min-height: 44px; }
.btn:disabled { color: var(--faint); border-color: var(--line-3); cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:active { background: var(--accent-strong); }
.btn.primary:disabled { opacity: .5; color: #fff; }
.btn.ghost { background: #fff; }
.btn.block { width: 100%; }

/* ---------------------------------------------------------------- dialogs */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .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; font-weight: 600; }
.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); 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-3); border-radius: 8px; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; background: rgba(51, 51, 51, .94); 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%; }
  .rrow.dd { grid-template-columns: 1fr; }
  .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; }
}
