/* ==========================================================================
   白事管家 · 视觉重构版
   按《Web视觉风格优化》设计交付包实现。设计性格：中文衬线 + 暖米底 + 低圆角，
   刻意安静克制——这是给极端情绪下的人用的产品，不做营销化元素和激励动画。
   ========================================================================== */

:root {
  /* 底色 */
  --page: #EFEAE2;          /* 桌面外底 */
  --paper: #FCFAF6;         /* 内容纸面 */
  --card: #FFFDF9;          /* 卡片 / 输入框 */
  --block: #F5F2EB;         /* 浅色块 */
  --block2: #F7F4ED;        /* 次级浅块 */

  /* 主色 */
  --green: #3F6455;
  --green-hover: #375648;
  --green-tint: #F1EFE8;
  --ink-deep: #33302C;      /* 深墨卡片 / 选中 Tab */
  --gold: #9A7B4F;
  --gold-on-dark: #C9A96B;

  /* 文字 */
  --title: #2B2523;
  --text: #443C38;
  --text2: #3A322E;
  --muted: #8A8079;
  --muted2: #A09790;
  --muted3: #9A9089;
  --on-dark: #F4F0E9;
  --on-dark-2: #A9A099;
  --danger: #A2604F;

  /* 线 */
  --border: #E2D9CA;        /* 控件描边 */
  --divider: #EBE4D9;       /* 分隔 */
  --hairline: #E7DFD2;      /* 细线 / 进度轨 */
  --dot-idle-bg: #E4DCCF;
  --dot-idle-fg: #96887F;
  --diamond: #C9BCA6;

  --maxw: 462px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* 中国大陆访问 Google Fonts 不稳定，回退到系统中文衬线，
     仍能保住设计的衬线性格。正式上线建议自托管子集化字体。 */
  --serif: "Noto Serif SC", "Songti SC", "SimSun", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

/* 任何设了 display 的类都会盖过 [hidden] 的 display:none（同优先级、后定义者胜）。
   .screen--center、.back-btn、.tabbar 等都设了 display:flex，所以必须显式兜底，
   否则隐藏的屏幕会漏出来叠在当前页上。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  text-wrap: pretty;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: #2F4C41; }
input, textarea, button { font-family: inherit; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- 外壳 ---------------- */

#app {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page);
  display: flex;
  justify-content: center;
}

.phone {
  width: 100%;
  max-width: var(--maxw);
  background: var(--paper);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 70px rgba(43, 37, 35, 0.10);
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 18px;
  padding-top: var(--safe-top);
  height: calc(56px + var(--safe-top));
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(252, 250, 246, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
}

.back-btn {
  width: 32px; height: 32px;
  margin-left: -8px;
  border: 0;
  background: none;
  color: #6E645E;
  font-size: 19px;
  cursor: pointer;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
/* 32px 达不到 44px 触达标准，用伪元素扩大热区 */
.back-btn::after { content: ""; position: absolute; inset: -6px; }
.back-btn:hover { background: #F1EBE1; }

.brand {
  display: flex; align-items: center; gap: 8px;
  border: 0; background: none; padding: 0; cursor: pointer;
}
.brand-diamond {
  width: 7px; height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  display: block;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--title);
}
.topbar-spacer { flex: 1; }

/* ---------------- 屏幕 ---------------- */

.screen {
  flex: 1;
  padding: 28px 22px 44px;
  animation: screenIn .3s ease;
}
.screen--home { padding-top: 34px; }
.screen--center { display: flex; flex-direction: column; justify-content: flex-start; }

/* ---------------- 底部 Tab ---------------- */

.tabbar {
  display: flex;
  margin-top: auto;
  background: var(--paper);
  border-top: 1px solid var(--divider);
  padding-bottom: var(--safe-bottom);
  position: sticky;
  bottom: 0;
  z-index: 15;
}
.tabbar button {
  flex: 1;
  border: 0;
  background: none;
  padding: 15px 0 17px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--muted3);
  font-weight: 400;
  cursor: pointer;
  border-top: 2px solid transparent;
  margin-top: -1px;
}
.tabbar button.is-active {
  color: var(--title);
  font-weight: 600;
  background: var(--block);
  border-top-color: var(--gold);
}

/* ---------------- 通用排版 ---------------- */

.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  margin: 0;
}
.page-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.45;
  color: var(--title);
  margin: 0 0 10px;
}
.page-sub {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.85;
  margin: 0 0 22px;
}

