/* editorial — handmade dark editorial theme for hanjiashu.club */

:root {
  --bg: #050505;
  --panel: #0B0B0B;
  --line: rgba(255, 255, 255, 0.13);
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #F2F2EF;
  --muted: #8A8A85;
  --faint: #55554F;
  --accent: #C8F04B;
  --accent-dim: rgba(200, 240, 75, 0.13);
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

::selection { background: var(--accent); color: #000; }

a { color: inherit; text-decoration: none; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 32px; }

.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

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

.kicker {
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 28px;
}

.meta {
  display: flex;
  gap: 22px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- header ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 68px;
}

.brand {
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}

.brand .accent { color: var(--accent); }

.site-nav {
  display: flex;
  gap: 34px;
}

.site-nav a {
  color: var(--muted);
  transition: color 0.2s;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover { color: var(--text); }
.site-nav a.on {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ---------- hero ---------- */

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-cell {
  background: var(--bg);
  padding: 88px 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 480px;
  transition: background 0.25s;
}

.hero-cell:hover { background: var(--panel); }

.hero-title {
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0.01em;
  margin-bottom: 32px;
}

.hero-desc {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.9;
  max-width: 34em;
  margin-bottom: 48px;
}

.hero-cell .meta { margin-top: auto; }

.hero-art {
  background: var(--panel);
  min-height: 480px;
  overflow: hidden;
}

.hero-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- card grid ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.card {
  background: var(--bg);
  padding: 34px 32px 30px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  transition: background 0.25s;
}

.card:hover { background: var(--panel); }

.card-kicker {
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 30px;
}

.card-title {
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 40px;
}

.card:hover .card-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; text-decoration-thickness: 2px; }

.card-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.arrow {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--muted);
  transition: all 0.22s;
}

.card:hover .arrow,
.hero-cell:hover .arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  transform: rotate(45deg);
}

.card-empty { cursor: default; }
.card-empty:hover { background: var(--bg); }
.card-empty .card-title { text-decoration: none; }

/* ---------- list / archives ---------- */

.list-head {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.list-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
}

.arch-year { border-bottom: 1px solid var(--line); padding: 40px 0; }

.arch-y {
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  margin-bottom: 20px;
}

.arch-list { list-style: none; }

.arch-list a {
  display: flex;
  align-items: baseline;
  gap: 28px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: padding-left 0.2s;
}

.arch-list a:hover { padding-left: 10px; }

.arch-date { color: var(--faint); flex-shrink: 0; }

.arch-title { font-size: 1.08rem; font-weight: 600; flex: 1; }

.arch-list .arrow { opacity: 0; transition: all 0.22s; flex-shrink: 0; align-self: center; }
.arch-list a:hover .arrow { opacity: 1; background: var(--accent); border-color: var(--accent); color: #000; }

.term-list { list-style: none; padding: 56px 0; display: flex; flex-wrap: wrap; gap: 14px; }

.term-list a {
  border: 1px solid var(--line);
  padding: 12px 20px;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.term-list a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- post ---------- */

.post {
  max-width: 780px;
  padding: 88px 0 40px;
}

.post-head { margin-bottom: 56px; }

.post-title {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 30px;
}

.post-body {
  font-size: 1.03rem;
  line-height: 2.05;
  color: #D8D8D2;
}

.post-body p { margin-bottom: 1.6em; }

.post-body h2,
.post-body h3,
.post-body h4 {
  color: var(--text);
  font-weight: 700;
  margin: 2.2em 0 0.9em;
  line-height: 1.4;
}

.post-body h2 { font-size: 1.45rem; padding-left: 14px; border-left: 3px solid var(--accent); }
.post-body h3 { font-size: 1.2rem; }

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(200, 240, 75, 0.4);
}

.post-body a:hover { text-decoration-color: var(--accent); }

.post-body ul, .post-body ol { margin: 0 0 1.6em 1.4em; }
.post-body li { margin-bottom: 0.5em; }

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 22px;
  margin: 2em 0;
  color: var(--muted);
}

.post-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 7px;
}

.post-body pre {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 22px 24px;
  overflow-x: auto;
  margin: 2em 0;
  line-height: 1.7;
}

.post-body pre code { background: none; color: var(--text); padding: 0; }

.post-body img { max-width: 100%; height: auto; display: block; margin: 2em auto; }

.post-body hr { border: none; border-top: 1px solid var(--line); margin: 3em 0; }

.post-body table { width: 100%; border-collapse: collapse; margin: 2em 0; font-size: 0.95rem; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.post-body th { color: var(--text); background: var(--panel); }

.post-tags {
  display: flex;
  gap: 16px;
  color: var(--muted);
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.post-nav {
  max-width: 780px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0 64px;
  border-top: 1px solid var(--line);
  text-transform: uppercase;
}

.post-nav a { color: var(--muted); transition: color 0.2s; max-width: 45%; }
.post-nav a:hover { color: var(--accent); }

/* ---------- cover images ---------- */

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-img {
  margin: -34px -32px 26px;
  height: 150px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

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

.post-cover {
  margin-bottom: 48px;
}

.post-cover img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
}

.post-cover figcaption {
  padding-top: 12px;
  font-size: 0.68rem;
}

/* ---------- 404 ---------- */

.nf { padding: 120px 0; }
.nf-back { display: inline-block; margin-top: 36px; color: var(--accent); }

/* ---------- league standings (home) ---------- */

.league-band {
  border-bottom: 1px solid var(--line);
}

.lb-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 56px 0 40px;
}

.lb-title {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.25;
}

.lb-head-r {
  text-align: right;
  line-height: 1.9;
  flex-shrink: 0;
}

.lb-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  margin: 0 -32px;
  padding: 0 32px;
}

