/* ============ 宴会布置双向确认 · 样式（移动优先，电脑自适应） ============ */
:root {
  --gold: #a9844e;
  --gold-d: #8a6a3a;
  --gold-l: #f3ece1;
  --bg: #f4f2ee;
  --card: #ffffff;
  --line: #e6e2da;
  --text: #24211d;
  --text-2: #6b6459;
  --text-3: #9b948a;
  --pending: #d98b21;
  --pending-bg: #fdf3e3;
  --received: #2f7fc1;
  --received-bg: #eaf3fb;
  --done: #2b9464;
  --done-bg: #e8f5ee;
  --withdrawn: #9a938a;
  --withdrawn-bg: #f1efec;
  --danger: #c8483f;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(36, 33, 29, .07), 0 6px 18px -10px rgba(36, 33, 29, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--gold-d); }

/* ---------- 布局 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 14px 96px; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1180px; margin: 0 auto; padding: 9px 14px;
  display: flex; align-items: center; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .3px; }
.brand .mk {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.brand small { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); letter-spacing: 0; }
.spacer { flex: 1; }

.iconbtn {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  color: var(--text-2); position: relative; transition: background .15s;
}
.iconbtn:hover { background: var(--gold-l); }
.iconbtn.spinning svg { animation: icon-spin .7s linear infinite; }
@keyframes icon-spin { to { transform: rotate(360deg); } }
.iconbtn:disabled { opacity: .55; }
.iconbtn .dot {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px;
  text-align: center; font-weight: 700; box-shadow: 0 0 0 2px #fff;
}
.whoami { font-size: 12px; color: var(--text-2); text-align: right; line-height: 1.25; }
.whoami b { display: block; font-size: 13px; color: var(--text); }
.rolechip {
  display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 20px;
  background: var(--gold-l); color: var(--gold-d); font-weight: 600; margin-top: 1px;
}

/* ---------- 分段控件 ---------- */
.seg {
  display: flex; gap: 4px; background: #e9e5de; padding: 3px; border-radius: 11px; margin: 14px 0 12px;
}
.seg button {
  flex: 1; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-2); transition: all .18s; white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--gold-d); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg button .n {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 8px;
  background: rgba(0,0,0,.07); font-size: 11px; font-weight: 700;
}
.seg button.on .n { background: var(--gold-l); color: var(--gold-d); }

