:root {
  color-scheme: light;
  --bg: #faf9f6;
  --ink: #172c24;
  --muted: #4f6358;
  --green: #245b44;
  --line: #dce4d8;
  --paper: #fffefa;
  --shell: 1024px;
  --gutter: 20px;
  --radius: 15px;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 16px/1.6 var(--sans); min-height: 100vh; min-height: 100svh; -webkit-text-size-adjust: 100%; display: flex; flex-direction: column; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #317453; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; vertical-align: middle; }
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { max-width: var(--shell); min-height: 64px; margin: auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 6px; }
.brand { display: inline-flex; align-items: center; gap: 8px; flex: none; font-weight: 750; font-size: 17px; letter-spacing: .025em; white-space: nowrap; }
.brand img { width: 33px; height: 33px; border-radius: 10px; }
nav { display: flex; align-items: center; margin-left: auto; }
nav a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 6px; border-radius: 10px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.nav-home, .header-help span { display: none; }
nav a:hover, nav a.nav-current { background: #eaf0e5; color: var(--green); }
.header-help { flex: none; min-height: 44px; width: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.main-content { flex: 1; width: min(100%, var(--shell)); margin: 0 auto; padding: 22px var(--gutter) 0; }
.home { max-width: 704px; padding: 28px 0 24px; margin: 0 auto; }
.hero { text-align: center; }
.hero h1 { font: 760 clamp(34px, 10vw, 45px)/1.18 var(--serif); letter-spacing: -.035em; }
.hero h1 span { display: block; }
.hero h1 span:last-child { color: var(--green); }
.hero p { color: var(--muted); margin: 13px auto 0; font-size: 16px; line-height: 1.65; }
.choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 26px; }
.role-card { display: flex; align-items: center; gap: 13px; min-height: 76px; padding: 13px 15px; border: 1px solid var(--role-line); border-radius: var(--radius); background: var(--role-bg); transition: border-color .16s, box-shadow .16s; }
.role-card > div { min-width: 0; }
.role-write { --role-bg: #edf5ef; --role-line: #dce9de; --role-icon: #deece1; --role-accent: #245b44; }
.role-listen { --role-bg: #f4f0fa; --role-line: #e9e1f3; --role-icon: #eae3f5; --role-accent: #594678; }
.role-card:hover { border-color: var(--role-accent); box-shadow: 0 4px 14px #26372d0b; }
.role-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 11px; flex: none; color: var(--role-accent); background: var(--role-icon); }
.role-card h2 { font-size: 19px; line-height: 1.4; }
.role-card p { color: var(--muted); font-size: 14px; margin-top: 3px; }
.privacy-line { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.site-footer { width: min(calc(100% - var(--gutter) * 2), calc(var(--shell) - var(--gutter) * 2)); padding: 12px 0; margin: 20px auto 0; border-top: 1px solid var(--line); text-align: right; color: var(--muted); font-size: 13px; }
.plain { border: 0; background: transparent; padding: 5px 0; color: var(--muted); }
.site-footer a:hover, .plain:hover, .header-help:hover, .back-link:hover { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.subpage { max-width: 656px; margin: 0 auto; padding-bottom: 9px; }
.page-title { margin-bottom: 20px; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.page-title h1, .write-page h1 { font: 760 clamp(34px, 4.2vw, 46px)/1.2 var(--serif); letter-spacing: -.03em; }
.page-title p { color: var(--muted); margin-top: 7px; }
.back-link { display: table; font-size: 14px; color: var(--muted); padding: 6px 0; margin: -8px 0 13px; }
.section-icon { width: 49px; height: 49px; border-radius: 14px; background: #e5f0e5; color: var(--green); display: grid; place-items: center; }
.paper { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 3px 15px #172e2006; overflow-wrap: anywhere; }
.flow { display: grid; gap: 20px; }
.field label { padding: 0; margin: 0 0 7px; font-weight: 700; display: block; }
.field label span { color: var(--muted); font-size: 13px; margin-left: 3px; font-weight: normal; }
.controls, .tag-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field input, .field select, .field textarea { background: #fbfcf8; border: 1px solid #d5e1d4; border-radius: 10px; width: 100%; padding: 11px 13px; color: var(--ink); }
textarea { resize: vertical; min-height: 86px; display: block; }
.field textarea::placeholder, .field input::placeholder { color: #64766b; }
.field small { margin-top: 7px; display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.write-page { max-width: 592px; }
.write-page h1 { margin-bottom: 17px; }
.write-form { display: grid; gap: 15px; }
.write-details { border-block: 1px solid var(--line); }
.write-details summary { display: flex; align-items: center; gap: 7px; min-height: 44px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 650; }
.write-details summary::-webkit-details-marker { display: none; }
.write-details summary span { color: var(--muted); font-size: 13px; font-weight: normal; }
.write-details summary svg { margin-left: auto; color: var(--muted); }
.write-details[open] summary svg { transform: rotate(180deg); }
.write-submit { justify-self: stretch; min-width: 132px; }
.connection { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 15px; }
.connection p { color: var(--muted); font-size: 14px; }
.candidate-foot, .conversation-top, .active-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.active-card { flex-wrap: wrap; }
.candidate-foot > span, .time, .state { font-size: 14px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; border: 1px solid transparent; font-weight: 660; font-size: 15px; padding: 8px 15px; min-height: 43px; white-space: nowrap; }
.primary { color: #fff; background: var(--green); }
.soft { color: var(--green); background: #edf3ea; border-color: #e2eadf; }
.soft:hover:not(:disabled) { background: #e2eee2; }
.notice { color: #932d28; background: #fff3ed; border-radius: 9px; padding: 8px 12px; }
.loading { color: var(--muted); padding: 16px 0; }
.stack { display: grid; gap: 12px; }
.candidate h2, .record h2, .active-card h2, .empty h2 { font-size: 19px; margin: 8px 0; }
.active-card p, .empty p { color: var(--muted); }
.empty { display: grid; justify-items: center; text-align: center; padding: 36px 17px; gap: 7px; }
.empty .btn { margin-top: 6px; }
.tag { display: inline-block; font-size: 13px; border-radius: 100px; background: #e5f1e6; color: #245940; padding: 3px 10px; }
.tag.subtle { background: #f1f2ea; color: #506457; }
.tag.highlight { background: #f4e8c9; color: #624a1f; }
.segmented { display: inline-flex; padding: 4px; gap: 3px; background: #eaf0e6; border-radius: 11px; margin-bottom: 15px; }
.segmented button { border: 0; background: transparent; padding: 7px 16px; border-radius: 8px; font-size: 15px; color: var(--muted); }
dialog::backdrop { background: #14261d80; }
.dialog-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.dialog-title h2 { font-size: 21px; }
.icon-button { border: 0; background: #edf1e9; border-radius: 8px; padding: 7px; }
.help-content { display: grid; gap: 13px; }
.help-content > div { display: flex; gap: 11px; color: var(--muted); }
#admin-key { margin-bottom: 8px; }
@media (min-width: 721px) {
  :root { --gutter: 32px; }
  .header-inner { min-height: 66px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0; }
  .brand { gap: 12px; width: fit-content; font-size: 19px; letter-spacing: .06em; }
  .brand img { width: 38px; height: 38px; border-radius: 11px; }
  nav { gap: 14px; margin-left: 0; }
  nav a { gap: 7px; min-height: 38px; padding: 8px 12px; }
  .nav-home { display: inline-flex; }
  .header-help { width: auto; margin-left: auto; gap: 7px; }
  .header-help span { display: inline; }
  .main-content { padding-top: 31px; }
  .home { padding: clamp(50px, 11vh, 104px) 0 24px; }
  .hero h1 { font-size: clamp(46px, 6vw, 68px); }
  .hero p { font-size: 17px; }
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 36px; }
  .role-card { min-height: 98px; padding: 16px 19px; }
  .role-card h2 { font-size: 20px; }
  .paper { padding: 22px; }
  .write-submit { justify-self: end; }
}

.hero h1 { color: var(--green); }
.role-icon { font-size: 25px; font-weight: 500; }
.role-card p { overflow-wrap: anywhere; }
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; text-align: left; }
.site-footer .controls { gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section-space { margin-top: 16px; }
.text-link { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.quiet { background: transparent; color: var(--muted); }
.quiet:hover { background: #eef1e9; color: var(--ink); }
.danger { color: #932d28; border-color: #f0d9d2; background: #fff4ef; }
.primary:hover:not(:disabled) { background: #174632; }
.btn { white-space: normal; text-align: center; }
.feedback { margin-top: 9px; color: var(--green); font-size: 14px; }
.notice:not([hidden]) { margin: 0 0 2px; }
.profile-fields { display: grid; gap: 14px; min-width: 0; }
.form-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.field, .field-label, .field > span:last-child { display: block; }
.field-label, .pill-field legend { margin: 0 0 5px; padding: 0; font-weight: 650; font-size: 14px; }
.field > input, .field > select, .field > textarea { min-height: 42px; }
.field :is(input,select,textarea) + span { margin-top: 6px; }
.field input[type="file"] { padding: 8px; }
.field textarea { display: block; resize: vertical; }
.pill-field { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.pill-field .controls { gap: 6px; }
.pill { position: relative; display: inline-flex; cursor: pointer; }
.pill input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.pill span { display: grid; place-items: center; min-height: 37px; white-space: nowrap; font-size: 13px; border-radius: 999px; padding: 4px 11px; background: #f8f8f0; border: 1px solid var(--line); }
.pill input:checked + span { background: #e1eee3; color: var(--green); border-color: #76a083; font-weight: 650; }
.pill input:focus-visible + span { outline: 2px solid #317453; outline-offset: 3px; }
.write-details .disclosure { margin-left: auto; font-size: 22px; line-height: 1; }
.write-details[open] .disclosure { transform: rotate(180deg); }
.extra-fields { padding: 4px 0 14px; }
.consents { display: grid; gap: 8px; }
.checkline { display: flex; align-items: flex-start; gap: 7px; font-size: 14px; cursor: pointer; }
.checkline input { width: 16px; height: 16px; margin: 3px 0 0; flex: none; accent-color: var(--green); }
.checkline:has(:disabled) { opacity: .55; }
.help-copy h2 { font-size: 19px; margin: 14px 0 5px; }
.help-copy h2:first-child { margin-top: 0; }
.help-copy p { margin-bottom: 7px; }
.match-page, .admin-page { max-width: 960px; }
.match-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; align-items: start; }
.match-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.match-heading h2, .match-card h2 { font-size: 19px; }
.match-card { display: grid; gap: 11px; min-width: 0; animation: card-arrival .22s ease-out; }
.match-card .btn { justify-self: start; }
.match-card.selected-card { border-color: #72a78a; box-shadow: 0 0 0 2px #e4eee2; }
.candidate-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 48px; height: 48px; border-radius: 13px; object-fit: cover; background: #e5f1e6; flex: none; }
.rank-tag { background: #f3ead3; color: #624a1f; }
.card-details summary { cursor: pointer; font-size: 14px; color: var(--green); }
.card-details dl { margin: 5px 0 0; font-size: 13px; }
.card-details dt { color: var(--muted); }
.card-details dd { margin: 0 0 5px; white-space: pre-wrap; }
.match-actions, .live-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.live-controls { margin-bottom: 16px; }
.live-view .page-title { margin-top: 15px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 0 0 14px; }
.stats > div { padding: 10px; background: #edf3ea; border-radius: 9px; color: var(--green); }
.stats span { display: block; font-size: 13px; }
.stats strong { font-size: 19px; }
.segmented { max-width: 100%; flex-wrap: wrap; }
.segmented [aria-pressed=true] { background: var(--paper); color: var(--green); box-shadow: 0 1px 3px #14302315; font-weight: 650; }
.toolbar { margin-bottom: 14px; }
.admin-player summary { cursor: pointer; }
.admin-player summary > span { margin-left: 8px; }
.admin-details { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.detail-pairs, .filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
dialog { width: min(650px, calc(100% - 24px)); max-height: 92vh; max-height: 92dvh; overflow: auto; color: var(--ink); background: var(--paper); padding: 20px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 60px #142e255a; }
code { display: inline-block; overflow-wrap: anywhere; max-width: 100%; padding: 1px 5px; color: var(--green); background: #f0f4e9; border-radius: 4px; }

@keyframes card-arrival {
  from { transform: translateY(4px); opacity: .8; }
  to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 721px) {
  .match-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 365px) {
  :root { --gutter: 12px; }
  .paper { padding: 12px; }
  .form-pair { gap: 12px 8px; }
  .pill span { padding-inline: 7px; }
  .site-header nav a { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
