/* 通用组件:卡片、按钮、表单、标签/徽章、列表、对话框、提示条 */
.page-title { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:6px 0 12px; flex-wrap:wrap; }
.page-title h2 { font-size:20px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:16px; margin-bottom:14px; }
.card h3 { font-size:16px; margin-bottom:4px; }
.sub { color:var(--muted); font-size:13px; }
.row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.between { justify-content:space-between; }
.btn { white-space:nowrap; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid transparent; background:var(--brand); color:var(--brand-ink); font:inherit; font-weight:600; padding:8px 16px; border-radius:10px; cursor:pointer; transition:transform .06s, filter .15s, background .15s, border-color .15s; box-shadow:0 1px 0 rgba(255,255,255,.12) inset; }
.btn.ghost, .btn.danger { box-shadow:none; }
.btn:hover { filter:brightness(1.08); } .btn:active { transform:scale(.97); } .btn:disabled { opacity:.55; cursor:default; }
.btn.ghost { background:transparent; color:var(--brand); border-color:color-mix(in srgb, var(--brand) 55%, transparent); }
.btn.ghost:hover { background:var(--brand-weak); }
.btn.danger { background:transparent; color:var(--danger); border-color:color-mix(in srgb, var(--danger) 55%, transparent); }
.btn.danger:hover { background:var(--danger-weak); }
.btn.sm { padding:3px 10px; font-size:13px; border-radius:8px; }
.btn.block { width:100%; padding:11px; }
input, select { font:inherit; color:inherit; background:var(--field); border:1px solid var(--line); border-radius:10px; padding:9px 11px; max-width:100%; outline:none; transition:border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
label.f { display:block; margin:12px 0 4px; font-size:13px; font-weight:600; color:var(--muted); }
label.f + input:not([type=checkbox]), label.f + select { width:100%; } /* 带标签的输入框撑满一行 */
label.chk { display:inline-flex; align-items:center; gap:6px; margin:0 12px 6px 0; cursor:pointer; }
input[type=checkbox] { width:17px; height:17px; accent-color:var(--brand); padding:0; }
.seg { display:inline-flex; background:var(--soft); border:1px solid var(--line-soft); border-radius:10px; padding:3px; }
.seg button { border:0; background:transparent; color:var(--muted); font:inherit; font-size:13px; font-weight:600; padding:5px 12px; border-radius:8px; cursor:pointer; }
.seg button.on { background:var(--surface); color:var(--ink); box-shadow:0 0 0 1px var(--line), 0 1px 3px rgba(0,0,0,.18); }
.empty { text-align:center; color:var(--muted); padding:36px 16px; }
.empty b { display:block; color:var(--ink); font-size:16px; margin-bottom:4px; }

.av { width:var(--s,28px); height:var(--s,28px); border-radius:50%; display:grid; place-items:center; color:#fff; font-weight:700; font-size:calc(var(--s,28px)*.42); flex:none; }
.pill { display:inline-flex; align-items:center; gap:5px; padding:2px 10px; border-radius:999px; font-size:12px; font-weight:700; background:var(--soft); color:var(--muted); border:1px solid var(--line-soft); }
.pill.admin { background:var(--brand-weak); color:var(--brand); } .pill.next { background:var(--ok-weak); color:var(--ok); } .pill.warn { background:var(--warn-weak); color:var(--warn); }
.rdot { width:9px; height:9px; border-radius:50%; flex:none; background:var(--c); display:inline-block; }
.tag { display:inline-flex; align-items:center; gap:6px; padding:2px 10px; border-radius:999px; background:var(--soft); border:1px solid var(--line-soft); font-size:12.5px; font-weight:600; }
.banner { border:1px solid color-mix(in srgb, var(--warn) 40%, transparent); display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; background:var(--warn-weak); color:var(--warn); border-radius:12px; padding:10px 14px; margin-bottom:14px; font-weight:600; }
.banner.info { background:var(--brand-weak); color:var(--brand); border-color:color-mix(in srgb, var(--brand) 40%, transparent); }
.pill.special { background:#fde7f3; color:#be185d; } :root[data-theme="dark"] .pill.special { background:#3d1a2d; color:#f472b6; }
.pill.pending { background:var(--warn-weak); color:var(--warn); } .pill.approved { background:var(--ok-weak); color:var(--ok); } .pill.rejected, .pill.cancelled { background:var(--danger-weak); color:var(--danger); }
.callout { background:var(--brand-weak); color:var(--brand); border:1px solid color-mix(in srgb, var(--brand) 35%, transparent); border-radius:12px; padding:12px 14px; margin-bottom:14px; }
.list-item { display:flex; align-items:center; gap:12px; padding:10px 8px; margin:0 -8px; border-bottom:1px solid var(--line-soft); transition:background .12s; }
.list-item:hover { background:var(--hover); }
.list-item:last-child { border-bottom:0; }
.list-item .main { flex:1; min-width:0; } .list-item .t { font-weight:600; }
.note-item { padding:10px 0; border-bottom:1px solid var(--line-soft); } .note-item:last-child { border-bottom:0; }
.note-item.unread { font-weight:600; } .note-item.unread::before { content:""; display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--brand); margin-right:8px; }
.sk { height:120px; border-radius:var(--radius); margin-bottom:14px; background:linear-gradient(90deg,var(--soft) 25%,var(--surface) 50%,var(--soft) 75%); background-size:200% 100%; animation:sh 1.2s infinite linear; }
@keyframes sh { to { background-position:-200% 0; } }
dialog { border:1px solid var(--line); border-radius:18px; padding:20px; background:var(--surface); color:var(--ink); width:min(94vw,440px); max-height:92vh; overflow:auto; box-shadow:0 24px 70px rgba(0,0,0,.5); }
dialog::backdrop { background:rgba(5,7,18,.62); backdrop-filter:blur(3px); }
dialog h3 { font-size:18px; margin-bottom:6px; }
dialog input:not([type=checkbox]), dialog select { width:100%; }
.dlg-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:18px; flex-wrap:wrap; }
#toast { position:fixed; left:50%; bottom:90px; transform:translate(-50%,20px); background:#1b2033; color:#fff; padding:10px 18px; border-radius:12px; opacity:0; pointer-events:none; transition:.25s; z-index:50; max-width:90vw; box-shadow:0 8px 24px rgba(0,0,0,.3); }
#toast.show { opacity:1; transform:translate(-50%,0); } #toast.err { background:var(--danger); }
@media (min-width:641px) { #toast { bottom:28px; } }

/* 窄屏:列表项里的按钮换到下一行,避免挤压文字 */
@media (max-width:520px) {
  .list-item { flex-wrap:wrap; }
  .list-item .main { flex-basis:calc(100% - 64px); }
  .list-item.nowrap { flex-wrap:nowrap; } .list-item.nowrap .main { flex-basis:auto; }
}

/* 语言切换:EN | 中文 */
.lang { display:inline-flex; border:1px solid var(--line); border-radius:999px; overflow:hidden; flex:none; }
.lang button { border:0; background:transparent; color:var(--muted); font:600 12px/1 system-ui,sans-serif; padding:6px 10px; cursor:pointer; }
.lang button.on { background:var(--soft); color:var(--ink); }
.lang-corner { display:flex; justify-content:flex-end; margin:-6px -6px 6px; }

/* 搜索 / 筛选条 */
.filters-bar { padding:12px 14px; }
.filters-bar input[type=search] { width:100%; padding:10px 12px; }
.filters-bar select { padding:7px 10px; }
.filters-bar [hidden] { display:none; }
.pill.admin, .pill.next, .pill.warn, .pill.special, .pill.pending, .pill.approved, .pill.rejected, .pill.cancelled { border-color:transparent; }

/* 家长选择器 */
.gp { position:relative; }
.gp-chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }
.gp-chips:empty { display:none; }
.gp-chips .tag { padding-right:4px; }
.gp-x { border:0; background:transparent; color:var(--muted); cursor:pointer; font:inherit; font-size:12px; padding:2px 6px; border-radius:999px; }
.gp-x:hover { background:var(--danger-weak); color:var(--danger); }
.gp-list:not([hidden]) { display:block; position:absolute; left:0; right:0; z-index:5; margin-top:4px; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); max-height:220px; overflow:auto; padding:4px; }
.gp-opt { display:flex; align-items:center; gap:8px; width:100%; border:0; background:transparent; color:inherit; font:inherit; text-align:left; padding:7px 8px; border-radius:8px; cursor:pointer; }
.gp-opt:hover { background:var(--hover); }
.gp-opt .sub { margin-left:auto; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:45%; }
.callout.err { background:var(--danger-weak); color:var(--danger); border-color:color-mix(in srgb, var(--danger) 45%, transparent); margin-top:12px; }
.callout[hidden] { display:none; }

