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

:root {
    --bg: #ffffff;
    --bg-soft: #f4f5f7;
    --bg-card: #ffffff;
    --bg-muted: #eceef2;
    --primary: #d4291a;
    --primary-dk: #b01f13;
    --primary-lt: #fdf1f0;
    --secondary: #1a1a2a;
    --secondary-mid: #2c2c42;
    --accent: #f0a500;
    --txt: #1a1a2a;
    --txt2: #52526e;
    --txt3: #a0a0b8;
    --border: #e8e8f0;
    --border2: #d8d8e8;
    --shadow-sm: 0 1px 3px rgba(26,26,42,.06);
    --shadow-md: 0 4px 14px rgba(26,26,42,.10);
    --shadow-lg: 0 8px 28px rgba(26,26,42,.14);
    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 10px;
}

html { font-size: 15px; }

body {
    background: var(--bg-soft);
    color: var(--txt);
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-dk); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
.cf::after { content: ''; display: table; clear: both; }

/* ===== PAGE WRAPPER ===== */
.site-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 14px;
}

/* ===== SITE HEADER ===== */
.top-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    box-shadow: var(--shadow-sm);
}

.top-header .site-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.brand-zone {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

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

.site-title-text {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
    font-style: normal;
    text-decoration: none;
    border-bottom: none;
}

.domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--secondary);
    border-radius: 20px;
    padding: 4px 13px;
}

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

.domain-badge .badge-domain {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

/* ===== BANNER ZONE ===== */
.banner-section {
    margin: 5px 0 3px;
}
.banner-section img { border-radius: var(--radius); width: 100%; }

/* ===== CATEGORY NAV ===== */
.category-nav {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 4px 0;
    box-shadow: var(--shadow-sm);
}

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

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

.zone-label {
    background: var(--secondary);
    color: rgba(255,255,255,.75);
    font-size: .66rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 2px;
    width: 64px;
    min-width: 64px;
    border-right: 1px solid rgba(255,255,255,.08);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

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

.nav-links-grid a {
    font-size: .81rem;
    color: var(--txt2);
    padding: 3px 4px;
    border-radius: var(--radius-sm);
    transition: all .15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid transparent;
    display: block;
}

.nav-links-grid a:hover {
    background: var(--primary-lt);
    color: var(--primary);
    border-color: rgba(212,41,26,.2);
}

.nav-links-grid a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 700;
}

/* ===== SEARCH ===== */
.search-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin: 4px 0;
    box-shadow: var(--shadow-sm);
}

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

.search-section input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    font-size: .87rem;
    color: var(--txt);
    background: var(--bg-soft);
    outline: none;
    transition: border-color .18s, background .18s;
}

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

.search-section button {
    height: 36px;
    padding: 0 11px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--secondary);
    color: #fff;
    font-size: .81rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease;
    flex-shrink: 0;
}

.search-section button:hover { background: var(--secondary-mid); }
.search-section button[value="1"] { background: var(--primary); }
.search-section button[value="1"]:hover { background: var(--primary-dk); }
.search-section button[value="2"] { background: var(--accent); color: #fff; }
.search-section button[value="2"]:hover { background: #c88a00; }

/* ===== HOT TAGS ===== */
.tag-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
    margin: 4px 0;
    box-shadow: var(--shadow-sm);
}

.tag-section h4 {
    font-size: .78rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 5px;
}

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

.tag-cloud .tc-item {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--txt2);
    border: 1px solid var(--border2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .75rem;
    text-decoration: none;
    transition: all .15s ease;
}

.tag-cloud .tc-item:hover {
    background: var(--primary-lt);
    color: var(--primary);
    border-color: rgba(212,41,26,.25);
}

/* ===== CONTENT BLOCK ===== */
.content-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 12px 10px;
    margin: 4px 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: 1.5px solid var(--bg-muted);
    position: relative;
}

