/* ============ 轮休选择 · 样式 ============ */
:root {
  --brand: #3358f4;
  --brand-dark: #2340c9;
  --brand-soft: #eef1ff;
  --mint: #0e9f74;
  --mint-soft: #e8f7f1;
  --ink: #161c2b;
  --ink-2: #3d4658;
  --muted: #7c8698;
  --line: #e6eaf2;
  --bg: #f4f6fb;
  --card: #ffffff;
  --danger: #e23b3b;
  --warn: #d9822b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(22, 28, 43, .04), 0 8px 24px -12px rgba(22, 28, 43, .12);
  --shadow-lift: 0 2px 4px rgba(22, 28, 43, .06), 0 16px 32px -16px rgba(22, 28, 43, .22);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 600; }
[hidden] { display: none !important; }

/* ---------------- 顶栏 ---------------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(244, 246, 251, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(230, 234, 242, .9);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #4f6dff, #2b46d8);
  color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 6px 14px -6px rgba(51, 88, 244, .7);
}
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt strong { font-size: 15px; letter-spacing: .2px; }
.brand-txt span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.appbar-right { display: flex; align-items: center; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #c5ccd8; }
.live.on i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }
.live.off i { background: #f59e0b; }
.live em { font-style: normal; }

.who {
  display: flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 10px 5px 5px; box-shadow: 0 1px 2px rgba(22, 28, 43, .04);
  max-width: 160px;
}
.who:active { transform: scale(.98); }
.who-name { font-size: 13px; font-weight: 600; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 10px; height: 8px; color: var(--muted); }

.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 700;
}

/* ---------------- 布局 ---------------- */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px max(14px, env(safe-area-inset-left)) 96px max(14px, env(safe-area-inset-right));
}

.monthbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 6px auto 16px; max-width: 460px;
}
.monthbar-mid { text-align: center; flex: 1; min-width: 0; }
.monthbar h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.monthsub { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.navbtn {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.navbtn svg { width: 10px; height: 16px; }
.navbtn:active { transform: scale(.94); }

.badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--mint-soft); color: var(--mint);
}
.badge.locked { background: #fff2e8; color: #c35500; }
.meta { font-size: 12px; color: var(--muted); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.cal-card { padding: 12px 10px 10px; }

/* ---------------- 日历 ---------------- */
.weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  margin-bottom: 7px; padding: 0 1px;
}
.weekdays span {
  text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 600;
}
.weekdays span.wk { color: #d9737a; }

.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.cell {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
  min-height: 58px; padding: 5px 5px 4px;
  border-radius: 11px; border: 1px solid var(--line);
  background: #fff; overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  text-align: left;
}
.cell.blank { background: transparent; border-color: transparent; box-shadow: none; pointer-events: none; min-height: 58px; }
.cell .d { font-size: 13.5px; font-weight: 700; line-height: 1.1; letter-spacing: -.2px; align-self: flex-start; }
.cell .d small { font-size: 9px; font-weight: 500; color: var(--muted); margin-left: 1px; }

.cell .chips { display: flex; gap: 2px; margin-top: auto; flex-wrap: wrap; max-height: 18px; overflow: hidden; }
.cell .chip {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; color: #fff;
  background: var(--c, #8b95a8); box-shadow: 0 0 0 1.5px #fff;
}
.cell .more { font-size: 9px; color: var(--muted); align-self: center; }
.cell .tag { font-size: 9.5px; font-weight: 600; letter-spacing: .2px; }
.cell .flag {
  position: absolute; top: 4px; right: 5px;
  font-size: 9px; font-weight: 700; color: #b24a4a; line-height: 1;
}
.cell.is-mine .flag { color: #ffe08a; }
.cell.flash { animation: flash .7s ease-out; }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 rgba(51, 88, 244, .55); }
  100% { box-shadow: 0 0 0 14px rgba(51, 88, 244, 0); }
}
.warnbox .btn { margin-top: 9px; }

/* 状态 */
.cell.is-free { background: #fff; }
.cell.is-free .d { color: var(--ink); }
.cell.is-free.wk .d { color: #d9737a; }
.cell.is-free:not(.is-past):hover { background: #f7f9ff; border-color: #c3cffd; box-shadow: 0 4px 12px -6px rgba(51, 88, 244, .4); }
.cell.is-free:not(.is-past)::after {
  content: "+"; position: absolute; right: 6px; bottom: 4px;
  font-size: 12px; font-weight: 600; color: #c3cffd; opacity: 0;
  transition: opacity .12s;
}
.cell.is-free:not(.is-past):hover::after { opacity: 1; }

.cell.is-part { background: var(--mint-soft); border-color: #c3e9da; }
.cell.is-part .d { color: #0b7a58; }
.cell.is-part .tag { color: var(--mint); }

.cell.is-mine {
  background: linear-gradient(160deg, #4b6cff, #2b48dd);
  border-color: #2b48dd; color: #fff;
  box-shadow: 0 6px 16px -8px rgba(43, 72, 221, .9);
}
.cell.is-mine .d { color: #fff; }
.cell.is-mine .chip { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }
.cell.is-mine .tag { color: rgba(255, 255, 255, .92); }

.cell.is-full {
  background: repeating-linear-gradient(135deg, #f4f5f8 0 6px, #eceef4 6px 12px);
  border-color: #e2e5ec;
}
.cell.is-full .d { color: #9aa3b4; }
.cell.is-full .tag { color: #b24a4a; }

.cell.is-off { background: #f7f8fa; border-style: dashed; border-color: #e2e5ec; }
.cell.is-off .d { color: #b3bac7; text-decoration: line-through; }
.cell.is-off .tag { color: #b3bac7; }

.cell.is-past { opacity: .58; }
.cell.is-past:hover { opacity: .7; }
.cell.is-past .tag { color: var(--muted); }

.cell.is-today { box-shadow: 0 0 0 2px var(--brand), 0 6px 16px -8px rgba(51, 88, 244, .6); }
.cell.is-today .d::after {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--brand); margin-left: 3px; vertical-align: 2px;
}
.cell.is-mine.is-today { box-shadow: 0 0 0 2px #ffd166, 0 6px 16px -8px rgba(43, 72, 221, .9); }
.cell.is-mine.is-today .d::after { background: #fff; }

.cell:not(.blank):active { transform: scale(.96); }

/* 图例 */
.legend {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  margin-top: 12px; padding: 10px 4px 2px; border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.sw.free { background: #fff; border: 1px solid var(--line); }
.sw.mine { background: linear-gradient(160deg, #4b6cff, #2b48dd); }
.sw.part { background: var(--mint-soft); border: 1px solid #c3e9da; }
.sw.full { background: repeating-linear-gradient(135deg, #f4f5f8 0 3px, #e2e5ec 3px 6px); border: 1px solid #e2e5ec; }
.sw.off { background: #f7f8fa; border: 1px dashed #cfd5e0; }

/* ---------------- 侧栏 ---------------- */
.side { display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-head h2 { font-size: 14px; }
.counter {
  font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 2px 9px;
}
.counter.over { background: #ffecec; color: var(--danger); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.chips .empty { font-size: 12.5px; color: var(--muted); }
.mychip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand-soft); color: var(--brand-dark);
  border: 1px solid #d5ddff; border-radius: 9px;
  padding: 4px 6px 4px 9px; font-size: 12.5px; font-weight: 600;
}
.mychip button {
  border: 0; background: transparent; color: #8a99e6; font-size: 13px;
  line-height: 1; padding: 2px 2px; border-radius: 5px;
}
.mychip button:hover { background: #dfe5ff; color: var(--brand-dark); }
.mychip em { font-style: normal; font-weight: 400; color: #7d8bd8; font-size: 11px; }

.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.hint.tiny { font-size: 11.5px; line-height: 1.55; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 14px;
  border-radius: 11px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2);
  font-size: 14px; font-weight: 600;
  transition: transform .1s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { border-color: #cfd6e4; background: #fafbff; }
.btn:active { transform: scale(.98); }
.btn.primary {
  background: linear-gradient(160deg, #4b6cff, #2b48dd); color: #fff; border-color: transparent;
  box-shadow: 0 8px 18px -10px rgba(43, 72, 221, .9);
}
.btn.primary:hover { background: linear-gradient(160deg, #5877ff, #3352e8); }
.btn.ghost { background: #f8f9fc; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: #f1f3f9; }
.btn.danger { color: var(--danger); border-color: #ffd9d9; background: #fffafa; }
.btn.danger:hover { background: #fff1f1; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }
.btn-row > * { flex: 1; min-width: 0; }
.btn-row .input.narrow { flex: 0 0 88px; max-width: 88px; }
#ovDate { flex: 1.5; min-width: 0; }
.btn .ic { width: 16px; height: 16px; }
.export-card .btn { margin-top: 8px; }
.export-card .btn-row .btn { margin-top: 0; }

/* ---------------- 底栏 ---------------- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bb-left { display: flex; align-items: baseline; gap: 5px; }
.bb-num { font-size: 22px; font-weight: 700; color: var(--brand); line-height: 1; }
.bb-txt { font-size: 12px; color: var(--muted); }
.bottombar .btn { min-height: 40px; padding: 0 18px; font-size: 13.5px; }

.foot { margin-top: 18px; text-align: center; font-size: 11.5px; color: #a6afc0; }
.foot-online { color: #9aa3b4; }
@media (max-width: 759px) {
  .appbar .live em { display: none; }
}

/* ---------------- 弹层 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; align-items: end; justify-items: center;
  background: rgba(16, 22, 38, .38);
  backdrop-filter: blur(2px);
  animation: fade .16s ease;
  padding: 0;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto;
  background: #fff; border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px -12px rgba(16, 22, 38, .3);
  animation: slideUp .22s cubic-bezier(.22, .8, .3, 1);
}
.modal-card.wide { max-width: 560px; }
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.modal-head h2 { font-size: 17px; }
.closebtn {
  border: 0; background: #f3f5f9; color: var(--muted);
  width: 30px; height: 30px; border-radius: 50%; font-size: 13px;
  display: grid; place-items: center; flex: none;
}
.modal-desc { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; line-height: 1.6; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.modal-actions .btn { width: 100%; }

.input {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe;
  font-size: 15px; color: var(--ink); outline: none;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.input::placeholder { color: #aab2c1; }
.input:focus { border-color: #a9b8fb; background: #fff; box-shadow: 0 0 0 3px rgba(51, 88, 244, .1); }
.input.narrow { max-width: 96px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }

.warnbox {
  margin-top: 8px; padding: 8px 11px; border-radius: 10px;
  background: #fff4f4; color: #c92a2a; font-size: 12.5px; border: 1px solid #ffe0e0;
}
.warnbox.ok { background: #eefaf4; color: #0b7a58; border-color: #d3f0e3; }

.divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 12px; color: #a3abba; font-size: 11.5px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.member-pick { display: flex; flex-wrap: wrap; gap: 8px; max-height: 168px; overflow-y: auto; }
.member-pick .pick {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 12px 5px 5px; font-size: 13px;
}
.member-pick .pick:active { transform: scale(.97); }
.member-pick .pick.cur { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.member-pick .avatar { width: 22px; height: 22px; font-size: 11px; }

.people { display: flex; flex-direction: column; gap: 6px; }
.person {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 11px; background: #f8f9fc; border: 1px solid var(--line);
  font-size: 14px;
}
.person .avatar { width: 28px; height: 28px; font-size: 12px; color: #fff; }
.person .tag-self { margin-left: auto; font-size: 11px; color: var(--brand); font-weight: 600; }
.person.empty { color: var(--muted); font-size: 13px; justify-content: center; background: #fbfcfe; border-style: dashed; }

.qr-wrap {
  display: grid; place-items: center; min-height: 180px;
  background: #f8f9fc; border-radius: 14px; border: 1px solid var(--line); padding: 12px;
}
.qr-wrap img { width: 176px; height: 176px; image-rendering: pixelated; display: block; }
.qr-fallback { font-size: 12px; color: var(--muted); text-align: center; }
.urls { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.urlrow {
  display: flex; align-items: center; gap: 8px;
  background: #f8f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px 7px 11px;
}
.urlrow code { font-size: 12.5px; color: var(--ink-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urlrow button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  font-size: 11.5px; padding: 4px 9px; color: var(--brand); font-weight: 600; flex: none;
}

/* 管理面板 */
.adm-sec { padding: 14px 0; border-bottom: 1px solid var(--line); }
.adm-sec:last-child { border-bottom: 0; padding-bottom: 0; }
.adm-sec h3 { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.adm-sec h3 small { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.adm-sec .btn-row { margin-top: 10px; }
.ovlist, .memlist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.rowitem {
  display: flex; align-items: center; gap: 8px;
  background: #f8f9fc; border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 8px 7px 11px; font-size: 13px;
}
.rowitem .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowitem .sub { color: var(--muted); font-size: 11.5px; }
.rowitem button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  font-size: 11.5px; padding: 4px 8px; color: var(--ink-2); flex: none;
}
.rowitem button.del { color: var(--danger); border-color: #ffdcdc; }
.rowitem .badge { flex: none; }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  z-index: 80; display: flex; align-items: center; gap: 12px;
  background: rgba(24, 30, 46, .94); color: #fff;
  padding: 10px 12px 10px 16px; border-radius: 12px;
  font-size: 13.5px; max-width: min(92vw, 460px);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .6);
  opacity: 0; transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast button {
  border: 0; background: rgba(255, 255, 255, .16); color: #fff;
  border-radius: 8px; padding: 5px 11px; font-size: 12.5px; font-weight: 600;
  flex: none; white-space: nowrap;
}
#toastMsg { white-space: nowrap; }

/* ---------------- v2 新增：分组 / 管理员 ---------------- */
.iconbtn {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  display: grid; place-items: center; position: relative;
  box-shadow: 0 1px 2px rgba(22, 28, 43, .04);
}
.iconbtn svg { width: 19px; height: 19px; }
.iconbtn:active { transform: scale(.94); }
.iconbtn .dot {
  position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: #f59e0b; border: 1.5px solid #fff;
}

.groupbar {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px;
  margin: -6px 0 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.groupbar::-webkit-scrollbar { display: none; }
.gpill {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(22, 28, 43, .04); white-space: nowrap;
}
.gpill .n { font-size: 11px; font-weight: 600; opacity: .55; }
.gpill.active { background: #1a2030; color: #fff; border-color: #1a2030; box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .8); }

.ro-banner {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: #fff8e6; border: 1px solid #ffe2a8; color: #8a5a00;
  border-radius: 12px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 10px;
}
.linkbtn {
  border: 0; background: transparent; color: #8a5a00; font-weight: 700;
  text-decoration: underline; font-size: 12.5px; padding: 0; flex: none;
}

.pillpick { display: flex; flex-wrap: wrap; gap: 8px; }
.pillpick button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 13px; font-size: 13px; color: var(--ink-2);
}
.pillpick button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.adm-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: #f5f7fc; border: 1px solid var(--line); border-radius: 12px;
  margin: 4px 0 2px; font-size: 12.5px; color: var(--ink-2);
}
.adm-toolbar .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-mini {
  width: auto; min-width: 104px; max-width: 46%; min-height: 34px;
  font-size: 13px; padding: 0 6px; flex: none;
}

.grouplist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.grouplist .n { font-size: 11.5px; color: var(--muted); }

.memlist .memrow {
  display: flex; align-items: center; gap: 7px;
  background: #f8f9fc; border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 8px 6px 9px;
}
.memrow .nm { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memrow select {
  min-height: 30px; font-size: 12px; padding: 0 4px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; max-width: 104px; flex: none;
}
.memrow button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  font-size: 11.5px; padding: 4px 7px; color: var(--ink-2); flex: none;
}
.memrow button.del { color: var(--danger); border-color: #ffdcdc; }

.qr-url {
  text-align: center; font-size: 12.5px; color: var(--ink-2);
  margin-top: 10px; word-break: break-all;
}
.urls .urlrow .alt-use { color: var(--muted); font-weight: 600; }
.urls .urlrow.primary { border-color: #cdd8ff; background: #f6f8ff; }

.tips { margin-top: 12px; font-size: 12px; color: var(--muted); }
.tips summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.tips ol { margin: 8px 0 0; padding-left: 18px; line-height: 1.75; }
.tips code { background: #f2f4f8; padding: 1px 4px; border-radius: 4px; font-size: 11.5px; }
.tips b { color: var(--ink-2); }

/* ---------------- 打印 ---------------- */
.print-area { display: none; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; padding: 0; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; }
  .print-area h1 { font-size: 18pt; text-align: center; margin: 0 0 2mm; font-weight: 700; }
  .print-area .sub { text-align: center; font-size: 8pt; color: #666; margin-bottom: 4mm; }
  .print-area table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
  .print-area th, .print-area td { border: .4pt solid #b9c0cc; padding: 1.4mm .6mm; text-align: center; }
  .print-area th { background: #2f5597; color: #fff; font-weight: 600; }
  .print-area th.wk { background: #c0504d; }
  .print-area td.name { text-align: left; padding-left: 2mm; font-weight: 600; white-space: nowrap; }
  .print-area td.rest { background: #d6e9ce; font-weight: 700; }
  .print-area tr.sum td { background: #f2f2f2; font-weight: 600; }
  .print-area .tip { margin-top: 3mm; font-size: 7.5pt; color: #888; }
}

/* ---------------- 响应式 ---------------- */
@media (min-width: 760px) {
  .appbar .live em { display: inline; }
  .cell { min-height: 66px; }
  .cell.blank { min-height: 66px; }
  .cell .d { font-size: 14.5px; }
  .drag-hint { display: none; }
}

@media (min-width: 900px) {
  .wrap { padding-bottom: 40px; }
  .bottombar { display: none; }
  .toast { bottom: 28px; }
  .layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
  .side { position: sticky; top: 74px; }
  .modal { align-items: center; padding: 24px; }
  .modal-card { border-radius: 20px; padding: 22px; max-height: 86vh; animation: pop .2s cubic-bezier(.22, .8, .3, 1); }
  @keyframes pop { from { transform: scale(.96); opacity: 0; } }
  .monthbar h1 { font-size: 26px; }
}

@media (max-width: 380px) {
  .cell { min-height: 52px; padding: 4px 3px 3px; border-radius: 9px; }
  .cell .d { font-size: 12.5px; }
  .cell .chip { width: 14px; height: 14px; font-size: 8px; }
  .brand-txt span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 成员折叠分组 */
.gfold { border: 1px solid var(--line, #e6eaf2); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.gfold-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: #f8f9fc; border: 0; padding: 10px 12px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: inherit; text-align: left;
}
.gfold-head .garr { font-size: 11px; color: #7c8698; }
.gfold-head .n { margin-left: auto; font-weight: 400; font-size: 12px; color: #7c8698; }
.gfold .memrow { border-radius: 0; border-top: 1px solid #eef1f6; }
.bb-hint { font-size: 12px; color: var(--muted, #7c8698); }