:root {
  --red: #e40716;
  --red-2: #ff3131;
  --ink: #111318;
  --muted: #6f7580;
  --line: #e9edf3;
  --soft: #f5f7fa;
  --paper: #ffffff;
  --green: #0e9f6e;
  --gold: #bd7a12;
  --shadow: 0 18px 45px rgba(22, 30, 45, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 75% 5%, rgba(228, 7, 22, 0.08), transparent 28%), #f2f5f9;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffd46a;
  background: radial-gradient(circle at 35% 30%, #c50012, #89000c);
  border: 3px solid #d8a23d;
  font-size: 25px;
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span, .sidebar-foot span, .topbar p, .panel-head span, .score-card p {
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #555c66;
  text-align: left;
  font-weight: 700;
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-2));
  box-shadow: 0 10px 24px rgba(228, 7, 22, 0.24);
}

.icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-weight: 900;
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.sidebar-foot strong {
  display: block;
  margin-top: 4px;
  color: var(--red);
}

.main {
  padding: 24px;
  overflow: hidden;
}

.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(22, 30, 45, 0.06);
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: 0;
}

.topbar-actions, .button-row, .venue-toolbar, .mode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.role-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}

.role-switch span {
  color: var(--muted);
  font-size: 13px;
}

select, input {
  height: 40px;
  min-width: 0;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  color: var(--ink);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
}

.score-card, .panel, .notice-paper {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.score-card {
  padding: 28px;
  min-height: 294px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.score-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(228, 7, 22, 0.08), transparent 40%);
  pointer-events: none;
}

.score-card-head {
  position: relative;
  display: grid;
  gap: 10px;
  font-size: 22px;
}

.score-card-head span {
  font-size: 15px;
  font-weight: 800;
}

.live-score {
  position: relative;
  margin: 18px 0;
  color: var(--red);
  font-size: 108px;
  line-height: 0.9;
  font-weight: 900;
}

.score-meta {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: baseline;
  font-size: 18px;
}

.score-meta strong {
  color: var(--red);
  font-size: 28px;
}

.quick-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.quick-panel button {
  min-height: 132px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.quick-panel span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.stats-row article {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-row span {
  color: var(--muted);
  font-weight: 700;
}

.stats-row strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  color: var(--red);
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.compact table {
  min-width: 560px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #fafbfc;
  color: #59616d;
  font-size: 13px;
}

td {
  font-size: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

.split-layout, .judge-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(460px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.import-box {
  padding: 18px;
  border: 1px dashed #ff9da4;
  border-radius: 8px;
  background: #fff6f7;
  margin-bottom: 14px;
}

.import-box input {
  display: none;
}

.import-box p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: #59616d;
  font-size: 13px;
  font-weight: 700;
}

.primary-btn, .ghost-btn {
  height: 42px;
  border-radius: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 900;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-2));
  box-shadow: 0 10px 22px rgba(228, 7, 22, 0.18);
}

.ghost-btn {
  background: #fff;
  border-color: #dce2ea;
  color: #3c4350;
}

.venue-toolbar {
  margin-bottom: 14px;
}

.venue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.venue-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.venue-card h3 {
  margin: 0 0 8px;
}

.venue-card ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.venue-card li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border-radius: 8px;
  background: var(--soft);
  font-size: 13px;
}

.judge-phone {
  max-width: 390px;
  margin: 0 auto;
  border: 8px solid #222733;
  border-radius: 32px;
  padding: 14px;
}

.phone-top {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 900;
}

.judge-filter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.judge-athletes {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.judge-row {
  display: grid;
  grid-template-columns: 34px 1fr 86px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffe7d8;
  color: var(--red);
  font-weight: 900;
}

.judge-row strong, .judge-row span {
  display: block;
}

.judge-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.judge-row input {
  width: 100%;
  height: 36px;
}

.full {
  width: 100%;
}

.judge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.judge-account {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.judge-account strong {
  display: block;
  margin-bottom: 8px;
}

.judge-account span {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 6px;
  background: #fff1f2;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.chief-adjust {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chief-adjust input {
  width: 78px;
  height: 34px;
}

.mini-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--red);
  font-weight: 900;
}

.mode-bar {
  margin-bottom: 14px;
}

.mode {
  height: 42px;
  border: 1px solid #ffc2c6;
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  color: var(--red);
  font-weight: 900;
}

.mode.active {
  background: var(--red);
  color: #fff;
}

.mode-bar label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mode-bar input {
  width: 72px;
}

.notice-layout {
  grid-template-columns: 370px 1fr;
}

.notice-paper {
  min-height: 620px;
  padding: 38px;
  box-shadow: 0 20px 55px rgba(22, 30, 45, 0.12);
}

.notice-paper h2, .notice-paper h3 {
  margin: 0;
  text-align: center;
}

.notice-paper h2 {
  font-size: 26px;
}

.notice-paper h3 {
  margin: 8px 0 20px;
  font-size: 24px;
}

.notice-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.notice-meta div {
  border-bottom: 1px solid #333;
  padding: 8px 0;
}

.notice-paper table {
  min-width: 0;
}

.notice-sign {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-weight: 800;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eef7f2;
  color: var(--green);
  font-weight: 800;
}

.score-red {
  color: var(--red);
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: 74px;
    padding: 8px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand, .sidebar-foot {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }

  .nav-item {
    padding: 8px 4px;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
  }

  .main {
    padding: 16px 16px 92px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .hero-grid, .split-layout, .judge-shell, .notice-layout {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .live-score {
    font-size: 78px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .notice-paper {
    padding: 22px;
  }
}

@media (max-width: 560px) {
  .nav-list {
    grid-template-columns: repeat(4, 1fr);
  }

  .sidebar {
    height: 132px;
  }

  .main {
    padding-bottom: 150px;
  }

  .topbar-actions, .role-switch {
    width: 100%;
  }

  .role-switch select, .ghost-btn, .primary-btn {
    flex: 1;
  }

  .stats-row, .quick-panel, .form-grid, .judge-filter {
    grid-template-columns: 1fr;
  }

  .quick-panel button {
    min-height: 86px;
  }

  .score-card {
    padding: 20px;
  }

  .notice-sign, .notice-meta {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar, .topbar, .section:not(#notice) .panel, #notice .panel:first-child {
    display: none !important;
  }

  .app-shell, .main, .notice-layout {
    display: block;
    padding: 0;
  }

  .section {
    display: none;
  }

  #notice {
    display: block;
  }

  .notice-paper {
    border: 0;
    box-shadow: none;
    width: 100%;
  }
}
