/* 名册、内容管理和登录页共用的主题、按钮与表单样式。 */
:root {
  color-scheme: dark;
  --ink: #141311;
  --panel: #1c1916;
  --paper: #f4e9d3;
  --muted: #b8aa95;
  --rule: #3d352b;
  --ember: #d87b60;
  --focus: #f5bd83;
  font: 16px/1.55 system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--paper); background: radial-gradient(ellipse at 15% 0, #2b201a, var(--ink) 52rem); min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.shell { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--rule); background: #151311a6; }
.topbar-content { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark, .back { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark { font-weight: 750; letter-spacing: .14em; }
.seal { flex: 0 0 auto; object-fit: contain; }
.back { font-size: .88rem; color: var(--muted); }
.back:hover { color: var(--paper); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding-block: 54px 32px; }
.kicker { margin: 0 0 8px; font-size: .74rem; font-weight: 750; color: var(--ember); letter-spacing: .24em; }
h1, h2 { margin: 0; line-height: 1.25; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 5vw, 3.45rem); letter-spacing: .035em; font-family: "Songti SC", SimSun, "Microsoft YaHei", serif; font-weight: 900; }
h2 { font-size: 1.22rem; }
.subtitle { margin: 12px 0 0; color: var(--muted); }
.totals { display: flex; flex: 0 0 auto; margin: 0; border: 1px solid var(--rule); background: #221c16; }
.totals div { padding: 10px 19px; min-width: 76px; }
.totals div + div { border-left: 1px solid var(--rule); }
.totals dt { color: var(--muted); font-size: .72rem; letter-spacing: .12em; }
.totals dd { margin: 2px 0 0; font-size: 1.35rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
/* 名册左栏用于选团，右栏显示成员、搜索和操作。 */
.workspace { display: grid; grid-template-columns: minmax(190px, 258px) minmax(0, 1fr); gap: 18px; align-items: start; padding-bottom: 64px; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--rule); }
.panel-title, .members-heading, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title { padding: 17px 16px; border-bottom: 1px solid var(--rule); }
.panel-title h2 { font-size: 1rem; }
.group-list { margin: 0; padding: 8px; list-style: none; }
.group-filter { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; padding: 10px 9px; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 3px; }
.group-filter:hover { color: var(--paper); background: #28211a; }
.group-filter[aria-pressed="true"] { color: var(--paper); border-color: #674335; background: #38261e; }
.group-filter span:first-child { overflow-wrap: anywhere; }
.group-count { color: #e4aa95; font-size: .76rem; font-variant-numeric: tabular-nums; }
.group-note { padding: 0 16px 16px; margin: 0; color: var(--muted); font-size: .84rem; }
.members { padding: 22px; min-height: 390px; }
.members-heading { align-items: flex-start; margin-bottom: 18px; }
.members-heading h2 { font-size: clamp(1.2rem, 3vw, 1.65rem); }
.group-description { margin: 8px 0 0; color: var(--muted); font-size: .89rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; flex: 0 0 auto; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; gap: 4px; padding: 8px 13px; background: #24201b; border: 1px solid #554638; border-radius: 3px; color: var(--paper); font-weight: 700; white-space: nowrap; }
.button:hover:not(:disabled) { background: #372b22; border-color: #806351; }
.button.small { font-size: .82rem; min-height: 36px; padding: 6px 9px; }
.button.primary { background: var(--ember); border-color: var(--ember); color: #1a120e; }
.button.primary:hover:not(:disabled) { background: #e3947d; border-color: #e3947d; }
.button.danger { color: #f2a78f; }
.button.danger-filled { color: #fff2e9; border-color: #ae4939; background: #9f4131; }
.button.danger-filled:hover:not(:disabled) { background: #b44938; border-color: #b44938; }
.search { min-width: 0; display: flex; align-items: center; gap: 7px; background: #141210; border: 1px solid #514236; border-radius: 3px; color: var(--muted); padding-left: 10px; flex: 0 1 310px; }
.search svg { width: 18px; height: 18px; flex-shrink: 0; }
.search input { width: 100%; min-height: 40px; background: none; border: 0; color: var(--paper); padding: 8px 9px 8px 0; }
.search input:focus-visible { outline: 0; }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.results { margin: 15px 0 8px; color: var(--muted); font-size: .82rem; }
.empty { display: grid; justify-items: center; place-content: center; min-height: 210px; margin-top: 18px; padding: 18px; border: 1px dashed #4d3c30; text-align: center; }
.empty-mark { display: grid; place-items: center; border: 1px solid #755041; color: #dba28b; font: 700 1.3rem/1 "Songti SC", SimSun, serif; width: 43px; height: 43px; border-radius: 50%; margin-bottom: 12px; }
.empty p { margin: 0; }
.empty p + p { margin-top: 6px; color: var(--muted); font-size: .87rem; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
th, td { padding: 11px 8px; vertical-align: top; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
th { font-size: .78rem; font-weight: 600; color: var(--muted); background: #251f1a; white-space: nowrap; }
td:first-child { font-weight: 700; }
.member-intro { white-space: pre-wrap; width: 39%; }
.row-actions { white-space: nowrap; }
.row-actions .button + .button { margin-left: 4px; }
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 10px 14px; border: 1px solid #855344; background: #38241d; }
.notice p, .form-error { margin: 0; color: #ffbcaa; }
.account-feedback { margin: 16px 0 0; padding: 8px 12px; border: 1px solid var(--rule); background: var(--panel); }
dialog { width: min(465px, calc(100% - 30px)); max-height: calc(100% - 32px); overflow: auto; background: #221c17; color: var(--paper); border: 1px solid #765445; border-radius: 5px; padding: clamp(18px, 5vw, 28px); box-shadow: 0 20px 100px #000a; }
dialog::backdrop { background: #0c0a08c4; }
dialog form { display: grid; gap: 15px; }
dialog .kicker { margin-bottom: -7px; }
dialog h2 { font-size: 1.45rem; }
dialog label { display: grid; gap: 5px; font-size: .88rem; }
dialog label small { margin-left: 4px; color: var(--muted); font-size: .75rem; }
dialog input, dialog select, dialog textarea { min-height: 41px; min-width: 0; width: 100%; padding: 8px 10px; color: var(--paper); background: #171411; border: 1px solid #554638; border-radius: 3px; }
dialog textarea { resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.confirmation-text { color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.screen-reader-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .shell { width: calc(100% - 36px); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .group-list { display: flex; flex-wrap: wrap; gap: 5px; }
  .group-filter { width: auto; border-color: var(--rule); }
}

/* 窄屏把表格行改为卡片，列名由单元格的 data-label 提供。 */
@media (max-width: 570px) {
  .shell { width: calc(100% - 28px); }
  .topbar-content { min-height: 60px; }
  .page-heading { flex-wrap: wrap; gap: 16px; padding-block: 30px 20px; }
  .totals div { padding: 7px 12px; }
  .members { padding: 14px; }
  .members-heading { flex-wrap: wrap; gap: 8px; }
  .toolbar { gap: 8px; }
  .toolbar .primary { font-size: .83rem; padding-inline: 8px; }
  .search input { font-size: .84rem; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tr { display: block; margin-bottom: 9px; border: 1px solid var(--rule); padding: 7px 9px; }
  td, .member-intro { display: grid; grid-template-columns: minmax(66px, 24%) minmax(0, 1fr); width: auto; padding: 6px 0; border: 0; gap: 4px; }
  td::before { content: attr(data-label); font-weight: 500; color: var(--muted); }
  .row-actions { display: block; padding-top: 8px; }
  .row-actions::before { content: none; }
}
