/* ===== GLOBAL RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-bg: #1a1a2e;
    --secondary-bg: #16213e;
    --tertiary-bg: #0f3460;
    --accent-color: #e94560;
    --accent-light: #ff6b7a;
    --accent-dark: #c73555;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --text-tertiary: #707080;
    --border-color: #2a2a42;
    --border-light: #353550;
    --success: #4caf50;
    --warning: #ff9800;
    --radius: 6px;
    --radius-lg: 12px;
    --radius-sm: 4px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.5);
}

html {
    font-size: 15px;
}

body {
    background: var(--primary-bg);
    color: var(--text-primary);
    font-family: 'Segoe UI','Helvetica Neue','PingFang SC','Hiragino Sans GB','Microsoft YaHei',Arial,sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: var(--accent-light);
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

.cf::after {
    content: '';
    display: table;
    clear: both;
}

/* ===== MAIN WRAPPER ===== */
.main-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== HEADER ===== */
.header-container {
    background: linear-gradient(135deg, #c73555 0%, #e94560 100%);
    padding: 12px 0;
    box-shadow: var(--shadow-md);
    margin-bottom: 3px;
}

.header-container .main-wrap {
    display: flex;
    align-items: center;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    flex: 1;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-name {
    font-size: 1.48rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -.5px;
    display: block;
}

.domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.15);
    border-radius: 6px;
    padding: 5px 14px;
    backdrop-filter: blur(10px);
}

.badge-label {
    font-size: 0.73rem;
    color: rgba(255,255,255,.7);
    white-space: nowrap;
}

.badge-value {
    font-size: 1.04rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

/* ===== BANNER ===== */
.banner-wrap {
    margin: 3px 0;
}

.banner-wrap img {
    border-radius: var(--radius-lg);
    width: 100%;
    box-shadow: var(--shadow-sm);
}

/* ===== NAVIGATION ===== */
.nav-container {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 3px 0;
    box-shadow: var(--shadow-sm);
}

.nav-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-color);
    min-height: 42px;
}

.nav-row:last-child {
    border-bottom: none;
}

.nav-label {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    color: rgba(255,255,255,.8);
    font-size: .68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    width: 62px;
    min-width: 62px;
    border-right: 1px solid var(--border-light);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

.nav-group {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    align-items: center;
    padding: 5px 8px;
    gap: 4px;
    flex: 1;
}

.nav-group a {
    font-size: .83rem;
    color: var(--text-secondary);
    padding: 4px 7px;
    border-radius: var(--radius-sm);
    transition: all .15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid transparent;
    text-decoration: none;
    display: block;
}

.nav-group a:hover {
    background: rgba(233, 69, 96, .15);
    color: var(--accent-color);
    border-color: var(--accent-dark);
}

.nav-group a.active {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    font-weight: 700;
}

/* ===== SEARCH BOX ===== */
.search-box {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 9px 12px;
    margin: 3px 0;
    box-shadow: var(--shadow-sm);
}

.search-box form {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.search-box input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    font-size: .88rem;
    color: var(--text-primary);
    background: var(--tertiary-bg);
    outline: none;
    transition: border-color .2s ease;
}

.search-box input[type="text"]::placeholder {
    color: var(--text-tertiary);
}

.search-box input[type="text"]:focus {
    border-color: var(--accent-color);
    background: var(--secondary-bg);
}

.search-box button {
    height: 38px;
    padding: 0 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--tertiary-bg);
    color: #ffffff;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}

.search-box button:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.search-box button[value="1"] {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.search-box button[value="1"]:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
}

.search-box button[value="2"] {
    background: var(--warning);
    border-color: var(--warning);
}

.search-box button[value="2"]:hover {
    background: #e88200;
}

/* ===== HOT KEYWORDS ===== */
.hotkey-section {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    margin: 3px 0;
    box-shadow: var(--shadow-sm);
}

.hotkey-section h4 {
    font-size: .82rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 6px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag-item {
    display: inline-block;
    background: rgba(233, 69, 96, .08);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 3px 11px;
    font-size: .76rem;
    text-decoration: none;
    transition: all .15s ease;
}

.tag-item:hover {
    background: rgba(233, 69, 96, .2);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* ===== CONTENT SECTION ===== */
.content-block {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin: 3px 0;
    box-shadow: var(--shadow-sm);
}

.block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

.block-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 40px;
    height: 2px;
    background: var(--accent-color);
    border-radius: 1px;
}

.block-header h3 {
    font-size: 1.0rem;
    font-weight: 800;
    color: var(--text-primary);
}

.block-header h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.block-header h3 a:hover {
    color: var(--accent-color);
}

.block-header h4 {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* ===== POSTER GRID ===== */
.poster-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.poster-grid li {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--tertiary-bg);
    transition: box-shadow .2s ease, transform .2s ease;
}

.poster-grid li:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.poster-link {
    display: block;
    width: 100%;
    aspect-ratio: 600 / 350;
    overflow: hidden;
    background: var(--tertiary-bg);
}

.poster-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.poster-link:hover img {
    transform: scale(1.08);
}

.poster-text {
    padding: 6px 8px 8px;
}

.poster-text h5 {
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.poster-text h5 a {
    color: var(--text-primary);
}

.poster-text h5 a:hover {
    color: var(--accent-color);
}

/* ===== PAGINATION ===== */
.pagination-wrap {
    margin: 12px 0 4px;
    display: flex;
    justify-content: center;
}

.page-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 11px;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: .84rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all .15s ease;
}

.page-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
}

.page-btn-active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 11px;
    background: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-sm);
    font-size: .84rem;
    font-weight: 700;
    color: #ffffff;
    cursor: default;
}

