:root {
  --ink: #10243c;
  --navy: #17375e;
  --navy-deep: #0b243d;
  --pine: #1e6b59;
  --pine-soft: #dcebe6;
  --gold: #c2944b;
  --paper: #f5f7f8;
  --white: #ffffff;
  --line: #dce3e7;
  --muted: #697987;
  --danger: #b4423b;
  --shadow: 0 18px 55px rgba(20, 48, 72, 0.09);
  --radius: 14px;
  --display: "FZKai-Z03", "STKaiti", "KaiTi", serif;
  --body: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --data: "DIN Alternate", "Arial Narrow", var(--body);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 1024px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(30, 107, 89, 0.25);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  height: 100vh;
  overflow: hidden;
}

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  color: var(--white);
  background: var(--navy-deep);
  border-bottom: 3px solid var(--gold);
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  color: inherit;
  /*background: var(--white);*/
  border-radius: 6px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 42px;
}

.judge-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.judge-chip:hover {
  background: rgba(255, 255, 255, 0.07);
}

.judge-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--navy-deep);
  background: #d7e7e2;
  border-radius: 50%;
  font-weight: 700;
}

.judge-copy {
  min-width: 72px;
  text-align: left;
}

.judge-copy small,
.judge-copy strong {
  display: block;
}

.judge-copy small {
  color: #9fb0c1;
  font-size: 10px;
}

.judge-copy strong {
  margin-top: 1px;
  font-size: 14px;
}

.judge-exit {
  padding: 0 8px 0 4px;
  color: #bcc8d3;
  font-size: 12px;
}

.workspace {
  height: calc(100vh - 78px);
  min-height: 0;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 42px 30px 28px;
  background: #edf1f3;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.eyebrow {
  display: block;
  color: var(--pine);
  font-family: var(--data);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar-heading h1 {
  margin: 8px 0 10px;
  font-family: var(--display);
  font-size: 29px;
  font-weight: 700;
}

.sidebar-heading p,
.sidebar-foot p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.field {
  margin-top: 28px;
}

.field + .field {
  margin-top: 20px;
}

.field label,
.modal-card label {
  display: block;
  margin-bottom: 8px;
  color: #425466;
  font-size: 12px;
  font-weight: 650;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 7px;
  height: 7px;
  border-right: 2px solid #627585;
  border-bottom: 2px solid #627585;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

select,
.modal-card input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #ced8dd;
  border-radius: 8px;
  appearance: none;
}

select:disabled {
  color: #9aa6af;
  background: #f4f6f7;
  cursor: not-allowed;
}

.team-note {
  display: flex;
  gap: 9px;
  margin-top: 22px;
  padding: 13px 14px;
  color: #435565;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid #dce4e7;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
}

.status-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 5px;
  background: var(--pine);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(30, 107, 89, 0.12);
}

.team-note.pending .status-dot {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(194, 148, 75, 0.14);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid #d4dde1;
}

.sidebar-foot > span {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
}

