/* ============================================================
   会员到期提醒 · 黑金深色主题
   ============================================================ */
:root {
  --primary-color: #d4af37;
  --primary-contrast: #171204;
  --primary-light: rgba(212, 175, 55, 0.16);
  --primary-dark: #b8962e;
  --bg-primary: #0f1115;
  --bg-secondary: #181b22;
  --bg-input: #10131a;
  --text-main: #f0ede4;
  --text-muted: #9aa0ab;
  --border-color: #2b2f38;
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.14);
  --warn: #fb923c;
  --warn-light: rgba(251, 146, 60, 0.14);
  --ok: #4ade80;
  --ok-light: rgba(74, 222, 128, 0.12);
  --card-radius: 12px;
  --font-body: -apple-system, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  --transition-fast: 150ms ease;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[v-cloak] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.65;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color-scheme: dark; }

/* ---------------- 登录 / 强制改密页 ---------------- */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-wrap { width: 400px; max-width: 94vw; }
.login-logo { text-align: center; margin-bottom: 22px; }
.logo-big { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, #3a2f10, #d4af37); margin: 0 auto 10px; }
.login-logo .t { font-size: 22px; font-weight: 800; }
.login-logo .s { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ---------------- 主布局 ---------------- */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 190px; flex: 0 0 190px; background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column; padding: 16px 10px;
  position: sticky; top: 0; height: 100vh;
}
.app-brand { font-size: 17px; font-weight: 700; color: var(--primary-color); padding: 4px 10px 16px; display: flex; align-items: center; gap: 8px; }
.logo-dot { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #3a2f10, #d4af37); flex: 0 0 22px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px;
  border: none; background: none; font-size: 14px; color: var(--text-muted);
  text-align: left; margin-bottom: 4px; transition: all var(--transition-fast); width: 100%;
}
.nav-item:hover { background: var(--bg-primary); color: var(--text-main); }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-item svg { width: 16px; height: 16px; flex: 0 0 16px; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--border-color); padding-top: 10px; }
.app-main { flex: 1; padding: 22px 26px 48px; min-width: 0; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.proto-h1 { font-size: 21px; font-weight: 700; margin-bottom: 4px; }
.proto-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.proto-note { font-size: 12px; color: var(--text-muted); }

/* ---------------- 汇总条 ---------------- */
.summary-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-pill {
  background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px;
  padding: 10px 16px; min-width: 118px; text-align: left; color: var(--text-main);
  font-family: inherit; transition: border-color var(--transition-fast);
}
.stat-pill:hover { border-color: var(--primary-color); }
.stat-pill .num { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-pill .lbl { font-size: 12px; color: var(--text-muted); }
.stat-pill.danger .num { color: var(--danger); }
.stat-pill.warn .num { color: var(--warn); }
.stat-pill.ok .num { color: var(--ok); }
.stat-pill.grey .num { color: var(--text-muted); }

/* ---------------- 分组与卡片 ---------------- */
.group-title {
  font-size: 13px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.03em;
  margin: 18px 0 10px; display: flex; align-items: center; gap: 8px;
  scroll-margin-top: 12px;
}
.gdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.gdot.danger { background: var(--danger); }
.gdot.warn { background: var(--warn); }
.gdot.muted { background: var(--text-muted); }
.gdot.ok { background: var(--ok); }
.gdot.teal { background: var(--primary-color); }

.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.member-card {
  background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--card-radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; transition: border-color var(--transition-fast);
}
.member-card:hover { border-color: var(--primary-color); }
.member-card.expired { opacity: 0.85; }
.member-card.expired .mc-name { color: var(--text-muted); }
.mc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mc-name { font-size: 15px; font-weight: 700; }
.mc-plan { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; flex: 0 0 auto; }
.badge.danger { background: var(--danger-light); color: var(--danger); }
.badge.warn { background: var(--warn-light); color: var(--warn); }
.badge.ok { background: var(--ok-light); color: var(--ok); }
.badge.grey { background: rgba(154, 160, 171, 0.15); color: var(--text-muted); }
.badge.teal { background: var(--primary-light); color: var(--primary-color); }
.mc-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { font-size: 11px; color: var(--text-muted); background: var(--bg-primary); border-radius: 5px; padding: 2px 7px; }
.chip.auto { color: var(--warn); background: var(--warn-light); }
.mc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; gap: 8px; flex-wrap: wrap; }
.mc-date { font-size: 12px; color: var(--text-muted); }
.mc-actions { display: flex; gap: 8px; }

/* 空状态 */
.empty-state { border: 1px dashed var(--border-color); border-radius: 14px; padding: 56px 20px; text-align: center; color: var(--text-muted); }
.empty-t { font-size: 16px; font-weight: 700; color: var(--text-main); margin-bottom: 6px; }
.empty-s { font-size: 13px; margin-bottom: 16px; }

/* ---------------- 按钮 ---------------- */
.btn { border: none; border-radius: 8px; padding: 8px 18px; font-size: 14px; font-weight: 600; transition: all var(--transition-fast); }
.btn-primary { background: var(--primary-color); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border-color); }
.btn-ghost:hover { color: var(--text-main); border-color: var(--text-muted); }
.btn-danger { background: var(--danger); color: #2a0b0b; }
.btn-danger:hover { background: #ef5b5b; }
.btn-danger-ghost { background: transparent; color: var(--danger); border: 1px solid var(--danger-light); }
.btn-danger-ghost:hover { border-color: var(--danger); }
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.text-danger { color: var(--danger); }

/* ---------------- 表单 ---------------- */
.form-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 14px; padding: 26px 30px; width: 640px; max-width: 100%; }
.form-title { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 13px; font-weight: 600; color: var(--text-main); }
.form-field label .req { color: var(--danger); margin-left: 2px; }
.s-sub-inline { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--border-color); border-radius: 8px; padding: 9px 12px;
  background: var(--bg-input); color: var(--text-main); outline: none; width: 100%;
}
.form-field select option { background: var(--bg-secondary); color: var(--text-main); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-field input:disabled { opacity: 0.45; cursor: not-allowed; }
.form-field input.err, .form-field select.err { border-color: var(--danger); }
.field-err { font-size: 12px; color: var(--danger); }
.form-err { color: var(--danger); font-size: 13px; margin: 8px 0; }
.form-hint { font-size: 12px; color: var(--text-muted); }
.form-check { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); font-weight: 400; cursor: pointer; }
.form-check input { width: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.switch { width: 48px; min-height: 26px; border-radius: 13px; background: var(--border-color); position: relative; border: none; transition: background 0.2s; flex: 0 0 48px; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left 0.2s; }
.switch.on { background: var(--primary-color); }
.switch.on::after { left: 25px; }

/* ---------------- 弹窗 ---------------- */
.modal-dim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.62); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 14px;
  padding: 26px 30px; width: 640px; max-width: 100%; max-height: calc(100vh - 40px); overflow-y: auto;
}
.modal-card.small { width: 440px; }
.modal-card.detail-modal { width: 780px; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.confirm-text { font-size: 14px; line-height: 1.8; margin-bottom: 8px; }

/* 续费弹窗 */
.renew-summary { background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 10px; padding: 4px 16px; margin-bottom: 12px; }
.renew-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border-color); font-size: 14px; }
.renew-row:last-child { border-bottom: none; }
.renew-row .k { color: var(--text-muted); flex: 0 0 auto; }
.renew-row .v { text-align: right; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.renew-cycle { font-size: 13px; }
.renew-rule { font-size: 12px; color: var(--text-muted); background: var(--warn-light); border-radius: 8px; padding: 10px 12px; line-height: 1.7; }
.inline-select, .inline-input {
  background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-main);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none;
}
.inline-input:focus, .inline-select:focus { border-color: var(--primary-color); }
.inline-input.xs-num { width: 110px; }
.num-input { background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 8px; padding: 8px 10px; width: 110px; outline: none; }
.num-input:focus { border-color: var(--primary-color); }
.num-input.xs { width: 76px; }