/* ===== FOOTER ===== */
.footer-links {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 9px 12px;
    margin: 3px 0;
    box-shadow: var(--shadow-sm);
}

.footer-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.footer-header h4 {
    font-size: .85rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
}

.links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.links-list dd {
    display: inline;
}

.links-list a {
    display: inline-block;
    font-size: .76rem;
    color: var(--text-secondary);
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    background: var(--tertiary-bg);
    text-decoration: none;
    transition: all .15s ease;
}

.links-list a:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(233, 69, 96, .1);
}

.footer-bar {
    text-align: center;
    padding: 8px 0 12px;
    color: var(--text-tertiary);
    font-size: .75rem;
}

/* ===== DETAIL PAGES ===== */
.detail-title {
    line-height: 1.8;
    text-align: center;
    padding: 13px 15px;
    font-size: .98rem;
    margin: 3px 0;
    word-break: break-all;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

.detail-title a {
    color: var(--accent-color);
    font-weight: 700;
    margin-right: 6px;
}

.detail-info {
    font-size: .9rem;
    line-height: 1.95;
    padding: 15px 18px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin: 3px 0;
    color: var(--text-primary);
}

.preview-gallery {
    display: block;
    width: 100%;
    margin-top: 10px;
}

.preview-gallery picture,
.preview-gallery img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    display: block;
}

/* ===== DOWNLOAD SECTION ===== */
.download-section {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 11px 24px;
    background: linear-gradient(135deg, #c73555 0%, #e94560 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .91rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
}

.download-btn:hover {
    background: linear-gradient(135deg, #e94560 0%, #ff6b7a 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.client-info {
    text-align: center;
    padding: 7px;
    font-size: .83rem;
}

.client-info a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
}

.client-info a:hover {
    color: var(--accent-light);
}

/* ===== SHARE SECTION ===== */
.share-section {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 13px;
    margin: 3px 0;
    flex-wrap: wrap;
}

.share-label {
    font-size: .77rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.share-url {
    font-size: .79rem;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
    word-break: break-all;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
    flex-shrink: 0;
}

.share-btn:hover {
    background: var(--accent-light);
}

/* ===== VISIBILITY HELPERS ===== */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 900px) {
    .poster-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .site-name {
        font-size: 1.12rem;
    }

    .badge-value {
        font-size: .92rem;
    }

    /* Navigation adjustments for mobile */
    .nav-row {
        align-items: stretch;
    }

    .nav-label {
        width: 15%;
        min-width: 15%;
        max-width: 15%;
        font-size: 10px;
        padding: 4px 2px;
        letter-spacing: 0;
        line-height: 1.5;
        word-break: break-all;
        flex-shrink: 0;
    }

    .nav-group {
        width: 85%;
        flex: 1;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
        padding: 4px 5px;
        align-items: center;
    }

    .nav-group a {
        font-size: 13px;
        padding: 5px 2px;
        text-align: center;
    }

    /* Search box - ensure single row */
    .search-box form {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .search-box input[type="text"] {
        height: 36px;
        font-size: .8rem;
        padding: 0 8px;
    }

    .search-box button {
        height: 36px;
        padding: 0 8px;
        font-size: .73rem;
    }

    /* Poster grid for mobile */
    .poster-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }

    .poster-link {
        aspect-ratio: 600 / 350;
    }

    .poster-text h5 {
        font-size: .72rem;
    }

    .content-block {
        padding: 9px;
    }

    .download-btn {
        padding: 9px 14px;
        font-size: .85rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .nav-label {
        font-size: 10px;
    }

    .nav-group a {
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .nav-label {
        font-size: 10px;
    }

    .nav-group a {
        font-size: 12px;
    }

    .search-box button {
        padding: 0 6px;
        font-size: .68rem;
    }
}
