/* 掌柜会员账 · 电脑版。色值与小程序 styles/variables.wxss 同源；窄屏（≤760px）见文末「H5 适配」。 */

:root {
  --c-primary: #07c160;
  --c-primary-dark: #06ad56;
  --c-primary-light: #e8f8ef;
  --c-recharge: #07c160;
  --c-consume: #ff9500;
  --c-consume-bg: rgba(255, 149, 0, 0.12);
  --c-reversed: #9099a6;
  --c-reversed-bg: rgba(144, 153, 166, 0.14);
  --c-danger: #fa5151;
  --c-danger-bg: rgba(250, 81, 81, 0.1);
  --c-warning: #b07d00;
  --c-warning-bg: rgba(255, 195, 0, 0.16);
  --c-link: #576b95;
  --c-balance: #07c160;
  --c-times: #3478f6;
  --c-points: #ff9f0a;
  --c-points-bg: rgba(255, 159, 10, 0.12);
  --c-text: #191919;
  --c-text-2: #6b7280;
  --c-text-3: #a3a9b3;
  --c-border: #e6e8eb;
  --c-divider: #f1f2f4;
  --c-bg: #f5f6f7;
  --c-card: #ffffff;
  --c-side: #ffffff;
  --c-mask: rgba(15, 23, 42, 0.45);
  --card-grad-a: #12d978;
  --card-grad-b: #07a653;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --side-w: 220px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-link); text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }

.text-secondary { color: var(--c-text-2); }
.text-placeholder { color: var(--c-text-3); }
.text-danger { color: var(--c-danger); }
.text-reversed { color: var(--c-reversed); }
.amount-recharge, .amount-balance { color: var(--c-balance); }
.amount-consume { color: var(--c-consume); }
.amount-points { color: var(--c-points); }
.amount-times { color: var(--c-times); }
.link { color: var(--c-link); font-size: 13px; }
.link:hover { text-decoration: underline; }

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

.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w);
  flex: none;
  background: var(--c-side);
  border-right: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--c-text); padding: 4px 8px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--c-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px;
}
.brand-text { font-weight: 600; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--c-text-2); background: var(--c-divider); border-radius: 4px; padding: 1px 6px; }
.brand-lg .brand-mark { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; }
.brand-lg .brand-text { font-size: 20px; }

.side-group { margin-bottom: 18px; }
.side-group-title { font-size: 12px; color: var(--c-text-3); padding: 0 10px 6px; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--c-text); font-size: 14px; min-height: 38px;
}
.side-link:hover { background: var(--c-divider); }
.side-link-active { background: var(--c-primary-light); color: var(--c-primary-dark); font-weight: 600; }
.side-icon { width: 18px; text-align: center; color: var(--c-text-2); }
.side-link-active .side-icon { color: var(--c-primary); }

.body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 24px; background: var(--c-card); border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 20;
}
.top-right { display: flex; align-items: center; gap: 14px; }
.top-user { color: var(--c-text-2); font-size: 13px; }
.top-logout { border: 0; background: none; color: var(--c-link); cursor: pointer; padding: 8px 4px; }
.main { flex: 1; padding: 24px; }
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* 门店切换 */
.switcher { position: relative; min-width: 0; }
.switcher-trigger {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--c-border); background: var(--c-card);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; min-height: 38px; max-width: 360px;
}
.switcher-trigger:hover { border-color: #cfd3d8; }
.switcher-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher-role { font-size: 12px; color: var(--c-text-2); background: var(--c-divider); border-radius: 4px; padding: 0 6px; flex: none; }
.switcher-caret { color: var(--c-text-3); font-size: 12px; }
.switcher-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px; max-width: 90vw; background: var(--c-card);
  border: 1px solid var(--c-border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30;
  max-height: 70vh; overflow-y: auto;
}
.switcher-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--c-text); min-height: 40px; }
.switcher-item:hover { background: var(--c-divider); }
.switcher-item .switcher-name { flex: 1; font-weight: 500; }
.switcher-item-active { background: var(--c-primary-light); }
.switcher-extra { color: var(--c-link); }
.switcher-sep { height: 1px; background: var(--c-divider); margin: 6px 4px; }

