/* ==========================================================================
   同安区新联会 · 会员会费缴纳系统  公共样式
   ========================================================================== */
:root {
  --brand-red: #c8161d;
  --brand-red-dark: #a30f16;
  --brand-red-soft: #fdeceb;
  --brand-blue: #1e2a63;
  --brand-blue-dark: #141d47;
  --brand-blue-soft: #eceefa;
  --gold: #c9a227;
  --gold-soft: #fbf4e0;

  --bg: #f2f3f5;
  --card: #ffffff;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #969ba3;
  --line: #e6e8eb;
  --line-soft: #f0f1f3;

  --green: #12a150;
  --green-soft: #e8f7ef;
  --orange: #e8890c;
  --orange-soft: #fdf3e3;
  --gray-soft: #eef0f2;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 2px 10px rgba(20, 29, 71, 0.06);
  --shadow-lg: 0 12px 40px rgba(20, 29, 71, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-blue); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ---------- 通用元件 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px;
  transition: filter .15s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:active { filter: brightness(.93); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark)); color: #fff; }
.btn-blue { background: var(--brand-blue); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: #c9ccd1; }
.btn-danger { background: #fff; color: var(--brand-red); border: 1px solid #f3c6c3; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  line-height: 1.7; white-space: nowrap;
}
.tag-wait { background: var(--gray-soft); color: var(--text-2); }
.tag-pending { background: var(--orange-soft); color: var(--orange); }
.tag-paid { background: var(--green-soft); color: var(--green); }
.tag-blue { background: var(--brand-blue-soft); color: var(--brand-blue); }
.tag-red { background: var(--brand-red-soft); color: var(--brand-red); }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-wait { background: #b6bbc2; }
.dot-pending { background: var(--orange); }
.dot-paid { background: var(--green); }

.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(30, 42, 99, .09);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.65; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }

/* ---------- 提示条 ---------- */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.7; }
.alert.ok { background: var(--green-soft); color: #0b6f37; }
.alert.err { background: var(--brand-red-soft); color: var(--brand-red-dark); }
.alert.warn { background: var(--gold-soft); color: #92590a; }

/* ---------- 状态提示条 ---------- */
.status-line {
  display: flex; align-items: center; gap: 8px; margin-top: 13px; padding: 11px 13px;
  border-radius: 11px; font-size: 13.5px; line-height: 1.55;
}
.status-wait { background: var(--gray-soft); color: #5b6169; }
.status-pending { background: var(--orange-soft); color: #92590a; }
.status-paid { background: var(--green-soft); color: #0b6f37; }
.status-line .ic { font-size: 17px; }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- 加载 / 提示 ---------- */
.spinner {
  width: 22px; height: 22px; border: 2.5px solid rgba(30, 42, 99, .18);
  border-top-color: var(--brand-blue); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-mask {
  position: fixed; inset: 0; background: rgba(255,255,255,.72);
  display: flex; align-items: center; justify-content: center; z-index: 900;
  backdrop-filter: blur(1px);
}
.toast-wrap {
  position: fixed; left: 0; right: 0; top: 18px; z-index: 2000;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  max-width: min(88vw, 460px); padding: 11px 18px; border-radius: 10px;
  background: rgba(31, 35, 41, .93); color: #fff; font-size: 14px;
  box-shadow: 0 8px 26px rgba(0,0,0,.22); animation: toastIn .22s ease;
}
.toast.ok { background: rgba(18, 161, 80, .95); }
.toast.err { background: rgba(200, 22, 29, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- 模态 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 18, 24, .5); z-index: 1500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
  max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line-soft);
  display: flex; gap: 10px; justify-content: flex-end;
  position: sticky; bottom: 0; background: #fff;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th {
  text-align: left; padding: 10px 12px; background: #f7f8fa; color: var(--text-2);
  font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.grid tbody tr:hover { background: #fafbfc; }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ---------- 空状态 ---------- */
.blank { padding: 34px 16px; text-align: center; color: var(--text-3); }
.blank .big { font-size: 34px; margin-bottom: 6px; opacity: .5; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3d6db; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
