
:root {
    --bg-body: #0b0c10;
    --bg-surface: #12141c;
    --bg-elevated: #191c27;
    --border: #222634;
    --text-main: #f3f4f6;
    --text-muted: #8b93a7;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, sans-serif; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background: rgba(16, 18, 24, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.logo {
    display: flex; align-items: center; gap: 0.55rem;
    font-size: 1.18rem; font-weight: 700; color: #fff; text-decoration: none;
}
.logo strong { color: #818cf8; }
.logo-img { height: 28px; width: auto; }
.logo-badge {
    width: 26px; height: 26px; border-radius: 7px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem;
}

.search-wrapper { position: relative; flex: 1; max-width: 440px; min-width: 230px; }
.search-input {
    width: 100%; padding: 0.55rem 1rem 0.55rem 2.3rem;
    background: var(--bg-body); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-main); font-size: 0.87rem;
}
.search-input:focus { outline: none; border-color: #6366f1; }
.search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: #646b7d; font-size: 0.82rem; }

.autocomplete-list {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 18px 36px rgba(0,0,0,0.8);
    display: none; overflow: hidden; z-index: 100;
}
.autocomplete-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); cursor: pointer;
}
.autocomplete-item:hover { background: var(--bg-elevated); }
.autocomplete-item img { width: 36px; height: 50px; object-fit: cover; border-radius: 5px; }
.ac-info { flex: 1; min-width: 0; }
.ac-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-meta { font-size: 0.74rem; color: var(--text-muted); }

