/* 方案 1：单场赛果与人员反馈并行。仅赛后总览接管原任务布局。 */
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard'] {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 0;
  row-gap: 0;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  > :not(.tf-workflow):not(.tpd-board) {
  display: none !important;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  > .tpd-board:not([hidden]) {
  display: grid !important;
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
}
.tpd-board[hidden] {
  display: none !important;
}
/* 原流程规则对已发布 section 有强制隐藏，显式覆盖总览而保留详情。 */
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  > section.tpd-board:not([hidden]) {
  display: grid !important;
}
body.tf-management:has(.workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard'])
  .management-shell > main {
  max-width: 1440px !important;
  padding-bottom: 28px !important;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  .tf-workflow {
  margin-bottom: 0 !important;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  .tf-phase-nav button {
  min-height: 44px;
  padding-block: 8px;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  .tf-phase-nav button strong {
  font-size: 15px;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  .tf-context {
  padding: 12px 16px;
  gap: 10px 20px;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  .tf-context h1 {
  margin-bottom: 4px;
  font-size: 16px;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  .tf-context h2 {
  font-size: 17px;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  .tf-context-tools { flex-basis: 320px; }
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  .tf-picker-controls { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr); }
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
  .tf-match-meta {
  margin-top: 4px;
}
.tpd-board,
.tpd-board * {
  box-sizing: border-box;
  min-width: 0;
}
.tpd-board {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  width: 100%;
  max-width: 100%;
  color: var(--tf-ink);
  background: var(--tf-panel);
  border-bottom: 1px solid var(--tf-line);
  font-size: 14px;
  font-family: 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.tpd-board :is(h2, h3, h4, p) {
  margin: 0;
}
.tpd-board :is(button, a, input, select, summary) {
  font: inherit;
}
.tpd-board :is(button, a, input, select, summary):focus-visible {
  outline: 3px solid var(--tf-accent);
  outline-offset: 3px;
}
.tpd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--tf-line);
}
.tpd-toolbar .tpd-actions { margin: 0 0 0 auto; }
.tpd-status { color: var(--tf-muted); font-size: 12px; }
.tpd-toolbar :is(h2, strong) {
  font-size: 18px;
  font-weight: 650;
}
.tpd-toolbar p {
  margin-top: 2px;
  color: var(--tf-muted);
  font-size: 12px;
}
.tpd-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
}
.tpd-matches {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 22px 14px 22px 0;
  border-right: 1px solid var(--tf-line);
}
.tpd-matches > :is(h3, header) {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 650;
}
.tpd-matches > p {
  color: var(--tf-muted);
  font-size: 12px;
}
.tpd-matches label {
  display: grid;
  gap: 4px;
  color: var(--tf-muted);
  font-size: 12px;
}
.tpd-matches select {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--tf-line);
  border-radius: 5px;
  background: var(--tf-bg);
  color: var(--tf-ink);
}
.tpd-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 6px;
  width: 100%;
  min-height: 84px;
  padding: 10px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 0 5px 5px 0;
  background: color-mix(in srgb, var(--tf-bg) 72%, var(--tf-panel));
  color: var(--tf-ink);
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.tpd-match > strong {
  font-size: 14px;
  font-weight: 650;
}
.tpd-match > span {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 1.6;
}
.tpd-match > .tpd-tag {
  grid-column: 2;
  grid-row: 1;
  font-size: 11px;
}
.tpd-match-list {
  display: grid;
  gap: 8px;
}
.tpd-match .tpd-time {
  color: var(--tf-muted);
  font-size: 11px;
}
.tpd-match[aria-current='true'] {
  border-left-color: var(--tf-accent);
  background: var(--tf-active);
}
.tpd-match[aria-current='true'] > strong {
  color: var(--tf-accent);
}
.tpd-match:hover {
  border-color: var(--tf-line);
}
.tpd-match[aria-current='true']:hover {
  border-left-color: var(--tf-accent);
}
.tpd-main {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
  align-items: start;
}
.tpd-records,
.tpd-feedback {
  padding: 22px;
}
.tpd-records {
  border-right: 1px solid var(--tf-line);
}
.tpd-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 16px;
}
.tpd-heading h2 {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', serif;
  font-size: clamp(21px, 1.7vw, 25px);
  font-weight: 650;
  line-height: 1.45;
}
.tpd-heading > p,
.tpd-heading > span:not(.tpd-tag) {
  color: var(--tf-muted);
  font-size: 12px;
}
.tpd-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--tf-line) 32%, transparent);
  color: var(--tf-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.tpd-tag[data-status='published'],
.tpd-tag[data-status='complete'],
.tpd-tag[data-state='published'],
.tpd-tag[data-state='complete'] {
  background: color-mix(in srgb, var(--ft-success, var(--tf-warm)) 12%, var(--tf-panel));
  color: var(--ft-success, var(--tf-warm));
}
.tpd-tag[data-status='pending'],
.tpd-tag[data-state='pending'] {
  background: var(--tf-active);
  color: var(--tf-accent);
}
.tpd-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tpd-heading .tpd-actions {
  margin: 0 0 0 auto;
}
.tpd-primary,
.tpd-secondary,
.tpd-link,
.tpd-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--tf-line);
  border-radius: 5px;
  color: var(--tf-ink);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
  font-family: inherit;
}
.tpd-primary {
  background: var(--tf-accent);
  border-color: var(--tf-accent);
  color: var(--tf-bg);
}
html.light-mode .tpd-primary {
  color: var(--ft-text-on-dark, #fff);
}
.tpd-secondary,
.tpd-return {
  background: var(--tf-bg);
}
.tpd-link {
  border-color: transparent;
  color: var(--tf-accent);
  padding-inline: 4px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.tpd-board :is(.tpd-primary, .tpd-secondary, .tpd-link):hover:not(:disabled) {
  box-shadow: 0 0 0 1px currentColor;
}
.tpd-board :is(button, a)[aria-disabled='true'],
.tpd-board button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='detail']
  > .tf-task-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='detail']
  > .tf-task-title > p {
  flex-basis: 100%;
  margin-bottom: 0;
}
body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='detail']
  > .tf-task-title > h2 {
  flex: 1 1 180px;
}
.tpd-return:focus-visible {
  outline: 3px solid var(--tf-accent);
  outline-offset: 3px;
}
/* 路由页的 z-index:1 把内部核验弹窗压在 z-index:50 的主导航下，抬升弹窗所在页。 */
body.tf-management app-tournament-management-page:has(
  .workspace-shell[data-tf-phase='after'][data-tpd-view='detail'] .je-manager
) {
  z-index: 60 !important;
}
.tpd-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 14px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--tf-bg) 72%, var(--tf-panel));
}
.tpd-facts > div {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 88px;
  padding: 12px 14px;
}
.tpd-facts > div + div {
  border-left: 1px solid var(--tf-line);
}
.tpd-facts :is(dt, span) {
  font-size: 12px;
  color: var(--tf-muted);
}
.tpd-facts dd {
  margin: 0;
  color: var(--tf-ink);
  font-size: 21px;
  font-weight: 650;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.tpd-facts strong[data-status='complete'],
.tpd-facts strong[data-state='complete'] {
  color: var(--ft-success, var(--tf-warm));
}
.tpd-table {
  max-width: 100%;
  border: 1px solid var(--tf-line);
  border-radius: 5px;
  overflow: hidden;
}
.tpd-board :is(.tpd-ballots, .tpd-people) {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--tf-ink);
  font-size: 13px;
}
.tpd-board :is(.tpd-ballots, .tpd-people) :is(th, td) {
  padding: 10px 12px;
  border-bottom: 1px solid var(--tf-line);
  font-weight: 400;
  line-height: 1.6;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.tpd-board :is(.tpd-ballots, .tpd-people) th {
  background: color-mix(in srgb, var(--tf-line) 18%, var(--tf-panel));
  color: var(--tf-muted);
  font-size: 12px;
  font-weight: 550;
}
.tpd-board :is(.tpd-ballots, .tpd-people) tr:last-child td {
  border-bottom: 0;
}
.tpd-ballots th:first-child { width: 38%; }
.tpd-ballots th:last-child { width: 62%; }
.tpd-people th:first-child { width: 58%; }
.tpd-person-name { display: grid; gap: 3px; }
.tpd-person-name strong { font-weight: 600; }
.tpd-person-name small { color: var(--tf-muted); font-size: 11px; line-height: 1.6; }
.tpd-board :is(.tpd-lineups, .tpd-source) {
  margin-top: 14px;
  border-top: 1px solid var(--tf-line);
  color: var(--tf-muted);
  font-size: 12px;
}
.tpd-board :is(.tpd-lineups, .tpd-source) summary {
  min-height: 44px;
  padding: 11px 0;
  color: var(--tf-ink);
  cursor: pointer;
  font-size: 13px;
}
.tpd-board :is(.tpd-lineups, .tpd-source) :is(p, ul, ol) {
  margin: 0 0 10px;
}
.tpd-board :is(.tpd-lineups, .tpd-source) li {
  margin-bottom: 4px;
}
.tpd-progress {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 10px;
  color: var(--tf-ink);
  font-size: 14px;
}
.tpd-number {
  color: var(--tf-accent);
  font-family: 'Noto Serif SC', 'Source Han Serif SC', serif;
  font-size: clamp(28px, 2.5vw, 38px);
  font-weight: 650;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.tpd-feedback > p {
  margin: 8px 0;
  color: var(--tf-muted);
  font-size: 12px;
  line-height: 1.7;
}
.tpd-feedback > p > strong {
  color: var(--tf-ink);
  font-size: 14px;
}
.tpd-feedback .tpd-table {
  margin-top: 14px;
}
.tpd-people time {
  color: var(--tf-muted);
  font-size: 12px;
}
.tpd-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 4px;
  padding: 14px 18px;
  border-top: 1px solid var(--tf-line);
  background: color-mix(in srgb, var(--tf-active) 38%, var(--tf-bg));
  color: var(--tf-muted);
  font-size: 14px;
}
.tpd-footer strong {
  color: var(--tf-ink);
  font-size: 13px;
}
.tpd-footer :is(nav, ol) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 1100px) {
  .tpd-layout { grid-template-columns: 150px minmax(0, 1fr); }
  .tpd-matches { padding-right: 10px; }
  .tpd-records, .tpd-feedback { padding: 18px 14px; }
  .tpd-facts > div { padding: 10px; }
  .tpd-facts dd { font-size: 18px; }
  .tpd-board :is(.tpd-ballots, .tpd-people) :is(th, td) { padding: 8px; }
}
@media (max-width: 900px) {
  .tpd-main { grid-template-columns: minmax(0, 1fr); }
  .tpd-records { border-right: 0; border-bottom: 1px solid var(--tf-line); }
  .tpd-matches { padding-top: 18px; }
}
@media (max-width: 700px) {
  .tpd-layout { grid-template-columns: minmax(0, 1fr); }
  .tpd-toolbar { padding-block: 12px; }
  .tpd-matches {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--tf-line);
  }
  .tpd-matches > h3 { margin: 0; }
  .tpd-match-list { display: none; }
  .tpd-match { min-height: 92px; }
  .tpd-records, .tpd-feedback { padding: 18px 12px; }
  .tpd-heading { margin-bottom: 12px; }
  .tpd-heading h2 { font-size: 22px; }
  .tpd-heading .tpd-actions { width: 100%; margin-left: 0; }
  .tpd-facts > div { padding: 10px 8px; }
  .tpd-facts dd { font-size: 17px; }
  .tpd-facts span { font-size: 11px; }
  .tpd-progress { gap: 8px 12px; }
  .tpd-actions > :is(button, a) { flex: 1 1 100px; }
  .tpd-toolbar .tpd-actions { width: 100%; }
  .tpd-feedback .tpd-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tpd-feedback .tpd-primary { grid-column: 1 / -1; }
  .tpd-return { width: 100%; }
  .tpd-footer { padding: 12px; gap: 8px; }
  body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
    .tf-context {
    padding: 10px 12px;
  }
  body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
    .tf-context-tools {
    flex-basis: 100%;
    margin-top: 8px;
  }
  body.tf-management .workspace-shell[data-tf-phase='after'][data-tpd-view='dashboard']
    .tf-phase-nav button strong {
    font-size: 13px;
  }
}
@media (max-width: 380px) {
  .tpd-matches { grid-template-columns: minmax(0, 1fr); }
  .tpd-match { min-height: 76px; }
  .tpd-facts { grid-template-columns: minmax(0, 1fr); }
  .tpd-facts > div { min-height: 0; padding: 10px 12px; }
  .tpd-facts > div + div { border-left: 0; border-top: 1px solid var(--tf-line); }
  .tpd-actions > :is(button, a) { flex-basis: 100%; }
  .tpd-board :is(.tpd-ballots, .tpd-people) :is(th, td) { padding: 7px 5px; font-size: 12px; }
}
