/* ============================================================
   瑾澜 JINLAN 会员系统 · 白金主题
   取色自品牌 LOGO：暖金渐变 + 象牙白
   ============================================================ */

:root {
  /* 金 */
  --gold-900: #6E5326;
  --gold-800: #8A6A32;
  --gold-700: #A17E3E;
  --gold-600: #B08D4F;
  --gold-500: #C2A164;
  --gold-400: #D6BB86;
  --gold-300: #E4D0A9;
  --gold-200: #EFE2C8;
  --gold-100: #F7EFE0;

  /* 中性 */
  --ivory:    #FAF7F2;
  --paper:    #FFFFFF;
  --ink:      #241F19;
  --ink-soft: #5A5148;
  --muted:    #8E8578;
  --line:     rgba(138, 106, 50, 0.16);
  --line-soft:rgba(138, 106, 50, 0.08);

  /* 语义色 */
  --success: #4C7A54;
  --danger:  #A8453C;
  --warning: #B5813A;

  /* 渐变 */
  --grad-gold: linear-gradient(135deg, #E4D0A9 0%, #C2A164 38%, #A17E3E 70%, #D6BB86 100%);
  --grad-gold-soft: linear-gradient(135deg, #FDFBF7 0%, #F7EFE0 100%);
  --grad-card: linear-gradient(150deg, #2B2419 0%, #3D3222 40%, #241E15 100%);

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(60, 45, 20, .06), 0 2px 8px rgba(60, 45, 20, .04);
  --shadow-md: 0 2px 8px rgba(60, 45, 20, .07), 0 12px 28px rgba(60, 45, 20, .07);
  --shadow-lg: 0 8px 24px rgba(60, 45, 20, .10), 0 24px 60px rgba(60, 45, 20, .10);

  --radius:    14px;
  --radius-lg: 20px;
  --radius-sm: 9px;

  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* 极淡的暖色底纹 */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(214, 187, 134, .20), transparent 60%),
    radial-gradient(900px 460px at 100% 0%, rgba(194, 161, 100, .13), transparent 62%);
  z-index: 0;
}

#app, .page { position: relative; z-index: 1; }

a { color: var(--gold-800); text-decoration: none; }
img { max-width: 100%; display: block; }
input, button, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- 排版 ---------- */
.serif { font-family: var(--font-serif); }

.gold-text {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: .01em; }
.title-lg { font-family: var(--font-serif); font-size: 26px; letter-spacing: .06em; }
.title    { font-size: 18px; font-weight: 650; letter-spacing: .02em; }
.subtitle { font-size: 13px; color: var(--muted); letter-spacing: .12em; }
.muted    { color: var(--muted); }
.small    { font-size: 12.5px; }
.mono     { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* 金色细分隔线 */
.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
  opacity: .55;
  margin: 18px 0;
}

/* ---------- 品牌标识 ---------- */
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.brand-logo { width: 92px; height: auto; }
.brand-logo.sm { width: 46px; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: .28em;
  text-indent: .28em;
  color: var(--gold-800);
}
.brand-sub {
  font-size: 11px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--muted);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.card-body { padding: 18px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-weight: 550; font-size: 14.5px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--gold-400); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--grad-gold);
  border-color: transparent;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(90, 65, 20, .28);
  box-shadow: 0 2px 6px rgba(161, 126, 62, .28);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(161, 126, 62, .36); border-color: transparent; }

.btn-dark { background: #2B2419; border-color: #2B2419; color: var(--gold-300); }
.btn-danger { color: var(--danger); border-color: rgba(168, 69, 60, .3); }
.btn-danger:hover { background: rgba(168, 69, 60, .06); border-color: rgba(168, 69, 60, .5); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--gold-800); padding: 8px 12px; }
.btn-ghost:hover { background: var(--gold-100); box-shadow: none; }
.btn-lg { padding: 15px 26px; font-size: 16px; width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 15px; }
.label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 550; color: var(--ink-soft); letter-spacing: .03em;
}
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(194, 161, 100, .16);
}
.input::placeholder { color: #B8AFA1; }
.input.lg { padding: 15px 16px; font-size: 17px; }
.input-hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.textarea { resize: vertical; min-height: 74px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

/* ---------- 标签 / 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  background: var(--gold-100);
  color: var(--gold-800);
  border: 1px solid var(--gold-200);
}
.badge-gold { background: var(--grad-gold); color: #fff; border-color: transparent; }
.badge-muted { background: #F2EFE9; color: var(--muted); border-color: transparent; }
.badge-green { background: rgba(76,122,84,.10); color: var(--success); border-color: rgba(76,122,84,.2); }
.badge-red { background: rgba(168,69,60,.09); color: var(--danger); border-color: rgba(168,69,60,.2); }

/* ---------- 数据格 ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 12.5px; color: var(--muted); letter-spacing: .05em; }
.stat-value {
  margin-top: 5px;
  font-size: 25px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  color: var(--ink);
}
.stat-value .unit { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat-foot { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
table.tbl th {
  text-align: left; padding: 11px 14px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .06em;
  color: var(--muted); background: var(--gold-100);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr:hover { background: rgba(247, 239, 224, .5); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- 列表 ---------- */
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.list-item:last-child { border-bottom: 0; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-icon { font-size: 30px; opacity: .35; margin-bottom: 10px; }

/* ---------- 提示条 ---------- */
#toast-host {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(36, 31, 25, .93);
  color: #F7EFE0;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn .26s cubic-bezier(.2,.9,.3,1);
  backdrop-filter: blur(6px);
}
.toast.ok { background: rgba(58, 96, 64, .95); }
.toast.err { background: rgba(150, 58, 50, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(36, 31, 25, .42);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: 100%; max-width: 460px;
  max-height: 88vh; overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop .24s cubic-bezier(.2,.9,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98) } to { opacity: 1; transform: none } }
.modal-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px 20px; display: flex; gap: 10px; }
.modal-foot .btn { flex: 1; }
.x-btn {
  border: 0; background: transparent; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.x-btn:hover { background: var(--gold-100); color: var(--ink); }

/* ---------- 加载 ---------- */
.spinner {
  width: 17px; height: 17px;
  border: 2px solid var(--gold-200);
  border-top-color: var(--gold-600);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg) } }
.loading-page { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px; color: var(--muted); }

/* ---------- 通用布局 ---------- */
.stack > * + * { margin-top: 12px; }
.flex { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-8 { gap: 8px } .gap-12 { gap: 12px } .gap-16 { gap: 16px }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