.lb-col {
  background: var(--bg);
  padding: 26px 22px 20px;
}

.lb-league {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

.lb-league::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  margin-right: 8px;
}

.lb-season {
  font-size: 0.68rem;
  margin-bottom: 16px;
  min-height: 1.2em;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
}

.lb-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.86rem;
}

.lb-table tr:last-child td { border-bottom: none; }

.lb-table .rk { width: 22px; color: var(--faint); }
.lb-table .tm { font-weight: 600; padding-right: 8px; }
.lb-table .wdl { width: 58px; font-size: 0.72rem; text-align: right; white-space: nowrap; }
.lb-table .pts { width: 30px; text-align: right; font-weight: 700; }

.lb-top .rk,
.lb-top .pts { color: var(--accent); }

/* ---------- monitor band (home) ---------- */

.monitor-band {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.mb-text {
  background: var(--bg);
  padding: 52px 44px 44px;
  display: flex;
  flex-direction: column;
  transition: background 0.25s;
}

.monitor-band:hover .mb-text { background: var(--panel); }

.mb-title {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
}

.monitor-band:hover .mb-title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

.mb-desc { color: var(--muted); margin-bottom: 40px; }

.mb-text .meta {
  margin-top: auto;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.monitor-band:hover .arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  transform: rotate(45deg);
}

.mb-img {
  background: var(--panel);
  overflow: hidden;
  max-height: 320px;
}

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

/* ---------- monitor ---------- */

.monitor-frame {
  border: 1px solid var(--line);
  margin: 56px 0 80px;
}

.monitor-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.monitor-frame > a {
  display: block;
  overflow: hidden;
}

.monitor-frame > a img {
  transition: opacity 0.25s;
}

.monitor-frame > a:hover img {
  opacity: 0.85;
}

.monitor-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.foot-inner {
  display: flex;
  justify-content: space-between;
  padding-top: 26px;
  padding-bottom: 26px;
  text-transform: uppercase;
}

.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { min-height: 260px; order: -1; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .monitor-band { grid-template-columns: 1fr; }
  .mb-img { order: -1; max-height: 220px; }
  .lb-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .card-grid { grid-template-columns: 1fr; }
  .hero-cell { padding: 56px 28px 44px; min-height: 0; }
  .post { padding: 56px 0 32px; }
  .head-inner { height: 58px; }
  .site-nav { gap: 22px; }
  .meta { flex-wrap: wrap; gap: 10px 18px; }
  .lb-grid { grid-template-columns: 1fr; margin: 0 -20px; padding: 0 20px; }
  .lb-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .lb-head-r { text-align: left; }
}

/* ---------- search page (pagefind ui → editorial dark) ---------- */

.search-box {
  margin: 8px 0 90px;
  border-top: 1px solid var(--line);
  padding-top: 44px;
}

.pagefind-ui {
  --pagefind-ui-scale: 1;
  --pagefind-ui-primary: var(--accent);
  --pagefind-ui-text: var(--text);
  --pagefind-ui-background: var(--panel);
  --pagefind-ui-border: var(--line);
  --pagefind-ui-tag: var(--panel);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 0;
  --pagefind-ui-image-border-radius: 0;
  --pagefind-ui-font: var(--sans);
}

.pagefind-ui .pagefind-ui__search-input {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  font-weight: 400;
}

.pagefind-ui .pagefind-ui__search-input::placeholder { color: var(--faint); }

.pagefind-ui .pagefind-ui__search-input:focus {
  border-color: var(--accent);
  outline: none;
}

.pagefind-ui .pagefind-ui__search-clear {
  background: var(--panel);
  color: var(--muted);
}

.pagefind-ui .pagefind-ui__search-clear:hover { color: var(--accent); }

.pagefind-ui .pagefind-ui__message {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.pagefind-ui .pagefind-ui__result {
  border-top: 1px solid var(--line-soft);
}

.pagefind-ui .pagefind-ui__result-title { font-weight: 700; }

.pagefind-ui .pagefind-ui__result-link { color: var(--text); }

.pagefind-ui .pagefind-ui__result-link:hover { color: var(--accent); }

.pagefind-ui .pagefind-ui__result-excerpt { color: var(--muted); }

.pagefind-ui .pagefind-ui__result-nested .pagefind-ui__result-link { color: var(--muted); }

.pagefind-ui .pagefind-ui__result-nested .pagefind-ui__result-link:hover { color: var(--accent); }

.pagefind-ui mark {
  background: var(--accent);
  color: #000;
}

.pagefind-ui .pagefind-ui__button {
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pagefind-ui .pagefind-ui__button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
