/* Comic Showcase — mobile-first, paper-like, comics carry the colour. */
:root {
  --bg: #faf7f0;
  --surface: #fffdf8;
  --text: #1d1a16;
  --muted: #6f6a61;
  --border: #e5ded0;
  --accent: #b3402a;
  --accent-soft: #f6e8e4;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.topnav a { margin-left: 18px; color: var(--text); text-decoration: none; }
.topnav a:hover { color: var(--accent); }

.view { max-width: 1060px; margin: 0 auto; padding: 20px 16px 40px; }
.intro h1 { font-size: 1.6rem; margin: 6px 0 4px; line-height: 1.3; }
.intro p { color: var(--muted); margin: 0 0 18px; max-width: 60ch; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.controls input[type="search"] {
  flex: 1 1 240px; padding: 10px 12px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.lang-toggle { display: flex; gap: 6px; }
.lang-toggle button, .chips button, .topics button, .more button, .reader-tools button {
  padding: 8px 14px; font-size: 0.95rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
}
.lang-toggle button.active, .chips button.active, .topics button.active {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.chips, .topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.topics button { font-size: 0.85rem; padding: 5px 11px; }
.count { color: var(--muted); font-size: 0.9rem; margin: 8px 0 12px; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text);
}
.card img { width: 100%; height: auto; background: #eee7d8; }
.card .card-body { padding: 10px 12px 12px; }
.card h2 { font-size: 1rem; margin: 0 0 2px; line-height: 1.35; }
.card .card-meta { font-size: 0.82rem; color: var(--muted); margin: 0; }
.card:hover { border-color: var(--accent); }
.empty { color: var(--muted); }
.more { text-align: center; margin-top: 18px; }

.crumbs { color: var(--muted); font-size: 0.9rem; }
.crumbs a { text-decoration: none; }
#comicTitle { font-size: 1.7rem; margin: 4px 0; }
.meta { color: var(--muted); margin: 0 0 14px; }
.stage {
  margin: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto; max-height: 82vh;
  touch-action: pan-x pan-y;
}
.stage img { width: 100%; height: auto; margin: 0 auto; }
.stage.zoomed { cursor: zoom-out; }
.stage.zoomed img { width: 220%; max-width: none; }
.reader-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.reader-tools button { border-radius: var(--radius); }
.share-msg { color: var(--muted); font-size: 0.9rem; }

.engage { margin: 4px 0 22px; }
.like-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.like-row button {
  padding: 8px 16px; font-size: 0.95rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
}
.like-row button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.like-count { font-size: 0.92rem; }
.like-note { color: var(--muted); font-size: 0.85rem; }
.comments h2, #about h2 { font-size: 1.1rem; margin: 0 0 10px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 10px 12px; }
.comment .c-head { margin: 0 0 2px; font-size: 0.92rem; }
.comment .c-time { color: var(--muted); font-size: 0.82rem; font-weight: 400; }
.comment .c-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-msg { color: var(--muted); font-size: 0.9rem; min-height: 1.2em; }
.comment-form { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.comment-form input[type="text"], .comment-form textarea {
  padding: 10px 12px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.comment-form button {
  align-self: flex-start; padding: 8px 16px; font-size: 0.95rem; cursor: pointer;
  border: 1px solid var(--text); border-radius: 999px;
  background: var(--text); color: var(--bg);
}
.prevnext { display: flex; justify-content: space-between; margin: 10px 0 22px; }
.prevnext a { text-decoration: none; font-weight: 600; }
.prevnext a[aria-disabled="true"] { color: var(--muted); pointer-events: none; font-weight: 400; }
.behind { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; }
.behind summary { cursor: pointer; font-weight: 700; }
.behind .facts { color: var(--muted); font-size: 0.92rem; }
.behind .qa-line { font-size: 0.9rem; }
.more-series h2 { font-size: 1.1rem; margin: 26px 0 10px; }
.strip { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.strip .card h2 { font-size: 0.9rem; }

#about p { max-width: 62ch; }
.foot { border-top: 1px solid var(--border); padding: 18px; text-align: center; color: var(--muted); font-size: 0.88rem; }
.foot a { color: var(--muted); }

@media (min-width: 720px) {
  .intro h1 { font-size: 2rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .stage.zoomed img { width: 160%; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512; --surface: #211e1a; --text: #f0ebe2;
    --muted: #a89f92; --border: #38322a; --accent: #e0785f; --accent-soft: #3a2723;
  }
  .card img { background: #2a2620; }
}
