/* ============================================================
   真妍·美业 原型主题（深橡木设计规范 v1.1）
   更新：标题一律居中 · 线性图标（禁用 emoji）
   ============================================================ */

:root {
  /* 核心色板 */
  --primary: #4E4338;        /* 深橡木 */
  --secondary: #D9CFC0;      /* 亚麻灰 */
  --bg: #F6F3EF;             /* 暖白 */
  --dark: #24201B;           /* 曜石黑 */

  /* 扩展色板 */
  --primary-hover: #3A322A;
  --primary-light: #6B5D4F;
  --surface: #FFFFFF;
  --text-primary: #24201B;
  --text-secondary: #5C5146;
  --text-muted: #9A8E80;
  --success: #5F7D5C;
  --warning: #B58A5B;
  --error: #B1553E;

  /* 布局 */
  --nav-h: 56px;
  --tabbar-h: 60px;
  --radius-card: 12px;
  --radius-btn: 8px;
  --shadow-card: 0 2px 8px rgba(36, 32, 27, 0.06);
  --shadow-nav: 0 2px 8px rgba(36, 32, 27, 0.15);

  /* 间距（8px 栅格） */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;
}

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

html, body {
  background: #E8E2DA;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

/* 手机视口框架 */
.phone {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}
@media (min-width: 480px) {
  .phone { border-radius: 24px; margin: 24px auto; min-height: calc(100vh - 48px); box-shadow: 0 12px 48px rgba(36,32,27,.25); overflow: hidden; }
}

/* ---------------- 线性图标（统一 SVG 样式，禁用 emoji） ---------------- */
.ic {
  width: 22px; height: 22px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.ic-lg { width: 26px; height: 26px; }
.ic-avatar { width: 52px; height: 52px; padding: 13px; background: var(--secondary); border-radius: 50%; color: var(--text-secondary); }
.ic-empty { width: 48px; height: 48px; color: var(--text-muted); opacity: .7; }
.ic-nav { width: 22px; height: 22px; color: var(--bg); }

/* ---------------- 顶部导航（标题严格居中 + 返回按钮保留） ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: var(--primary);
  color: var(--bg);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--sp-md);
  box-shadow: var(--shadow-nav);
}
.topbar .back {
  justify-self: start;
  display: flex; align-items: center;
  width: 28px; height: 100%;
  cursor: pointer; color: var(--bg);
}
.topbar .title {
  font-size: 17px; font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.topbar .spacer { }

/* ---------------- 底部标签栏 ---------------- */
.tabbar {
  position: sticky; bottom: 0; z-index: 50;
  height: var(--tabbar-h);
  background: var(--surface);
  border-top: 1px solid var(--secondary);
  display: flex;
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; cursor: pointer; color: var(--text-muted); font-size: 11px;
  position: relative;
}
.tabbar .tab.active { color: var(--primary); font-weight: 600; }
.tabbar .tab.active::after {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px; background: var(--secondary); border-radius: 2px;
}

/* ---------------- 屏幕切换 ---------------- */
.screen { display: none; flex: 1; padding: var(--sp-md) var(--sp-md) var(--sp-lg); }
.screen.active { display: block; }
.screen.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--sp-lg)); }

