/* ==========================================================================
   Potatoes & Tomatoes / 地蛋与洋柿子
   A fictional academic journal. Static, dependency-free stylesheet.
   ========================================================================== */

:root {
  --paper:      #fbf7ee;
  --paper-2:    #f4ecdd;
  --ink:        #241c14;
  --ink-soft:   #5b5045;
  --ink-faint:  #8b7f70;
  --rule:       #ded2bd;
  --rule-soft:  #ece3d2;
  --tomato:     #c0392b;
  --tomato-lit: #e0563f;
  --potato:     #c99a3f;
  --potato-lit: #e3bd6c;
  --leaf:       #5f7a3a;
  --plum:       #6b3f6b;

  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC",
           Georgia, "Times New Roman", "SimSun", serif;
  --sans:  "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
           "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  --wrap: 1080px;
  --shadow: 0 1px 0 rgba(36,28,20,.04), 0 12px 28px -18px rgba(36,28,20,.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(201,154,63,.10), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(192,57,43,.08), transparent 38%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--tomato); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* ---------- typography ------------------------------------------------- */

h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.12rem; }
p  { margin: 0 0 1rem; }

.en {
  font-family: var(--sans);
  font-size: .82em;
  letter-spacing: .06em;
  color: var(--ink-faint);
}
.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.lede { font-size: 1.06rem; color: var(--ink-soft); }
.mono { font-family: var(--mono); font-size: .84em; }
.drop::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: .82;
  padding: .06em .12em 0 0;
  color: var(--tomato);
}

/* ---------- masthead / nav --------------------------------------------- */

.topbar {
  border-bottom: 1px solid var(--rule);
  background: rgba(251,247,238,.88);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
}
.topbar-in {
  display: flex; align-items: center; gap: 1rem;
  min-height: 60px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand b { font-size: 1rem; letter-spacing: .02em; }
.brand span { font-family: var(--sans); font-size: .7rem; letter-spacing: .12em; color: var(--ink-faint); display: block; }

nav.jump { margin-left: auto; display: flex; gap: .2rem; flex-wrap: wrap; }
nav.jump a {
  font-family: var(--sans); font-size: .82rem; color: var(--ink-soft);
  padding: .35rem .6rem; border-radius: 4px; white-space: nowrap;
}
nav.jump a:hover { background: var(--paper-2); text-decoration: none; color: var(--ink); }
nav.jump a[aria-current="page"] { color: var(--tomato); font-weight: 600; }

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

.hero { padding: 3.2rem 0 2.2rem; text-align: center; }
.hero .masthead-line {
  display: flex; justify-content: center; gap: 1.1rem; flex-wrap: wrap;
  font-family: var(--sans); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint);
  padding-bottom: 1.4rem;
}
.hero .masthead-line b { color: var(--tomato); font-weight: 700; }
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 5rem);
  letter-spacing: .04em; margin-bottom: .1em;
}
.hero h1 .amp { color: var(--tomato); font-style: italic; }
.hero .subtitle {
  font-size: clamp(1rem, 2.2vw, 1.3rem); color: var(--ink-soft);
  letter-spacing: .22em; margin-bottom: .2rem;
}
.hero .motto { font-style: italic; color: var(--ink-faint); font-size: .96rem; }

.rule-stack { margin: 1.6rem auto .4rem; max-width: 640px; }
.rule-stack i { display: block; border-top: 1px solid var(--rule); }
.rule-stack i:nth-child(2) { margin-top: 3px; border-top-width: 3px; border-color: var(--ink); }

/* ---------- now-issue banner ------------------------------------------- */

