/* kkmh.cc 动漫索引站 —— 搜索驱动设计 */
:root {
  --bg: #f7f8fa; --card: #ffffff; --text: #1a2433; --muted: #6b7c8f;
  --border: #e8edf3; --primary: #5b6ef5; --primary-dark: #4755d6;
  --accent: #ff6b6b; --radius: 14px; --shadow: 0 4px 20px rgba(30,50,90,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16191f; --card: #1e222a; --text: #e8ecf2; --muted: #9aa5b4;
    --border: #2b313b; --primary: #7c8aff; --primary-dark: #9aa6ff;
    --shadow: 0 4px 20px rgba(0,0,0,.3);
  }
}
[data-theme="dark"] {
  --bg:#16191f; --card:#1e222a; --text:#e8ecf2; --muted:#9aa5b4; --border:#2b313b; --primary:#7c8aff; --primary-dark:#9aa6ff;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif; background:var(--bg); color:var(--text); line-height:1.6; min-height:100vh; }
a { color:inherit; text-decoration:none; }

/* 顶部 */
.site-header { background:var(--card); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:20; }
.header-inner { max-width:1240px; margin:0 auto; padding:.85rem 1.5rem; display:flex; align-items:center; gap:1.5rem; }
.brand { display:flex; align-items:center; gap:.55rem; font-weight:700; font-size:1.15rem; }
.brand-mark { width:2rem; height:2rem; display:grid; place-items:center; border-radius:8px; background:linear-gradient(135deg,var(--primary),var(--accent)); color:#fff; font-size:.78rem; font-weight:800; }
.top-nav { display:flex; gap:1.5rem; margin-left:auto; font-size:.9rem; }
.top-nav a { color:var(--muted); transition:color .15s; }
.top-nav a:hover { color:var(--primary); }

/* Hero 搜索区 */
.hero { background:linear-gradient(160deg,#eef1ff 0%,var(--bg) 70%); padding:4.5rem 1.5rem 3rem; text-align:center; }
@media (prefers-color-scheme:dark) { .hero { background:linear-gradient(160deg,#1d2233 0%,var(--bg) 70%); } }
.hero-inner { max-width:720px; margin:0 auto; }
.hero-title { font-size:2.6rem; font-weight:800; letter-spacing:-.03em; margin-bottom:.7rem; }
.hero-title span { color:var(--primary); }
.hero-sub { color:var(--muted); font-size:1rem; margin-bottom:2rem; }
.search-box { display:flex; align-items:center; background:var(--card); border:2px solid var(--border); border-radius:2rem; padding:.35rem .4rem .35rem 1.2rem; box-shadow:var(--shadow); transition:border-color .2s,box-shadow .2s; }
.search-box:focus-within { border-color:var(--primary); box-shadow:0 8px 30px rgba(91,110,245,.15); }
.search-icon { width:1.25rem; height:1.25rem; color:var(--muted); flex-shrink:0; }
.search-box input { flex:1; border:none; outline:none; background:transparent; padding:.7rem .8rem; font-size:1rem; color:var(--text); min-width:0; }
.search-box button { background:var(--primary); color:#fff; border:none; border-radius:2rem; padding:.75rem 1.8rem; font-size:.95rem; font-weight:600; cursor:pointer; transition:background .15s; }
.search-box button:hover { background:var(--primary-dark); }
.suggestions { margin-top:.6rem; background:var(--card); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); text-align:left; overflow:hidden; position:absolute; left:50%; transform:translateX(-50%); width:min(720px,calc(100% - 3rem)); z-index:10; }
@media (max-width:760px) { .suggestions { position:static; transform:none; width:100%; } }
.suggestions a { display:block; padding:.6rem 1rem; font-size:.9rem; border-bottom:1px solid var(--border); }
.suggestions a:hover { background:var(--bg); color:var(--primary); }
.suggestions a:last-child { border-bottom:none; }
.hero-tags { margin-top:1.2rem; display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; justify-content:center; font-size:.85rem; }
.tags-label { color:var(--muted); }
.hero-tags a { padding:.25rem .8rem; background:var(--card); border:1px solid var(--border); border-radius:1rem; color:var(--muted); transition:all .15s; }
.hero-tags a:hover { color:var(--primary); border-color:var(--primary); }

/* 站点统计条 */
.site-stats { display:flex; align-items:center; justify-content:center; gap:1.5rem; margin:1.5rem 0 .3rem; }
.stat-item { display:flex; flex-direction:column; align-items:center; min-width:88px; }
.stat-num { font-size:1.55rem; font-weight:800; line-height:1.1; color:var(--primary); font-variant-numeric:tabular-nums; }
.stat-label { font-size:.76rem; color:var(--muted); margin-top:.25rem; }
.stat-divider { width:1px; height:2.2rem; background:var(--border); }
@media (max-width:600px) { .site-stats { gap:.9rem; } .stat-num { font-size:1.3rem; } .stat-item { min-width:72px; } }

/* 主体 */
.main-content { max-width:1240px; margin:0 auto; padding:1rem 1.5rem 4rem; }
.section-title { font-size:1.3rem; font-weight:700; margin-bottom:1.2rem; }
.section-head { display:flex; align-items:baseline; justify-content:space-between; }
.section-more { color:var(--primary); font-size:.88rem; }
.category-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:1rem; margin-bottom:2.5rem; }
.category-card { display:flex; flex-direction:column; gap:.25rem; padding:1.4rem; background:var(--card); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); transition:transform .2s,border-color .2s; }
.category-card:hover { transform:translateY(-3px); border-color:var(--primary); }
.cat-icon { font-size:1.8rem; }
.category-card strong { font-size:1rem; }
.category-card small { color:var(--muted); font-size:.8rem; }
.tag-section { margin-bottom:2.5rem; }
.tag-cloud { display:flex; flex-wrap:wrap; gap:.6rem; }
.tag-cloud a { padding:.35rem 1rem; background:var(--card); border:1px solid var(--border); border-radius:1.2rem; font-size:.85rem; color:var(--muted); transition:all .15s; }
.tag-cloud a:hover { color:#fff; background:var(--primary); border-color:var(--primary); }
.muted { color:var(--muted); font-size:.85rem; }

/* 番剧网格 */
.bangumi-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:1.2rem 1rem; }
.bangumi-card { display:block; }
.poster-wrap { position:relative; aspect-ratio:9/12; border-radius:10px; overflow:hidden; background:#e8edf4; box-shadow:var(--shadow); }
.poster-wrap img { width:100%; height:100%; object-fit:cover; display:block; transition:transform .25s; }
.bangumi-card:hover .poster-wrap img { transform:scale(1.05); }
.episode-badge { position:absolute; bottom:0; left:0; right:0; padding:.35rem .5rem; font-size:.72rem; color:#fff; background:linear-gradient(transparent,rgba(0,0,0,.8)); text-align:right; }
.card-title { font-size:.88rem; font-weight:600; margin-top:.5rem; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card-tagline { font-size:.74rem; color:var(--muted); line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card-source { display:inline-block; margin-top:.3rem; font-size:.68rem; color:var(--primary); }

/* 页脚 */
.site-footer { background:var(--card); border-top:1px solid var(--border); padding:2rem 1.5rem; font-size:.82rem; color:var(--muted); }
.footer-inner { max-width:1240px; margin:0 auto; display:flex; flex-wrap:wrap; gap:1rem; justify-content:space-between; }
.footer-links { display:flex; gap:1rem; }
.footer-links a:hover { color:var(--primary); }

@media (max-width:1000px) { .bangumi-grid { grid-template-columns:repeat(5,1fr); } }
@media (max-width:820px)  { .bangumi-grid { grid-template-columns:repeat(4,1fr); } .category-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px)  {
  .hero { padding:3rem 1rem 2rem; } .hero-title { font-size:2rem; }
  .search-box button { padding:.75rem 1.2rem; }
  .bangumi-grid { grid-template-columns:repeat(3,1fr); gap:.8rem .6rem; }
  .header-inner, .main-content { padding-left:1rem; padding-right:1rem; }
  .top-nav { gap:1rem; font-size:.85rem; }
}
@media (max-width:400px) { .bangumi-grid { grid-template-columns:repeat(2,1fr); } }