/* ---------- 统计条 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 10px; text-align: center;
}
.stat .v { font-size: 19px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.stat.p .v { color: var(--pending); } .stat.r .v { color: var(--received); }
.stat.d .v { color: var(--done); } .stat.w .v { color: var(--withdrawn); }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center;
}
.toolbar .grow { flex: 1; min-width: 150px; }
.field {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(169,132,78,.12); }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6459' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

.btn {
  padding: 9px 14px; border-radius: 9px; font-size: 13px; font-weight: 600;
  background: #fff; border: 1px solid var(--line); color: var(--text-2);
  transition: all .15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { border-color: var(--gold); color: var(--gold-d); }
.btn.primary { background: linear-gradient(135deg, var(--gold), var(--gold-d)); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: #fdf2f1; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gold-l); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 筛选面板（手机默认收起，电脑常开） ---------- */
.filterbox {
  display: none; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end;
  margin: -3px 0 12px; padding: 11px 12px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.filterbox.on { display: grid; }
.fl { display: block; font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; font-weight: 600; }

/* ---------- 两个大卡片：待确认 / 已确认 ---------- */
.statcards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.statcard {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; text-align: left; transition: all .18s; position: relative; overflow: hidden;
}
.statcard:hover { border-color: #d5cbb9; transform: translateY(-1px); }
.statcard .v {
  font-size: 28px; font-weight: 700; line-height: 1.05; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.statcard .k { font-size: 13.5px; font-weight: 700; margin-top: 2px; color: var(--text-2); }
.statcard .d { font-size: 11px; color: var(--text-3); margin-top: 4px; line-height: 1.45; }
.statcard.pend.on { border-color: var(--pending); background: var(--pending-bg); box-shadow: 0 2px 12px -6px rgba(217,139,33,.5); }
.statcard.pend.on .v, .statcard.pend.on .k { color: var(--pending); }
.statcard.conf.on { border-color: var(--done); background: var(--done-bg); box-shadow: 0 2px 12px -6px rgba(43,148,100,.5); }
.statcard.conf.on .v, .statcard.conf.on .k { color: var(--done); }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.chk input { width: 15px; height: 15px; accent-color: var(--gold); }

/* ---------- 任务卡 ---------- */
.list { display: flex; flex-direction: column; gap: 9px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 12px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: border-color .15s;
}
.card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pending);
}
.card.s-received::before { background: var(--received); }
.card.s-done::before { background: var(--done); }
.card.s-withdrawn::before { background: var(--withdrawn); }
.card.s-withdrawn { opacity: .68; }

.card-h { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.card-date { font-size: 15px; font-weight: 700; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.card-date .wk { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 12px; color: var(--text-2); }
.pill {
  display: inline-flex; align-items: center; gap: 3px; padding: 1.5px 7px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.pill.venue { background: var(--gold-l); color: var(--gold-d); white-space: normal; word-break: break-all; max-width: 100%; }
.pill.meal { background: #f1efec; color: var(--text-2); }
.pill.by { background: #f1efec; color: var(--text-2); }
.pill.self { background: #e9f4ff; color: #2f6f9e; }
.self-tag {
  display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 20px;
  font-size: 10.5px; font-weight: 600; background: #e9f4ff; color: #2f6f9e;
}
.badge { padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge.pending { background: var(--pending-bg); color: var(--pending); }
.badge.received { background: var(--received-bg); color: var(--received); }
.badge.done { background: var(--done-bg); color: var(--done); }
.badge.withdrawn { background: var(--withdrawn-bg); color: var(--withdrawn); }
.badge.today { background: #fdecea; color: var(--danger); }

.req {
  margin-top: 8px; padding: 8px 10px; background: #faf8f5; border-radius: 8px;
  font-size: 13px; white-space: pre-wrap; word-break: break-word; border: 1px solid #f0ece5;
}
.req.changed { border-color: #f0dcb8; background: #fffcf5; }
.remark-line {
  margin-top: 7px; font-size: 12.5px; color: var(--text-2); display: flex; gap: 5px; align-items: flex-start;
}
.remark-line .lb { color: var(--gold-d); font-weight: 700; flex-shrink: 0; }
.card-f {
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line);
  display: flex; gap: 7px; align-items: center; flex-wrap: wrap;
}
.card-f .lft { font-size: 11.5px; color: var(--text-3); }
.card-f .acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 空态 ---------- */
.empty { text-align: center; padding: 46px 16px; color: var(--text-3); }
.empty .ic { font-size: 34px; opacity: .45; }
.empty h3 { margin: 10px 0 4px; font-size: 15px; color: var(--text-2); font-weight: 600; }
.empty p { margin: 0; font-size: 13px; }

/* ---------- 抽屉 / 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(30, 26, 20, .45); z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  background: #fff; width: 100%; max-width: 560px; border-radius: 16px 16px 0 0;
  max-height: 92vh; overflow-y: auto; animation: up .24s cubic-bezier(.22,.9,.3,1);
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes up { from { transform: translateY(28px); opacity: .6; } }
.sheet-h {
  position: sticky; top: 0; background: #fff; z-index: 2;
  padding: 14px 16px 11px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.sheet-h h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.sheet-b { padding: 14px 16px 20px; }
.sheet-f {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  padding: 11px 16px calc(11px + env(safe-area-inset-bottom)); display: flex; gap: 8px;
}
.sheet-f .btn { flex: 1; justify-content: center; padding: 11px; }

.form-row { margin-bottom: 13px; }
.form-row > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.form-row > label .req-star { color: var(--danger); margin-left: 2px; }
textarea.field { resize: vertical; min-height: 96px; line-height: 1.6; }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.venue-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.venue-grid button {
  padding: 7px 11px; border-radius: 20px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; color: var(--text-2); transition: all .15s;
}
.venue-grid button.on { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }
.meal-grid { display: flex; gap: 6px; }
.meal-grid button {
  flex: 1; padding: 8px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; color: var(--text-2);
}
.meal-grid button.on { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }

/* ---------- 留痕时间线 ---------- */
.timeline { margin-top: 4px; }
.tl-item { display: flex; gap: 10px; padding-bottom: 14px; position: relative; }
.tl-item:not(:last-child)::before {
  content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1px; background: var(--line);
}
.tl-dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--gold); margin-top: 4px;
  flex-shrink: 0; box-shadow: 0 0 0 3px #fff; z-index: 1;
}
.tl-item.act-withdraw .tl-dot { background: var(--danger); }
.tl-item.act-complete .tl-dot { background: var(--done); }
.tl-item.act-receive .tl-dot { background: var(--received); }
.tl-body { flex: 1; min-width: 0; }
.tl-body .t1 { font-size: 13px; font-weight: 600; }
.tl-body .t2 { font-size: 12.5px; color: var(--text-2); word-break: break-word; }
.tl-body .t3 { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* ---------- 通知 ---------- */
.notif {
  padding: 11px 12px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line);
  display: flex; gap: 10px; align-items: flex-start;
}
.notif.unread { border-color: #e8d9bd; background: #fffdf8; }
.notif .nd { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex-shrink: 0; }
.notif .nd.off { background: transparent; }
.notif .nt { font-size: 13.5px; font-weight: 600; }
.notif .nb { font-size: 12.5px; color: var(--text-2); margin-top: 2px; word-break: break-word; }
.notif .nm { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.notif.hot { border-left: 3px solid var(--danger); }

/* ---------- 表格（电脑） ---------- */
.tablewrap { display: none; }
@media (min-width: 900px) {
  .list { display: none; }
  .filterbox { display: grid; }
  .tablewrap { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
  table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
  table.tbl th {
    background: #faf8f5; text-align: left; padding: 9px 11px; font-size: 12px; color: var(--text-2);
    font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap;
  }
  table.tbl td { padding: 10px 11px; border-bottom: 1px solid #f2efe9; vertical-align: top; }
  table.tbl tr:last-child td { border-bottom: none; }
  table.tbl tr:hover td { background: #fdfbf8; }
  table.tbl .c-req { max-width: 340px; white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
  table.tbl .c-act { white-space: nowrap; text-align: right; }
  table.tbl .c-num { font-variant-numeric: tabular-nums; }
  .sheet { border-radius: 14px; margin-bottom: 6vh; }
  .mask { align-items: center; }
}
@media (max-width: 640px) {
  .filterbox { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hide-sm { display: none; }
  .btn { padding: 8px 11px; font-size: 12.5px; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .wrap { padding: 0 10px 92px; }
  .toolbar .grow { min-width: 120px; }
}

/* ---------- 提示条 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #2b2721; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px;
  z-index: 200; opacity: 0; pointer-events: none; transition: all .25s; max-width: 88vw; text-align: center;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }
#toast.ok { background: #217a52; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(160deg, #f7f4ef 0%, #efe9df 100%);
}
.login-card {
  width: 100%; max-width: 370px; background: #fff; border-radius: 16px; padding: 28px 24px;
  box-shadow: 0 10px 40px -12px rgba(36,33,29,.22); border: 1px solid var(--line);
}
.login-card .lg { text-align: center; margin-bottom: 22px; }
.login-card .lg .mk {
  width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d)); color: #fff;
  display: grid; place-items: center; font-size: 21px; font-weight: 700;
  box-shadow: 0 6px 18px -6px rgba(169,132,78,.6);
}
.login-card h1 { font-size: 18px; margin: 0 0 3px; letter-spacing: .3px; }
.login-card .sub { font-size: 12.5px; color: var(--text-3); }
.login-card .btn.primary { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }
.login-tip {
  margin-top: 18px; padding: 11px; border-radius: 9px; background: #faf8f5;
  font-size: 12px; color: var(--text-2); line-height: 1.7; border: 1px dashed var(--line);
}
.login-tip b { color: var(--gold-d); }

/* ---------- 加载 ---------- */
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp .6s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.loading { text-align: center; padding: 40px; color: var(--text-3); font-size: 13px; }