/* ---------------- 卡片（标题一律居中） ---------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--secondary);
  box-shadow: var(--shadow-card);
  padding: var(--sp-md);
  margin-bottom: var(--sp-md);
}
.card-title { font-size: 16px; font-weight: 550; color: var(--text-primary); text-align: center; margin-bottom: var(--sp-sm); }
.card-sub { font-size: 12px; color: var(--text-muted); text-align: center; }

/* ---------------- 区块标题（居中） ---------------- */
.section-title { font-size: 18px; font-weight: 600; color: var(--text-primary); text-align: center; margin: var(--sp-lg) 0 var(--sp-md); }
.section-link { font-size: 13px; color: var(--primary); text-decoration: none; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 var(--sp-lg);
  border-radius: var(--radius-btn);
  font-size: 15px; font-weight: 500;
  border: none; cursor: pointer;
  text-decoration: none; gap: var(--sp-sm);
}
.btn-primary { background: var(--primary); color: var(--bg); }
.btn-primary:active { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-text { background: transparent; color: var(--primary); }
.btn-block { display: flex; width: 100%; }
.btn-disabled { background: var(--secondary); color: var(--text-muted); cursor: not-allowed; }
.btn-sm { height: 34px; padding: 0 var(--sp-md); font-size: 13px; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; line-height: 1.8; white-space: nowrap;
}
.tag-default { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--secondary); }
.tag-progress { background: var(--secondary); color: var(--dark); }
.tag-done { background: var(--success); color: #fff; }
.tag-pending { background: var(--warning); color: #fff; }
.tag-cancel { background: var(--error); color: #fff; }
.tag-primary { background: var(--primary); color: var(--bg); }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: var(--sp-md); }
.field label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.input, .select, textarea.input {
  width: 100%; height: 40px;
  border: 1px solid var(--secondary); border-radius: var(--radius-btn);
  padding: 0 12px; font-size: 14px; color: var(--text-primary);
  background: var(--surface);
  outline: none;
}
.input:focus { border-color: var(--primary); border-width: 2px; }
.input::placeholder { color: var(--text-muted); }
textarea.input { height: auto; padding: 10px 12px; resize: none; }

/* ---------------- 列表 ---------------- */
.list-item {
  display: flex; align-items: center; gap: var(--sp-md);
  padding: 12px 0;
  border-bottom: 1px solid var(--secondary);
  cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 14px; color: var(--text-primary); }
.list-item .li-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-item .li-arrow { color: var(--text-muted); display: flex; }
.list-item .li-right { text-align: right; }

/* ---------------- 数据展示 ---------------- */
.amount { font-size: 24px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.amount-sm { font-size: 16px; font-weight: 600; }
.amount-up { color: var(--success); }
.amount-warn { color: var(--warning); }

.stat-row { display: flex; gap: var(--sp-sm); margin-top: var(--sp-md); }
.stat-cell { flex: 1; text-align: center; }
.stat-cell .v { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.stat-cell .k { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-divider { width: 1px; background: var(--secondary); }

/* ---------------- 分段控制器 ---------------- */
.seg { display: flex; background: var(--secondary); border-radius: var(--radius-btn); padding: 3px; }
.seg .seg-item {
  flex: 1; text-align: center; padding: 8px 4px;
  font-size: 13px; color: var(--text-secondary);
  border-radius: 6px; cursor: pointer;
}
.seg .seg-item.active { background: var(--primary); color: var(--bg); font-weight: 600; }

/* ---------------- 其他 ---------------- */
.divider { height: 1px; background: var(--secondary); margin: var(--sp-md) 0; }
.muted { color: var(--text-muted); font-size: 12px; }
.center { text-align: center; }
.flex { display: flex; align-items: center; gap: var(--sp-sm); }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-sm { margin-top: var(--sp-sm); } .mt-md { margin-top: var(--sp-md); } .mt-lg { margin-top: var(--sp-lg); }
.mb-sm { margin-bottom: var(--sp-sm); } .mb-md { margin-bottom: var(--sp-md); }

/* ---------------- 登录页 ---------------- */
.login-hero {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--bg); padding: var(--sp-xxl) var(--sp-lg) var(--sp-xl);
  border-radius: 0 0 32px 32px; text-align: center;
}
/* 高端深色登录（真妍国际·会所质感） */
.login-hero.dark {
  background: radial-gradient(120% 90% at 50% 0%, #3A322A 0%, var(--dark) 55%, #171410 100%);
}
.login-hero .logo {
  width: 72px; height: 72px; margin: 0 auto var(--sp-md);
  background: var(--dark); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg);
}
.login-hero.dark .logo {
  background: linear-gradient(145deg, #6B5D4F, var(--primary));
  border: 1px solid rgba(217,207,192,.35);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.login-hero h1 { font-size: 24px; font-weight: 600; text-align: center; }
.login-hero .brand-sub { font-size: 13px; letter-spacing: .35em; opacity: .9; margin-top: 6px; text-align: center; }
.login-hero p { font-size: 13px; opacity: .85; margin-top: var(--sp-sm); text-align: center; line-height: 1.8; }
.login-body { padding: var(--sp-xl) var(--sp-lg); }
.login-note { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: var(--sp-md); line-height: 1.8; }

/* ---------------- 钱包卡片 ---------------- */
.wallet-card {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
  border-radius: var(--radius-card); color: var(--bg);
  padding: var(--sp-lg); margin-bottom: var(--sp-md);
  box-shadow: var(--shadow-nav);
  text-align: center;
}
.wallet-card .w-label { font-size: 12px; opacity: .8; text-align: center; }
.wallet-card .w-amount { font-size: 30px; font-weight: 600; margin: var(--sp-xs) 0 var(--sp-md); text-align: center; }
.wallet-card .w-row { display: flex; gap: var(--sp-lg); font-size: 13px; opacity: .9; justify-content: center; }

/* ---------------- 收款码 ---------------- */
.qr-box {
  width: 180px; height: 180px; margin: var(--sp-md) auto;
  background: #fff; border: 1px solid var(--secondary); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.qr-box .qr-grid {
  width: 140px; height: 140px;
  background-image:
    linear-gradient(0deg, var(--dark) 25%, transparent 25%, transparent 75%, var(--dark) 75%),
    linear-gradient(90deg, var(--dark) 25%, transparent 25%, transparent 75%, var(--dark) 75%);
  background-size: 20px 20px;
  opacity: .85;
}
.qr-corner {
  position: absolute; width: 32px; height: 32px; border: 6px solid var(--dark);
}
.qr-corner.tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.qr-corner.tr { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.qr-corner.bl { bottom: 10px; left: 10px; border-right: none; border-top: none; }

/* ---------------- 步骤条 ---------------- */
.steps { display: flex; align-items: center; margin: var(--sp-md) 0; }
.step { flex: 1; text-align: center; position: relative; }
.step .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--secondary); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; position: relative; z-index: 1;
}
.step.done .dot { background: var(--success); color: #fff; }
.step.active .dot { background: var(--primary); color: var(--bg); }
.step .lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.step.active .lbl { color: var(--text-primary); font-weight: 600; }
.step::before {
  content: ""; position: absolute; top: 13px; left: calc(-50% + 13px); right: calc(50% + 13px);
  height: 2px; background: var(--secondary);
}
.step:first-child::before { display: none; }
.step.done::before, .step.done ~ .step::before { background: var(--success); }

/* ---------------- 横幅（标题居中） ---------------- */
.banner {
  border-radius: var(--radius-card); overflow: hidden;
  background: linear-gradient(120deg, var(--primary-light), var(--primary));
  color: var(--bg); padding: var(--sp-lg);
  margin-bottom: var(--sp-md); text-align: center;
}
.banner h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; text-align: center; }
.banner p { font-size: 12px; opacity: .85; text-align: center; line-height: 1.7; }

/* ---------------- 提示弹层 ---------------- */
.toast {
  position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%);
  background: rgba(36,32,27,.9); color: var(--bg);
  padding: 12px 20px; border-radius: 10px; font-size: 14px;
  z-index: 99; display: none;
}
.toast.show { display: block; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- 底部弹层（合同详情等） ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(36, 32, 27, 0.5);
  display: none; align-items: flex-end; justify-content: center;
}
.overlay.show { display: flex; }
.overlay-card {
  background: var(--surface);
  width: 100%; max-width: 420px;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px calc(var(--sp-lg) + 12px);
  max-height: 78vh; overflow-y: auto;
}
.overlay-card .clause {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.8; margin-bottom: 12px;
}
.overlay-card .clause b { color: var(--text-primary); }
.overlay-close {
  position: absolute; top: 14px; right: 16px;
  font-size: 20px; color: var(--text-muted); cursor: pointer;
}

/* ---------------- 演示水印 ---------------- */
.demo-hint {
  position: fixed; right: 8px; bottom: calc(var(--tabbar-h) + 8px); z-index: 80;
  background: var(--primary); color: var(--bg); font-size: 11px;
  padding: 4px 10px; border-radius: 999px; opacity: .85;
}

/* ============================================================
   v1.3 细节样式：克制的动效与渐变（不喧宾夺主）
   ============================================================ */

/* 页面切换过渡：淡入 + 轻微上移 */
.screen.active { animation: dsh-fade-up .28s ease both; }
@keyframes dsh-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* 卡片微交互：悬停轻浮 + 点击回弹 */
.card { transition: transform .18s ease, box-shadow .18s ease; }
@media (hover: hover) {
  .card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(36, 32, 27, .10); }
}
.card:active { transform: scale(.99); }

/* 按钮：按压回弹 */
.btn { transition: transform .12s ease, background .2s ease, box-shadow .2s ease; }
.btn:active { transform: scale(.97); }
.btn-primary { box-shadow: 0 4px 12px rgba(78, 67, 56, .18); }

/* 列表项：悬停暖底 */
.list-item { transition: background .2s ease; }
@media (hover: hover) { .list-item:hover { background: rgba(246, 243, 239, .7); } }

/* 标签：点击微缩 */
.tag { transition: transform .15s ease; }
.tag:active { transform: scale(.94); }

/* 分段切换项：选中过渡 */
.seg-item { transition: background .2s ease, color .2s ease; }

/* 钱包卡片：微妙光泽渐变 */
.wallet-card {
  background:
    radial-gradient(120% 140% at 85% -10%, rgba(255,255,255,.10) 0%, transparent 55%),
    linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
}

/* 悬浮按钮：按压反馈（不加无限动画） */
.fab { transition: transform .15s ease; }
.fab:active { transform: scale(.92); }
