:root {
  --ink: #14262c;
  --paper: #e3ecee;
  --card: #f6fbfb;
  --line: #b7c9ce;
  --seal: #8d2c28;
  --open: #0c684f;
  --muted: #5c7278;
  --navy: #173f4e;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --kai: "KaiTi", "STKaiti", "楷体", "Songti SC", serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, monospace;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--navy); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: white;
  padding: 0.4rem 0.7rem;
}
.skip:focus { top: 0.5rem; }

.mast, main { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.mast { padding: 2.2rem 0 1rem; }
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.journal {
  margin: 0.2rem 0 0;
  font-family: var(--kai);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: 0.14em;
  line-height: 1.1;
}
.journal a { color: inherit; text-decoration: none; }
.journal a:hover { color: var(--seal); }
h1 {
  margin: 0.4rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.deck { max-width: 40rem; margin: 0.7rem 0 0; }
.when {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  margin: 1rem 0 0;
  font-family: var(--mono);
  font-size: 0.86rem;
}
.when span { border-bottom: 2px solid var(--seal); padding-bottom: 0.15rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem;
  margin-top: 1.4rem;
}
.card {
  position: relative;
  display: block;
  min-height: 100%;
  padding: 1.15rem 1.15rem 1rem;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
}
.card:hover { border-color: var(--navy); }
.index, .team { color: var(--muted); }
.index { margin: 0; font-family: var(--mono); font-size: 0.78rem; }
.card h2, .detail h2 {
  margin: 0.35rem 0 0.55rem;
  font-size: 1.12rem;
  line-height: 1.45;
  font-weight: 650;
}
.card p { margin: 0.35rem 0; }
.team { font-size: 0.92rem; }
.tab {
  display: inline-block;
  padding: 0.18rem 0.45rem;
  color: white;
  background: var(--open);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.card .tab { position: absolute; top: 0; right: 0; }
.tab.locked, .tab.closed { background: var(--seal); }
.tab.inline { margin: 0.2rem 0 0.8rem; }

.back { margin: 1.1rem 0 0; font-family: var(--mono); font-size: 0.86rem; }
.done, .login, .admin { margin: 2rem auto 3rem; }

.notice {
  width: min(42rem, calc(100% - 2rem));
  margin: 0 auto 3.5rem;
}
.notice header { padding: 2.4rem 0 0.2rem; }
.notice .kicker {
  margin: 0.85rem 0 0;
  color: var(--seal);
  font-family: var(--kai);
  font-size: 1.35rem;
  letter-spacing: 0.28em;
}
.notice h1 {
  font-family: var(--kai);
  font-weight: 400;
  font-size: clamp(2rem, 5.4vw, 2.85rem);
  letter-spacing: 0.08em;
  line-height: 1.2;
}
.notice .deck { max-width: none; }
.notice h2 {
  margin: 1.8rem 0 0.55rem;
  font-family: var(--kai);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}
.notice h2 .seal {
  display: inline-block;
  padding: 0.18em 0.42em 0.22em;
  line-height: 1.35;
  background: var(--seal);
  color: #fff;
}
.notice p { margin: 0.75rem 0; }
.notice section p { text-indent: 2em; }
.notice ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.notice li { margin: 0.45rem 0; }
.notice .note { color: var(--muted); }
.enter {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.75rem;
  margin: 1.4rem 0 1.6rem;
  background: var(--seal);
  color: white;
  text-decoration: none;
  font-family: var(--kai);
  font-size: 1.85rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
}
.enter:hover { background: #731f1c; }
.note { color: var(--muted); }
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 3rem;
}
.detail article, aside, .login, .done {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.2rem;
}
label { display: block; margin: 0 0 0.8rem; font-size: 0.92rem; }
input, textarea, button {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 7.5rem; resize: vertical; }
button {
  width: auto;
  border: 0;
  background: var(--navy);
  color: white;
  cursor: pointer;
}
.hint, .fine { color: var(--muted); font-size: 0.88rem; }
.fine { padding-left: 1.1rem; }
.alert {
  margin: 0 0 0.9rem;
  padding: 0.65rem 0.75rem;
  background: #f8e8e6;
  color: var(--seal);
}
.login { width: min(420px, 100%); }
.admin-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.admin-bar h1 { font-size: 1.4rem; }
.admin-bar p { display: flex; gap: 1rem; align-items: center; margin: 0; }
.admin-bar form { margin: 0; }
.admin-bar button { width: auto; background: transparent; color: var(--navy); border: 1px solid var(--line); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 800px) {
  .detail { grid-template-columns: 1fr; }
  .enter { font-size: 1.5rem; letter-spacing: 0.24em; text-indent: 0.24em; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