.main-panel {
  height: 100%;
  min-width: 0;
  padding: 52px clamp(42px, 5vw, 82px) 140px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.welcome-state,
.pending-state {
  min-height: calc(100vh - 230px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.score-orbit {
  position: relative;
  width: 152px;
  height: 152px;
  display: grid;
  place-items: center;
  margin-bottom: 36px;
  color: var(--navy);
  border: 1px solid #a9bbc8;
  border-radius: 50%;
}

.score-orbit::before,
.score-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.score-orbit::before {
  inset: 13px;
  border: 1px dashed #9dafbc;
}

.score-orbit::after {
  top: -5px;
  width: 11px;
  height: 11px;
  background: var(--gold);
  box-shadow: 0 151px 0 var(--pine);
}

.score-orbit span {
  font-family: var(--data);
  font-size: 38px;
  font-weight: 700;
}

.welcome-state h2,
.pending-state h2 {
  margin: 13px 0 10px;
  font-family: var(--display);
  font-size: 39px;
}

.welcome-state p,
.pending-state p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.pending-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: #8c692f;
  background: #f1e6d2;
  border: 1px solid #d9bd8c;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 26px;
}

.score-page {
  max-width: 1040px;
  margin: 0 auto;
}

.score-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 26px;
}

.score-head h2 {
  max-width: 780px;
  margin: 8px 0 7px;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1.3;
}

.score-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.completion {
  flex: 0 0 auto;
  text-align: right;
}

.completion span,
.completion strong {
  display: block;
}

.completion span {
  color: var(--muted);
  font-size: 11px;
}

.completion strong {
  margin-top: 4px;
  font-family: var(--data);
  font-size: 19px;
}

.submitted-note {
  margin: -8px 0 22px;
  padding: 12px 15px;
  color: #315d51;
  background: var(--pine-soft);
  border-left: 3px solid var(--pine);
  font-size: 13px;
}

.section-card {
  margin-top: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(23, 55, 94, 0.035);
  overflow: hidden;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 22px;
  background: #f9fbfb;
  border-bottom: 1px solid var(--line);
}

.section-heading h3 {
  margin: 0;
  font-size: 17px;
}

.section-score {
  color: var(--navy);
  font-family: var(--data);
  font-size: 13px;
  font-weight: 700;
}

.criterion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 28px;
  padding: 23px 22px 24px;
}

.criterion + .criterion {
  border-top: 1px solid #e7ecef;
}

.criterion-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.criterion-title h4 {
  margin: 0;
  font-size: 15px;
}

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

.anchor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 20px;
  margin-top: 14px;
}

.anchor {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: #647482;
  font-size: 13px;
  line-height: 1.55;
}

.anchor-range {
  padding-top: 1px;
  color: var(--pine);
  font-family: var(--data);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.score-input-wrap {
  align-self: center;
}

.score-input-wrap label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.score-control {
  display: flex;
  align-items: center;
  height: 50px;
  background: var(--paper);
  border: 1px solid #cdd8de;
  border-radius: 9px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.score-control:focus-within {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(30, 107, 89, 0.12);
}

.score-control.invalid {
  border-color: var(--danger);
}

.score-input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 4px 0 14px;
  color: var(--navy);
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--data);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  appearance: auto;
}

.score-suffix {
  padding: 0 12px 0 7px;
  color: var(--muted);
  font-family: var(--data);
  font-size: 12px;
  white-space: nowrap;
}

.submit-bar {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 310px;
  height: 94px;
  display: grid;
  grid-template-columns: 150px minmax(160px, 1fr) 190px;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(42px, 5vw, 82px);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 36px rgba(19, 50, 76, 0.08);
  backdrop-filter: blur(12px);
}

.total-block > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.total-block strong {
  font-family: var(--data);
  font-size: 32px;
}

.total-block small {
  margin-left: 5px;
  color: var(--muted);
  font-family: var(--data);
  font-size: 13px;
}

.meter {
  height: 4px;
  background: #dfe6e9;
  overflow: hidden;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--pine), var(--gold));
  transition: width 0.25s ease;
}

.primary-button {
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 20px;
  color: var(--white);
  background: var(--navy);
  border: 0;
  border-radius: 8px;
  font-weight: 650;
  box-shadow: 0 8px 20px rgba(23, 55, 94, 0.16);
  transition: transform 0.15s, background 0.15s, opacity 0.15s;
}

.primary-button:hover:not(:disabled) {
  background: var(--navy-deep);
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: rgba(7, 27, 45, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: 440px;
  padding: 42px;
  background: var(--white);
  border-top: 4px solid var(--gold);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.28);
}

.modal-card::after {
  content: "决";
  position: absolute;
  top: 32px;
  right: 36px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: rgba(23, 55, 94, 0.18);
  border: 1px solid rgba(23, 55, 94, 0.14);
  font-family: var(--display);
  font-size: 23px;
  transform: rotate(7deg);
}

