/* Author: VIVI x Codex */
:root {
  --bg: #f5f6ef;
  --ink: #101213;
  --muted: #636864;
  --sheet: #fffef7;
  --line: #22251f;
  --soft-line: rgba(16, 18, 19, 0.14);
  --blue: #1f6feb;
  --green: #8fc63d;
  --red: #ee5937;
  --yellow: #f3c84b;
  --shadow: 8px 8px 0 #101213;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(90deg, rgba(16, 18, 19, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 18, 19, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 2px solid var(--line);
  background: rgba(245, 246, 239, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  font-weight: 900;
  text-decoration: none;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.nav-actions a,
.tool-row button {
  min-height: 38px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--sheet);
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--line);
}

.tool-row button {
  cursor: pointer;
}

.tool-row button:hover,
.nav-actions a:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--line);
}

.tool-row .danger {
  background: #ffe4dc;
}

.page-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.7fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
  min-height: 280px;
  padding: clamp(22px, 5vw, 56px);
  border: 2px solid var(--line);
  background:
    linear-gradient(135deg, rgba(143, 198, 61, 0.92), rgba(243, 200, 75, 0.9) 46%, rgba(31, 111, 235, 0.88));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 14px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 9em;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(42px, 8vw, 96px);
  line-height: 0.96;
  letter-spacing: 0;
}

.lede {
  margin: 0;
  padding: 18px;
  border: 2px solid var(--line);
  background: rgba(255, 254, 247, 0.9);
  font-size: 18px;
  line-height: 1.7;
}

.control-deck {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin: 30px 0 20px;
  padding: 18px;
  border: 2px solid var(--line);
  background: var(--sheet);
}

.search-box {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-line {
  grid-column: 1 / -1;
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.award-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}

.award-card {
  min-height: 170px;
  padding: 16px;
  border: 2px solid var(--line);
  background: var(--sheet);
  box-shadow: 4px 4px 0 var(--line);
}

.award-card[data-tone="grand"] {
  background: #fff2a8;
}

.award-card[data-tone="beauty"] {
  background: #ffd9e1;
}

.award-card[data-tone="idea"] {
  background: #dff1ff;
}

.award-card[data-tone="wild"] {
  background: #dff7c2;
}

.award-card h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Songti SC", serif;
  letter-spacing: 0;
}

.award-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.leader-list {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.leader-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(16, 18, 19, 0.22);
  padding-top: 6px;
  font-size: 14px;
}

.score-stage {
  border: 2px solid var(--line);
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.table-frame {
  overflow-x: auto;
}

.score-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.score-table th,
.score-table td {
  border-bottom: 1px solid var(--soft-line);
  border-right: 1px solid var(--soft-line);
  padding: 12px;
  vertical-align: top;
}

.score-table th {
  position: sticky;
  top: 64px;
  z-index: 5;
  background: var(--line);
  color: #fff;
  text-align: left;
  white-space: nowrap;
}

.score-table td:not(:first-child),
.score-table th:not(:first-child) {
  text-align: center;
}

.project-cell {
  display: grid;
  gap: 7px;
  min-width: 360px;
}

.project-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-weight: 900;
}

.project-index {
  color: var(--blue);
  font-family: Georgia, "Songti SC", serif;
}

.project-owner {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.project-summary {
  margin: 0;
  color: #343837;
  line-height: 1.55;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-links a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration-thickness: 2px;
}

.score-select {
  width: 74px;
  min-height: 38px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fff;
  text-align: center;
}

.total-score {
  font-family: Georgia, "Songti SC", serif;
  font-size: 28px;
  font-weight: 900;
}

.is-hidden {
  display: none;
}

@media (max-width: 980px) {
  .hero,
  .control-deck {
    grid-template-columns: 1fr;
  }

  .award-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-row {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .award-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: 44px;
  }
}
