/* ===== Design Tokens ===== */
:root {
    --grape: #7B4FBF;
    --fuchsia: #C040A8;
    --violet: #5B3FA0;
    --gradient: linear-gradient(135deg, #C040A8 0%, #7B4FBF 50%, #5B3FA0 100%);
    --gradient-soft: linear-gradient(135deg, rgba(192,64,168,0.08) 0%, rgba(123,79,191,0.08) 100%);
    --blue-btn: #3E7FD8;
    --blue-btn-dark: #2C65B8;
    --white: #FFFFFF;
    --off-white: #F7F6FC;
    --surface: #FFFFFF;
    --border: #E4DFF0;
    --border-card: #EAE5F5;
    --text-dark: #1E1535;
    --text-body: #3D3556;
    --text-muted: #8A82A0;
    --text-nav: #2D2646;
    --radius: 8px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 4px rgba(91,63,160,0.06);
    --shadow-sm: 0 3px 12px rgba(91,63,160,0.10);
    --shadow-hover: 0 6px 20px rgba(91,63,160,0.16);
    --max-w: 1200px;
    --gap: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--off-white);
    color: var(--text-body);
    font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--grape); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== Layout ===== */
.pg-wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 16px;
}

.spacing-row { margin: 6px 0; }

/* ===== Site Header ===== */
.main-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 6px rgba(91,63,160,0.06);
}

.main-header .pg-wrap {
    display: flex;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 18px;
    flex-wrap: nowrap;
}

.header-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

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

.site-name-link:hover { text-decoration: none; }

.site-name-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: normal;
    text-decoration: none;
    border-bottom: none;
    line-height: 1;
    letter-spacing: -0.3px;
}

.domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-soft);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    padding: 5px 14px;
    white-space: nowrap;
}

.domain-hint {
    font-size: 0.71rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.03em;
}

.domain-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--grape);
}

/* ===== Banner ===== */
.banner-region {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    border-radius: 0;
}

.banner-region img { width: 100%; display: block; }

/* ===== Category Nav ===== */
.cat-nav-block {
    background: var(--white);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.zone-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
}

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

.zone-name-cell {
    background: var(--gradient);
    color: rgba(255,255,255,0.95);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5px;
    min-width: 15%;
    flex-shrink: 0;
    word-break: break-all;
    line-height: 1.3;
}

.zone-links-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 5px 8px;
    flex: 1;
    gap: 0;
    background: var(--white);
}

.zone-links-cell a {
    font-size: 12px;
    color: var(--text-nav);
    text-decoration: none;
    padding: 5px 6px;
    border-radius: var(--radius);
    transition: background 0.14s, color 0.14s;
    white-space: nowrap;
    flex: 0 0 25%;
    text-align: center;
}

.zone-links-cell a:hover {
    background: var(--gradient-soft);
    color: var(--grape);
    text-decoration: none;
}

.zone-links-cell a.active {
    background: var(--gradient);
    color: var(--white);
    font-weight: 700;
    border-radius: var(--radius);
}

/* ===== Search ===== */
.search-unit {
    background: var(--white);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-xs);
}

#main-search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

#main-search-form input[type="text"] {
    flex: 1;
    min-width: 150px;
    border: 1.5px solid var(--border-card);
    border-radius: var(--radius-xl);
    padding: 8px 16px;
    font-size: 14px;
    background: var(--off-white);
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#main-search-form input[type="text"]::placeholder { color: var(--text-muted); }

#main-search-form input[type="text"]:focus {
    border-color: var(--grape);
    box-shadow: 0 0 0 3px rgba(123,79,191,0.12);
    background: var(--white);
}

#main-search-form button {
    border: none;
    border-radius: var(--radius-xl);
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    background: var(--blue-btn);
    color: var(--white);
}

#main-search-form button:hover { background: var(--blue-btn-dark); }

/* ===== Hot Tags ===== */
.hot-panel {
    background: var(--white);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    box-shadow: var(--shadow-xs);
}

.hot-panel h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
}

.tag-cloud a {
    display: inline-block;
    background: var(--off-white);
    border: 1.5px solid var(--border-card);
    border-radius: var(--radius-xl);
    padding: 4px 13px;
    font-size: 13px;
    color: var(--text-body);
    text-decoration: none;
    transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.tag-cloud a:hover {
    background: var(--gradient);
    border-color: transparent;
    color: var(--white);
    text-decoration: none;
}

/* ===== Content Module ===== */
.module-card {
    background: var(--white);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-xs);
}

.module-title-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid transparent;
    border-image: var(--gradient) 1;
}

.module-title-row h3,
.module-title-row h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.2px;
}

.module-title-row h3 a,
.module-title-row h4 a {
    color: var(--text-dark);
    text-decoration: none;
}