.modal-kicker {
  color: var(--pine);
  font-family: var(--data);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.modal-card h2 {
  margin: 9px 0 11px;
  font-family: var(--display);
  font-size: 34px;
}

.modal-card > p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.modal-card input {
  padding-right: 14px;
  appearance: auto;
}

.field-error {
  min-height: 20px;
  margin: 6px 0 7px;
  color: var(--danger);
  font-size: 12px;
}

.modal-button {
  width: 100%;
}

.organizer-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  margin: 15px auto 0;
  padding: 4px 6px;
  color: #778895;
  font-size: 11px;
  text-decoration: none;
}

.organizer-entry small {
  color: #9aa7b0;
  font-size: 10px;
}

.organizer-entry:hover {
  color: var(--navy);
}

.organizer-entry:focus-visible {
  outline: 3px solid rgba(30, 107, 89, 0.25);
  outline-offset: 2px;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 28px;
  top: 96px;
  max-width: 360px;
  padding: 13px 18px;
  color: var(--white);
  background: var(--navy-deep);
  border-left: 4px solid var(--pine);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-left-color: var(--danger);
}

@media (max-width: 1180px) {
  .criterion {
    grid-template-columns: minmax(0, 1fr) 120px;
  }

  .anchor-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  body {
    min-width: 0;
  }

  .app-shell {
    min-width: 0;
  }

  .topbar {
    height: 64px;
    padding: 0 14px;
  }

  .brand {
    padding: 5px 8px;
  }

  .brand-logo {
    height: 32px;
  }

  .judge-chip {
    gap: 7px;
    padding: 5px 7px;
  }

  .judge-avatar {
    width: 30px;
    height: 30px;
  }

  .judge-copy {
    min-width: 0;
  }

  .judge-copy small {
    display: none;
  }

  .judge-copy strong {
    max-width: 64px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .judge-exit {
    display: none;
  }

  .workspace {
    height: calc(100vh - 64px);
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar {
    height: auto;
    padding: 22px 16px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .sidebar-heading h1 {
    margin: 5px 0 5px;
    font-size: 24px;
  }

  .sidebar-heading p {
    font-size: 12px;
  }

  .field {
    margin-top: 17px;
  }

  .field + .field {
    margin-top: 14px;
  }

  .team-note {
    margin-top: 14px;
  }

  .sidebar-foot {
    display: none;
  }

  .main-panel {
    height: auto;
    min-height: 420px;
    padding: 26px 16px 112px;
    overflow: visible;
  }

  .welcome-state,
  .pending-state {
    min-height: 390px;
  }

  .score-orbit {
    width: 118px;
    height: 118px;
    margin-bottom: 25px;
  }

  .score-orbit::after {
    box-shadow: 0 117px 0 var(--pine);
  }

  .welcome-state h2,
  .pending-state h2 {
    font-size: 31px;
  }

  .score-head {
    display: block;
    margin-bottom: 20px;
  }

  .score-head h2 {
    margin-top: 7px;
    font-size: 27px;
  }

  .completion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    text-align: left;
  }

  .completion strong {
    margin-top: 0;
  }

  .section-card {
    margin-top: 14px;
    border-radius: 11px;
  }

  .section-heading {
    padding: 16px;
  }

  .section-heading h3 {
    font-size: 16px;
  }

  .criterion {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 19px 16px 20px;
  }

  .anchor-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .score-input-wrap label {
    text-align: left;
  }

  .score-control {
    height: 48px;
  }

  .submit-bar {
    left: 0;
    height: calc(82px + env(safe-area-inset-bottom));
    grid-template-columns: minmax(95px, 0.7fr) minmax(170px, 1.3fr);
    gap: 14px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }

  .meter {
    display: none;
  }

  .total-block strong {
    font-size: 28px;
  }

  .primary-button {
    padding: 0 15px;
  }

  .modal-backdrop {
    padding: 18px;
  }

  .modal-card {
    width: min(100%, 420px);
    padding: 32px 25px 27px;
  }

  .modal-card::after {
    top: 25px;
    right: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
