/* 名册方案1：纸白 / 暖墨双栏；所有规则限定在“报名名册 → 队伍与参赛人员”。 */
body.tr-roster-active {
  --tr-bg: #100e0c;
  --tr-panel: #1b1713;
  --tr-text: #f5efe3;
  --tr-muted: #c5baac;
  --tr-line: #39332b;
  --tr-red: #ef8a80;
  --tr-button: #b73931;
  --tr-tint: #2b211d;
  --tf-bg: var(--tr-bg);
  --tf-panel: var(--tr-panel);
  --tf-ink: var(--tr-text);
  --tf-muted: var(--tr-muted);
  --tf-line: var(--tr-line);
  --tf-accent: var(--tr-red);
  --tf-active: var(--tr-tint);
  --tf-warm: #ceb17b;
}
html.light-mode body.tr-roster-active {
  --tr-bg: #fdfbf6;
  --tr-panel: #f6f0e4;
  --tr-text: #262a33;
  --tr-muted: #625a50;
  --tr-line: #e6ded1;
  --tr-red: #a92f28;
  --tr-button: #b52d28;
  --tr-tint: #f6eae3;
  --tf-bg: var(--tr-bg);
  --tf-panel: var(--tr-panel);
  --tf-ink: var(--tr-text);
  --tf-muted: var(--tr-muted);
  --tf-line: var(--tr-line);
  --tf-accent: var(--tr-red);
  --tf-active: var(--tr-tint);
  --tf-warm: #8c642f;
}
body.tr-roster-active .workspace-shell {
  grid-template-columns: 170px minmax(0, 1fr) !important;
  column-gap: 24px;
}
body.tr-roster-active .registration-panel {
  background: var(--tr-bg);
  border-color: var(--tr-line);
  box-shadow: none;
  border-radius: 4px;
  margin-bottom: 12px;
}
body.tr-roster-active .registration-panel > summary {
  min-height: 44px !important;
  padding: 8px 16px !important;
}
body.tr-roster-active .registration-summary__copy {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
body.tr-roster-active .registration-summary__copy small {
  color: var(--tr-muted);
}
body.tr-roster-active .tf-workflow {
  display: flex;
  flex-direction: column;
}
body.tr-roster-active .tf-context {
  order: -1;
  padding: 14px 18px;
  border-radius: 4px;
  margin-bottom: 4px;
}
body.tr-roster-active .tf-context h1 {
  font-size: 19px !important;
  margin-bottom: 6px;
}
body.tr-roster-active .tf-context > div:first-child {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
}
body.tr-roster-active .tf-context h1 {
  flex-basis: 100%;
}
body.tr-roster-active .tf-context h2 {
  display: none;
}
body.tr-roster-active .tf-context-tools {
  flex: 0 0 170px;
}
body.tr-roster-active .tf-picker-steps {
  display: none;
}
body.tr-roster-active .tf-context-actions {
  gap: 6px;
}
body.tr-roster-active .tf-phase-nav button {
  min-height: 44px;
  padding: 10px 4px;
  background: transparent;
}
body.tr-roster-active .tf-phase-nav button strong {
  font-size: 15px;
}
body.tr-roster-active .tf-checklist {
  padding: 0 8px 16px 0;
}
body.tr-roster-active .tf-checklist button {
  min-height: 52px;
  padding: 12px 6px 12px 34px;
}
body.tr-roster-active .tf-checklist button strong {
  font-size: 14px;
}
body.tr-roster-active .tf-task-title {
  display: none;
}
body.tr-roster-active .tr-roster {
  display: grid !important;
  grid-template-columns: minmax(220px, 32%) minmax(0, 1fr) !important;
  gap: 24px;
  grid-row: 2;
  margin: 0 !important;
  color: var(--tr-text);
}
.tr-roster .tr-section {
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent;
}
.tr-roster .tr-team-section {
  border-right: 1px solid var(--tr-line) !important;
  padding-right: 20px !important;
}
.tr-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0 14px;
}
.tr-heading-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.tr-roster .tr-section-heading h3 {
  color: var(--tr-text) !important;
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
  font-size: 23px;
  line-height: 1.4;
  margin: 0;
  font-weight: 650;
}
.tr-count {
  color: var(--tf-warm);
  font: 16px/1.4 Georgia, serif;
  font-variant-numeric: tabular-nums;
}
.tr-add {
  flex-shrink: 0;
  border: 1px solid var(--tr-line);
  border-radius: 4px;
  background: transparent;
  color: var(--tr-text);
  padding: 8px 12px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tr-person-section .tr-add {
  background: var(--tr-button);
  border-color: var(--tr-button);
  color: #fffaf3;
}
.tr-roster .tr-list {
  margin-top: 0 !important;
  max-height: min(66vh, 680px) !important;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--tr-line) transparent;
}
.tr-roster .tr-row {
  margin: 0 !important;
  border: 0;
  border-bottom: 1px solid var(--tr-line);
  border-radius: 0 !important;
  background: transparent !important;
  min-height: 60px;
  padding: 10px 8px !important;
  gap: 10px;
}
.tr-roster .tr-row:hover {
  background: var(--tr-panel) !important;
}
.tr-roster .tr-name {
  min-width: 0;
}
.tr-roster .tr-name > p:first-child {
  color: var(--tr-text) !important;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.tr-roster .tr-team-row .tr-name > p + p {
  color: var(--tr-muted) !important;
  font-size: 12px;
  margin-top: 2px;
}
.tr-native-meta {
  display: none;
}
.tr-roster .tr-person-row,
.tr-table-head {
  display: grid !important;
  grid-template-columns: minmax(80px, 1fr) minmax(90px, 1.1fr) minmax(100px, 1.35fr) 48px 82px;
  align-items: center;
  gap: 10px;
}
.tr-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 8px;
  min-height: 40px;
  color: var(--tr-muted);
  background: var(--tr-panel);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.tr-cell {
  min-width: 0;
  color: var(--tr-muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.tr-account {
  font-size: 12px;
}
.tr-roster .tr-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.tr-roster .tr-actions .link-button,
.tr-more summary {
  min-width: 40px;
  min-height: 36px;
  padding: 8px 4px;
  color: var(--tr-red) !important;
  background: transparent;
  border: 0;
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
  text-align: center;
}
.tr-more summary {
  list-style: none;
  color: var(--tr-muted) !important;
}
.tr-more summary::-webkit-details-marker {
  display: none;
}
.tr-more[open] {
  background: var(--tr-panel);
  border-radius: 4px;
}
.tr-more > button {
  display: block;
  width: 100%;
  border-top: 1px solid var(--tr-line) !important;
}
.tr-roster .tr-form {
  padding: 14px;
  margin: 0 0 12px !important;
  border: 1px solid var(--tr-line);
  border-radius: 4px;
  background: var(--tr-panel);
  gap: 12px;
}
.tr-roster .tr-form[hidden],
.tr-roster [data-tr-owned][hidden] {
  display: none !important;
}
.tr-roster .tr-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tr-muted);
}
.tr-roster .tr-field .field {
  color: var(--tr-text);
  background: var(--tr-bg);
  border-color: var(--tr-line);
  font-size: 14px;
  min-height: 44px;
  width: 100%;
  min-width: 0;
}
.tr-roster .tr-field .field::placeholder {
  color: var(--tr-muted);
  opacity: 0.8;
}
.tr-roster .tr-roles {
  grid-column: 1/-1;
  padding: 0;
  color: var(--tr-text) !important;
}
.tr-roles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}
.tr-roles input {
  accent-color: var(--tr-button);
}
body.tr-roster-active .tr-roster .primary-button {
  background: var(--tr-button) !important;
  color: #fffaf3 !important;
  border-color: var(--tr-button) !important;
  min-height: 44px;
}
body.tr-roster-active .tr-roster .secondary-button {
  color: var(--tr-text);
  border-color: var(--tr-line);
  background: var(--tr-bg);
  min-height: 44px;
}
.tr-roster button:focus-visible,
.tr-roster summary:focus-visible,
.tr-roster .field:focus-visible {
  outline: 2px solid var(--tr-red);
  outline-offset: 3px;
}
@media (max-width: 1199px) {
  body.tr-roster-active .workspace-shell {
    grid-template-columns: 145px minmax(0, 1fr) !important;
    gap: 18px;
  }
  body.tr-roster-active .tr-roster {
    grid-template-columns: minmax(185px, 30%) minmax(0, 1fr) !important;
    gap: 16px;
  }
  .tr-roster .tr-team-section {
    padding-right: 14px !important;
  }
  .tr-roster .tr-team-row {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .tr-roster .tr-person-row,
  .tr-table-head {
    grid-template-columns: minmax(66px, 1fr) minmax(68px, 1fr) minmax(80px, 1.2fr) 44px 78px;
    gap: 6px;
  }
  .tr-roster .tr-section-heading h3 {
    font-size: 20px;
  }
  .tr-add {
    font-size: 13px;
    padding-inline: 8px;
  }
}
@media (max-width: 900px) {
  body.tr-roster-active .workspace-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.tr-roster-active .tf-checklist {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: row;
    border: 0;
    padding: 0;
  }
  body.tr-roster-active .tf-checklist button {
    min-height: 44px;
    flex: 1;
  }
  body.tr-roster-active .workspace-shell > .tr-roster {
    grid-column: 1 !important;
    grid-row: 3;
  }
  body.tr-roster-active .tf-context-tools {
    flex: 0 0 130px;
  }
}
@media (max-width: 650px) {
  body.tr-roster-active main {
    padding-inline: 14px !important;
  }
  body.tr-roster-active .tr-roster {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px;
  }
  .tr-roster .tr-team-section {
    padding: 0 !important;
    border-right: 0 !important;
  }
  .tr-roster .tr-team-row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .tr-roster .tr-list {
    max-height: 420px !important;
  }
  .tr-roster .tr-person-section .tr-list {
    max-height: 600px !important;
  }
  .tr-roster .tr-person-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'name actions' 'role actions' 'school account';
    gap: 2px 12px;
    min-height: 86px;
    padding-block: 12px !important;
  }
  .tr-person-row .tr-name { grid-area: name; }
  .tr-person-row .tr-role { grid-area: role; }
  .tr-person-row .tr-school { grid-area: school; }
  .tr-person-row .tr-account { grid-area: account; text-align: right; }
  .tr-person-row .tr-actions { grid-area: actions; }
  .tr-roster .tr-actions .link-button,
  .tr-more summary {
    min-height: 44px;
    min-width: 44px;
  }
  .tr-table-head {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
  body.tr-roster-active .tf-context {
    display: block;
    padding: 12px;
  }
  body.tr-roster-active .tf-context h1 {
    white-space: normal;
    font-size: 17px !important;
  }
  body.tr-roster-active .tf-context-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
  }
  body.tr-roster-active .tf-context-actions .back-link {
    display: none;
  }
  body.tr-roster-active .registration-summary__copy {
    display: block;
  }
  body.tr-roster-active .tf-phase-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  body.tr-roster-active .tf-phase-nav button strong {
    font-size: 13px;
  }
}