.block-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1.5px;
    width: 36px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.block-header h3 {
    font-size: .96rem;
    font-weight: 800;
    color: var(--secondary);
}

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

.block-header h4 {
    font-size: .93rem;
    font-weight: 800;
    color: var(--secondary);
}

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

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

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

.media-cover {
    display: block;
    width: 100%;
    aspect-ratio: 600 / 350;
    overflow: hidden;
    background: var(--bg-muted);
}

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

.media-cover:hover img { transform: scale(1.04); }

.media-info {
    padding: 5px 7px 7px;
}

.media-info h5 {
    font-size: .77rem;
    font-weight: 500;
    color: var(--txt);
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.media-info h5 a { color: var(--txt); }
.media-info h5 a:hover { color: var(--primary); }

/* ===== PAGINATION ===== */
.page-nav {
    margin: 13px 0 5px;
    display: flex;
    justify-content: center;
}

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

.page-btns a.pn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    font-size: .83rem;
    color: var(--txt2);
    text-decoration: none;
    transition: all .15s ease;
}

.page-btns a.pn-btn:hover {
    background: var(--primary-lt);
    border-color: var(--primary);
    color: var(--primary);
}

.page-btns a.pn-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: .83rem;
    font-weight: 700;
    color: #fff;
    cursor: default;
}

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

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

.friend-links dd { display: inline; }

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

.friend-links a:hover { color: var(--primary); border-color: var(--primary); }

.copyright-bar {
    text-align: center;
    padding: 8px 0 14px;
    color: var(--txt3);
    font-size: .75rem;
}

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

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

.detail-info {
    font-size: .89rem;
    line-height: 2;
    padding: 14px 17px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin: 4px 0;
}

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

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

/* ===== ACTION BUTTONS ===== */
.action-btns {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 22px;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .89rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, transform .15s ease;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

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

.client-hint a { color: var(--secondary); font-weight: 600; }
.client-hint a:hover { color: var(--primary); }

/* ===== SHARE BAR ===== */
.share-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin: 4px 0;
    flex-wrap: wrap;
}

.share-bar .sh-label { font-size: .76rem; color: var(--txt3); white-space: nowrap; }
.share-bar .sh-url { font-size: .78rem; color: var(--txt2); flex: 1; min-width: 0; word-break: break-all; }

.share-bar .sh-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 13px;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .79rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
    flex-shrink: 0;
}

.share-bar .sh-btn:hover { background: var(--primary); }

/* ===== VISIBILITY ===== */
.pc-only { display: block; }
.mb-only { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .media-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
    .pc-only { display: none; }
    .mb-only { display: block; }
}

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

    .site-title-text { font-size: 1.05rem; }
    .domain-badge .badge-domain { font-size: .87rem; }

    .nav-row { align-items: stretch; }

    .zone-label {
        width: 15%;
        min-width: 15%;
        max-width: 15%;
        font-size: 10px;
        padding: 4px 1px;
        letter-spacing: 0;
        line-height: 1.4;
        word-break: break-all;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

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

    .nav-links-grid a {
        font-size: 12px;
        padding: 5px 2px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    /* Search bar: no wrap */
    .search-section form {
        flex-wrap: nowrap;
        gap: 3px;
    }

    .search-section input[type="text"] {
        height: 34px;
        font-size: .78rem;
        padding: 0 7px;
    }

    .search-section button {
        height: 34px;
        padding: 0 6px;
        font-size: .73rem;
    }

    /* Media grid: 2 columns */
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .media-cover { aspect-ratio: 600 / 350; }
    .media-info h5 { font-size: .71rem; }
    .content-block { padding: 8px 8px 6px; }
    .action-btn { padding: 9px 13px; font-size: .83rem; }
}

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

@media (max-width: 380px) {
    .zone-label { font-size: 10px; }
    .nav-links-grid a { font-size: 12px; }
    .search-section button { padding: 0 5px; font-size: .67rem; }
}
