/* ==========================================================================
   谷子拼团管理 · 样式
   设计：左侧深色导航 + 浅色内容区，中文界面，桌面优先，窄屏可折叠
   ========================================================================== */

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e5e7eb;
  --line-soft: #f0f1f3;
  --text: #1a1d21;
  --text-2: #5b6270;
  --text-3: #8b919e;
  --brand: #4f46e5;
  --brand-soft: #eef0ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --sidebar: #1c1f26;
  --sidebar-2: #262a33;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
code { font-family: "Cascadia Mono", Consolas, monospace; background: #f1f2f4; padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------- 登录页 */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 600px at 20% 0%, #eef0ff 0%, var(--bg) 55%);
  padding: 24px;
}
/* 登录失败：把出错的输入框标红，但不改动已输入的内容 */
.input-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, .15);
}
.login-error { font-weight: 600; }

/* 字段下方的提示 / 错误行：错误就显示在出问题的那个输入框下面 */
.field-msg { font-size: 12px; line-height: 1.5; margin-top: 4px; color: var(--text-3); }
.field-msg.is-err { color: var(--danger); font-weight: 600; }

/* 头像：圆形；没图就用首字色块 */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; object-fit: cover; flex: none;
  color: #fff; font-weight: 600; line-height: 1;
}
.avatar-md { width: 34px; height: 34px; font-size: 15px; }
.avatar-sm { width: 26px; height: 26px; font-size: 12px; }
.avatar-tiny { width: 18px; height: 18px; font-size: 10px; vertical-align: -4px; }
.sidebar .me-row { display: flex; align-items: center; gap: 10px; }
.sidebar .me-info { min-width: 0; }
.sidebar .me-info b {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board-note .meta .avatar-tiny { margin-right: 4px; }

/* 注册页头像选择 */
.avatar-box {
  width: 72px; height: 72px; border-radius: 50%; cursor: pointer;
  border: 1px dashed var(--line); display: flex; align-items: center;
  justify-content: center; overflow: hidden; background: #fafbfc;
}
.avatar-box:hover { border-color: var(--brand); }
.avatar-pick { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { color: var(--text-3); font-size: 22px; line-height: 1; }

/* 待审核账号标签 */
.tag-pending { background: #fff4e5; color: #b26a00; border-color: #ffe0b2; }

/* 密码框 + 显示/隐藏开关 */
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 46px; }
.pass-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  padding: 2px 8px; font-size: 14px; line-height: 1.4;
  background: transparent; border: 0; cursor: pointer;
}

/* 预设模版列表 */
.preset-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--line-soft);
}
.preset-row:last-child { border-bottom: 0; }
.preset-title { font-weight: 600; font-size: 13.5px; }
.preset-text {
  white-space: pre-wrap; word-break: break-word;
  max-height: 3.6em; overflow: hidden;
}