/* 顶栏的通知铃铛 + 红点数字 */
.bell { position:relative; display:grid; place-items:center; width:38px; height:38px; border-radius:50%; color:var(--muted); text-decoration:none; flex:none; border:1px solid transparent; transition:background .15s, color .15s; }
.bell:hover { background:var(--soft); color:var(--ink); }
.bell .i { width:21px; height:21px; }
.bell .dot { position:absolute; top:0; right:-2px; min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--danger); color:#fff; font-size:11px; font-weight:700; display:grid; place-items:center; box-shadow:0 0 0 2px var(--surface); }

/* 通知列表 */
.note-day { font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin:14px 0 4px; }
.note-row { display:flex; align-items:flex-start; gap:10px; width:100%; text-align:left; border:0; border-bottom:1px solid var(--line-soft); background:transparent; color:inherit; font:inherit; padding:11px 8px; margin:0 -8px; width:calc(100% + 16px); cursor:pointer; transition:background .12s; }
.note-row:hover { background:var(--hover); }
.note-row:last-child { border-bottom:0; }
.note-dot { width:8px; height:8px; border-radius:50%; margin-top:7px; flex:none; background:transparent; }
.note-row.unread .note-dot { background:var(--brand); }
.note-row.unread .note-msg { font-weight:600; }
.note-msg { flex:1; min-width:0; overflow-wrap:anywhere; }
.note-time { flex:none; margin-top:2px; }
.note-go { color:var(--muted); font-size:20px; line-height:1.2; flex:none; }

