:root {
  color-scheme: light;
  --page: #ffffff;
  --soft: #f5f7f6;
  --ink: #1f2a26;
  --muted: #66736d;
  --line: #e4e9e6;
  --line-strong: #cfd8d3;
  --accent: #2f7a5c;
  --accent-dark: #225c45;
  --accent-soft: #eaf4ef;
  --accent-line: #8fc2aa;
  --warning: #7a5418;
  --caution: #fbf3e4;
  --danger: #b3363e;
  --text: -apple-system, BlinkMacSystemFont, "PingFang HK", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  /* 旧名称，后台和报告样式仍在使用 */
  --paper: var(--page);
  --leaf: var(--accent);
  --wash: var(--accent-soft);
  --ground: var(--page);
}

* { box-sizing: border-box; }
html { font: 16px/1.65 var(--text); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); overflow-wrap: anywhere; }
body.modal-open { overflow: hidden; }
[hidden] { display: none !important; }
p { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.35; font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 1.625rem; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button, input[type="radio"], input[type="checkbox"] { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input[type="text"], input[type="number"], input[type="search"], input[type="tel"], input[type="datetime-local"], select, textarea {
  display: block;
  min-height: 52px;
  min-width: 0;
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--page);
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
/* 勾选框和隐藏的选相片按钮用键盘选中时也要看得见。 */
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#tongue-photo:focus-visible + .record-actions label.button { outline: 2px solid var(--accent); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: #a3ada8; }
input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
textarea { resize: vertical; min-height: 84px; }
select { appearance: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 页面框架 */
.shell { width: min(100%, 560px); min-height: 100vh; margin-inline: auto; padding: 0 20px calc(24px + env(safe-area-inset-bottom)); }
/* 首页与感谢页 */
.welcome { display: grid; justify-items: center; gap: 10px; padding: 48px 0 8px; text-align: center; }
.welcome h1 { font-size: 1.75rem; }
.welcome > p { max-width: 22em; color: var(--muted); }
.intro-list { display: grid; gap: 10px; width: 100%; margin: 14px 0 0; padding: 0; list-style: none; text-align: left; }
.intro-list li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--page);
  color: var(--ink);
  font-size: .9375rem;
}
.intro-list li:nth-child(2) { border-left-color: #d29a3a; }
.intro-list li:nth-child(3) { border-left-color: #b9748a; }
.thanks {
  width: 100%;
  justify-items: stretch;
  padding-top: clamp(56px, 26vh, 220px);
  padding-top: max(clamp(56px, 26svh, 220px), env(safe-area-inset-top));
  overflow-wrap: break-word;
}
.thanks > * { justify-self: center; max-width: 100%; }
.thanks h1, .thanks > p { width: 100%; max-width: 20em; }
.thanks h1:focus { outline: none; }
.thanks-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.thanks-mark::after {
  content: "";
  width: 22px;
  height: 12px;
  border-left: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: translateY(-3px) rotate(-45deg);
}
#quiz > .status-card { margin-top: 16px; }

/* 进度 */
.quiz-form { margin-top: 0; }
.progress { position: sticky; top: 0; z-index: 2; margin: 0 -20px; padding: 12px 20px 10px; background: var(--page); border-bottom: 1px solid var(--line); }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: .8125rem; font-weight: 600; margin: 0 0 8px; }
.progress-track { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .3s; }
.page-heading { margin: 26px 0 4px; text-align: center; font-size: 1.5rem; }

/* 题目 */
.field {
  width: 100%;
  min-inline-size: 0;
  padding: 24px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.quiz-form > .field:last-of-type { border-bottom: 0; }
.field h2 { font-size: 1.0625rem; font-weight: 700; margin: 0 0 12px; }
.field-hint { color: var(--muted); font-size: .875rem; margin: -6px 0 12px; }
.field-error { color: var(--danger); font-size: .875rem; }
.field-error:empty, #list-status:empty { display: none; }
.field-error:not(:empty) { margin-top: 10px; }
.field.invalid h2 { color: var(--danger); }
.subfield.invalid input[type="text"], .subfield.invalid input[type="tel"], .subfield.invalid input[type="number"], .subfield.invalid textarea { border-color: var(--danger); }
.subfield.invalid .sub-label { color: var(--danger); }

/* 一道题有几个小项时：小标题、「可多選」「可不填」标记、数字后面的单位 */
.subfields { display: grid; gap: 20px; }
.sub-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 8px; color: var(--ink); font-size: .9375rem; font-weight: 600; line-height: 1.45; }
.sub-note { color: var(--muted); font-size: .8125rem; font-weight: 500; }
.optional-tag { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: .75rem; font-weight: 500; line-height: 1.75; letter-spacing: .02em; white-space: nowrap; }
.field h2 .optional-tag { margin-left: 8px; vertical-align: .12em; }
.input-unit { display: flex; align-items: center; gap: 10px; }
.input-unit input { flex: 1 1 auto; }
.unit { flex-shrink: 0; min-width: 2em; color: var(--muted); font-size: .9375rem; font-weight: 600; }
.field textarea { line-height: 1.55; }

/* 选项：等宽两列，长选项一行一个 */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choices.wide { grid-template-columns: minmax(0, 1fr); }
.choices.scale { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.choices.scale .choice span { justify-content: center; min-height: 44px; padding-inline: 4px; }
.choices.scale .choice span::before { display: none; }
.choices.scale .scale-labels { display: flex; grid-column: 1 / -1; justify-content: space-between; width: 100%; margin: -2px 0 0; }
.choice { position: relative; display: grid; min-width: 0; }
.choice span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--page);
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.choice span::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 1.5px solid #9aa8a1;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--page);
}
.choice input[type="checkbox"] + span::before { border-radius: 5px; }
.choice:hover span { border-color: var(--accent-line); }
.choice input:checked + span { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); }
.choice input:checked + span::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--page); }
.choice input[type="checkbox"]:checked + span::before { box-shadow: none; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.gender-choices .choice span { justify-content: center; min-height: 56px; font-size: 1rem; }

/* 舌头相片 */
.photo-preview img { display: block; max-width: min(100%, 240px); margin: 0 0 12px; border-radius: 12px; border: 1px solid var(--line); }
.photo-field .record-actions .button { flex: 1; }

/* 同意 */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 0;
  padding: 14px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--ink);
  font-size: .9375rem;
  cursor: pointer;
}
.consent.invalid { color: var(--danger); background: #fbeff0; }

/* 底部按钮 */
.form-nav, .report-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 0 -20px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--page);
  border-top: 1px solid var(--line);
}
.form-nav { display: grid; gap: 10px; grid-template-columns: 1fr 2fr; margin-top: 16px; }
.form-nav > :only-child { grid-column: 1 / -1; }
.button {
  min-height: 48px;
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  transition: background-color .15s, border-color .15s;
}
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.secondary { color: var(--accent-dark); border-color: var(--line-strong); background: var(--page); }
.secondary:hover { border-color: var(--accent-line); }
.button:disabled, .button.busy { opacity: .6; cursor: progress; }
label.button { cursor: pointer; }
.status-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--page);
  border-radius: 14px;
  text-align: center;
}
.status-card:empty { display: none; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


/* 首页的间距独立于答题页和完成页。 */
.welcome-intro {
  padding: clamp(28px, 7.5vw, 48px) 0 0;
}
.welcome-intro h1 {
  font-size: clamp(1.5625rem, 6.4vw, 1.75rem);
  line-height: 1.3;
}
.welcome-intro > p {
  max-width: 24em;
  font-size: .9375rem;
  line-height: 1.65;
  text-wrap: balance;
}
.keep-phrase { white-space: nowrap; }
.welcome-intro .intro-list {
  gap: 8px;
  margin-top: 10px;
}
.welcome-intro .intro-list li {
  padding: 11px 13px;
  line-height: 1.55;
  text-wrap: pretty;
}
.welcome-intro .intro-list li:last-child {
  text-wrap: balance;
}
.quiz-form--opening {
  margin-top: 22px;
}
.quiz-form--opening > .field {
  padding: 0;
  border-bottom: 0;
}
.quiz-form--opening .gender-choices .choice span {
  min-height: 52px;
}
.quiz-form--opening .consent {
  margin-top: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}
.quiz-form--opening .form-nav {
  position: static;
  margin: 18px 0 0;
  padding: 0;
  border-top: 0;
}

@media (max-width: 600px) {
  .shell.view-opening {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    min-height: 100dvh;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .shell.view-opening #quiz {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 24px;
  }
  .welcome-intro {
    flex: 1.25;
    grid-template-rows: auto auto 1fr;
    padding-top: max(clamp(32px, 6dvh, 54px), calc(14px + env(safe-area-inset-top)));
  }
  .welcome-intro .intro-list {
    grid-auto-rows: minmax(min-content, 1fr);
    gap: 10px;
    margin-top: 20px;
  }
  .welcome-intro .intro-list li {
    align-content: center;
    padding-block: 13px;
  }
  .quiz-form--opening {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    margin-top: 0;
  }
  .quiz-form--opening .consent,
  .quiz-form--opening .form-nav {
    margin-top: 0;
  }
}

@media (max-width: 600px) and (max-height: 660px) {
  .shell.view-opening #quiz { gap: 16px; }
  .welcome-intro {
    padding-top: max(20px, calc(10px + env(safe-area-inset-top)));
  }
  .welcome-intro .intro-list { gap: 6px; margin-top: 6px; }
  .welcome-intro .intro-list li { padding-block: 6px; }
  .quiz-form--opening { gap: 12px; }
  .quiz-form--opening .consent { padding: 10px 12px; }
}

/* 客户版报告 */
.report-content { display: grid; gap: 12px; padding: 16px 0; background: var(--page); }
.report-content section {
  display: grid;
  gap: 12px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--page);
}
.report-content .report-hero { color: #fff; background: var(--accent); border-color: var(--accent); padding: 24px 20px; }
.report-hero h1 { font-size: 2.25rem; }
.report-hero ul { color: #e6f3ec; }
.report-brand { font-size: .8125rem; letter-spacing: .08em; color: #d3eadf; }
.report-content .warnings { color: var(--warning); background: var(--caution); border-color: #ead7b4; }
.report-content ul { margin: 0; padding-inline-start: 1.2em; }
.report-content li + li { margin-top: 4px; }
.report-content .stack-item { display: grid; gap: 6px; }
.report-content .stack-item + .stack-item { padding-top: 12px; border-top: 1px solid var(--line); }
.report-content h3 { color: var(--accent-dark); }
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: grid; gap: 5px 8px; grid-template-columns: minmax(7em, 1fr) minmax(0, 2fr); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.meal-label { font-weight: 700; margin-right: 8px; }
.checklist label { display: flex; align-items: flex-start; gap: 9px; min-height: 44px; padding-block: 6px; cursor: pointer; }
.report-footer { display: grid; gap: 8px; padding: 10px 4px; color: var(--muted); font-size: .875rem; }
.report-actions .button { width: 100%; }
.overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: end;
  background: rgb(14 28 21 / 75%);
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.image-sheet { width: min(100%, 456px); max-height: 100%; overflow: auto; background: var(--page); border-radius: 14px; overscroll-behavior: contain; }
.image-sheet header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; background: var(--page); }
.image-sheet img { display: block; width: 100%; height: auto; -webkit-touch-callout: default; }

/* 顾问工作台：参考网易云音乐 / 飞书桌面端——浅灰侧栏、白色主区、品牌色只用在当前菜单和主要按钮 */
.admin-note { color: var(--muted); margin: 14px 0 12px; }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; }

body.wb {
  --wb-text: #1f2329;
  --wb-sub: #646a73;
  --wb-weak: #8f959e;
  --wb-line: #ebedf0;
  --wb-side: #f6f7f9;
  --wb-hover: #eff0f2;
  --wb-fill: #f5f6f7;
  --wb-border: #dfe1e5;
  --wb-brand: var(--accent);
  --wb-brand-dark: var(--accent-dark);
  color: var(--wb-text);
  background: #fff;
  font: 14px/1.57 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
}
.wb h1, .wb h2, .wb h3, .wb h4 { font-weight: 600; letter-spacing: 0; }
.wb svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wb-muted { color: var(--wb-sub); }
.wb-warn { color: #c2770c; }
.wb-danger { color: #d83931; }
.wb-strong { font-weight: 600; }

/* 侧栏 */
.wb-side { position: fixed; inset: 0 auto 0 0; z-index: 4; width: 208px; display: flex; flex-direction: column; gap: 4px; padding: 22px 12px 18px; background: var(--wb-side); }
.wb-logo { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font-size: 18px; font-weight: 600; line-height: 1.25; }
.wb-logo small { display: block; color: var(--wb-sub); font-size: 12px; font-weight: 400; letter-spacing: .04em; }
.wb-logo .seal { width: 30px; height: 30px; }
.wb-nav { display: grid; gap: 2px; }
.wb-nav button, .wb-side-link { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; color: var(--wb-text); background: none; border: 0; border-radius: 8px; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
.wb-nav button:hover, .wb-side-link:hover { background: var(--wb-hover); }
.wb-nav button.active { color: #fff; background: var(--wb-brand); font-weight: 500; }
.nav-count { margin-left: auto; color: var(--wb-weak); font-size: 12px; }
.wb-nav button.active .nav-count { color: rgb(255 255 255 / 80%); }
.wb-side-link { margin-top: auto; color: var(--wb-sub); font-size: 14px; }

/* 主区域 */
.wb-main { min-height: 100vh; margin-left: 208px; padding: 0 32px 48px; }
.wb-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; background: #fff; }
.wb-top h1 { font-size: 20px; }
.wb-search { display: flex; align-items: center; gap: 8px; width: 280px; height: 36px; padding: 0 14px; color: var(--wb-weak); background: var(--wb-fill); border-radius: 999px; }
.wb-search:focus-within { box-shadow: 0 0 0 2px var(--accent-soft); }
.wb .wb-search input { flex: 1; min-width: 0; height: 34px; min-height: 0; padding: 0; color: var(--wb-text); background: none; border: 0; font-size: 14px; }
.wb .wb-search input:focus { outline: none; }
.wb-status { margin: -4px 0 12px; color: var(--wb-sub); font-size: 13px; }
.wb-status:empty { display: none; }

/* 按钮 */
.wb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 16px; color: var(--wb-text); background: #fff; border: 1px solid var(--wb-border); border-radius: 999px; font-size: 14px; font-weight: 400; text-decoration: none; white-space: nowrap; cursor: pointer; }
.wb-btn:hover { background: var(--wb-fill); }
.wb-btn.primary { color: #fff; background: var(--wb-brand); border-color: var(--wb-brand); }
.wb-btn.primary:hover { background: var(--wb-brand-dark); }
.wb-btn.small { height: 28px; padding: 0 12px; font-size: 13px; }
.wb-btn.link { height: auto; margin-top: 6px; padding: 0; color: var(--wb-brand-dark); background: none; border: 0; }
.wb-btn:disabled { opacity: .5; cursor: default; }
.wb-icon-button { display: grid; place-items: center; width: 32px; height: 32px; color: var(--wb-sub); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.wb-icon-button:hover { background: var(--wb-hover); }

/* 状态圆点 */
.wb [data-status] { --dot: #b0b5bb; }
.wb [data-status="未联络"] { --dot: #f5a623; }
.wb [data-status="已联络"] { --dot: #3370ff; }
.wb [data-status="已预约"] { --dot: #7f3bf5; }
.wb [data-status="已到店"] { --dot: #14a9a0; }
.wb [data-status="已成交"] { --dot: var(--wb-brand); }
.wb-status-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--wb-sub); font-size: 13px; white-space: nowrap; }
.wb-status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.wb-intent { color: var(--wb-weak); font-weight: 600; }
.wb-intent.intent-高 { color: var(--wb-brand); }
.wb-intent.intent-中 { color: var(--wb-text); }
.wb .wb-select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  height: 28px;
  min-height: 28px;
  padding: 0 26px 0 22px;
  color: var(--wb-text);
  background-color: var(--wb-fill);
  background-image: radial-gradient(circle at 12px 50%, var(--dot) 3.5px, transparent 4px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238f959e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 0, right 9px center;
  background-size: auto, 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.wb .wb-select:hover { border-color: var(--wb-border); }

/* 工作台首页 */
.wb-greeting { margin: 0 0 16px; color: var(--wb-sub); }
.wb-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.wb-kpi { display: grid; gap: 4px; padding: 16px 18px; color: inherit; text-align: left; background: var(--wb-fill); border: 0; border-radius: 12px; cursor: pointer; }
.wb-kpi:hover { background: var(--wb-hover); }
.wb-kpi:first-child { color: #fff; background: var(--wb-brand); }
.wb-kpi:first-child:hover { background: var(--wb-brand-dark); }
.wb-kpi-label { color: var(--wb-sub); font-size: 13px; }
.wb-kpi:first-child .wb-kpi-label { color: rgb(255 255 255 / 82%); }
.wb-kpi-value { font-size: 28px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.wb-columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.wb-column { display: grid; gap: 28px; }
.wb-panel-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.wb-panel-head h2 { font-size: 17px; }
.wb-count { color: var(--wb-weak); font-size: 13px; font-variant-numeric: tabular-nums; }
.wb-tasks { margin: 0; padding: 0; list-style: none; }
.wb-task { display: flex; align-items: center; gap: 12px; min-height: 58px; margin: 0 -12px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.wb-task:hover { background: var(--wb-fill); }
.wb-task-main { display: grid; flex: 1; min-width: 0; }
.wb-task-main strong { font-size: 15px; font-weight: 500; }
.wb-task-main span { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.wb-task-actions { display: flex; flex-shrink: 0; gap: 8px; }
.wb-tasks.compact .wb-task { min-height: 50px; }
.wb-time { flex-shrink: 0; width: 8.5em; color: var(--wb-sub); font-size: 13px; font-variant-numeric: tabular-nums; }
.wb-time.today { color: var(--wb-brand-dark); font-weight: 600; }
.wb-empty { padding: 18px 0; color: var(--wb-weak); font-size: 13px; }

/* 客人列表 */
.wb-tabs { display: flex; gap: 26px; margin-bottom: 6px; border-bottom: 1px solid var(--wb-line); }
.wb-tab { position: relative; padding: 6px 0 12px; color: var(--wb-sub); background: none; border: 0; font-size: 15px; white-space: nowrap; cursor: pointer; }
.wb-tab:hover { color: var(--wb-text); }
.wb-tab-count { margin-left: 4px; color: var(--wb-weak); font-size: 12px; }
.wb-tab[aria-selected="true"] { color: var(--wb-text); font-weight: 600; }
.wb-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 22px; height: 3px; background: var(--wb-brand); border-radius: 3px; transform: translateX(-50%); }
.wb .table-wrap { overflow-x: auto; }
.wb-table { width: 100%; min-width: 960px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.wb-table th { height: 40px; padding: 0 12px; text-align: left; color: var(--wb-weak); font-size: 13px; font-weight: 400; white-space: nowrap; }
.wb-table td { height: 52px; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.wb-table tbody tr { cursor: pointer; }
.wb-table tbody tr:nth-child(odd) td { background: #fafafa; }
.wb-table tbody tr:hover td { background: var(--wb-hover); }
.wb-table tbody td:first-child { border-radius: 8px 0 0 8px; }
.wb-table tbody td:last-child { border-radius: 0 8px 8px 0; }
.wb-link { color: var(--wb-text); text-decoration: none; font-variant-numeric: tabular-nums; }
.wb-link:hover { color: var(--wb-brand-dark); text-decoration: underline; }
.wb-mobile-list { display: none; margin: 0; padding: 0; list-style: none; }
.is-empty .table-wrap, .is-empty .wb-mobile-list { display: none; }

/* 跟进看板 */
.wb-board { display: grid; grid-auto-columns: minmax(220px, 1fr); grid-auto-flow: column; gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.wb-lane { padding: 12px; background: var(--wb-fill); border-radius: 12px; }
.wb-lane-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; }
.wb-lane-head .wb-status-dot { color: var(--wb-text); font-size: 14px; font-weight: 600; }
.wb-lane-body { display: grid; gap: 8px; }
.wb-lane-body .wb-empty { padding: 8px 4px; }
.wb-card { display: grid; gap: 3px; padding: 12px; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgb(31 35 41 / 6%); cursor: pointer; }
.wb-card:hover { box-shadow: 0 2px 10px rgb(31 35 41 / 10%); }
.wb-card p { font-size: 13px; }
.wb-card-top { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.wb-card-top strong { font-weight: 500; }
.wb-card .wb-select { justify-self: start; margin-top: 6px; }

/* 右侧详情抽屉 */
.wb-drawer { position: fixed; inset: 0; z-index: 10; }
.wb-drawer-mask { position: absolute; inset: 0; background: rgb(31 35 41 / 30%); }
.wb-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(560px, 100%); background: #fff; box-shadow: -8px 0 24px rgb(31 35 41 / 12%); }
.wb-drawer-head { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 14px 0 24px; border-bottom: 1px solid var(--wb-line); }
.wb-drawer-head h2 { font-size: 16px; }
.wb-drawer-body { display: grid; flex: 1; align-content: start; gap: 16px; overflow-y: auto; padding: 20px 24px 40px; }
body.drawer-open { overflow: hidden; }
.wb-detail-head { display: grid; gap: 2px; }
.wb-detail-title { display: flex; align-items: center; gap: 12px; }
.wb-detail-title h2 { font-size: 22px; }
.wb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wb-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin: 0; padding: 14px 16px; background: var(--wb-fill); border-radius: 10px; }
.wb-info dt { color: var(--wb-weak); font-size: 12px; }
.wb-info dd { margin: 0; overflow-wrap: anywhere; }
.wb-section { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--wb-line); }
.wb-section-title { font-size: 15px; }
.wb-section h4 { margin-top: 4px; color: var(--wb-sub); font-size: 13px; font-weight: 500; }
.wb-section .wb-info { grid-template-columns: minmax(0, 1fr); padding: 0; background: none; }
.wb-section .wb-btn.small { justify-self: start; }
.wb-bullets { margin: 0; padding-left: 1.2em; }
.wb-bullets li + li { margin-top: 4px; }
.wb-quote { margin: 0; padding: 12px 14px; background: var(--wb-fill); border-radius: 10px; }
.wb-intent-line { display: flex; align-items: baseline; gap: 8px; }
.wb-photo { display: block; width: 100%; max-width: 280px; border-radius: 10px; }
.wb-fold { padding-top: 14px; border-top: 1px solid var(--wb-line); }
.wb-fold summary { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; list-style: none; cursor: pointer; }
.wb-fold summary::-webkit-details-marker { display: none; }
.wb-fold summary::after { content: "展开"; color: var(--wb-brand-dark); font-size: 13px; font-weight: 400; }
.wb-fold[open] summary::after { content: "收起"; }
.wb-fold[open] > :not(summary) { margin-top: 12px; }
.wb-fold pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 12px/1.5 ui-monospace, Menlo, monospace; }
.wb .facts { gap: 8px; font-size: 14px; }
.wb .facts div { grid-template-columns: 7em minmax(0, 1fr); }
.wb .report-content { padding: 0; }
.wb-form { display: grid; gap: 12px; }
.wb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wb-field { display: grid; gap: 4px; }
.wb-field label { color: var(--wb-sub); font-size: 13px; }
.wb .wb-input { min-height: 36px; padding: 6px 10px; border: 1px solid var(--wb-border); border-radius: 8px; font-size: 14px; }
.wb .wb-input:focus { border-color: var(--wb-brand); }
.wb .wb-field .wb-select { width: 100%; height: 36px; min-height: 36px; padding-left: 24px; background-color: #fff; border-color: var(--wb-border); border-radius: 8px; font-size: 14px; }
.wb-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }

/* 手机底部菜单 */
.wb-tabbar { display: none; }

@media (max-width: 820px) {
  .wb-side { display: none; }
  .wb-main { margin-left: 0; padding: 0 16px calc(76px + env(safe-area-inset-bottom)); }
  .wb-top { height: 56px; }
  .wb-top h1 { font-size: 18px; }
  .wb-search { flex: 1; width: auto; max-width: 220px; }
  .wb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
  .wb-kpi { padding: 14px; }
  .wb-columns { display: flex; flex-direction: column; gap: 24px; }
  .wb-column { display: contents; }
  .p-waiting { order: 1; }
  .p-upcoming { order: 2; }
  .p-problems { order: 3; }
  .p-recent { order: 4; }
  .wb-task { margin: 0 -8px; padding: 8px; }
  .wb-tabs { gap: 20px; overflow-x: auto; scrollbar-width: none; }
  .wb .table-wrap { display: none; }
  .wb-mobile-list { display: block; }
  .wb-mobile-list li + li { border-top: 1px solid var(--wb-line); }
  .wb-mobile-item { display: grid; gap: 3px; width: 100%; padding: 12px 0; color: inherit; text-align: left; background: none; border: 0; font-size: 14px; }
  .wb-mobile-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; }
  .wb-mobile-row > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wb-mobile-row strong { font-size: 16px; font-weight: 500; }
  .wb-mobile-row.wb-muted { font-size: 13px; }
  .wb-board { grid-auto-columns: 78%; }
  .wb-tabbar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 5; display: flex; height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgb(255 255 255 / 96%); border-top: 1px solid var(--wb-line); }
  .wb-tabbar button { display: grid; flex: 1; align-content: center; justify-items: center; gap: 2px; color: var(--wb-weak); background: none; border: 0; font-size: 11px; }
  .wb-tabbar button svg { width: 22px; height: 22px; }
  .wb-tabbar button.active { color: var(--wb-brand); }
  .wb-drawer-panel { width: 100%; }
  .wb-drawer-head { padding-left: 16px; }
  .wb-drawer-body { padding: 16px 16px 40px; }
  .wb-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-form-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .shell { padding-inline: 14px; }
  .progress, .form-nav, .report-actions { margin-inline: -14px; padding-inline: 14px; }
  .choices:not(.gender-choices):not(.scale) { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