.login-card {
  width: 100%;
  max-width: 880px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-side {
  background: linear-gradient(160deg, #2b2f3a 0%, #1c1f26 100%);
  color: #fff;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-side h1 { font-size: 22px; letter-spacing: .5px; }
.login-side p { color: #b9bec9; margin: 0; font-size: 13px; }
.login-side ul { margin: 6px 0 0; padding-left: 18px; color: #cfd3db; font-size: 13px; }
.login-side li { margin-bottom: 5px; }
.login-body { padding: 36px 32px; }
.role-switch { display: flex; gap: 8px; margin-bottom: 22px; background: #f1f2f5; padding: 4px; border-radius: 10px; }
.role-switch button {
  flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 8px;
  cursor: pointer; color: var(--text-2); font-weight: 500;
}
.role-switch button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.demo-hint { margin-top: 18px; font-size: 12px; color: var(--text-3); line-height: 1.8; }
.demo-hint b { color: var(--text-2); }

/* ---------------------------------------------------------- 表单元素 */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field .req::after { content: " *"; color: var(--danger); }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=search], input[type=email], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { resize: vertical; min-height: 70px; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #f7f8fa; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-danger { color: var(--danger); border-color: #f3c7c7; background: var(--danger-soft); }
.btn-danger:hover { background: #fde8e8; }
.btn-sm { padding: 4px 9px; font-size: 13px; border-radius: 6px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #f1f2f5; }
.btn-block { width: 100%; justify-content: center; padding: 10px; }

/* ---------------------------------------------------------- 应用布局 */

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; flex: 0 0 252px; background: var(--sidebar); color: #d7dae1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  padding: 20px 20px 16px; font-weight: 600; font-size: 17px; color: #fff;
  display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #2e323c;
}
.sidebar .brand small { font-weight: 400; font-size: 11.5px; color: #8b919e; display: block; margin-top: 2px; }
.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 11.5px; color: #767e8d; padding: 16px 12px 6px; letter-spacing: .6px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: 8px; color: #c7cbd4; margin-bottom: 2px; font-size: 14.5px;
}
.nav a:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.nav a.on { background: var(--brand); color: #fff; }
.nav .badge {
  background: var(--danger); color: #fff; border-radius: 10px; padding: 0 6px;
  font-size: 11px; line-height: 17px; min-width: 17px; text-align: center;
}
.nav a.on .badge { background: rgba(255, 255, 255, .28); }
.sidebar .me {
  padding: 14px 16px; border-top: 1px solid #2e323c; font-size: 13px; color: #9aa0ac;
}
.sidebar .me b { color: #fff; display: block; font-size: 14px; }
.sidebar .me .build-stamp {
  margin-top: 8px; font-size: 11px; color: #6b7280; cursor: help;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* 移动端才显示：菜单按钮与抽屉遮罩（桌面端隐藏，不影响现有布局） */
.nav-toggle { display: none; }
.sidebar-mask { display: none; }
.topbar {
  height: 54px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 20px; position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 16px; }
.topbar .spacer { flex: 1; }
.content { padding: 20px; flex: 1; }
.section { margin-bottom: 20px; }

/* ---------------------------------------------------------- 卡片 / 网格 */

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.card-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { font-size: 14.5px; }
.card-head .spacer { flex: 1; }
.card-head .sub { font-size: 12px; color: var(--text-3); }
.card-body { padding: 16px; }
.card-body.tight { padding: 10px 16px; }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid.c4, .grid.c6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .k { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.stat .v { font-size: 24px; font-weight: 600; letter-spacing: -.5px; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.stat .f { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* ---------------------------------------------------------- 状态标签 */

.status {
  display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px;
  white-space: nowrap; border: 1px solid transparent;
}
.st-pending_order { background: #f1f2f4; color: #4b5563; border-color: #e3e5e9; }
.st-not_shipped  { background: var(--warn-soft); color: #b45309; border-color: #fde68a; }
.st-in_japan     { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.st-intl_shipping{ background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.st-pending_ship { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.st-shipped      { background: var(--ok-soft); color: #15803d; border-color: #bbf7d0; }
.st-cancelled    { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }

/* 发货申请状态（与货品状态分开，语义更直白） */
.st-approved     { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.st-rejected     { background: #f4f4f5; color: #52525b; border-color: #e4e4e7; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: #f1f2f4; color: var(--text-2); font-size: 12px; }
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.pill { padding: 3px 10px; border-radius: 20px; background: #f1f2f5; font-size: 12.5px; cursor: pointer; border: 1px solid transparent; }
.pill.on { background: var(--brand-soft); color: var(--brand); border-color: #c7cbfb; font-weight: 500; }

/* ---------------------------------------------------------- 表格 */

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 9px 10px; background: #fafbfc; color: var(--text-2);
  font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr:hover { background: #fafbfd; }
table.tbl tr.selected { background: var(--brand-soft); }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .muted { color: var(--text-3); }
table.tbl .name { font-weight: 500; }

/* ---------------------------------------------------------- 提示条 */

.alert {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px;
  border: 1px solid transparent; display: flex; gap: 8px; align-items: flex-start;
}
.alert.info { background: var(--brand-soft); color: #3730a3; border-color: #c7cbfb; }
.alert.ok { background: var(--ok-soft); color: #15803d; border-color: #bbf7d0; }
.alert.warn { background: var(--warn-soft); color: #b45309; border-color: #fde68a; }
.alert.danger { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }
.alert .x { margin-left: auto; cursor: pointer; opacity: .6; }
.empty { padding: 34px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty .big { font-size: 26px; display: block; margin-bottom: 6px; opacity: .5; }

/* ---------------------------------------------------------- 弹窗 */

.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 20, 24, .5);
  display: grid; place-items: center; z-index: 100; padding: 20px;
}
/* 最后一道保险：空遮罩绝不能拦住页面点击（曾因只删卡片留下空遮罩导致“关弹窗后卡住”） */
.modal-mask:empty { display: none; pointer-events: none; }
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px; max-height: 90vh; display: flex; flex-direction: column;
}
.modal.wide { max-width: 1000px; }
.modal-head { padding: 15px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; }
.modal-head h3 { font-size: 15.5px; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; justify-content: flex-end; }
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1c1f26; color: #fff; padding: 10px 16px; border-radius: 9px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px; animation: slidein .18s ease-out;
}
.toast.ok { background: #166534; }
.toast.err { background: #991b1b; }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------- 日程 */

.agenda-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 10px; }
.day-chip {
  flex: 0 0 auto; min-width: 74px; text-align: center; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
}
.day-chip .d { font-size: 11px; color: var(--text-3); }
.day-chip .n { font-size: 19px; font-weight: 600; }
.day-chip .c { font-size: 11px; color: var(--text-3); }
.day-chip.today { border-color: var(--brand); background: var(--brand-soft); }
.day-chip.has { border-color: #fdba74; background: #fff7ed; }
.day-chip.over { border-color: #fca5a5; background: var(--danger-soft); }

.agenda-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line-soft); border-radius: 9px; margin-bottom: 7px; background: #fff;
}
.agenda-item .left { flex: 1; min-width: 0; }
.agenda-item .t { font-weight: 500; }
.agenda-item .d { font-size: 12px; color: var(--text-3); }
.agenda-item .due { text-align: right; font-size: 12.5px; white-space: nowrap; }
.agenda-item .due b { display: block; font-size: 15px; }
.due-over { color: var(--danger); }
.due-soon { color: var(--warn); }
.due-ok { color: var(--text-2); }
.agenda-item.done { opacity: .55; }
.agenda-item.done .t { text-decoration: line-through; }

/* ---------------------------------------------------------- 留言黑板 */

.board {
  background: #2f3a34;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 22px 22px;
  border-radius: 14px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  min-height: 340px;
  align-content: start;
}
.board .empty { color: #9fb0a6; }

/* 便签：黄底便利贴（不再有颜色/标签区分，只有置顶） */
.note {
  padding: 16px 16px 12px; border-radius: 3px 14px 3px 12px;
  position: relative; min-height: 132px; display: flex; flex-direction: column;
  background: #fdf0a8; border: 1px solid #e8d27a;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .22);
}
/* 顶部一条黄色装饰条 */
.note::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  border-radius: 3px 14px 0 0; background: #e0bf4a;
}
.note.pinned { box-shadow: 0 5px 14px rgba(0, 0, 0, .32); }

.note .txt {
  flex: 1; white-space: pre-wrap; word-break: break-word;
  font-size: 14px; line-height: 1.62; color: #23282e; padding-top: 4px;
}
.note .meta {
  margin-top: 10px; font-size: 11.5px; color: rgba(35, 40, 46, .58);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.note .ops { position: absolute; top: 8px; right: 8px; display: none; gap: 2px; }
.note:hover .ops { display: flex; }
.note .ops button {
  border: 0; background: rgba(255, 255, 255, .75); border-radius: 6px; cursor: pointer;
  padding: 1px 6px; font-size: 12px; color: var(--text-2);
}
.note .ops button:hover { background: #fff; color: var(--text); }
.note .pin { position: absolute; top: 9px; left: 11px; font-size: 13px; }
.note.pinned { box-shadow: 0 5px 14px rgba(0, 0, 0, .3); }

/* 新建留言：一条窄栏，把面积留给黑板 */
.compose {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 14px;
}
.compose textarea {
  flex: 1; min-height: 42px; max-height: 120px; resize: vertical;
  font-size: 13.5px; padding: 8px 10px;
}
.compose .side { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.compose select { font-size: 12.5px; padding: 5px 8px; }
.compose .pinrow {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2);
}
@media (max-width: 720px) {
  .compose { flex-direction: column; }
  .compose .side { flex-direction: row; align-items: center; }
}

/* ---------------------------------------------------------- 团员公开页（免登录）
   收款页 / 查我的谷子：手机优先，层级尽量少 */

.public-wrap { max-width: 640px; margin: 0 auto; padding: 18px 14px 60px; }
.pay-head { padding: 4px 2px 16px; }
.pay-title h1 { margin: 0 0 4px; font-size: 21px; letter-spacing: .3px; }
.pay-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 8px; font-size: 12.5px; color: var(--text-2);
}
.pay-note {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  background: var(--brand-soft); color: #3730a3;
}
.pay-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.pay-card h2 { margin: 0 0 10px; font-size: 15.5px; }
.pay-foot { text-align: center; padding: 6px 0 10px; font-size: 13px; }

.pay-names { display: flex; flex-direction: column; gap: 8px; }
.pay-name {
  display: flex; align-items: center; gap: 10px; width: 100%; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: #fbfbfd; font-size: 15px; text-align: left; color: var(--text);
  font-family: inherit;
}
.pay-name:hover { background: var(--brand-soft); border-color: #c7c9f7; }
.pay-name .nm { flex: 1; font-weight: 600; }
.pay-name .amt { color: var(--text-2); font-size: 13.5px; }

.pay-chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; border: 1px solid transparent; white-space: nowrap;
}
.pay-unpaid    { background: #fff4e5; color: #b45309; border-color: #fde3bf; }
.pay-submitted { background: #eef2ff; color: #4338ca; border-color: #d9def7; }
.pay-confirmed { background: var(--ok-soft); color: #15803d; border-color: #bbf7d0; }
.pay-rejected  { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }

.pay-me {
  padding: 12px 14px; border-radius: 12px; background: #f7f8fb;
  border: 1px solid var(--line); margin-bottom: 14px;
}
.pay-me .who { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.pay-due { font-size: 17px; color: #b91c1c; }

.pay-drop {
  border: 2px dashed #c9ccd6; border-radius: 12px; padding: 22px 14px;
  text-align: center; cursor: pointer; background: #fcfcfe;
}
.pay-drop:hover, .pay-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.pay-drop .big { font-size: 30px; }
.pay-drop .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.pay-preview {
  max-width: 100%; max-height: 240px; border-radius: 10px;
  margin-top: 10px; border: 1px solid var(--line);
}

.pay-hist {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; background: #fcfcfe; font-size: 13.5px;
}

/* 后台看付款截图 */
.proof-img {
  max-width: 100%; max-height: 460px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
}
.ml8 { margin-left: 8px; }

/* ---------------------------------------------------------- 收款码 */
.qr-cell {
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fcfcfe;
}
.qr-img {
  max-width: 200px; max-height: 200px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
}
.qr-drop {
  margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line);
  border-radius: 8px; text-align: center; cursor: pointer; font-size: 13px;
  color: var(--text-2); background: #fff;
}
.qr-drop:hover { border-color: var(--brand); color: var(--brand); }

/* 团员端收钱码 */
.pay-qr { text-align: center; }.pay-qr img {
  max-width: 240px; width: 70%; border-radius: 12px; border: 1px solid var(--line);
  background: #fff;
}
.pay-qr-empty {
  padding: 18px; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--text-3); font-size: 13.5px;
}

/* 团员端「我的应收」大金额区 */
.pay-hero { text-align: center; }
.pay-person {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; margin-bottom: 6px;
}
.pay-bigmoney {
  font-size: 38px; font-weight: 700; color: #b91c1c; line-height: 1.1;
  letter-spacing: -.5px;
}
.pay-dueline { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.pay-deadline {
  display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: #f1f2f4; color: var(--text-2);
}
.pay-deadline.urgent { background: #fff4e5; color: #b45309; }

.pay-actlist {
  margin: 12px 0 4px; border-top: 1px solid var(--line-soft);
  padding-top: 10px; text-align: left;
}
.pay-actrow {
  display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px;
}
.pay-actrow .t { flex: 1; }
.pay-actrow .q { color: var(--text-3); }
.pay-actrow .m { font-variant-numeric: tabular-nums; }

/* 付款方式 */
.pay-methods { display: flex; gap: 8px; }
.pay-method {
  flex: 1; padding: 11px 10px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; font-size: 15px; font-weight: 600;
  color: var(--text-2);
}
.pay-method.on {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand);
}
.pay-method-tip { font-size: 13px; color: var(--text-2); margin-top: 8px; }

/* ---------------------------------------------------------- 存款管理 */

.fund-hero {
  padding: 14px 16px; margin-bottom: 16px; border-radius: 12px;
  background: linear-gradient(135deg, #f6f7fb, #eef3ff);
  border: 1px solid var(--line);
}
.fund-name { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.fund-balance {
  font-size: 30px; font-weight: 700; margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}
.fund-balance-sm {
  font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------- 抽赏 */

/* 团员端封面：按原始比例完整显示，不裁切 */
.draw-cover { margin: 0 0 12px; text-align: center; }
.draw-cover img {
  max-width: 100%; height: auto; max-height: 70vh;
  object-fit: contain; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; display: block; margin: 0 auto;
}
.draw-cover-empty {
  height: 120px; display: grid; place-items: center; font-size: 44px;
  border: 1px dashed var(--line); border-radius: 14px; color: var(--text-3);
}

/* 用封面做的整页淡色背景：等比放大铺满整页、居中、不变形、不挡点击 */
.draw-page { position: relative; }
.draw-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;          /* 等比缩放到铺满，不改变比例 */
  background-attachment: fixed;
  opacity: 0.18;          /* 淡色，但要看得出来 */
  filter: saturate(1.05);
}
/* 抽赏页的内容浮在淡背景之上 */
.draw-page > *:not(.draw-bg) { position: relative; z-index: 1; }

/* 已结束的提示做得显眼一点 */
.draw-closed {
  font-size: 15px; font-weight: 600; text-align: center; padding: 14px;
}

/* 团员端赏品清单 */
.draw-prizes { display: flex; flex-direction: column; gap: 8px; }
.draw-prize-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.draw-prize-row > b { width: 48px; color: var(--text-2); }
.draw-prize-row .codes { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.draw-code {
  display: inline-block; min-width: 26px; text-align: center;
  padding: 2px 8px; border-radius: 6px; font-size: 13px;
  background: var(--brand-soft); color: var(--brand); font-weight: 600;
}

/* 管理端：封面预览 */
.draw-cover-preview {
  max-width: 100%; max-height: 200px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
}
.draw-proof-preview {
  max-width: 100%; max-height: 320px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
}

/* 管理端：赏品编辑器 */
.prize-edit {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fcfcfe;
}
.prize-edit input[type=text] { font-size: 14px; }

/* 管理端：反馈结果的赏品数量网格 */
.prize-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.prize-group {
  padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fcfcfe;
}
.prize-cat { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.draw-qty-cell {
  display: inline-flex; align-items: center; gap: 4px; margin: 3px 10px 3px 0;
}
.draw-qty-cell .code {
  display: inline-block; min-width: 20px; text-align: center; font-size: 12.5px;
  color: var(--text-2);
}
.draw-qty-cell input.draw-qty {
  width: 46px; padding: 3px 4px; font-size: 13px; text-align: center;
}
.draw-total {
  margin: 12px 0 4px; padding: 10px 12px; border-radius: 10px;
  background: #f6f7fa; font-size: 14px; font-weight: 600;
}
.draw-total .over { color: #b91c1c; }
.draw-reqinfo { margin-bottom: 12px; font-size: 14px; }

/* 管理端：申请卡片 */
.draw-req {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; background: #fcfcfe; font-size: 13.5px;
}

/* 项目状态标签 + 已完成卡片 */
.tag-doing { background: var(--brand-soft); color: var(--brand); }
.tag-done { background: #e8f6ec; color: #1c7a3e; }
.card-done { opacity: .96; }
.card-done .card-head h3 a { color: var(--text-2); }

.pay-search { display: flex; flex-direction: column; gap: 8px; }
.pay-search input { font-size: 16px; padding: 12px 14px; }
.pay-search.compact { flex-direction: row; gap: 8px; margin-top: 12px; }
.pay-search.compact input { flex: 1; }
.public-entry {
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.pay-batch-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
@media (max-width: 640px) {
  .public-wrap { padding: 12px 10px 50px; }
  .pay-card { padding: 13px; border-radius: 12px; }
  .note { min-height: 112px; }
}

/* ---------------------------------------------------------- 导入向导 */

.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.steps .s {
  flex: 1; text-align: center; padding: 8px; border-radius: 8px; background: #f1f2f5;
  font-size: 13px; color: var(--text-3);
}
.steps .s.on { background: var(--brand); color: #fff; font-weight: 500; }
.steps .s.done { background: var(--brand-soft); color: var(--brand); }

.drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 34px 20px; text-align: center;
  background: #fafbfc; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .big { font-size: 30px; display: block; margin-bottom: 8px; }
.drop .hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }

.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.map-cell { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; }
.map-cell.miss { border-color: #fca5a5; background: var(--danger-soft); }
.map-cell .col { font-size: 12px; color: var(--text-3); margin-bottom: 5px; word-break: break-all; }
.map-cell select { padding: 5px 8px; font-size: 13px; }

/* ---------------------------------------------------------- 杂项 */

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 108px; }
.filters input[type=search] { min-width: 190px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.right { text-align: right; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(0,0,0,.15); border-top-color: var(--brand); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.loading { padding: 30px; text-align: center; color: var(--text-3); }
.bar { height: 7px; background: #eef0f3; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.kv { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-3); }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; }
.timeline .ev { position: relative; padding: 5px 0; font-size: 12.5px; }
.timeline .ev::before {
  content: ""; position: absolute; left: -20px; top: 12px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--brand);
}
.timeline .ev .when { color: var(--text-3); font-size: 11.5px; }

/* ---------------------------------------------------------- 移动端适配
   重要：这一段必须放在文件**最末尾**。
   媒体查询不提高优先级，同名的后出现者胜出；如果放在基础规则（.modal 等）
   前面，会被后面的基础规则覆盖（之前移动端弹窗不适配就是这个原因）。 */
@media (max-width: 900px) {
  .grid.c2, .grid.c3 { grid-template-columns: 1fr; }

  /* ---------- 移动端：侧边栏改为左侧抽屉 ---------- */
  .sidebar {
    display: flex;
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 78vw; max-width: 300px; flex: none; height: 100vh;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 95;
    box-shadow: 2px 0 18px rgba(0, 0, 0, .28);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask {
    display: none; position: fixed; inset: 0; z-index: 94;
    background: rgba(17, 20, 24, .45);
  }
  .sidebar-mask.show { display: block; }
  body.drawer-open { overflow: hidden; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; font-size: 16px; line-height: 1;
  }

  /* ---------- 尺寸微调（只作用于移动端） ---------- */
  .topbar { height: 50px; padding: 0 12px; gap: 8px; }
  .topbar h2 { font-size: 15px; }
  .content { padding: 12px; }
  .card-head { padding: 10px 12px; }
  .card-body { padding: 12px; }
  .card-head h3 { font-size: 14px; }
  /* ---------- 弹窗：手机上必须完整显示 ----------
     1) .modal-body 是 flex 子项，默认 min-height:auto 撑不小 → 内容会溢出白卡，
        必须给 min-height:0 才能让「内部滚动」真正生效
     2) vh 在手机浏览器里包含地址栏，会超出可视区 → 用 dvh（不支持时回退 vh） */
  .modal-mask { padding: 8px; }
  .modal {
    max-width: none; width: 100%;
    max-height: 92vh;                     /* 老浏览器兜底 */
    max-height: calc(100dvh - 16px);      /* 跟随真实可视高度 */
    border-radius: 12px;
    overflow: hidden;                     /* 圆角裁切，内容不越出白卡 */
  }
  .modal-head { padding: 12px 14px; flex: 0 0 auto; }
  .modal-body {
    padding: 14px;
    min-height: 0;                        /* 关键：允许收缩，内部滚动生效 */
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .modal-foot {
    padding: 10px 14px; flex: 0 0 auto;
    flex-wrap: wrap; gap: 8px;            /* 按钮多时换行，不被裁掉 */
  }
  .modal-foot .btn { flex: 1 1 auto; min-width: 96px; }
  .tbl th, .tbl td { padding: 8px 8px; }
  /* iOS 输入框小于 16px 会自动放大页面，这里统一提到 16px */
  input, select, textarea { font-size: 16px; }
}

/* ---------------------------------------------------------- 备案号页脚
   固定在页面最底部一行；#root 占满剩余高度，所以不会遮住内容 */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#root { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.site-foot {
  flex: 0 0 auto;
  text-align: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  font-size: 12px;
  line-height: 1.6;
  color: #8b919e;
  background: #fff;
  border-top: 1px solid var(--line);
}
.site-foot a { color: #8b919e; text-decoration: none; }
.site-foot a:hover { color: var(--brand); text-decoration: underline; }
/* 主容器少留页脚那一行的高度，避免整页出现多余滚动条 */
.app, .login-wrap { min-height: calc(100vh - 46px); }
.public-wrap { min-height: calc(100vh - 46px); box-sizing: border-box; }