/* 下拉框:和网站风格一致的选择器(js/ui/select.js);原来的 <select> 被藏起来,但仍然在页面里 */
.sel { display:inline-block; position:relative; max-width:100%; vertical-align:middle; }
label.f + .sel, dialog .sel { display:block; width:100%; }
.sel-native { position:absolute; inset:0 auto auto 0; width:1px; height:1px; opacity:0; pointer-events:none; padding:0; border:0; }
.sel-btn { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; text-align:left; font:inherit; color:inherit; background:var(--field); border:1px solid var(--line); border-radius:10px; padding:9px 11px; cursor:pointer; outline:none; transition:border-color .15s, box-shadow .15s; }
.sel-btn:hover:not(:disabled) { border-color:var(--brand); }
.sel-btn:focus-visible, .sel-btn[aria-expanded="true"] { border-color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.sel-btn:disabled { opacity:.55; cursor:default; }
.sel-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sel-caret { color:var(--muted); font-size:12px; flex:none; }
.filters .sel-btn, .filters-bar .sel-btn { padding:7px 10px; }
.sel-pop { position:fixed; z-index:200; display:flex; flex-direction:column; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 12px 36px rgba(0,0,0,.45); overflow:hidden; }
.sel-pop .sel-q { box-sizing:border-box; margin:8px 8px 4px; width:calc(100% - 16px); max-width:none; padding:8px 10px; }
.sel-list { overflow:auto; padding:4px; }
.sel-group { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); padding:8px 10px 4px; }
.sel-opt { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; text-align:left; border:0; background:transparent; color:inherit; font:inherit; padding:9px 10px; border-radius:8px; cursor:pointer; }
.sel-opt:hover, .sel-opt:focus-visible { background:var(--hover); outline:none; }
.sel-opt.on { background:var(--brand-weak); color:var(--brand); font-weight:600; }
.sel-opt:disabled { opacity:.4; cursor:default; }
.sel-opt[hidden], .sel-group[hidden] { display:none; }
.sel-tick { color:var(--brand); }
.req::after { content:" *"; color:var(--danger,#e5484d); font-weight:700; }

/* 成员列表:岗位很多时折叠成“+N”,点开再看 */
.tag.more { cursor:pointer; border:1px dashed var(--line); background:transparent; color:var(--brand); font:inherit; font-size:12.5px; font-weight:600; }
.tag.more:hover { background:var(--brand-weak); border-color:var(--brand); }
.moretags { display:contents; } .moretags[hidden] { display:none; }

/* 日期框:触屏设备上用“日期显示框”(没选时浅色 dd/mm/yyyy),真正的日期框透明地盖在上面,点一下弹出日期选择器 */
.dph { position:relative; display:block; } .dph-v { display:none; }
@media (pointer: coarse) {
  .dph input[type="date"] { position:absolute; inset:0; width:100%; height:100%; opacity:0; z-index:1; }
  .dph-v { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:42px; padding:9px 11px; border:1px solid var(--line); border-radius:10px; background:var(--field); }
  .dph-v .ph { color:var(--muted); } .dph-v svg { width:18px; height:18px; stroke:var(--muted); fill:none; stroke-width:2; flex:none; }
  .dph:focus-within .dph-v { border-color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
}
/* 不可服事:“从 / 到”两个日期并排,每个都有名字 */
.datepair { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:4px; } .datepair .sub { margin-bottom:4px; }

/* 一场聚会的备注 / 诗歌(“我的”页) */
.plan { margin:2px 0 12px 58px; padding:8px 12px; border-left:3px solid var(--brand); background:var(--soft); border-radius:0 10px 10px 0; }
.plan-note { white-space:pre-wrap; margin-bottom:6px; }
.plan-songs { margin:4px 0 6px; padding-left:20px; } .plan-songs li { margin:2px 0; } .plan-songs .pill { margin-left:4px; }
.songrow { display:grid; grid-template-columns:1fr 84px auto; gap:6px; align-items:center; margin-bottom:10px; } .songrow input { width:100%; box-sizing:border-box; } .songrow .song-l { grid-column:1 / -1; font-size:13px; }
.psec { margin-top:4px; } .psec .sel { width:auto; flex:1; min-width:0; }
.plan-h { font-weight:700; margin:8px 0 0; } .plan-songs a { color:var(--brand); text-decoration:none; } .plan-songs a:hover { text-decoration:underline; }
dialog textarea { width:100%; box-sizing:border-box; font:inherit; color:inherit; background:var(--field); border:1px solid var(--line); border-radius:10px; padding:9px 11px; resize:vertical; }
@media (max-width:520px) { .plan { margin-left:0; } }