.module-title-row h3 a:hover,
.module-title-row h4 a:hover {
    color: var(--grape);
    text-decoration: none;
}

.vol-counter {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ===== Film Grid ===== */
.film-matrix {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    list-style: none;
    padding: 0;
    margin: 0;
}

.film-matrix li {
    background: var(--off-white);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.film-matrix li:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--grape);
}

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

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

.film-matrix li:hover .poster-link img {
    transform: scale(1.05);
}

.film-text {
    padding: 7px 9px 9px;
    background: var(--white);
}

.film-text h5 {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-body);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.film-text h5 a {
    color: var(--text-body);
    text-decoration: none;
}

.film-text h5 a:hover {
    color: var(--grape);
    text-decoration: none;
}

/* ===== Detail Title ===== */
.entry-title-bar {
    background: var(--gradient);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    line-height: 1.8;
    text-align: center;
    font-size: 17px;
    word-break: break-all;
}

.entry-title-bar .cat-anchor {
    color: rgba(255,255,255,0.85);
    font-weight: 700;
    margin-right: 8px;
    text-decoration: none;
}

.entry-title-bar b { color: var(--white); }

/* ===== Detail Specs ===== */
.specs-panel {
    background: var(--white);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    font-size: 15px;
    line-height: 2;
    color: var(--text-body);
    box-shadow: var(--shadow-xs);
}

/* ===== Capture preview ===== */
.snap-frame { margin-top: 14px; }

.snap-frame picture img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
    border: 1px solid var(--border-card);
}

/* ===== Download Buttons ===== */
.download-toolbar {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 0;
}

.down-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: var(--radius-xl);
    padding: 10px 26px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 3px 10px rgba(123,79,191,0.25);
}

.down-btn:hover {
    opacity: 0.88;
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(123,79,191,0.32);
}

/* ===== Client hint ===== */
.client-tip {
    text-align: center;
    padding: 8px 0;
}

.client-tip a {
    color: var(--blue-btn);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.client-tip a:hover { text-decoration: underline; }

/* ===== Share bar ===== */
.link-share-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--off-white);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
}

.link-share-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.link-share-url {
    flex: 1;
    font-size: 13px;
    color: var(--text-body);
    word-break: break-all;
}

.link-copy-btn {
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: var(--radius-xl);
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.14s;
}

.link-copy-btn:hover { opacity: 0.85; }

/* ===== Pagination ===== */
.pgn-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 14px 0;
}

.pgn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-xl);
    background: var(--white);
    border: 1.5px solid var(--border-card);
    color: var(--text-body);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.pgn-btn:hover {
    background: var(--gradient);
    border-color: transparent;
    color: var(--white);
    text-decoration: none;
}

.pgn-active {
    background: var(--gradient);
    border-color: transparent;
    color: var(--white);
    font-weight: 800;
}

/* ===== Friend Links ===== */
.flinks-unit {
    background: var(--white);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    box-shadow: var(--shadow-xs);
}

.flinks-unit h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--grape);
    display: inline-block;
}

.flink-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.flink-items dl { display: contents; }
.flink-items dd { display: inline; margin: 0; }

.flink-items a {
    display: inline-block;
    font-size: 13px;
    color: var(--text-muted);
    padding: 3px 11px;
    border-radius: var(--radius-xl);
    border: 1.5px solid var(--border-card);
    background: var(--off-white);
    text-decoration: none;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.flink-items a:hover {
    color: var(--grape);
    border-color: var(--grape);
    background: var(--white);
    text-decoration: none;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--gradient);
    padding: 16px 0;
    margin-top: 8px;
}

.footer-copy {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
}

/* ===== Utility ===== */
.clearfix::after { content: ''; display: table; clear: both; }

/* ===== Responsive ===== */
@media (max-width: 768px) {

    .film-matrix {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }

    .zone-name-cell {
        font-size: 10px;
        min-width: 15%;
        padding: 0 3px;
    }

    .zone-links-cell { padding: 3px 4px; }

    .zone-links-cell a {
        font-size: 12px;
        padding: 4px 3px;
        flex: 0 0 25%;
    }

    .entry-title-bar { font-size: 15px; padding: 12px 14px; }

    #main-search-form input[type="text"] { min-width: 120px; }
    #main-search-form button { padding: 8px 11px; font-size: 12px; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .zone-links-cell a { font-size: 14px; }
    .zone-name-cell { font-size: 10px; }
}

@media (min-width: 769px) {
    .zone-name-cell {
        font-size: 13px;
        min-width: auto;
        padding: 0 18px;
    }
    .zone-links-cell { padding: 6px 12px; }
    .zone-links-cell a {
        font-size: 14px;
        flex: 1;
        padding: 6px 4px;
    }
}

@media (max-width: 768px) { .desktop-item { display: none !important; } }
@media (min-width: 769px) { .mobile-item { display: none !important; } }
