:root {
  --bg-1: #f7f3e8;
  --bg-2: #e7eef3;
  --ink: #1d2b36;
  --ink-soft: #5b6e7c;
  --accent: #c4662f;
  --accent-strong: #ab5222;
  --accent-2: #2b6f8e;
  --accent-2-strong: #1f5670;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --border: rgba(24, 46, 61, 0.14);
  --shadow: 0 12px 30px rgba(25, 44, 59, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(196, 102, 47, 0.12), transparent 22%),
    radial-gradient(circle at 92% 10%, rgba(43, 111, 142, 0.15), transparent 24%),
    linear-gradient(148deg, var(--bg-1), var(--bg-2));
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  position: relative;
  min-height: 100vh;
  line-height: 1.45;
}

.bg-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.25;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px;
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 6px;
  padding: 18px 18px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(120deg, var(--panel-strong), rgba(255, 255, 255, 0.86));
  box-shadow: var(--shadow);
}

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

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  letter-spacing: 0.01em;
  color: #1a3341;
}

.hero p {
  margin-top: 10px;
  max-width: 760px;
  color: var(--ink-soft);
}

.github-link {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(24, 46, 61, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: #1a3341;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.github-link:hover {
  background: #fff;
  border-color: rgba(24, 46, 61, 0.28);
  transform: translateY(-1px);
}

.github-link:focus-visible {
  outline: 3px solid rgba(43, 111, 142, 0.2);
  outline-offset: 2px;
}

.github-link svg {
  display: block;
  width: 24px;
  height: 24px;
}

.panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  animation: panelFadeIn 320ms ease;
}

.panel h2 {
  margin: 0 0 12px 0;
  font-size: 1.14rem;
  color: #203746;
}

.project-meta p {
  margin: 8px 0;
  line-height: 1.6;
}

.project-meta a {
  color: var(--accent-2);
  text-decoration: none;
  border-bottom: 1px dashed rgba(47, 109, 140, 0.45);
}

.project-meta a:hover {
  color: var(--accent);
  border-bottom-color: rgba(192, 90, 44, 0.65);
}

.gallery,
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.rounds {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.round-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.96);
}

.round-head {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 9px;
  color: #264354;
}

.round-results {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.card {
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(23, 41, 55, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(23, 41, 55, 0.16);
}

.card.selected {
  border-color: var(--accent);
  box-shadow: 0 12px 26px rgba(196, 102, 47, 0.22);
}

.card img {
  width: 100%;
  height: 136px;
  object-fit: cover;
  display: block;
}

.card .caption {
  padding: 7px;
  font-size: 0.76rem;
  word-break: break-all;
  color: #2c4658;
}

.control-row {
  margin-top: 10px;
}

textarea {
  width: 100%;
  min-height: 84px;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.96);
}

textarea:focus,
input[type="number"]:focus,
.ref-picker input[type="text"]:focus {
  outline: none;
  border-color: rgba(43, 111, 142, 0.45);
  box-shadow: 0 0 0 3px rgba(43, 111, 142, 0.12);
}

.inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

input[type="number"] {
  width: 90px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
}

.ref-picker input[type="text"] {
  min-width: 220px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
}

button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 16px rgba(196, 102, 47, 0.24);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(196, 102, 47, 0.28);
}

button.ghost {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-2-strong));
  box-shadow: 0 8px 16px rgba(43, 111, 142, 0.24);
}

.status {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #3a4a51;
}

.inline-status {
  font-size: 0.88rem;
  color: #3a4a51;
}

.tag-label {
  margin-bottom: 6px;
  font-size: 0.84rem;
  color: #3a4a51;
}

.tag-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-chip {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(192, 90, 44, 0.35);
  background: rgba(192, 90, 44, 0.1);
  color: #7a3a1c;
  font-size: 0.76rem;
  line-height: 1.2;
  white-space: nowrap;
}

.tag-empty {
  font-size: 0.78rem;
  color: #607178;
}

.suggestion-label {
  margin-bottom: 6px;
  font-size: 0.84rem;
  color: #3a4a51;
}

.suggestion-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.suggestion-chip {
  padding: 6px 10px;
  border: 1px solid rgba(47, 109, 140, 0.35);
  border-radius: 999px;
  background: rgba(47, 109, 140, 0.08);
  color: #264e64;
  font-size: 0.78rem;
  line-height: 1.25;
  box-shadow: none;
}

.suggestion-chip:hover {
  background: rgba(47, 109, 140, 0.16);
  box-shadow: none;
}

.suggestion-empty {
  font-size: 0.78rem;
  color: #607178;
}

.turns {
  margin: 0;
  padding-left: 18px;
}

.turns li {
  margin-bottom: 4px;
}

.result-meta {
  padding: 4px 6px 8px;
  font-size: 0.72rem;
  color: #34434a;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 0 22px 22px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-2);
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 12px;
  }

  .hero {
    padding: 14px 14px 12px;
  }

  .github-link {
    width: 38px;
    height: 38px;
  }

  .card img {
    height: 120px;
  }

  .panel {
    padding: 13px;
  }

  .site-footer {
    padding: 0 12px 16px;
  }
}