/* 详情弹窗 */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.kv { display: flex; gap: 10px; font-size: 13px; }
.kv .k { color: var(--text-muted); flex: 0 0 70px; }
.kv .v { color: var(--text-main); word-break: break-all; }

/* 时间线 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--border-color); }
.tl-item { position: relative; padding: 9px 0 9px 14px; }
.tl-item::before { content: ''; position: absolute; left: -19px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary-color); border: 2px solid var(--bg-secondary); }
.tl-item.gap::before { background: var(--warn); }
.tl-date { font-weight: 700; font-size: 14px; }
.tl-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.tl-tag { display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--warn-light); color: var(--warn); font-weight: 600; }

/* ---------------- 统计页 ---------------- */
.stats-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: 12px; padding: 18px 22px; margin-bottom: 16px;
}
.big-num { font-size: 30px; font-weight: 800; color: var(--primary-color); line-height: 1.3; }
.mid-num { font-size: 22px; font-weight: 700; }
.lbl { font-size: 12px; color: var(--text-muted); }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-label { flex: 0 0 110px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; color: var(--text-main); }
.bar-track { flex: 1; height: 10px; background: var(--bg-input); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #8a6d1d, var(--primary-color)); border-radius: 5px; }
.bar-fill.dim { background: linear-gradient(90deg, #5a4a18, var(--primary-dark)); }
.bar-val { flex: 0 0 84px; font-size: 13px; text-align: right; color: var(--text-muted); }

/* ---------------- 设置页 ---------------- */
.settings-section {
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 14px;
}
.settings-section h4 { font-size: 14px; margin-bottom: 12px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 0; }
.s-label { font-size: 14px; }
.s-sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 400; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 3000;
  padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); max-width: 92vw;
}
.toast.ok { background: #12301c; color: var(--ok); border: 1px solid rgba(74, 222, 128, 0.4); }
.toast.error { background: #3a1516; color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.4); }
.toast.info { background: #2c2410; color: var(--primary-color); border: 1px solid rgba(212, 175, 55, 0.4); }

/* ---------------- 移动端自适应 ---------------- */
@media (max-width: 760px) {
  .app-layout { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; flex-direction: row; align-items: center;
    padding: 8px 12px; gap: 2px; height: auto; position: sticky; top: 0; z-index: 100;
    border-right: none; border-bottom: 1px solid var(--border-color);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .app-brand { padding: 0 8px 0 0; font-size: 15px; flex: 0 0 auto; }
  .logo-dot { width: 18px; height: 18px; flex-basis: 18px; }
  .nav-item { padding: 10px 12px; margin-bottom: 0; min-height: 44px; white-space: nowrap; flex: 0 0 auto; }
  .nav-item svg { display: none; }
  .sidebar-bottom { margin-top: 0; margin-left: auto; border-top: none; padding-top: 0; }
  .app-main { padding: 14px 14px 40px; }
  .card-grid { grid-template-columns: 1fr; }
  .stat-pill { flex: 1 1 30%; min-width: 0; padding: 10px 12px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .mc-actions .btn-sm { min-height: 40px; }
  .modal-dim { padding: 10px; align-items: flex-start; }
  .modal-card { padding: 18px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: 1fr; }
  .bar-label { flex-basis: 84px; font-size: 12px; }
  .bar-val { flex-basis: 76px; }
  .setting-row { flex-wrap: wrap; }
  .mc-actions { flex: 1 1 100%; justify-content: flex-end; }
  .mc-actions .btn { flex: 0 0 auto; padding: 8px 18px; }
  .detail-head { flex-direction: column; }
  .stats-hero { flex-direction: row; padding: 14px 16px; }
  .big-num { font-size: 24px; }
}