.store-logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: var(--c-divider); }
.store-logo-sm { width: 24px; height: 24px; font-size: 12px; }
.store-logo-lg { width: 48px; height: 48px; font-size: 20px; }
.store-logo-text { display: inline-flex; align-items: center; justify-content: center; background: var(--c-primary-light); color: var(--c-primary-dark); font-weight: 600; }

/* --- 页面通用 ----------------------------------------------------------- */

.page-head { display: flex; flex-direction: column; gap: 4px; }
.page-head-row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 600; line-height: 1.3; }
.page-sub { color: var(--c-text-2); font-size: 13px; }
.page-foot { color: var(--c-text-3); font-size: 12px; text-align: center; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { color: var(--c-text-2); font-size: 13px; }

.card { background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 16px; font-weight: 600; }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.notice-card p { color: var(--c-text-2); }
.form-card { max-width: 640px; }
.danger-zone { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; max-width: 640px; }
.divider { height: 1px; background: var(--c-divider); }
.empty-line { padding: 8px 0; }

.banner { border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.banner-warning { background: var(--c-warning-bg); color: var(--c-warning); }
.banner-info { background: var(--c-divider); color: var(--c-text-2); }
.usage-line { color: var(--c-text-3); font-size: 12px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* --- 按钮 & 表单 --------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 18px;
  border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-size: 14px; font-weight: 500;
  white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--c-primary-dark); }
.btn-secondary { background: var(--c-card); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:not(:disabled):hover { border-color: #c9cdd3; background: #fafafa; }
.btn-warn { background: var(--c-consume); color: #fff; }
.btn-warn:not(:disabled):hover { background: #e88700; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:not(:disabled):hover { background: #e54646; }
.btn-danger-text { background: none; color: var(--c-danger); border-color: transparent; padding: 0 8px; }
.btn-text { background: none; color: var(--c-link); border-color: transparent; padding: 0 8px; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-danger-text.btn-sm, .btn-text.btn-sm { padding: 0 6px; }

.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--c-text-2); font-weight: 500; }
.field-label .req { color: var(--c-danger); font-style: normal; margin-left: 2px; }
.field-hint { font-size: 12px; color: var(--c-text-3); }
.field-error { font-size: 12px; color: var(--c-danger); }
.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--c-border); border-radius: 8px;
  font: inherit; font-size: 14px; color: var(--c-text); background: #fff; outline: none;
}
.input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12); }
.input:disabled { background: var(--c-divider); color: var(--c-text-2); }
.input.is-error { border-color: var(--c-danger); }
.textarea { resize: vertical; min-height: 72px; }
.input-money { font-size: 22px; font-weight: 600; min-height: 48px; font-variant-numeric: tabular-nums; }
.input-short { width: 90px; text-align: center; }
.input-code { font-size: 20px; letter-spacing: 4px; text-transform: uppercase; max-width: 280px; font-family: ui-monospace, Menlo, monospace; }
.input-search { min-height: 44px; padding-left: 14px; }
select.input { appearance: auto; }
.inline-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; min-height: 32px; }
.check input { width: 16px; height: 16px; accent-color: var(--c-primary); }
.search-bar { max-width: 520px; }

