:root {
  --bg: #0d0f14;
  --bg-2: #14171f;
  --card: #1a1e29;
  --line: #2a3040;
  --text: #e8e6e1;
  --muted: #9aa0ae;
  --accent: #e5b769;
  --accent-2: #cc4a4a;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(229,183,105,.07), transparent),
    var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.6;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── header ─────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(13,15,20,.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
.brand { display: flex; gap: 14px; align-items: center; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.brand .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.brand-mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  font-size: 24px; font-weight: 700; color: #111;
  background: linear-gradient(135deg, var(--accent), #f0d9a6);
  border-radius: 10px;
}
.controls { display: flex; gap: 10px; flex-wrap: wrap; }
.controls input, .controls select {
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; font-family: inherit;
}
.controls input { width: 240px; }
.controls input:focus, .controls select:focus { outline: 1px solid var(--accent); }

/* ── grid ───────────────────────────── */
.status { color: var(--muted); padding: 30px 0; text-align: center; }
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  padding: 24px 0 60px;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.poster {
  position: relative; aspect-ratio: 27/40;
  background: linear-gradient(160deg, #232838, #161a24);
  overflow: hidden;
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster .noimg {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #3d4457; font-size: 34px;
}
.score {
  position: absolute; top: 8px; right: 8px;
  background: rgba(13,15,20,.85); color: var(--accent);
  border-radius: 6px; padding: 2px 8px;
  font-size: 13px; font-weight: 700;
}
.rev-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent-2); color: #fff;
  border-radius: 6px; padding: 2px 8px; font-size: 12px;
}
.card-body { padding: 12px 14px 14px; }
.card-body h3 {
  margin: 0 0 4px; font-size: 15px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.8em;
}
.card-body .date { color: var(--muted); font-size: 12.5px; }

/* ── modal ──────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72);
}
.modal-panel {
  position: relative; margin: auto;
  width: min(860px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-close {
  position: sticky; top: 0; float: right;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  width: 34px; height: 34px; font-size: 15px; cursor: pointer;
}
.m-head { display: flex; gap: 24px; flex-wrap: wrap; }
.m-head img {
  width: 200px; aspect-ratio: 27/40; object-fit: cover;
  border-radius: 10px; background: var(--card); flex: none;
}
.m-info { flex: 1; min-width: 260px; }
.m-info h2 { margin: 0 0 4px; font-size: 24px; line-height: 1.3; }
.m-info .orig { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.m-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.tag {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 12px; font-size: 13px; color: var(--muted);
}
.tag.gold { color: var(--accent); border-color: #55452a; }
.m-section { margin-top: 22px; }
.m-section h4 {
  margin: 0 0 8px; font-size: 15px; color: var(--accent);
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.m-section p { margin: 0; font-size: 15px; color: #cfd3dc; }
.review {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 12px;
}
.review h5 { margin: 0 0 2px; font-size: 14.5px; }
.review .by { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.review .txt { font-size: 14.5px; color: #cfd3dc; white-space: pre-line; }
.review .more { margin-top: 8px; font-size: 13px; }
.news-item { margin: 6px 0; font-size: 14.5px; }
.news-item span { color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.src-link { display: inline-block; margin-top: 18px; }

/* ── footer ─────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
  padding: 22px 0 34px;
}

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .m-head img { width: 130px; }
  .controls input { width: 100%; }
}
