:root { --brand: var(--brand); --brand-soft: var(--brand-soft); }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Segoe UI, Roboto, sans-serif; background: #f4f4f6; color: #26232e; }
header { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--brand); color: #fff; }
.brand { font-size: 19px; font-weight: 700; display: flex; flex-direction: column; }
.brand small { font-size: 11px; font-weight: 400; opacity: .85; }
.head-actions { display: flex; gap: 6px; }
button { border: 1px solid #cfccd8; background: #fff; border-radius: 9px; padding: 7px 12px; font-size: 14px; cursor: pointer; }
button.primary { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
button.big { width: 100%; padding: 14px; font-size: 18px; margin-top: 10px; }
button.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
button:disabled { opacity: .5; }
.hidden { display: none !important; }
main { max-width: 860px; margin: 0 auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.card { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 1px 4px rgba(38,35,46,.08); }
h2 { margin: 2px 0 10px; font-size: 17px; } h3 { margin: 14px 0 8px; font-size: 15px; }
label { display: block; margin: 8px 0; font-size: 13px; color: #55525e; }
input, select { width: 100%; padding: 9px 10px; border: 1px solid #cfccd8; border-radius: 9px; font-size: 15px; margin-top: 3px; background: #fff; }
.row { display: flex; gap: 8px; align-items: center; } .row input { flex: 1; } .row.wrap { flex-wrap: wrap; } .row.wrap > * { flex: 1 1 130px; } .row.small input { padding: 5px 8px; font-size: 13px; }
.row label { flex: 1; }
.dim { color: #7b7785; font-size: 13px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600; }
.badge.expired, .badge.exhausted { background: #fde8e8; color: #b3261e; }
.badge.none { background: #eceff0; color: #5d6a61; }
.badge.warn { background: #fff3d6; color: #8a6100; }
.badge.ok { background: var(--brand-soft); } .badge.sm { font-weight: 500; }
.mine { margin-top: 12px; border-top: 1px dashed #ddd9e4; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat { border: 1px solid #e2dfe8; border-radius: 11px; padding: 10px; }
.stat-name { font-weight: 700; } .stat-big { font-size: 24px; font-weight: 800; } .stat-big small { font-size: 13px; color: #7b7785; }
.list { display: flex; flex-direction: column; }
.line { display: flex; gap: 8px; align-items: center; padding: 8px 2px; border-bottom: 1px solid #efedf2; flex-wrap: wrap; }
.line.col { flex-direction: column; align-items: stretch; } .line-main { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.line .time { font-variant-numeric: tabular-nums; color: #55525e; min-width: 44px; }
.line .who { min-width: 110px; }
.line.is-undone { opacity: .5; text-decoration: line-through; }
.subform { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; background: #f5f4f8; border-radius: 9px; }
.subform > * { flex: 1 1 120px; }
table.ana { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.ana th, table.ana td { border: 1px solid #e2dfe8; padding: 5px 7px; text-align: left; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); padding: 11px 18px; border-radius: 99px; color: #fff; font-size: 15px; z-index: 20; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.toast.ok { background: var(--brand); } .toast.bad { background: #b3261e; }

.staffbar { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs .tab { border-radius: 99px; padding: 7px 14px; font-weight: 600; }
.tabs .tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.daynav { margin: 4px 0 10px; } .daynav .daylabel { flex: 1; text-align: center; font-size: 16px; }
.today-banner { background: var(--brand-soft); border: 1px solid var(--brand); color: var(--brand); border-radius: 9px; padding: 8px 10px; font-weight: 600; font-size: 14px; }
button.mini { padding: 2px 8px; font-size: 12px; border-radius: 99px; }
textarea { font-family: inherit; padding: 9px 10px; border: 1px solid #cfccd8; border-radius: 9px; font-size: 14px; }

/* v3.1: 今日页 Program 筛选 chips + 前台搜索联想下拉 */
.chiprow { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.chipbtn { border-radius: 99px; padding: 6px 13px; font-weight: 600; font-size: 14px; }
.chipbtn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chipbtn .badge { margin-left: 2px; }
.countline { margin-bottom: 6px; }
.sugg-wrap { position: relative; }
.sugg { position: absolute; left: 0; right: 0; top: 100%; z-index: 15; background: #fff; border: 1px solid #cfccd8; border-radius: 11px; box-shadow: 0 8px 22px rgba(0,0,0,.16); overflow: hidden; margin-top: 4px; }
.sugg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.sugg-row + .sugg-row { border-top: 1px solid #efedf2; }
.sugg-row:hover { background: var(--brand-soft); }

/* v3: Program 卡片（今日页）与 Program 编辑器（设置页） */
.prog-card { border: 1px solid #e2dfe8; border-radius: 11px; padding: 10px; margin-bottom: 12px; }
.prog-row { border: 1px solid #e2dfe8; border-radius: 11px; padding: 10px; margin-bottom: 10px; }
.pg-days { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.pg-days .chip { display: inline-flex; align-items: center; gap: 3px; margin: 0; padding: 4px 9px; border: 1px solid #cfccd8; border-radius: 99px; font-size: 13px; color: #26232e; cursor: pointer; }
.pg-days .chip input { width: auto; margin: 0; padding: 0; }
.pg-days .chip:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* v13: 收入按日合计行、签到二维码卡、打印签到牌 */
.daytotal { font-size: 17px; margin: 6px 0 8px; }
.qrcard { text-align: center; }
.qrbox { max-width: 230px; margin: 8px auto 4px; }
.qrbox svg { width: 100%; height: auto; display: block; }
.qrurl { word-break: break-all; margin-bottom: 8px; }
#printSheet { display: none; }
@media print {
  header, #app, #toast { display: none !important; }
  body { background: #fff; }
  #printSheet { display: block; text-align: center; padding-top: 22mm; color: #000; }
  #printSheet .ps-club { font-size: 32pt; font-weight: 800; line-height: 1.2; }
  #printSheet .ps-qr { margin-top: 10mm; }
  #printSheet .ps-qr svg { width: 62mm; height: 62mm; }
  #printSheet .ps-scan { font-size: 19pt; font-weight: 700; margin-top: 8mm; }
  #printSheet .ps-date { font-size: 13pt; margin-top: 4mm; }
  #printSheet .ps-prog { font-size: 13pt; margin-top: 2mm; }
}

/* v23 会员页放大：标题、查卡输入与按钮、注册/访客入口、可订行都加大，让人一眼看清 */
.member-card h2 { font-size: 23px; }
.member-card h3 { font-size: 18px; }
.member-card .lookup-row input { font-size: 17px; padding: 12px; }
.member-card .lookup-row button { font-size: 16px; padding: 12px 16px; }
button.entry-btn { font-size: 15px; padding: 9px 16px; border-radius: 99px; font-weight: 600; }
button.entry-btn.reg { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.member-card .line { font-size: 15px; }
.member-card .line button.primary { font-size: 15px; padding: 9px 14px; }

/* v28 一台手机记住多个人：切换胶囊 */
.pchip { display: inline-flex; align-items: center; border: 1.5px solid #cfccd8; border-radius: 99px; padding: 1px 2px 1px 6px; background: #fff; }
.pchip.on { border-color: var(--brand); background: var(--brand-soft); }
.pchip-name { border: none; background: none; font-size: 15px; font-weight: 600; padding: 3px 2px; cursor: pointer; }
.pchip-x { border: none; background: none; color: #7b7785; font-size: 15px; padding: 0 7px; cursor: pointer; }

/* v29 新签到提醒：横幅（带呼吸光圈，想看不见都难）+ 页签角标 + 名单行高亮 */
.newbanner { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fdf3e3; border: 2px solid #e8a13a; color: #5b4305; border-radius: 14px; padding: 10px 14px; margin: 10px 0; font-size: 15px; animation: nbpulse 1s ease-in-out 3; }
.newbanner button { border-color: #e8a13a; font-weight: 600; }
@keyframes nbpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 161, 58, 0); } 50% { box-shadow: 0 0 0 7px rgba(232, 161, 58, .35); } }
.tabbadge { background: #e4572e; color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.line.is-new { background: #fdf6e0; }
.badge.newb { background: #e4572e; color: #fff; }