.now-issue {
  display: grid; grid-template-columns: minmax(0,1fr) 272px; gap: 0;
  border: 1px solid var(--ink); border-radius: 3px; overflow: hidden;
  background: var(--paper-2); box-shadow: var(--shadow); margin-bottom: 3rem;
}
.now-issue .body { padding: 2rem 2.1rem; }
.now-issue h2 { margin-bottom: .3rem; }
.now-issue .issue-title { font-size: clamp(1.4rem, 3.4vw, 2.1rem); line-height: 1.3; margin: .5rem 0 .8rem; }
.now-issue .issue-title em { color: var(--tomato); font-style: normal; border-bottom: 2px solid var(--potato-lit); }
.now-issue .cover {
  background: linear-gradient(150deg, var(--tomato) 0%, #9c2f22 45%, var(--potato) 100%);
  color: #fdf6ea; padding: 1.6rem; display: flex; flex-direction: column;
  justify-content: space-between; position: relative; overflow: hidden;
}
.now-issue .cover::after {
  content: ""; position: absolute; inset: auto -30px -40px auto;
  width: 190px; height: 190px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.now-issue .cover .vol { font-family: var(--sans); font-size: .7rem; letter-spacing: .2em; opacity: .9; }
.now-issue .cover .big { font-size: 1.55rem; line-height: 1.3; margin: .6rem 0; }
.now-issue .cover .big small { display: block; font-family: var(--sans); font-size: .68rem; letter-spacing: .16em; opacity: .85; margin-top: .5rem; }
.now-issue .cover .stamp {
  font-family: var(--sans); font-size: .68rem; letter-spacing: .12em;
  border: 1px solid rgba(255,255,255,.6); border-radius: 999px;
  padding: .18rem .6rem; align-self: flex-start;
}

/* ---------- cards ------------------------------------------------------- */

.section-head {
  display: flex; align-items: baseline; gap: 1rem;
  border-top: 3px solid var(--ink); padding-top: .7rem; margin-bottom: 1.4rem;
}
.section-head h2 { margin: 0; }
.section-head .en { margin-left: auto; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; }

.card {
  border: 1px solid var(--rule); border-radius: 3px; background:
    linear-gradient(180deg, #fffdf8, var(--paper));
  padding: 1.5rem 1.6rem; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ink-faint); }
.card h3 { margin-bottom: .5rem; }
.card .slug { font-family: var(--mono); font-size: .76rem; color: var(--ink-faint); }
.card .zh { font-size: 1.25rem; font-weight: 600; margin-bottom: .1rem; }
.card p { color: var(--ink-soft); font-size: .95rem; }
.card .more { margin-top: auto; font-family: var(--sans); font-size: .82rem; font-weight: 600; }
.card .accent { height: 4px; width: 46px; border-radius: 2px; margin-bottom: 1rem; }
.accent-tomato { background: var(--tomato); }
.accent-potato { background: var(--potato); }
.accent-plum { background: var(--plum); }

/* ---------- article list ----------------------------------------------- */

.article {
  border-bottom: 1px solid var(--rule-soft); padding: 1.5rem 0;
}
.article:last-child { border-bottom: 0; }
.article .kicker {
  display: flex; gap: .8rem; flex-wrap: wrap; align-items: center;
  font-family: var(--sans); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: .5rem;
}
.pill {
  font-family: var(--sans); font-size: .7rem; letter-spacing: .1em;
  border: 1px solid var(--rule); border-radius: 999px; padding: .1rem .55rem;
  color: var(--ink-soft); background: #fffdf8;
}
.pill.t { border-color: var(--tomato); color: var(--tomato); }
.pill.p { border-color: var(--potato); color: #966c1f; }
.pill.g { border-color: var(--leaf); color: var(--leaf); }
.article h3 { font-size: 1.22rem; margin-bottom: .25rem; }
.article h3 .en-title { display: block; font-family: var(--sans); font-size: .78rem; font-weight: 400; color: var(--ink-faint); letter-spacing: .04em; margin-top: .25rem; }
.article .authors { font-size: .92rem; color: var(--ink-soft); margin-bottom: .55rem; }
.article .authors sup { color: var(--tomato); }
.article .meta { font-family: var(--mono); font-size: .76rem; color: var(--ink-faint); }
.article .abs { font-size: .96rem; color: var(--ink-soft); }
.article details { margin-top: .7rem; }
.article summary {
  cursor: pointer; font-family: var(--sans); font-size: .82rem; font-weight: 600;
  color: var(--tomato); list-style: none;
}
.article summary::-webkit-details-marker { display: none; }
.article summary::before { content: "▸ "; }
.article details[open] summary::before { content: "▾ "; }
.article details .kw { font-family: var(--sans); font-size: .8rem; color: var(--ink-faint); margin-top: .6rem; }

/* ---------- prose blocks ------------------------------------------------ */

.panel {
  border: 1px solid var(--rule); background: #fffdf8; border-radius: 3px;
  padding: 1.6rem 1.8rem; margin-bottom: 1.4rem;
}
.panel h3 { border-bottom: 1px solid var(--rule-soft); padding-bottom: .45rem; }
.panel ul, .panel ol { padding-left: 1.2rem; margin: 0 0 1rem; }
.panel li { margin-bottom: .4rem; color: var(--ink-soft); }
.panel li b { color: var(--ink); }

.note {
  border-left: 4px solid var(--potato);
  background: rgba(201,154,63,.09);
  padding: .9rem 1.1rem; font-size: .94rem; color: var(--ink-soft);
  margin-bottom: 1.2rem;
}
.note.tomato { border-left-color: var(--tomato); background: rgba(192,57,43,.07); }

.quote {
  border-left: 3px solid var(--tomato);
  padding: .2rem 0 .2rem 1.1rem; margin: 1.2rem 0;
  font-style: italic; color: var(--ink-soft);
}
.quote cite { display: block; font-style: normal; font-family: var(--sans); font-size: .78rem; color: var(--ink-faint); margin-top: .4rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 1rem; margin: 1.6rem 0 2.4rem; }
.stat { border-top: 2px solid var(--ink); padding-top: .6rem; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { font-family: var(--sans); font-size: .74rem; letter-spacing: .08em; color: var(--ink-faint); }

.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th, .table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.table th { font-family: var(--sans); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); border-bottom-color: var(--ink); }
.table td:first-child { white-space: nowrap; }

/* ---------- editorial --------------------------------------------------- */

.editorial { max-width: 720px; }
.editorial h2 { margin-top: 2rem; }
.editorial .byline {
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: .6rem 0; margin-bottom: 1.6rem;
  font-family: var(--sans); font-size: .82rem; color: var(--ink-faint);
}
.eq {
  font-family: var(--serif); text-align: center; margin: 1.4rem 0;
  font-size: 1.05rem;
}
.eq i { font-family: "Cambria Math", "Latin Modern Math", Georgia, serif; }
.eq .num { color: var(--ink-faint); font-family: var(--sans); font-size: .82rem; margin-left: .8rem; }

/* ---------- random review widget --------------------------------------- */

.reviewer {
  border: 1px dashed var(--ink-faint); border-radius: 3px;
  padding: 1.2rem 1.4rem; background: #fffdf8;
}
.reviewer .out {
  font-family: var(--mono); font-size: .88rem; color: var(--ink-soft);
  min-height: 3.2em; margin-bottom: .9rem;
}
button.btn {
  font-family: var(--sans); font-size: .84rem; font-weight: 600;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: .5rem 1.05rem; border-radius: 3px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
button.btn:hover { background: var(--tomato); border-color: var(--tomato); }
button.btn.ghost { background: transparent; color: var(--ink); }
button.btn.ghost:hover { background: var(--paper-2); color: var(--ink); }

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

footer.site {
  margin-top: 4rem; border-top: 3px solid var(--ink); background: var(--paper-2);
  padding: 2.2rem 0 2.6rem;
}
footer.site .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1.6rem; }
footer.site h4 { font-family: var(--sans); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
footer.site a { color: var(--ink-soft); font-size: .92rem; display: block; margin-bottom: .25rem; }
footer.site .fine {
  margin-top: 1.8rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: .76rem; color: var(--ink-faint); line-height: 1.7;
}

/* ---------- misc -------------------------------------------------------- */

.crumb { font-family: var(--sans); font-size: .78rem; color: var(--ink-faint); padding: 1.2rem 0 0; }
.crumb a { color: var(--ink-faint); }
.page-head { padding: 1.2rem 0 2rem; }
.page-head h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
.tagline { font-style: italic; color: var(--ink-faint); }
.center { text-align: center; }
.mt2 { margin-top: 2rem; }
.mb2 { margin-bottom: 2rem; }
.mb3 { margin-bottom: 3rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 820px) {
  .now-issue { grid-template-columns: 1fr; }
  .now-issue .cover { min-height: 190px; }
  nav.jump { width: 100%; margin-left: 0; padding-bottom: .5rem; }
}

@media print {
  .topbar, footer.site, .reviewer { display: none; }
  body { background: #fff; font-size: 12pt; }
  a { color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}
