:root {
  /* 色板对齐《03_页面草图》定稿的金色米色体系（客户确认过的那版视觉） */
  --bg: #faf7f1;
  --card: #ffffff;
  --line: #e5dcc9;
  --ink: #2b2620;
  --ink-2: #6b6357;
  --ink-3: #8a8177;
  --accent: #C08A2D;        /* 品牌金 */
  --accent-deep: #a87623;   /* 品牌金·按压/聚焦 */
  --accent-soft: #F5E9D2;   /* 金·浅底 */
  --green: #4a7c59;         /* 成功语义（草图 tag.green 同源） */
  --green-soft: #e2efe6;
  --danger: #b04a3a;
  --warn: #8a5a12;
  --radius: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

.view { display: none; max-width: 560px; margin: 0 auto; }
.view.active { display: block; }

/* ---------- 登录 ---------- */
.brand { text-align: center; padding: 48px 20px 24px; }
.brand-logo {
  width: 92px; height: 92px; display: block; margin: 0 auto 16px;
  filter: drop-shadow(0 6px 14px rgba(192, 138, 45, .28));
}
.brand-name { font-size: 26px; font-weight: 600; letter-spacing: 6px; color: var(--ink); }
.brand-sub { color: var(--ink-3); font-size: 13px; margin-top: 6px; letter-spacing: 1px; }

.seg {
  display: flex; gap: 4px; margin: 0 20px 16px;
  background: rgba(0, 0, 0, .05); padding: 4px; border-radius: 10px;
}
.seg-btn {
  flex: 1; padding: 9px; border: 0; border-radius: 8px; background: transparent;
  font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.seg-btn.active { background: var(--card); color: var(--ink); font-weight: 500; }

.card {
  margin: 0 20px; padding: 20px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
}

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent-deep);
}
.field textarea { min-height: 70px; resize: vertical; }

.btn {
  display: block; width: 100%; padding: 12px; border: 0; border-radius: 999px;
  font-size: 15px; font-family: inherit; cursor: pointer;
  background: rgba(43, 38, 32, .06); color: var(--ink);
}
.btn.primary { background: var(--accent); color: #fff; font-weight: 500; }
.btn.primary:active { background: var(--accent-deep); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { width: auto; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.danger { background: transparent; color: var(--danger); }

.msg { margin-top: 12px; font-size: 13px; min-height: 18px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--green); }

.hint {
  margin: 20px; padding: 14px 16px; background: rgba(0, 0, 0, .03);
  border-radius: var(--radius); font-size: 12px; color: var(--ink-3); line-height: 1.9;
}
.hint p { margin: 0; }

/* ---------- 顶栏与标签 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center;
  justify-content: space-between; padding: 14px 20px;
  background: rgba(250, 247, 241, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); font-weight: 500;
}
.topbar-logo { width: 24px; height: 24px; vertical-align: -7px; margin-right: 8px; }
.tabs { display: flex; gap: 6px; padding: 12px 20px 0; flex-wrap: wrap; }
.tab {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); font-size: 13px; font-family: inherit;
  color: var(--ink-2); cursor: pointer;
}
.tab.active { background: var(--accent-soft); border-color: transparent; color: var(--accent-deep); font-weight: 600; }

.body { padding: 16px 20px 40px; }

/* ---------- 列表与卡片 ---------- */
.item {
  padding: 14px 16px; margin-bottom: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.item-title { font-weight: 500; }
.item-sub { color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.item-body { color: var(--ink-2); font-size: 14px; margin-top: 8px; white-space: pre-wrap; }
.item-actions { display: flex; gap: 8px; margin-top: 12px; }
.section-actions { margin-bottom: 12px; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; background: rgba(43, 38, 32, .06); color: var(--ink-2);
}
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: #faeeda; color: var(--warn); }

.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); font-size: 14px; }
.loading { padding: 32px; text-align: center; color: var(--ink-3); font-size: 14px; }

.kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.kv span:first-child { color: var(--ink-3); }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  max-width: 80%; padding: 10px 18px; border-radius: 999px;
  background: rgba(29, 28, 26, .92); color: #fff; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.section-title { font-size: 13px; color: var(--ink-3); margin: 20px 0 8px; }
.section-title:first-child { margin-top: 0; }

/* ---------- 签名弹窗 ---------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(29, 28, 26, .45);
}
.sheet {
  width: 100%; max-width: 560px;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--card);
  border-radius: 16px 16px 0 0;
}
.sheet-title { font-size: 16px; font-weight: 500; }
.sheet-sub { font-size: 13px; color: var(--ink-3); margin: 4px 0 14px; }

.sign-pad {
  display: block; width: 100%; height: 180px;
  border: 1px dashed var(--line); border-radius: 10px;
  background: #fdfdfc; touch-action: none; cursor: crosshair;
}
.sheet-tip { font-size: 12px; color: var(--ink-3); margin: 6px 0 14px; }

.agree {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--ink-2); line-height: 1.5;
  padding: 10px 12px; margin-bottom: 12px;
  background: rgba(0, 0, 0, .03); border-radius: 8px;
}
.agree input { margin-top: 2px; flex: none; }

.sheet-msg { min-height: 20px; font-size: 13px; margin-bottom: 10px; }
.sheet-msg .err { color: var(--danger); }

.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .btn { flex: 1; }
.sheet-actions .sheet-clear, .sheet-actions .sheet-cancel { flex: 0 0 auto; padding: 12px 16px; }

/* ---------- 服务计时条（开始服务后常驻顶部） ---------- */
body.has-timer .view.active { padding-top: 54px; }
#nsy-timer {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: var(--accent-deep); color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
#nsy-timer .timer-inner {
  max-width: 560px; margin: 0 auto; display: flex; align-items: center;
  gap: 10px; padding: 11px 14px;
}
#nsy-timer .timer-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #fff;
  animation: nsy-blink 1.2s infinite; flex: 0 0 auto;
}
@keyframes nsy-blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
#nsy-timer .timer-text { flex: 1; font-size: 14px; font-weight: 500; min-width: 0; }
#nsy-timer .btn.primary { background: #fff; color: var(--accent-deep); flex: 0 0 auto; }
#nsy-timer .btn.primary:active { background: #f3e9d6; }