.divider-diamond {
  display: flex; align-items: center; gap: 12px;
  margin: 28px 0 24px;
}
.divider-diamond span:first-child,
.divider-diamond span:last-child { flex: 1; height: 1px; background: var(--hairline); }
.divider-diamond i {
  width: 5px; height: 5px;
  background: var(--diamond);
  transform: rotate(45deg);
  display: block;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 3px;
  padding: 15px;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  font-family: var(--sans);
}
.btn-primary { background: var(--green); color: #F6F3ED; }
.btn-primary:hover { background: var(--green-hover); color: #F6F3ED; }

.btn-outline {
  background: var(--card);
  border: 1px solid var(--green);
  color: var(--green);
  padding: 14px;
}
.btn-outline:hover { background: var(--green-tint); }

.btn-quiet {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 14px;
}
.btn-quiet:hover { background: #F7F3EA; }

.btn-done {
  background: var(--block2);
  border: 1px solid var(--border);
  color: var(--muted2);
  padding: 14px;
  cursor: default;
}

.btn-text {
  background: none;
  border: 0;
  color: var(--muted3);
  font-size: 13.5px;
  padding: 8px 0;
  cursor: pointer;
  width: 100%;
}
.btn-danger-text { color: var(--danger); }

.btn-stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------------- 01 首页 ---------------- */

.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 33px;
  line-height: 1.35;
  letter-spacing: 1px;
  color: var(--title);
  margin: 0 0 12px;
}

.entry {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 18px;
  border-radius: 4px;
  width: 100%;
  border: 0;
  cursor: pointer;
  text-align: left;
  margin-bottom: 12px;
  font-family: var(--sans);
}
.entry-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 19px;
  flex: 0 0 auto;
}
.entry-text { flex: 1; }
.entry-title { display: block; font-size: 16.5px; font-weight: 600; letter-spacing: .5px; }
.entry-desc { display: block; font-size: 12.5px; line-height: 1.6; margin-top: 3px; }
.entry-arrow { font-size: 18px; }

.entry--green { background: var(--green); color: #F6F3ED; }
.entry--green:hover { background: var(--green-hover); }
.entry--green .entry-icon { background: rgba(255,255,255,0.13); color: #F6F3ED; }
.entry--green .entry-desc { color: #C6D5CD; }
.entry--green .entry-arrow { color: #9DB5AB; }

.entry--light { background: var(--card); border: 1px solid var(--border); color: var(--text2); }
.entry--light:hover { background: #F7F3EA; }
.entry--light .entry-icon { background: #F1EDE3; color: var(--gold); }
.entry--light .entry-desc { color: var(--muted); }
.entry--light .entry-arrow { color: #C0B6AA; }

/* ---------------- 02 情况采集 ---------------- */

.wizard-progress {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 34px;
}
.wizard-track { flex: 1; height: 2px; background: var(--hairline); }
.wizard-bar { height: 2px; background: var(--green); transition: width .3s ease; }
.wizard-count {
  font-size: 11.5px; color: var(--muted3);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.step-q {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.5;
  color: var(--title);
  margin: 0;
}
.step-hint { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 10px 0 0; }

.option-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  width: 100%;
  padding: 17px 18px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 15.5px;
  color: var(--text2);
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
}
.option-btn:hover { border-color: var(--green); background: #F4F2EA; }
.option-btn b { display: block; font-size: 15.5px; font-weight: 600; color: var(--title); }
.option-btn span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }

/* ---------------- 03 任务方案 ---------------- */

.plan-summary {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.9;
  color: var(--text2);
  margin: 8px 0 0;
}
.progress-row { display: flex; align-items: center; gap: 12px; margin: 24px 0 22px; }
.progress-track { flex: 1; height: 2px; background: var(--hairline); }
.progress-bar { height: 2px; background: var(--green); transition: width .35s ease; }
.progress-label {
  font-size: 12px; color: var(--green);
  font-variant-numeric: tabular-nums;
}

.roadmap { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.task-row {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px;
  border-radius: 3px;
  border: 1px solid transparent;
  background: var(--block2);
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
}
.task-row--current { background: var(--green-tint); border-color: var(--green); }
.task-row--done { background: transparent; opacity: .55; }

.task-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px;
  flex: 0 0 auto;
  background: var(--dot-idle-bg);
  color: var(--dot-idle-fg);
}
.task-dot--on { background: var(--green); color: #F6F3ED; }

.task-name { flex: 1; font-size: 14.5px; color: var(--text2); font-weight: 600; }
.task-row--done .task-name { text-decoration: line-through; font-weight: 400; }
.task-state { font-size: 11px; color: var(--muted2); }
.task-state--doing { color: var(--green); }
.task-state--guanjia { color: var(--gold); }
.task-arrow { font-size: 17px; color: #C2B8AC; }
.task-row--current .task-arrow { color: var(--green); }

/* ---------------- 04 任务详情 ---------------- */

.fact-list { margin: 24px 0 28px; border-top: 1px solid var(--divider); }
.fact { padding: 16px 0; border-bottom: 1px solid var(--divider); }
.fact-label {
  font-size: 11.5px; letter-spacing: 1.5px; color: var(--gold);
  margin: 0 0 6px;
}
.fact-body { font-size: 14px; color: var(--text); line-height: 1.85; margin: 0; }

.assigned-note {
  background: var(--green-tint);
  color: var(--green);
  padding: 16px;
  text-align: center;
  font-size: 14px;
  border-radius: 3px;
  margin-bottom: 10px;
}

/* ---------------- 05 服务确认 / 提交成功 ---------------- */

.center-box { text-align: center; padding-top: 16px; }
.mark {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
/* 待办 / 未送达状态用铜金，与"已完成"的绿明确区分 */
.mark--pending { background: var(--gold); }

.center-box h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.5;
  color: var(--title);
  margin: 10px 0 16px;
}
.center-box p { font-size: 13px; color: var(--muted); line-height: 1.9; margin: 0 0 20px; }

.confirm-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.confirm-list li {
  background: var(--block);
  padding: 14px 16px;
  border-radius: 3px;
  font-size: 14px;
  color: var(--text2);
  display: flex; align-items: center; gap: 10px;
  text-align: left;
}
.confirm-list li .pill { margin-left: auto; font-size: 11px; color: var(--gold); }
.confirm-list li .pill--pending { color: var(--gold); }

/* ---------------- 06 管家 ---------------- */

.guanjia-card {
  display: flex; align-items: center; gap: 15px;
  background: var(--ink-deep);
  border-radius: 4px;
  padding: 20px;
  margin: 18px 0 24px;
}
.guanjia-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--green);
  color: #F6F3ED;
  font-family: var(--serif);
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.guanjia-name {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 1px;
  color: var(--on-dark);
  margin: 0;
}
.guanjia-role { font-size: 12.5px; color: var(--on-dark-2); margin: 4px 0 0; line-height: 1.6; }

.log-list { border-top: 1px solid var(--divider); margin-bottom: 24px; }
.log-item {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--divider);
  font-size: 14.5px;
  color: #6E645E;
}
.log-check { color: var(--green); font-size: 14px; }
.log-item .pill { margin-left: auto; font-size: 11px; color: var(--muted2); }
.log-item .pill--pending { color: var(--gold); }

.doing-card {
  background: var(--block);
  border-left: 2px solid var(--gold);
  padding: 16px 18px;
  margin-bottom: 24px;
}
.doing-card p { margin: 0; }
.doing-name { font-family: var(--serif); font-size: 16.5px; color: var(--title); margin-top: 6px; }

.empty-block {
  background: var(--block);
  padding: 26px 18px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 16px;
}

/* ---------------- 07 表单 ---------------- */

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span {
  font-size: 12.5px;
  letter-spacing: 1.5px;
  color: var(--gold);
}
.field input, .field textarea, textarea {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 13px;
  font-size: 15.5px;
  background: var(--card);
  color: var(--text);
  width: 100%;
  font-family: var(--sans);
}
.field input:focus, .field textarea:focus, textarea:focus {
  outline: 0;
  border-color: var(--green);
}
textarea { resize: vertical; }

.field-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}
.field-consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px; height: 16px;
  margin: 2px 0 0;
  accent-color: var(--green);
}
.link-inline {
  background: none; border: 0; padding: 0;
  color: var(--green);
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.or-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0 16px;
}
.or-divider span:first-child, .or-divider span:last-child {
  flex: 1; height: 1px; background: var(--hairline);
}
.or-divider i { font-size: 12.5px; color: var(--muted2); font-style: normal; }

/* ---------------- 09 城市流程 ---------------- */

.city-tabs { display: flex; gap: 8px; margin: 18px 0 24px; }
.city-tab {
  flex: 1;
  padding: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  font-family: var(--sans);
}
.city-tab.is-active { background: var(--ink-deep); border-color: var(--ink-deep); color: var(--on-dark); }

.timeline { margin-left: 13px; padding-left: 26px; border-left: 1px solid var(--hairline); }
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-dot {
  position: absolute;
  left: -39px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: #F6F3ED;
  font-size: 12.5px;
  display: flex; align-items: center; justify-content: center;
}
.timeline-item b {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--title);
  display: block;
}
.timeline-item p { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 6px 0 0; }

.city-note {
  font-size: 12.5px;
  color: var(--muted2);
  line-height: 1.8;
  border-top: 1px solid var(--divider);
  padding-top: 16px;
  margin-top: 8px;
}
.city-unverified {
  background: #F6EFE2;
  border: 1px solid #E5D7BC;
  color: #7A5E23;
  padding: 12px 14px;
  border-radius: 3px;
  font-size: 12.5px;
  line-height: 1.8;
  margin: 0 0 18px;
}
.city-verified { font-size: 12px; color: var(--muted2); margin: 10px 0 0; }
.city-empty { font-size: 13.5px; color: var(--muted); line-height: 1.85; margin: 0 0 18px; }

/* ---------------- 隐私政策 ---------------- */

.legal-draft-note {
  background: #F6EFE2;
  border: 1px solid #E5D7BC;
  border-radius: 3px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.8;
  color: #7A5E23;
  margin: 0 0 18px;
}
.legal { font-size: 14px; line-height: 1.85; color: var(--text); }
.legal h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--title);
  margin: 24px 0 8px;
}
.legal h3:first-child { margin-top: 4px; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal b { color: var(--title); }

/* ---------------- 安装引导 ---------------- */

.install-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(78px + var(--safe-bottom));
  width: calc(100% - 32px);
  max-width: calc(var(--maxw) - 32px);
  background: var(--ink-deep);
  color: var(--on-dark);
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  line-height: 1.6;
  z-index: 30;
  box-shadow: 0 6px 24px rgba(43,37,35,0.18);
}
.install-banner span { flex: 1; }
.install-banner button {
  border: 0;
  background: var(--green);
  color: #F6F3ED;
  border-radius: 3px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  flex: 0 0 auto;
}
.install-banner .dismiss {
  background: none;
  color: var(--on-dark-2);
  padding: 4px 2px;
  font-size: 14px;
}

/* 待办页空态：只有一行字，不放任何入口 */
.plan-empty {
  text-align: center;
  padding: 80px 0;
  font-size: 14px;
  color: var(--muted2);
  margin: 0;
}
