:root {
  --bg: #f4efe6;
  --bg-card: #fffdf8;
  --ink: #1a1714;
  --ink-soft: #4a433a;
  --line: #d9d0c1;
  --accent: #2c4a3e;
  --warn: #8b3a2a;
  --ok: #2f5d3a;
  --fl-none: #5c5c5c;
  --fl-cool: #2a6f9e;
  --fl-warm: #c47a22;
  --fl-dual: #6b3fa0;
  --fl-dual-lim: #8a5a2b;
  --fl-other: #3d6b5a;
  --color-bw: #3a3a3a;
  --color-color: #b33b5a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26,23,20,.06), 0 8px 24px rgba(26,23,20,.06);
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  background-image:
    radial-gradient(rgba(26,23,20,.03) 1px, transparent 1px);
  background-size: 8px 8px;
}
a { color: var(--accent); }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

.site-header {
  background: linear-gradient(180deg, #ebe4d7 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 2rem 0 1.5rem;
}
.site-header.hero { padding: 2.5rem 0 2rem; }
.eyebrow { margin: 0 0 .5rem; color: var(--ink-soft); font-size: .9rem; letter-spacing: .04em; }
.site-header h1 {
  margin: 0 0 .75rem;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.25;
}
.lead { max-width: 48rem; color: var(--ink-soft); margin: 0 0 .75rem; }
.sub, .meta-line { color: var(--ink-soft); margin: 0; }
.header-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

.badge {
  display: inline-flex; align-items: center;
  padding: .28rem .65rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  border: 1px solid transparent;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.badge-lg { font-size: .95rem; padding: .4rem .9rem; }
.badge-none { background: var(--fl-none); }
.badge-cool { background: var(--fl-cool); }
.badge-warm { background: var(--fl-warm); }
.badge-dual { background: var(--fl-dual); }
.badge-dual-limited { background: var(--fl-dual-lim); }
.badge-other { background: var(--fl-other); }
.badge-bw { background: var(--color-bw); }
.badge-color { background: var(--color-color); }
.badge-android-high { background: #1f6b4a; }
.badge-android-mid { background: #6b6b1f; }
.badge-android-low { background: #8a4b1f; }
.badge-android-closed { background: #444; }
.badge-warn { background: var(--warn); }

.alert {
  margin: 1.25rem 0;
  padding: .9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-card);
}
.alert-ok { border-left: 4px solid var(--ok); }
.alert-warn { border-left: 4px solid var(--warn); background: #fff5f0; }

.legend, .filters {
  margin: 1.5rem 0;
  padding: 1.1rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
details.legend {
  margin: 1rem 0 1.5rem;
}
details.legend > summary {
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  list-style: none;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  padding: .15rem 0;
  min-height: 2rem;
  display: flex;
  align-items: center;
}
details.legend > summary::-webkit-details-marker { display: none; }
details.legend > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: .45rem;
  color: var(--ink-soft);
  transition: transform .15s ease;
}
details.legend[open] > summary::before { transform: rotate(90deg); }
details.legend[open] > summary { margin-bottom: .75rem; }
.legend h2, .filters h2, section h2 {
  margin: 0 0 .75rem;
  font-size: 1.15rem;
}
.legend-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .25rem; }
.hint { color: var(--ink-soft); font-size: .92rem; margin: .4rem 0 0; }
.size-dist { margin: .65rem 0 0; font-size: .85rem; }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem 1rem;
}
.filter-grid label {
  display: flex; flex-direction: column; gap: .35rem;
  font-size: .85rem; color: var(--ink-soft); font-weight: 600;
  font-family: system-ui, sans-serif;
}
.filter-grid .grow { grid-column: 1 / -1; }
select, input[type="search"] {
  font: inherit;
  padding: .5rem .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.filter-status { margin: .9rem 0 0; font-size: .9rem; color: var(--ink-soft); }
.btn-text {
  background: none; border: none; color: var(--accent);
  cursor: pointer; text-decoration: underline; font: inherit; padding: 0;
}


/* pass1c advanced filters */
.filters-advanced {
  margin: .85rem 0 0;
  padding: .65rem .85rem .75rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.45);
}
.filters-advanced > summary {
  cursor: pointer;
  list-style: none;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  min-height: 2rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.filters-advanced > summary::-webkit-details-marker { display: none; }
.filters-advanced > summary::before {
  content: "▸";
  display: inline-block;
  color: var(--ink-soft);
  transition: transform .15s ease;
}
.filters-advanced[open] > summary::before { transform: rotate(90deg); }
.filters-advanced[open] > summary { margin-bottom: .65rem; }
.filters-advanced.is-active > summary {
  color: var(--accent);
}
.filters-advanced.is-active > summary::after {
  content: var(--filters-active-label, "已启用");
  font-size: .75rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-left: .15rem;
}
.filters-advanced .filter-grid-advanced {
  margin-top: .15rem;
}
.filters-advanced .hint {
  margin-top: .65rem;
  font-size: .82rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 3rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(26,23,20,.1); }
.card.is-hidden { display: none; }
.card-link {
  display: block; padding: 1rem 1.1rem 1.15rem;
  color: inherit; text-decoration: none; height: 100%;
}
.card-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .65rem; }
.card-title { margin: 0 0 .35rem; font-size: 1.1rem; }
.card-meta { margin: 0; color: var(--ink-soft); font-size: .88rem; }
.card-specs {
  margin: .45rem 0 0;
  font-size: .85rem;
  color: var(--ink-soft);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .01em;
}
.card-panel { margin: .45rem 0 0; font-size: .85rem; color: var(--ink-soft); }
.card-cta { display: inline-block; margin-top: .7rem; font-size: .88rem; color: var(--accent); font-weight: 600; font-family: system-ui, sans-serif; }

/* device page */
.device-page { padding-bottom: 3rem; }
.fl-banner {
  margin: 1.25rem 0;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  overflow: hidden;
}
.fl-banner-inner {
  display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap;
  padding: 1rem 1.2rem;
  background: #fff;
}
.fl-none .fl-banner-inner { border-left: 8px solid var(--fl-none); }
.fl-cool .fl-banner-inner { border-left: 8px solid var(--fl-cool); background: #eef6fb; }
.fl-warm .fl-banner-inner { border-left: 8px solid var(--fl-warm); background: #fff6e8; }
.fl-dual .fl-banner-inner { border-left: 8px solid var(--fl-dual); background: #f5eefc; }
.fl-dual-limited .fl-banner-inner { border-left: 8px solid var(--fl-dual-lim); background: #faf0e4; }
.fl-other .fl-banner-inner { border-left: 8px solid var(--fl-other); background: #eef7f2; }

.toc {
  display: flex; flex-wrap: wrap; gap: .5rem .85rem;
  margin: 1rem 0 1.5rem;
  padding: .75rem 0;
  border-bottom: 1px dashed var(--line);
  font-family: system-ui, sans-serif;
  font-size: .9rem;
}
.toc a { text-decoration: none; font-weight: 600; }
.toc a:hover { text-decoration: underline; }

.spec-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: .95rem;
}
.spec-table th, .spec-table td {
  text-align: left; padding: .55rem .75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.spec-table th {
  width: 8.5rem;
  background: #efe8db;
  font-weight: 700;
  color: var(--ink);
}
.spec-table tr.hl th, .spec-table tr.hl td {
  background: #f3e9ff;
  font-weight: 600;
}
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
  .spec-table th { width: 6.5rem; }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .filter-grid label {
    font-size: .9rem;
  }
  select, input[type="search"], .btn-text {
    min-height: 2.5rem;
    font-size: 1rem;
  }
  .card-badges {
    gap: .4rem;
  }
  .badge {
    font-size: .74rem;
    padding: .32rem .6rem;
  }
  .filters-advanced {
    padding: .75rem .85rem;
  }
  .filters-advanced > summary {
    font-size: 1rem;
    min-height: 2.5rem;
  }
  .legend, .filters {
    padding: 1rem;
  }
}

ul.pros, ul.cons, ul.quotes, ul.reviews, ul.manga-list {
  padding-left: 1.2rem;
  margin: 0;
}
ul.pros li, ul.cons li, ul.quotes li, ul.reviews li {
  margin-bottom: .65rem;
}
ul.quotes li {
  padding: .65rem .8rem;
  background: var(--bg-card);
  border-left: 3px solid var(--line);
  list-style: none;
  margin-left: -1.2rem;
  border-radius: 0 8px 8px 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: .75rem;
}
.gallery-item {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.gallery-item img {
  width: 100%; height: 180px; object-fit: cover; display: block; background: #ddd;
}
.gallery-item figcaption {
  padding: .55rem .7rem;
  font-size: .82rem;
  color: var(--ink-soft);
  word-break: break-all;
}
.ph-card {
  min-height: 180px;
  padding: 1rem;
  display: flex; flex-direction: column; justify-content: center;
  background: repeating-linear-gradient(
    -45deg, #f0ebe3, #f0ebe3 8px, #e8e1d6 8px, #e8e1d6 16px
  );
  text-align: center;
}
.ph-icon { font-size: 1.6rem; margin-bottom: .35rem; }
.ph-note { font-size: .85rem; color: var(--ink-soft); }

.pager {
  display: flex; justify-content: space-between; align-items: center;
  margin: 2rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: system-ui, sans-serif;
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  color: var(--ink-soft);
  font-size: .88rem;
  background: #ebe4d7;
  line-height: 1.55;
}
.site-footer .wrap > p {
  margin: 0 0 .55rem;
  max-width: 52rem;
}
.site-footer .wrap > p:last-child {
  margin-bottom: 0;
}
.site-footer .footer-brand {
  font-weight: 600;
  color: var(--ink);
}
.site-footer a {
  color: inherit;
  text-underline-offset: 2px;
}
.site-footer code {
  font-size: .85em;
  background: rgba(0,0,0,.05);
  padding: .1rem .3rem;
  border-radius: 4px;
}
.src-line { font-size: .88rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }

@media print {
  body { background: #fff; background-image: none; font-size: 11pt; }
  .filters, .toc, .pager, .card-cta { display: none !important; }
  .card { break-inside: avoid; box-shadow: none; }
  .site-header, .fl-banner, .gallery-item { break-inside: avoid; }
  a[href]::after { content: ""; }
  .grid { display: block; }
  .card { margin-bottom: .8rem; }
}

/* size badges */
.badge-size-pocket { background: #2a6a5a; }
.badge-size-7 { background: #3a6a4a; }
.badge-size-8 { background: #3a5a7a; }
.badge-size-10 { background: #5a3a6a; }
.badge-size-13 { background: #6a3a4a; }
.badge-size-large { background: #4a3a5a; }

.card-thumb {
  margin: -1rem -1.1rem 0.75rem;
  height: 140px;
  overflow: hidden;
  background: #e8e1d6;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* cite source bubbles — short label, full URL on hover */
a.cite {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: .28em;
  padding: .05em .45em;
  font-size: .72em;
  font-weight: 700;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--accent);
  background: #e8f0eb;
  border: 1px solid #c5d6cb;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  cursor: help;
}
a.cite:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}
.review-site {
  font-weight: 700;
  margin-right: .15em;
}
.spec-table td a.cite { margin-left: .35em; }


/* pass1c: filter slots, lang switch, lightbox */
.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.header-main { flex: 1 1 16rem; min-width: 0; }
.lang-switch {
  display: inline-flex;
  gap: .25rem;
  padding: .2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  flex-shrink: 0;
}
.lang-switch button {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  padding: .35rem .7rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: 2rem;
}
.lang-switch button.is-active,
.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.filter-slot {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .85rem;
  color: var(--ink-soft);
  font-weight: 600;
  font-family: system-ui, sans-serif;
  position: relative;
}
.filter-slot[data-coverage="0"] select {
  opacity: .55;
  cursor: not-allowed;
  background: #f3efe6;
}
.filter-slot-pending {
  font-size: .72rem;
  font-weight: 600;
  color: var(--warn);
  letter-spacing: .02em;
}
.filter-advanced-note {
  margin: .65rem 0 0;
  font-size: .82rem;
}

/* lightbox */
body.lightbox-open { overflow: hidden; }
.lightbox[hidden] { display: none !important; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, .72);
}
.lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(960px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  padding: .75rem;
}
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  background: #e8e1d6;
}
.lightbox-caption {
  margin: .55rem 0 0;
  font-size: .85rem;
  text-align: center;
  max-width: 40rem;
  word-break: break-word;
}
.lightbox-close {
  position: absolute;
  top: .35rem;
  right: .45rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 999px;
  background: rgba(26,23,20,.85);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.lightbox-close:hover { background: var(--accent); }
a.gallery-zoom { cursor: zoom-in; }

@media (max-width: 720px) {
  .lang-switch { align-self: flex-end; }
  .filter-slot { font-size: .9rem; }
  .filter-slot select { min-height: 2.5rem; font-size: 1rem; }
  .lightbox { padding: .5rem; }
  .lightbox-panel { padding: .5rem; }
}