.logo-row { display: flex; align-items: center; gap: 16px; }
.logo-preview {
  width: 72px; height: 72px; border-radius: 50%; border: 1px dashed var(--c-border); background: var(--c-divider);
  display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; flex: none; font-size: 12px;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.logo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 分段 */
.seg { display: inline-flex; background: var(--c-divider); border-radius: 8px; padding: 3px; gap: 2px; }
.seg-inline { align-self: flex-start; }
.seg-item { border: 0; background: none; padding: 6px 16px; border-radius: 6px; cursor: pointer; color: var(--c-text-2); min-height: 32px; }
.seg-active { background: #fff; color: var(--c-text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.seg-item:disabled { cursor: not-allowed; opacity: 0.6; }

/* 选择列表（开卡 / 核销） */
.choice-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px;
  border: 1px solid var(--c-border); border-radius: 8px; background: #fff; cursor: pointer; min-height: 56px;
}
.choice:hover { border-color: #c9cdd3; }
.choice-active { border-color: var(--c-primary); background: var(--c-primary-light); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.choice:disabled { cursor: not-allowed; opacity: 0.7; }

.badge { display: inline-flex; align-items: center; font-size: 12px; line-height: 1; padding: 4px 7px; border-radius: 4px; white-space: nowrap; font-weight: 500; }
.badge-success { background: var(--c-primary-light); color: var(--c-primary-dark); }
.badge-danger { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-reversed { background: var(--c-reversed-bg); color: var(--c-reversed); }

.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--c-primary-light); color: var(--c-primary-dark); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; }
.chip-x { border: 0; background: rgba(0, 0, 0, 0.06); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; color: inherit; }
.filter-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filter-item { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--c-text-2); }
.filter-item .input { min-width: 150px; }

/* --- 表格 ------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--c-text-2); font-size: 12px; padding: 10px 16px; background: #fafbfc; border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--c-divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.row-clickable { cursor: pointer; }
.row-clickable:hover td { background: #f8fbf9; }
.row-reversed td { color: var(--c-reversed); }
.col-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.col-num { text-align: right; }
.col-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.col-remark { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 6px; }
.card .table-wrap { margin: 0 -20px; }
.card .table th:first-child, .card .table td:first-child { padding-left: 20px; }
.card-flush .table-wrap { margin: 0; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 16px; color: var(--c-text-2); font-size: 13px; }
.pager-total { margin-right: auto; }
.pager-mini { justify-content: flex-start; color: var(--c-text-3); }
.card:not(.card-flush) .pager { padding: 8px 0 0; }

.tx-type { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tx-icon { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.tx-icon-lg { width: 44px; height: 44px; font-size: 18px; }
.tx-icon-recharge { background: var(--c-primary-light); color: var(--c-primary-dark); }
.tx-icon-consume { background: var(--c-consume-bg); color: var(--c-consume); }
.tx-icon-points { background: var(--c-points-bg); color: var(--c-points); }
.tx-icon-reversed { background: var(--c-reversed-bg); color: var(--c-reversed); }
.tx-card-name { font-size: 12px; }
.tx-delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.tx-delta-recharge { color: var(--c-recharge); }
.tx-delta-consume { color: var(--c-consume); }
.tx-delta-neutral, .tx-delta-reversed { color: var(--c-reversed); }
.row-reversed .tx-delta { text-decoration: line-through; }

/* --- 状态块 ------------------------------------------------------------ */

.state-block { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 16px; color: var(--c-text-2); flex-wrap: wrap; text-align: center; }
.state-error { color: var(--c-danger); }
.state-empty { flex-direction: column; color: var(--c-text-3); }
.empty-icon { font-size: 28px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--c-border); border-top-color: var(--c-primary); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- 工作台 ------------------------------------------------------------ */

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: #fafbfc; border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { color: var(--c-text-2); font-size: 13px; }
.stat-value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-sub { color: var(--c-text-3); font-size: 12px; }

/* --- 会员卡面 & 详情 ------------------------------------------------------ */

.member-hero { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.member-card-face, .wallet-card {
  background: linear-gradient(135deg, var(--card-grad-a), var(--card-grad-b)); color: #fff; border-radius: 14px; padding: 22px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: 0 8px 24px rgba(7, 166, 83, 0.25); min-height: 180px;
}
.face-top { display: flex; align-items: center; gap: 10px; }
.face-name { font-size: 20px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face-tag { font-size: 12px; background: rgba(255, 255, 255, 0.22); border-radius: 4px; padding: 2px 8px; flex: none; }
.face-sub { color: rgba(255, 255, 255, 0.8); font-size: 13px; }
.face-logo { border: 2px solid rgba(255, 255, 255, 0.6); }
.face-cols { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: auto; padding-top: 14px; }
.face-cols > div { display: flex; flex-direction: column; align-items: center; gap: 2px; border-left: 1px solid rgba(255, 255, 255, 0.3); min-width: 0; }
.face-cols > div:first-child { border-left: 0; }
.face-cols span { font-size: 12px; color: rgba(255, 255, 255, 0.8); }
.face-cols strong { font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: center; }
.member-ops { background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.ops-main { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ops-main .btn { min-height: 48px; font-size: 16px; }
.ops-sub { display: flex; gap: 8px; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--c-text-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv-compact { font-size: 13px; gap: 6px 14px; }
.kv-wide { gap: 12px 24px; }

.mcard-list { display: flex; flex-direction: column; gap: 10px; }
.mcard { border: 1px solid var(--c-border); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.mcard .btn { align-self: flex-start; }
.mcard-off { background: #fafbfc; }
.mcard-off strong, .mcard-off .amount-times { color: var(--c-reversed); }
.mcard-head, .mcard-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.ledger-member { padding: 10px 12px; background: var(--c-divider); border-radius: 8px; }
.ledger-result { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; text-align: center; }
.ledger-result .kv { text-align: left; }
.ledger-result-ok { width: 52px; height: 52px; border-radius: 50%; background: var(--c-primary-light); color: var(--c-primary); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; }
.ledger-result h4 { font-size: 18px; }

.tx-detail-head { display: flex; align-items: center; gap: 14px; }
.tx-detail-head > div { flex: 1; }

/* 门店 / 卡包 */
.store-list { display: flex; flex-direction: column; gap: 8px; }
.store-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--c-border); border-radius: 10px; color: var(--c-text); }
.store-card:hover { border-color: var(--c-primary); background: #f8fbf9; }
.store-card-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chev { color: var(--c-text-3); font-size: 20px; }
.join-store { display: flex; align-items: center; gap: 12px; }
.wallet { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.wallet-card { color: #fff; }
.wallet-card:hover { transform: translateY(-1px); }
.wallet-card-closed { filter: grayscale(0.85); }
.bill-list { list-style: none; margin: 0; padding: 0; }
.bill { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-divider); }
.bill:last-child { border-bottom: 0; }
.bill-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bill-side { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.bill-reversed .bill-main strong { text-decoration: line-through; color: var(--c-reversed); }

.invite-share { display: flex; align-items: center; gap: 20px; padding: 14px; background: var(--c-primary-light); border-radius: 10px; flex-wrap: wrap; }
.invite-share > div:last-child { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.invite-code { font-family: ui-monospace, Menlo, monospace; font-size: 30px; letter-spacing: 6px; font-weight: 700; color: var(--c-primary-dark); }

/* --- 弹窗 & toast -------------------------------------------------------- */

.mask { position: fixed; inset: 0; background: var(--c-mask); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; animation: fade 0.15s ease-out; }
.modal { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop 0.18s ease-out; }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 520px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-x { border: 0; background: none; font-size: 22px; color: var(--c-text-3); cursor: pointer; width: 36px; height: 36px; border-radius: 8px; }
.modal-x:hover { background: var(--c-divider); }
.modal-body { padding: 10px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-text { color: var(--c-text-2); }
.modal-error { margin: 0; }
.form-error { color: var(--c-danger); font-size: 13px; background: var(--c-danger-bg); border-radius: 8px; padding: 8px 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } }

.toast {
  position: fixed; left: 50%; top: 20px; transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 200;
  transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg);
}
.toast-show { opacity: 1; transform: translate(-50%, 0); }
.toast-success { background: #0b8a46; }
.toast-error { background: #d93f3f; }

/* --- 登录 ------------------------------------------------------------- */

.public-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: radial-gradient(1200px 600px at 10% 0%, #e3f7ec 0%, transparent 60%), var(--c-bg); }
.login-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 380px); gap: 56px; align-items: center; max-width: 980px; width: 100%; }
.login-intro { display: flex; flex-direction: column; gap: 16px; }
.login-title { font-size: 34px; line-height: 1.25; font-weight: 700; letter-spacing: -0.5px; }
.login-desc { color: var(--c-text-2); font-size: 16px; max-width: 460px; }
.login-points { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.login-points li { padding-left: 24px; position: relative; }
.login-points li::before { content: '✓'; position: absolute; left: 0; color: var(--c-primary); font-weight: 700; }
.login-foot { color: var(--c-text-3); font-size: 12px; }
.login-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login-card-title { font-size: 18px; font-weight: 600; }
.qr-box { position: relative; width: 240px; height: 240px; border-radius: 12px; border: 1px solid var(--c-border); display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; }
.qr-img { width: 220px; height: 220px; object-fit: contain; }
.qr-spinner { position: absolute; display: none; }
.qr-loading .qr-spinner { display: inline-block; }
.qr-overlay { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-weight: 600; }
.login-status { font-size: 15px; font-weight: 500; }
.login-status-ok { color: var(--c-primary-dark); }
.login-help { color: var(--c-text-2); font-size: 13px; }
.login-note { color: var(--c-warning); background: var(--c-warning-bg); border-radius: 8px; padding: 8px 10px; font-size: 12px; }

/* --- H5 适配（≤760px）：侧栏变顶部横滑导航，表格转卡片，表单与按钮加大点击区 -------- */

@media (max-width: 1080px) {
  .detail-grid, .member-hero { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell { flex-direction: column; }
  .side { position: static; width: 100%; height: auto; padding: 10px 16px 0; border-right: 0; border-bottom: 1px solid var(--c-border); overflow: visible; }
  .brand { padding: 2px 0 8px; }
  .side-nav { display: flex; gap: 4px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 8px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-group { display: contents; }
  .side-group-title { display: none; }
  .side-link { flex: none; padding: 8px 12px; white-space: nowrap; }
  .top { position: static; height: auto; padding: 10px 16px; flex-wrap: wrap; }
  .top-user { display: none; }
  .switcher { flex: 1; }
  .switcher-trigger { max-width: 100%; width: 100%; }
  .switcher-menu { min-width: 0; width: 100%; }
  .main { padding: 16px; }
  .page-title { font-size: 20px; }
  .card { padding: 16px; }
  .home-grid, .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 20px; }
  .input, select.input { font-size: 16px; min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-item .input { min-width: 0; }
  .danger-zone { flex-direction: column; align-items: stretch; }
  .search-bar { max-width: none; }
  .face-cols strong { font-size: 17px; }

  /* 表格转卡片：每行一张卡，单元格用 data-label 当左侧标题 */
  .card .table-wrap { margin: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 8px solid var(--c-bg); padding: 8px 0; }
  .card:not(.card-flush) .table tr { border: 1px solid var(--c-border); border-radius: 8px; margin-bottom: 8px; }
  .table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 6px 14px; text-align: right; min-height: 34px; }
  .card .table th:first-child, .card .table td:first-child { padding-left: 14px; }
  .table td::before { content: attr(data-label); color: var(--c-text-3); font-size: 13px; text-align: left; flex: none; }
  .col-remark { max-width: none; white-space: normal; }
  .pager { flex-wrap: wrap; }

  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; }
  .mask { align-items: flex-end; padding: 0; }
  .modal { border-radius: 14px 14px 0 0; max-height: 92vh; max-width: none; }

  .login-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .login-title { font-size: 24px; }
  .login-points { display: none; }
  .login-card { padding: 20px; }
}