/* ---------- 微信一键登录 ----------
 * 小程序 AppID 到位前用一次性链接顶这一格，样式先按"主按钮"做，
 * 等真接上 wx.login 时不用为了换入口再动一次 UI。
 */
.btn.wx {
  margin: 10px 20px 0; width: auto;
  background: #07c160; color: #fff;      /* 微信绿，让客户一眼认出"这就是微信登录" */
}
.btn.wx:active { opacity: .9; }

/* ---------- 表单内提示 ---------- */
.form-tip {
  margin: 0 0 16px; font-size: 13px; color: var(--ink-2); line-height: 1.6;
}
.form-sec {
  margin: 18px 0 12px; font-size: 13px; font-weight: 500; color: var(--ink-2);
  padding-top: 14px; border-top: 1px solid var(--line);
}
.field-note {
  display: block; margin-top: 6px;
  font-size: 12px; color: var(--ink-3); font-style: normal; line-height: 1.5;
}

/* ---------- 绑定卡片：老板发给客户的一次性链接 ---------- */
.bind-card { border-color: #07c160; }

/* ---------- 我的反馈：可编辑表单 ---------- */
.fb-radio { display: flex; align-items: center; gap: 16px; margin: 4px 0 14px; font-size: 14px; }
.fb-radio-label { color: var(--ink-2); }
.fb-radio-opt { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); cursor: pointer; }
.fb-msg { font-size: 13px; }
.fb-msg.err { color: var(--danger); }
.fb-msg.ok { color: var(--green); }

.link-box {
  width: 100%; box-sizing: border-box; margin: 8px 0 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 12px; line-height: 1.5; color: var(--ink-2);
  background: var(--bg); resize: none;
}

/* ---------- ICP 备案（工信部要求，全页面底部常驻） ---------- */
footer.icp {
  max-width: 560px; margin: 0 auto;
  padding: 18px 20px 26px; text-align: center;
  font-size: 12px; color: var(--ink-2);
}
footer.icp a { color: var(--ink-2); text-decoration: none; }
footer.icp a:hover { text-decoration: underline; }
