/* ===========================================
   PDF漫画阅读器 - 前端样式
   主题：黑白极简 · Monochrome Editorial
   =========================================== */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@200;300;400;500;700&display=swap');

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fff;
    color: #1a1a1a;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* --- Selection --- */
::selection { background: #000; color: #fff; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* ===========================================
   HEADER
   =========================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #e8e8e8;
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-icon {
    font-size: 18px;
    line-height: 1;
    filter: grayscale(1);
}

.logo-text {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    letter-spacing: 2px;
}

.header-nav { display: flex; gap: 2px; }

.header-nav a {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    transition: all .2s;
}

.header-nav a:hover,
.header-nav a.active {
    color: #000;
    background: #f0f0f0;
}

/* ===========================================
   HERO SECTION
   =========================================== */
.hero {
    position: relative;
    padding: 80px 16px 40px;
    text-align: center;
    overflow: hidden;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
    pointer-events: none;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0,0,0,.015) 40px, rgba(0,0,0,.015) 41px);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.hero-title {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 40px;
    font-weight: 200;
    color: #000;
    letter-spacing: 8px;
    margin-bottom: 10px;
}

.hero-title .accent {
    font-weight: 700;
}

.hero-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
    font-weight: 300;
    letter-spacing: 1px;
}

.hero-search {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    pointer-events: none;
}

.hero-search input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}

.hero-search input::placeholder { color: #bbb; }

.hero-search input:focus {
    border-color: #000;
}

/* ===========================================
   COMIC GRID
   =========================================== */
.comic-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    letter-spacing: 1px;
}

.title-deco {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: #000;
    border-radius: 1px;
}

.section-count {
    font-size: 12px;
    color: #bbb;
    font-weight: 300;
}

.comic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

/* Comic Card */
.comic-card {
    position: relative;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    transition: all .25s ease;
}

.comic-card:hover {
    border-color: #000;
}

.comic-card:active {
    opacity: .7;
}

.comic-card-cover {
    aspect-ratio: 3/4;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #eee;
}

.comic-card-cover svg {
    width: 36%;
    height: 36%;
    opacity: .12;
    color: #999;
}

.comic-card-cover img.comic-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comic-card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.03) 100%);
}

.comic-card-body {
    padding: 10px 12px 12px;
}

.comic-card-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.comic-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #bbb;
    font-weight: 300;
}

.comic-card-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Badge */
.comic-card .badge-new {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #000;
    color: #fff;
    font-size: 9px;
    font-weight: 500;
    padding: 2px 7px;
    z-index: 2;
    letter-spacing: .5px;
}

/* Hover overlay */
.comic-card .read-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.03);
    opacity: 0;
    transition: opacity .25s;
    z-index: 2;
}

.comic-card:hover .read-overlay {
    opacity: 1;
}

.read-overlay .read-btn {
    background: #000;
    color: #fff;
    padding: 5px 16px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* ===========================================
   LOADING & EMPTY STATES
   =========================================== */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}

.loading-state p { margin-top: 12px; font-size: 13px; }

.loader {
    width: 24px;
    height: 24px;
    border: 2px solid #eee;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; filter: grayscale(1); opacity: .4; }
.empty-state p { font-size: 13px; }

/* ===========================================
   FOOTER
   =========================================== */
.site-footer {
    text-align: center;
    padding: 20px 16px 32px;
    font-size: 11px;
    color: #ccc;
    border-top: 1px solid #f0f0f0;
    letter-spacing: .5px;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (min-width: 768px) {
    .comic-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    .hero-title { font-size: 48px; letter-spacing: 12px; }
}

@media (max-width: 380px) {
    .comic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .hero-title { font-size: 32px; letter-spacing: 4px; }
}

/* Touch device adjustments */
@media (hover: none) {
    .comic-card:hover { border-color: #eee; }
    .comic-card:active { opacity: .6; }
    .read-overlay { display: none; }
}
