@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  color-scheme:dark;
  --background:#090b10;
  --foreground:#f4f7fb;
  --card:#121722;
  --muted:#1b2230;
  --muted-foreground:#94a3b8;
  --secondary:#171e2b;
  --accent:#162c2a;
  --primary:#67e8c9;
  --primary-foreground:#05110f;
  --border:rgba(255,255,255,.09);
  --input:rgba(255,255,255,.14);
  --ring:#67e8c9;
  --radius:10px;
  --shadow:0 18px 45px rgba(0,0,0,.42);
}

*{box-sizing:border-box}
body{margin:0;background:radial-gradient(circle at 16% -10%,rgba(103,232,201,.14),transparent 34%),radial-gradient(circle at 95% 0,rgba(244,114,182,.12),transparent 28%),var(--background);color:var(--foreground);font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
input,select,textarea,button{font:inherit}

.site-header{position:sticky;top:0;z-index:40;border-bottom:1px solid var(--border);background:rgba(9,11,16,.76);backdrop-filter:blur(16px)}
.site-header{display:flex;height:64px;align-items:center;gap:16px;padding:0 max(16px,calc((100vw - 1280px)/2 + 24px))}
.brand{display:flex;align-items:center;gap:8px;font-size:18px;font-weight:800;letter-spacing:-.02em}
.brand span,.brand img{display:grid;width:32px;height:32px;place-items:center;border-radius:8px;background:linear-gradient(135deg,var(--primary),#f472b6);color:#04100e}
.brand img{object-fit:cover}
nav{display:none;align-items:center;gap:4px}
nav a{border-radius:8px;padding:8px 12px;color:var(--muted-foreground);font-size:14px;font-weight:600}
nav a:hover{background:var(--secondary);color:var(--foreground)}
.quick-search{margin-left:auto;display:flex;max-width:320px;flex:1;gap:8px}
.quick-search input{height:36px;width:100%;border:1px solid var(--input);border-radius:8px;background:rgba(18,23,34,.74);color:var(--foreground);padding:0 12px;font-size:14px;outline:none}
.quick-search button{height:36px}

.page{width:min(1280px,100%);margin:0 auto;padding:24px 16px 56px}
.notice{width:min(1248px,calc(100% - 32px));margin:16px auto 0;border:1px solid color-mix(in srgb,var(--primary) 28%,var(--border));border-radius:8px;background:color-mix(in srgb,var(--primary) 11%,var(--background));padding:12px 14px;color:var(--foreground)}
.site-footer{border-top:1px solid var(--border);padding:34px max(16px,calc((100vw - 1280px)/2 + 24px));color:var(--muted-foreground);font-size:13px;background:linear-gradient(180deg,rgba(18,23,34,.72),rgba(9,11,16,.98))}
.footer-grid{display:grid;gap:24px;text-align:left}
.footer-grid strong{display:block;margin-bottom:8px;color:var(--foreground);font-size:18px}
.footer-grid h3{margin:0 0 10px;color:var(--foreground);font-size:14px}
.footer-grid p{margin:0;max-width:560px;line-height:1.65}
.footer-grid a{display:block;margin:7px 0;color:var(--muted-foreground)}
.footer-grid a:hover{color:var(--primary)}
.footer-bottom{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;margin-top:26px;border-top:1px solid var(--border);padding-top:18px}

.button,button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--border);border-radius:8px;background:var(--card);color:var(--foreground);padding:8px 14px;font-size:14px;font-weight:600;cursor:pointer}
.button:hover,button:hover{background:var(--secondary)}
.button.primary,button.primary{border-color:transparent;background:linear-gradient(135deg,var(--primary),#5eead4);color:var(--primary-foreground)}
.button.ghost{background:var(--secondary)}

.discover-head{display:flex;flex-direction:column;gap:16px;margin-bottom:24px}
.discover-head h1{margin:0;font-size:24px;line-height:1.2;letter-spacing:-.02em}
.discover-head p{margin:4px 0 0;color:var(--muted-foreground);font-size:14px}
.type-switch{display:inline-flex;width:max-content;border:1px solid var(--border);border-radius:10px;background:color-mix(in srgb,var(--secondary) 50%,transparent);padding:4px}
.type-switch a{border-radius:7px;padding:7px 16px;color:var(--muted-foreground);font-size:14px;font-weight:600}
.type-switch a:hover{background:var(--background);color:var(--foreground);box-shadow:0 1px 2px rgba(0,0,0,.05)}

.filter-hero{margin-bottom:32px}
.filter-hero.compact{margin-bottom:24px}
.ani-filter{display:grid;grid-template-columns:1fr;gap:22px;align-items:end}
.ani-filter label{display:grid;gap:12px;color:#dbeafe;font-weight:800}
.ani-filter label span{font-size:16px}
.ani-filter input,.ani-filter select{height:48px;border:1px solid var(--border);border-radius:9px;background:linear-gradient(180deg,#151b27,#101621);box-shadow:0 16px 28px rgba(0,0,0,.22);color:#cbd5e1;padding:0 16px;font-weight:700;outline:none}
.ani-filter input:focus,.ani-filter select:focus{box-shadow:0 0 0 3px rgba(103,232,201,.15),0 16px 28px rgba(0,0,0,.22)}
.filter-button{height:48px;width:48px;border:1px solid var(--border);border-radius:9px;background:linear-gradient(180deg,#151b27,#101621);box-shadow:0 16px 28px rgba(0,0,0,.22);color:var(--primary);font-size:22px}
.poster-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:28px 48px}
.compact-posters{grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:18px}

.hero-cinema{position:relative;min-height:224px;overflow:hidden;border:1px solid var(--border);border-radius:18px;background:var(--hero),var(--secondary);background-size:cover;background-position:center}
.hero-cinema:before{content:"";position:absolute;inset:0;background:linear-gradient(to top,var(--background),color-mix(in srgb,var(--background) 85%,transparent),color-mix(in srgb,var(--background) 40%,transparent))}
.hero-cinema:after{content:"";position:absolute;inset:0;background:linear-gradient(to right,color-mix(in srgb,var(--background) 90%,transparent),transparent)}
.hero-cinema{display:flex;align-items:end;gap:16px;padding:20px}
.hero-poster{position:relative;z-index:1;display:none;width:128px;aspect-ratio:2/3;overflow:hidden;border:1px solid var(--border);border-radius:10px;background:var(--muted);box-shadow:var(--shadow)}
.hero-poster img{width:100%;height:100%;object-fit:cover}
.hero-copy{position:relative;z-index:1;display:flex;flex-direction:column;gap:10px;max-width:720px}
.hero-copy h1{margin:0;max-width:760px;font-size:clamp(26px,4vw,42px);line-height:1.06;letter-spacing:-.03em}
.hero-copy p{display:none;margin:0;max-width:680px;color:var(--muted-foreground);font-size:14px;line-height:1.65}
.eyebrow{margin:0;display:flex;align-items:center;gap:8px;color:var(--primary);font-size:12px;font-weight:700}
.actions,.filters,.admin-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

.section-title{display:flex;align-items:center;justify-content:space-between;margin:34px 0 12px}
.section-title h2{margin:0;color:#dbeafe;font-size:18px;line-height:1.25;letter-spacing:.04em}
.rail,.mini-rail{display:flex;gap:16px;overflow-x:auto;margin:0 -16px;padding:0 16px 8px;scroll-snap-type:x mandatory;scrollbar-width:none}
.rail::-webkit-scrollbar,.mini-rail::-webkit-scrollbar{display:none}
.media-card{width:128px;min-width:128px;scroll-snap-align:start}
.media-card a{display:flex;flex-direction:column;gap:8px}
.poster{position:relative;aspect-ratio:2/3;overflow:hidden;border:1px solid var(--border);border-radius:12px;background:var(--muted);box-shadow:0 16px 30px rgba(0,0,0,.24)}
.poster img{width:100%;height:100%;object-fit:cover;transition:transform .3s ease}
.media-card:hover .poster img{transform:scale(1.05)}
.poster-fade{position:absolute;inset:0;background:linear-gradient(to top,rgba(0,0,0,.6),transparent 48%);opacity:0;transition:opacity .2s ease}
.media-card:hover .poster-fade{opacity:1}
.score-badge{position:absolute;left:8px;top:8px;z-index:2;border-radius:6px;background:color-mix(in srgb,var(--background) 90%,transparent);box-shadow:0 1px 4px rgba(0,0,0,.12);padding:3px 6px;color:var(--foreground);font-size:12px;font-weight:800;backdrop-filter:blur(8px)}
.media-card-body{display:flex;flex-direction:column;gap:3px}
.media-card-body strong{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:14px;font-weight:600;line-height:1.3}
.media-card:hover .media-card-body strong{color:var(--primary)}
.media-card-body span,.muted,.empty{color:var(--muted-foreground);font-size:12px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:18px}

.detail-hero{position:relative;margin:-24px -16px 0;height:260px;overflow:hidden;background:var(--hero),var(--secondary);background-size:cover;background-position:center}
.detail-hero:after{content:"";position:absolute;inset:0;background:linear-gradient(to top,var(--background),color-mix(in srgb,var(--background) 40%,transparent),transparent)}
.detail-shell{position:relative;z-index:1;width:min(1280px,100%);height:100%;margin:0 auto;display:flex;align-items:end;gap:24px;padding:0 16px 18px}
.detail-poster{width:128px;min-width:128px;border-radius:12px;box-shadow:var(--shadow)}
.detail-copy{display:flex;min-width:0;flex:1;flex-direction:column;gap:10px;padding-bottom:2px}
.detail-copy h1{margin:0;font-size:clamp(26px,4vw,42px);line-height:1.06;letter-spacing:-.03em}
.badge-row{display:flex;gap:8px;flex-wrap:wrap}
.badge-row span,.chips span{display:inline-flex;border:1px solid var(--border);border-radius:999px;background:var(--secondary);padding:4px 9px;color:var(--foreground);font-size:12px;font-weight:600}
.detail-tabs{display:flex;justify-content:flex-end;gap:44px;margin:0 -16px 28px;padding:14px 24px;border-bottom:1px solid var(--border);background:var(--card)}
.detail-tabs a{color:#9ca3af;font-size:14px}
.detail-tabs a:hover{color:var(--primary)}

.stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:28px 0}
.stat-grid div{display:flex;min-height:72px;flex-direction:column;gap:6px;border:1px solid var(--border);border-radius:10px;background:var(--card);padding:14px}
.stat-grid span{color:var(--muted-foreground);font-size:12px}
.stat-grid strong{font-size:15px}
.content-layout{display:grid;gap:28px}
.nozu-detail{align-items:start}
.main-column{display:flex;flex-direction:column;gap:28px}
.content-section{display:flex;flex-direction:column;gap:12px}
.content-section h2{margin:0;font-size:18px}
.summary{margin:0;white-space:pre-line;color:var(--muted-foreground);font-size:14px;line-height:1.75}
.character-grid,.relation-grid{display:grid;gap:12px}
.character-card,.relation-card{display:flex;align-items:center;gap:12px;border:1px solid var(--border);border-radius:6px;background:var(--card);padding:8px}
.character-card img{width:56px;height:56px;border-radius:8px;object-fit:cover;background:var(--muted)}
.relation-card img{width:48px;height:72px;border-radius:8px;object-fit:cover;background:var(--muted)}
.character-card div,.relation-card div{display:flex;min-width:0;flex:1;flex-direction:column;gap:3px}
.character-card strong,.relation-card strong{overflow:hidden;text-overflow:ellipsis;font-size:14px}
.character-card span,.relation-card span{color:var(--primary);font-size:12px;font-weight:700}
.character-card small,.relation-card small{color:var(--muted-foreground);font-size:12px}
.character-card.split{display:grid;grid-template-columns:56px 1fr 1fr 56px}
.character-card.split .voice{text-align:right}
.staff-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}
.staff-card{display:flex;align-items:center;gap:12px;border:1px solid var(--border);border-radius:6px;background:var(--card);padding:8px}
.staff-card img{width:56px;height:56px;object-fit:cover;border-radius:6px;background:var(--muted)}
.staff-card div{display:grid;gap:4px}
.staff-card span{color:var(--muted-foreground);font-size:12px}
.ranking-box{display:grid;gap:10px}
.ranking-box p{margin:0;border-radius:8px;background:linear-gradient(135deg,rgba(103,232,201,.12),rgba(244,114,182,.08));box-shadow:0 10px 24px rgba(0,0,0,.18);padding:12px 14px;color:#d1fae5;font-weight:700}
.tag-cloud,.external-grid{display:flex;flex-wrap:wrap;gap:10px}
.tag-cloud span{border-radius:999px;background:var(--secondary);padding:7px 10px;color:#cbd5e1;font-size:13px;font-weight:700}
.tag-cloud small{color:var(--primary)}
.external-grid a{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:8px;background:var(--card);padding:8px 10px;color:#cbd5e1;font-weight:700}
.external-grid img{width:18px;height:18px;border-radius:4px}
.side-panel{display:flex;flex-direction:column;gap:16px}
.info-box,.genre-box{border:1px solid var(--border);border-radius:14px;background:var(--card);padding:16px}
.info-box p{display:flex;flex-direction:column;gap:4px;margin:0;padding:10px 0;border-bottom:1px solid var(--border)}
.info-box p:first-child{padding-top:0}
.info-box p:last-child{border-bottom:0;padding-bottom:0}
.info-box span{color:var(--muted-foreground);font-size:12px}
.info-box strong{font-size:14px;line-height:1.4}
.genre-box h3{margin:0 0 10px;font-size:14px}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.mini-card{width:128px;min-width:128px;display:flex;flex-direction:column;gap:8px}
.mini-card img{width:128px;aspect-ratio:2/3;object-fit:cover;border:1px solid var(--border);border-radius:10px;background:var(--muted)}
.mini-card strong{font-size:13px;line-height:1.3}

.panel,.auth-card{border:1px solid var(--border);border-radius:14px;background:var(--card);padding:20px;margin-bottom:20px}
.auth-card{max-width:420px;margin:48px auto}
.auth-card form,.settings-form,.settings-form section{display:grid;gap:12px}
.filters input,.filters select,.settings-form input,.settings-form select,.settings-form textarea,.auth-card input{border:1px solid var(--input);border-radius:8px;background:var(--background);color:var(--foreground);padding:10px 12px;outline:none}
.error{color:#d92d20}
.admin-bar{justify-content:space-between;border:1px solid var(--border);border-radius:14px;background:var(--card);padding:20px;margin-bottom:20px}
.admin-bar h1{margin:0}
.admin-bar p{margin:6px 0 0;color:var(--muted-foreground)}
.admin-results{display:grid;gap:12px}
.result-row{display:grid;grid-template-columns:64px 1fr;gap:14px;align-items:center;border:1px solid var(--border);border-radius:12px;background:var(--card);padding:12px}
.result-row img{width:64px;height:88px;object-fit:cover;border-radius:8px;background:var(--muted)}
.result-row p{margin:4px 0 0;color:var(--muted-foreground)}
.result-row form{grid-column:1/-1}
.check{display:flex;align-items:center;gap:8px}
.docs pre{overflow:auto;border:1px solid var(--border);border-radius:10px;background:var(--muted);padding:14px;color:var(--foreground)}
.api-hero{border:1px solid var(--border);border-radius:18px;background:linear-gradient(135deg,rgba(103,232,201,.12),rgba(244,114,182,.08));padding:34px;margin-bottom:24px}
.api-hero h1{max-width:760px;margin:6px 0 12px;font-size:38px;line-height:1.05;color:#f8fafc}
.api-hero p{max-width:760px;color:#cbd5e1;line-height:1.7}
.docs-grid{display:grid;gap:18px}
.person-hero{display:flex;align-items:center;gap:22px;border:1px solid var(--border);border-radius:18px;background:linear-gradient(135deg,rgba(103,232,201,.12),rgba(244,114,182,.08));padding:24px;margin-bottom:30px}
.person-avatar{width:112px;height:112px;min-width:112px;overflow:hidden;border:1px solid var(--border);border-radius:18px;background:var(--muted);box-shadow:var(--shadow)}
.person-avatar img{width:100%;height:100%;object-fit:cover}
.person-avatar span{display:grid;width:100%;height:100%;place-items:center;color:var(--primary);font-size:44px;font-weight:800}
.person-hero h1{margin:0;font-size:38px;line-height:1.05}
.person-hero p{margin:8px 0 0;color:var(--muted-foreground)}
.credit-list{display:grid;gap:14px}
.credit-card{display:grid;grid-template-columns:72px 1fr 56px;gap:14px;align-items:center;border:1px solid var(--border);border-radius:14px;background:var(--card);padding:10px}
.credit-cover img{width:72px;height:104px;object-fit:cover;border-radius:9px;background:var(--muted)}
.credit-card span{color:var(--primary);font-size:12px;font-weight:800}
.credit-card h2{margin:4px 0;font-size:17px}
.credit-card p{margin:0;color:var(--muted-foreground)}
.credit-role-image{width:56px;height:56px;object-fit:cover;border-radius:9px;background:var(--muted)}
.legal-page{max-width:860px;border:1px solid var(--border);border-radius:18px;background:rgba(18,23,34,.72);padding:28px;box-shadow:var(--shadow)}
.legal-page h1{margin:6px 0 18px;font-size:38px;line-height:1.05}
.legal-page h2{margin:28px 0 10px;font-size:20px}
.legal-page p{color:var(--muted-foreground);line-height:1.8}

@media (min-width:640px){
  nav{display:flex}
  .page{padding:32px 24px 64px}
  .discover-head{flex-direction:row;align-items:center;justify-content:space-between}
  .hero-cinema{min-height:288px;padding:32px}
  .hero-poster{display:block}
  .hero-copy p{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}
  .media-card{width:160px;min-width:160px}
  .rail,.mini-rail{margin:0;padding:0 0 8px}
  .detail-hero{height:320px;margin:-32px -24px 0}
  .detail-shell{padding:0 24px 22px}
  .detail-poster{width:192px;min-width:192px}
  .stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .character-grid,.relation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .result-row{grid-template-columns:64px 1fr auto}
  .result-row form{grid-column:auto}
  .ani-filter{grid-template-columns:1fr 1fr 1fr}
  .footer-grid{grid-template-columns:2fr 1fr 1.4fr}
}

@media (max-width:720px){
  .site-header{height:auto;align-items:flex-start;flex-direction:column;padding:12px 16px}
  .quick-search{margin-left:0;max-width:none;width:100%}
  .detail-tabs{justify-content:flex-start;gap:18px;overflow-x:auto}
  .character-card.split{grid-template-columns:48px 1fr;align-items:center}
  .character-card.split .voice{text-align:left}
  .character-card.split > img:last-child{display:none}
  .person-hero{align-items:flex-start;flex-direction:column}
  .credit-card{grid-template-columns:64px 1fr}
  .credit-role-image{display:none}
}

@media (min-width:1024px){
  .content-layout{grid-template-columns:minmax(0,1fr) 280px}
  .nozu-detail{grid-template-columns:260px minmax(0,1fr)}
  .nozu-detail .side-panel{order:0}
  .nozu-detail .main-column{order:1}
  .stat-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
  .ani-filter{grid-template-columns:1fr 1fr 1fr 1fr 1fr auto}
  .docs-grid{grid-template-columns:1fr 1fr}
}