.nav-links { display: flex; gap: 0.5rem; align-items: center; }
.nav-link {
    color: var(--text-muted); text-decoration: none; font-size: 0.84rem; font-weight: 500;
    padding: 0.45rem 0.8rem; border-radius: 7px; transition: all 0.15s;
}
.nav-link:hover { color: #fff; background: var(--bg-elevated); }
.nav-admin { border: 1px solid var(--border); }

.container { max-width: 1320px; width: 100%; margin: 1.75rem auto; padding: 0 2rem; flex: 1; }
@media (max-width: 640px) { .container { padding: 0 1rem; } .site-header { padding: 0.8rem 1rem; } }

.hero-card {
    position: relative; border-radius: 14px; overflow: hidden;
    border: 1px solid var(--border); margin-bottom: 2rem;
    min-height: 250px; display: flex; align-items: flex-end; background: var(--bg-surface);
}
.hero-banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.45; }
.hero-card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(11,12,16,0.96) 0%, rgba(11,12,16,0.72) 55%, rgba(11,12,16,0.2) 100%);
}
.hero-overlay { position: relative; z-index: 2; padding: 1.85rem; max-width: 620px; }
.badge-accent {
    display: inline-block; font-size: 0.72rem; font-weight: 700; color: #818cf8;
    background: rgba(79, 70, 229, 0.18); border: 1px solid rgba(99, 102, 241, 0.35);
    padding: 3px 8px; border-radius: 6px; margin-bottom: 0.6rem;
}
.hero-overlay h1 { font-size: 1.55rem; margin-bottom: 0.35rem; }
.hero-meta { font-size: 0.83rem; color: #d1d5db; margin-bottom: 0.6rem; }
.hero-desc {
    font-size: 0.85rem; color: var(--text-muted); line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 1.1rem;
}
.hero-btns { display: flex; gap: 0.65rem; flex-wrap: wrap; }

.btn-primary {
    background: var(--accent); color: #fff; text-decoration: none;
    padding: 0.58rem 1.1rem; border-radius: 8px; font-size: 0.84rem; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; border: none; cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
    background: var(--bg-elevated); color: var(--text-main); text-decoration: none;
    padding: 0.58rem 1rem; border-radius: 8px; font-size: 0.84rem; font-weight: 600;
    border: 1px solid var(--border); cursor: pointer;
}
.btn-secondary:hover { border-color: #6366f1; }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.section-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem;
}
.section-header h1, .section-header h2 {
    font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem;
}
.section-header h1::before, .section-header h2::before {
    content: ''; width: 4px; height: 18px; background: #6366f1; border-radius: 4px;
}
.see-all { color: #818cf8; text-decoration: none; font-size: 0.84rem; font-weight: 600; }
.muted-text { color: var(--text-muted); font-size: 0.84rem; }

.anime-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 1.25rem;
}
@media (max-width: 480px) { .anime-grid { grid-template-columns: repeat(2, 1fr); gap: 0.85rem; } }

.card {
    background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px;
    overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: #363d54; }
.poster-wrap { position: relative; aspect-ratio: 2/3; display: block; background: #0d0f14; overflow: hidden; }
.poster-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.card:hover .poster-wrap img { transform: scale(1.03); }

.tag-quality {
    position: absolute; top: 8px; left: 8px; background: rgba(11,12,16,0.85);
    color: #e5e7eb; font-size: 0.68rem; font-weight: 600; padding: 3px 7px; border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.1);
}
.tag-score {
    position: absolute; bottom: 8px; right: 8px; background: rgba(11,12,16,0.85);
    color: #fbbf24; font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 5px;
}

.card-body { padding: 0.8rem; display: flex; flex-direction: column; flex: 1; }
.card-title {
    font-size: 0.9rem; font-weight: 600; color: #f9fafb; text-decoration: none;
    line-height: 1.35; margin-bottom: 0.3rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-title:hover { color: #818cf8; }
.card-meta { font-size: 0.74rem; color: var(--text-muted); margin-bottom: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-footer { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.btn-card {
    background: var(--bg-elevated); border: 1px solid var(--border); color: #d1d5db;
    text-decoration: none; font-size: 0.76rem; font-weight: 600; padding: 0.46rem;
    border-radius: 6px; text-align: center;
}
.btn-card:hover { color: #fff; border-color: #6366f1; }
.btn-card-dl {
    background: var(--accent); color: #fff; text-decoration: none;
    font-size: 0.76rem; font-weight: 600; padding: 0.46rem 0.75rem;
    border-radius: 6px; text-align: center;
}
.btn-card-dl:hover { background: var(--accent-hover); }

.filter-panel {
    background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 0.85rem; margin-bottom: 0.9rem;
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0.65rem;
}
@media (max-width: 820px) { .filter-panel { grid-template-columns: 1fr 1fr; } }
.ctrl-input, .ctrl-select {
    width: 100%; padding: 0.52rem 0.8rem; background: var(--bg-body);
    border: 1px solid var(--border); border-radius: 7px; color: var(--text-main); font-size: 0.84rem;
}
.alpha-bar { display: flex; gap: 0.22rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.alpha-btn {
    background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-muted);
    font-size: 0.72rem; font-weight: 600; padding: 4px 7.5px; border-radius: 6px; cursor: pointer;
}
.alpha-btn:hover, .alpha-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination-bar { display: flex; justify-content: center; align-items: center; gap: 0.75rem; margin-top: 2rem; }

.anime-detail-box {
    background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.detail-banner { width: 100%; height: 220px; object-fit: cover; display: block; opacity: 0.65; }
.detail-body { padding: 1.75rem; display: flex; gap: 1.75rem; flex-wrap: wrap; position: relative; }
.detail-poster {
    width: 210px; border-radius: 10px; object-fit: cover; margin-top: -85px;
    border: 4px solid var(--bg-surface); box-shadow: 0 12px 28px rgba(0,0,0,0.65);
}
.detail-poster.no-banner { margin-top: 0; }
.detail-info { flex: 1; min-width: 260px; }
.breadcrumb { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.breadcrumb a { color: #818cf8; text-decoration: none; }
.detail-info h1 { font-size: 1.65rem; margin-bottom: 0.25rem; }
.romaji-sub { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.detail-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.pill-info { background: var(--bg-elevated); border: 1px solid var(--border); padding: 4px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; }
.pill-score { background: rgba(251,191,36,0.14); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); padding: 4px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 700; }
.genre-tags { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 1rem; }
.genre-chip {
    background: rgba(79,70,229,0.14); color: #a5b4fc; text-decoration: none;
    font-size: 0.75rem; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(99,102,241,0.25);
}
.detail-synopsis { font-size: 0.9rem; color: #d1d5db; line-height: 1.65; margin-bottom: 1.35rem; }
.download-box {
    background: var(--bg-body); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem;
}
.download-box h3 { font-size: 0.92rem; margin-bottom: 0.75rem; color: #e5e7eb; }
.dl-buttons { display: flex; gap: 0.65rem; flex-wrap: wrap; }

.site-footer {
    border-top: 1px solid var(--border); padding: 1.35rem 2rem;
    color: var(--text-muted); font-size: 0.8rem; margin-top: 3rem;
}
.footer-inner {
    max-width: 1320px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
}
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: #fff; }

.btn-card-full {
    grid-column: 1 / -1;
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-card-full:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.hero-dots {
    display: flex;
    gap: 0.45rem;
    margin-top: 1rem;
}
.hero-dot {
    width: 24px;
    height: 5px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}
.hero-dot.active {
    width: 36px;
    background: #818cf8;
}

.site-notice-wrap {
    max-width: 1320px;
    width: 100%;
    margin: 1rem auto 0;
    padding: 0 2rem;
}
@media (max-width: 640px) {
    .site-notice-wrap { padding: 0 1rem; }
}
.note-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.45;
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.12);
    color: #c7d2fe;
}
.note-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}
.note-banner.type-maintenance {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
}
.note-banner.type-maintenance .note-badge {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}
.note-banner.type-error {
    border-color: rgba(239, 68, 68, 0.42);
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}
.note-banner.type-error .note-badge {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}
.note-banner.type-update {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
    color: #a7f3d0;
}
.note-banner.type-update .note-badge {
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
}
