/* 设计系统迁移自 F:\Codex06.25\overseas-pwa\styles.css（浅色主题+品牌绿，与真实小程序视觉一致）。
   不是逐字拷贝——class结构按本项目SPA（public/app.js）实际生成的HTML重新组织，但沿用同一套设计token和交互模式：
   sticky毛玻璃topbar、卡片网格、进度分段条、圆点配额指示器、bottom-bar固定操作栏、toast提示、verdict主题色。 */
:root {
  color-scheme: light;
  --green: #1aad19;
  --green-dark: #138f13;
  --ink: #202124;
  --muted: #6f7377;
  --line: #e4e7e2;
  --page: #f7f8f6;
  --panel: #ffffff;
  --soft: #eef7ee;
  --red: #d94f3d;
  --gray: #777777;
  --blue: #1976d2;
  --gold: #c99722;
}

* { box-sizing: border-box; }

html {
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

.shell {
  width: min(960px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 16px 110px;
}

/* ---- topbar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -22px -16px 18px;
  padding: 14px 16px;
  background: rgba(247, 248, 246, .94);
  border-bottom: 1px solid rgba(228, 231, 226, .86);
  backdrop-filter: blur(14px);
}

.brand { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font-size: 18px; font-weight: 900; }
.brand-sub { margin-top: 3px; color: var(--muted); font-size: 12px; }

.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.nav button, .lang-btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
  padding: 0 12px;
}

.nav button.active, .lang-btn.active {
  border-color: rgba(26, 173, 25, .35);
  background: var(--soft);
  color: var(--green-dark);
}

/* ---- hero / notice ---- */
.hero { padding: 10px 2px 22px; }
.hero h1 { margin: 0; font-size: 32px; line-height: 1.16; letter-spacing: 0; }
.hero p { margin: 10px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(26, 173, 25, .22);
  border-radius: 8px;
  background: rgba(26, 173, 25, .06);
  color: #315a31;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ---- generic card / grid ---- */
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.card.clickable { cursor: pointer; text-align: left; width: 100%; }
.card.clickable:hover { border-color: rgba(26, 173, 25, .38); }
.card.clickable:active { opacity: .85; }

.muted { display: block; color: var(--muted); font-size: 13px; line-height: 1.6; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.dimension-card {
  display: grid;
  grid-template-columns: 44px 1fr 20px;
  gap: 12px;
  align-items: center;
  min-height: 116px;
  padding: 18px;
}

.dimension-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft);
  font-size: 24px;
}

.dimension-name, .section-title { display: block; font-size: 18px; font-weight: 900; }
.dimension-desc, .section-desc { display: block; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.arrow { color: #9aa09b; font-size: 26px; justify-self: end; }

/* ---- quota ---- */
.quota { display: grid; gap: 12px; margin: 18px 0; }
.quota-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quota-title { font-weight: 900; }
.quota-count { color: var(--green-dark); font-size: 24px; font-weight: 900; }
.dots { display: flex; gap: 8px; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); }
.dot.used { background: #d3d7d1; }

/* ---- section headers ---- */
.section-head { margin: 4px 0 16px; }
.section-kicker, .label { color: var(--green-dark); font-size: 12px; font-weight: 900; }
.section-title.big { margin-top: 6px; font-size: 22px; }

/* ---- scene picker ---- */
.scene-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.scene-btn {
  max-width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}
.scene-btn.active { border-color: var(--green); background: var(--soft); color: var(--green-dark); }

.fit-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fit-tag { border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; color: var(--muted); }

.detail-panel, .question-card, .result-main, .history-panel { padding: 18px; }
.detail-title { margin-top: 6px; font-size: 20px; font-weight: 900; }
.detail-body { margin-top: 10px; color: var(--muted); line-height: 1.75; }

/* ---- calm/prep page: 文案在topbar和bottom-bar之间的可用空间内水平+垂直居中，
   而不是只用margin-top把文案钉在顶部、下方留一大片空白 ---- */
.calm-center {
  min-height: calc(100vh - 230px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- bottom action bar ---- */
.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  width: min(960px, 100%);
  transform: translateX(-50%);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(247, 248, 246, .96);
  border-top: 1px solid rgba(228, 231, 226, .9);
  backdrop-filter: blur(14px);
}

.primary-btn, .secondary-btn, .danger-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 900;
}

/* .bottom-bar 里始终只有单个 primary-btn（config/calm/quiz 三处用法一致，见 app.js），
   宽视口下把它撑满整个960px内容列宽度会显得异常拉长；桌面端收窄并居中，
   移动端（<=720px）保持满宽，因为满宽大按钮在移动端是有意的大触控目标设计 */
.bottom-bar .primary-btn {
  max-width: 420px;
  margin: 0 auto;
  display: block;
}

/* 参照上面 .bottom-bar .primary-btn 同样的理由：真实小程序只在手机宽度渲染，
   "清空历史"按钮 width:100% 天然就是手机宽度；网页版桌面宽视口下 100% 会撑成异常长条，
   同样需要收窄居中，这里之前漏做了（只给 bottom-bar 场景做过，没横向检查其他 width:100% 按钮） */
.history-actions .danger-btn { max-width: 420px; margin: 0 auto; display: block; }

.primary-btn { background: var(--green); color: #fff; }
.primary-btn:disabled { background: #cfd6cf; color: #fff; cursor: not-allowed; }
.secondary-btn { border: 1px solid rgba(26, 173, 25, .35); background: var(--soft); color: var(--green-dark); }
.danger-btn { border: 1px solid rgba(217, 79, 61, .32); background: #fff3f1; color: var(--red); }

/* 通用点击态：之前所有按钮类元素只有:hover（部分连hover都没有），完全没有:active——
   鼠标/手指按下的瞬间没有任何视觉反馈，用户点了以后不确定有没有点中。这里给全站按钮类元素
   统一补上按下时轻微缩小+变暗的反馈，:disabled元素排除在外（它们本来就不该有可点击的视觉暗示） */
.primary-btn:not(:disabled):active,
.secondary-btn:not(:disabled):active,
.danger-btn:not(:disabled):active,
.remark-btn:not(:disabled):active,
.filter-chip:active,
.scene-btn:active,
.nav button:active,
.lang-btn:active,
.history-item:active,
.dimension-card:active,
.help-item-head:active,
.fb-btn:active {
  transform: scale(.97);
  opacity: .85;
}
.bottom-hint { margin-top: 8px; color: var(--muted); font-size: 12px; text-align: center; }

/* ---- quiz ---- */
.quiz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 850;
}
.progress-text { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }

.segments { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; margin: 12px 0 16px; }
.segment { height: 8px; border-radius: 8px; background: #e1e5df; }
.segment.done { background: var(--green); }
.segment.current { background: #94d894; }
.segment.skipped { background: #f2c15c; }

.question { margin: 10px 0 18px; font-size: 22px; font-weight: 900; line-height: 1.45; }

.option {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.option.selected { border-color: var(--green); background: var(--soft); }
.option-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #edf0eb;
  color: #59615a;
  font-weight: 900;
}
.option.selected .option-mark { background: var(--green); color: #fff; }
.option-text { line-height: 1.55; }

.inline-actions, .result-actions, .history-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.inline-actions button, .result-actions button, .history-actions button { flex: 1; min-width: 140px; }
.skip-link { color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }

/* ---- result ---- */
.result-header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.verdict { padding: 4px 12px; border-radius: 8px; font-weight: 900; }
.theme-red { color: var(--red); background: #fff0ee; }
.theme-gray { color: var(--gray); background: #f1f2ef; }
.theme-blue { color: var(--blue); background: #edf5ff; }
.theme-gold { color: var(--gold); background: #fff8e7; }
.theme-green { color: var(--green-dark); background: var(--soft); }

.result-title { margin: 8px 0 8px; font-size: 34px; font-weight: 950; line-height: 1.16; }
.result-subtitle { color: var(--muted); font-size: 16px; line-height: 1.65; }

/* ---- 备注（参照小程序 result.wxml 的 remark-entry/remark-panel 结构） ---- */
.remark-entry-action { color: var(--green-dark); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.remark-panel { margin: 10px 0 4px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.remark-textarea { width: 100%; min-height: 96px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; background: #fff; }
.remark-count { margin-top: 6px; text-align: right; font-size: 12px; color: var(--muted); }
.remark-count.over { color: var(--red); }
.remark-hint { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.remark-readonly { white-space: pre-wrap; line-height: 1.65; color: var(--ink); }
.remark-actions { display: flex; gap: 10px; margin-top: 12px; }
.remark-btn { flex: 1; min-height: 38px; padding: 0 12px; border-radius: 8px; font-weight: 800; font-size: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.remark-btn.primary { border-color: transparent; background: var(--green); color: #fff; }
.remark-btn.danger { border-color: rgba(217, 79, 61, .32); background: #fff3f1; color: var(--red); }
.remark-btn:disabled { opacity: .6; cursor: not-allowed; }

.action-list { display: grid; gap: 10px; margin-top: 16px; }
.action-item { padding: 14px; border-left: 4px solid var(--green); border-radius: 8px; background: #f7f8f6; }
.action-list.theme-red .action-item { border-left-color: var(--red); }
.action-list.theme-gray .action-item { border-left-color: var(--gray); }
.action-list.theme-blue .action-item { border-left-color: var(--blue); }
.action-list.theme-gold .action-item { border-left-color: var(--gold); }
.action-list.theme-green .action-item { border-left-color: var(--green); }
.action-card-title { font-size: 22px; font-weight: 900; margin-bottom: 4px; color: var(--ink); }
/* action-hint 显式设色，不能省略——.action-list.theme-X 为了给左侧边框上色设了 color，
   而 color 是可继承属性，不显式覆盖的话这段风险/信号正文文案会跟着边框一起被染成主题色，
   而不是应有的中性深色（参照小程序 result.wxss .action-hint: color:#222222，只有边框该跟主题色走） */
.action-hint { font-weight: 850; line-height: 1.6; color: var(--ink); }
.action-context { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.feedback-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.fb-btn { cursor: pointer; font-size: 18px; opacity: .5; }
.fb-btn.active { opacity: 1; }

/* ---- history ---- */
.history-list { display: grid; gap: 10px; margin-top: 14px; }
/* swipe-wrap 参照小程序 history.wxml 的 swipe-wrap/delete-btn 结构：外层裁切溢出，
   .history-item 左滑时向左位移露出底下常驻的 delete-btn；桌面端没有触摸手势，
   用鼠标做等效的"按下-向左拖动-松开"也走同一套判定逻辑（见 app.js wireHistorySwipe） */
.swipe-wrap { position: relative; overflow: hidden; border-radius: 8px; }
.history-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  transition: transform .2s ease;
  touch-action: pan-y;
}
.history-item.swiped { transform: translateX(-88px); }
.history-item:hover { border-color: rgba(26, 173, 25, .38); }
.delete-btn {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transform: translateX(100%);
  transition: transform .2s ease;
}
.delete-btn.visible { transform: translateX(0); }
.history-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.theme-dot-red { background: var(--red); }
.theme-dot-gray { background: var(--gray); }
.theme-dot-blue { background: var(--blue); }
.theme-dot-gold { background: var(--gold); }
.theme-dot-green { background: var(--green); }
/* history-title-row/history-meta 之间要稳定地各占一行——title-row 用 display:flex（块级流），
   自然把下面的 history-meta 挤到下一行，不依赖 inline 元素折行时机，同一套道理见下面 remark-tag 说明 */
.history-main { min-width: 0; display: block; }
.history-title-row { display: flex; align-items: flex-start; gap: 6px; }
.history-title { font-weight: 900; min-width: 0; }
.history-meta { margin-top: 5px; color: var(--muted); font-size: 13px; display: block; }
.history-view { color: var(--green-dark); font-size: 13px; font-weight: 800; white-space: nowrap; }
/* 参照真实小程序 history.wxss：备注标签是跟在子场景标题文字后面的内联标签（history-title-row 的
   flex子项），不是钉死在整张卡片右上角的绝对定位元素——之前用 position:absolute 会让标签飘到
   卡片右上角（View按钮上方），跟标题脱节，用户反馈"note标识应该显示在子场景的右上角" */
.remark-tag { display: inline-flex; flex-shrink: 0; margin-top: 1px; font-size: 11px; font-weight: 800; color: var(--green-dark); background: var(--soft); border-radius: 999px; padding: 2px 8px; }

/* ---- history filters（参照小程序 history.wxml filter-panel：4行横向可滚动chip + 1行排序） ---- */
.filter-panel { display: grid; gap: 12px; margin-top: 14px; }
/* 参照小程序 history.wxml：filter-row 里 filter-label 和滚动chip行是各占一行（上下堆叠），
   不是同一行左右排布——原来用 display:flex(横向) 硬凑，中文标签("时间"两个字)恰好窄，没暴露问题，
   英文标签("Dimension"这种长单词)撑不下就被挤压截断("Dimensi")，这是真实的布局bug不是文案问题 */
.filter-row { display: flex; flex-direction: column; gap: 6px; }
.filter-label { color: var(--muted); font-size: 13px; font-weight: 800; }
.filter-chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip.active { border-color: var(--green); background: var(--soft); color: var(--green-dark); }

.empty {
  padding: 36px 18px;
  border: 1px dashed #ccd2ca;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

/* ---- help ---- */
.help-menu { overflow: hidden; margin-top: 12px; padding: 0; }
.help-item + .help-item { border-top: 1px solid var(--line); }
.help-item-head {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.help-item.open .help-item-head { background: var(--soft); }
.help-item-title { display: block; font-size: 17px; font-weight: 900; }
.help-item-desc { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.help-item-arrow { flex-shrink: 0; color: var(--green-dark); font-size: 20px; font-weight: 900; }

.help-card { padding: 18px; border-top: 1px solid var(--line); line-height: 1.78; }
.help-card h2 { margin: 0 0 10px; font-size: 22px; line-height: 1.35; }
.help-card h2:not(:first-child) { margin-top: 24px; }
.help-card h3 { margin: 18px 0 6px; font-size: 16px; }
.help-card p { margin: 8px 0 0; color: var(--muted); }
.help-card ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.help-card li { margin: 4px 0; }
.help-meta, .help-footer { color: #9aa09b; font-size: 13px; }
.help-meta { margin-bottom: 14px; }
.help-footer { margin-top: 18px; text-align: center; }

.warning-box {
  margin-top: 12px; padding: 12px;
  border: 1px solid rgba(217, 79, 61, .25);
  border-radius: 8px;
  background: #fff3f1;
  color: #9f3527;
  line-height: 1.7;
}

.principle-box {
  margin-top: 12px; padding: 14px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--soft);
  color: var(--green-dark);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.55;
}

.result-guide { display: grid; gap: 10px; margin-top: 12px; }
.result-guide .verdict { display: inline-flex; margin-right: 8px; white-space: nowrap; }

.feedback-input {
  width: 100%;
  min-height: 140px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  background: #f7f8f6;
  color: var(--ink);
  line-height: 1.7;
}

.feedback-row-web, .contact-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.feedback-row-web .muted { margin-right: auto; }
.compact-btn { width: auto; flex: 0 0 auto; min-height: 38px; padding: 0 14px; }
.feedback-row-web .compact-btn { min-width: 96px; }
.contact-row { justify-content: space-between; }

/* ---- login (standalone page, same design language) ---- */
.login-shell { width: min(420px, 100%); margin: 0 auto; min-height: 100vh; padding: 48px 16px; }
.login-shell .hero { text-align: center; padding-bottom: 12px; }
input[type=email], input[type=text] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 10px;
}
.error { color: var(--red); font-size: 13px; margin-bottom: 8px; }

/* ---- toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 80;
  max-width: min(420px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(32, 33, 36, .92);
  color: #fff;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- modal (privacy gate / no-quota) ----
   桌面端居中显示（对话框式）；移动端（见下方 @media）改回贴底的bottom-sheet样式——
   贴底样式是移动端的常见交互惯例（原样式一直是flex-end，桌面端直接沿用导致弹窗贴在屏幕底部，
   在宽视口下显得既不居中也不像正常对话框） */
.modal-backdrop {
  display: flex;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-panel { max-width: 480px; width: calc(100% - 32px); margin: 0; border-radius: 16px; padding: 20px; background: #fff; }

@media (max-width: 720px) {
  .shell { padding-top: 16px; }
  .topbar { align-items: flex-start; margin-top: -16px; }
  .nav { gap: 6px; }
  .nav button, .lang-btn { min-height: 34px; padding: 0 9px; font-size: 13px; }
  .hero h1 { font-size: 28px; }
  .grid { grid-template-columns: 1fr; }
  .dimension-card { min-height: 104px; }
  .inline-actions, .result-actions, .history-actions { flex-direction: column; }
  .inline-actions button, .result-actions button, .history-actions button { min-width: 0; }
  .bottom-bar .primary-btn { max-width: none; }
  /* 移动端改回贴底弹出的bottom-sheet样式，是移动端更常见的交互惯例 */
  .modal-backdrop { align-items: flex-end; }
  .modal-panel { width: 100%; max-width: none; border-radius: 16px 16px 0 0; }
}
