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

:root {
    --primary-green: #2d5016;
    --secondary-green: #3a6b1f;
    --accent-gold: #d4a574;
    --accent-yellow: #e8c547;
    --text-primary: #ffffff;
    --text-dark: #2d2d2d;
    --text-light: #888888;
    --bg-light: #f8f8f8;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,.15);
    --radius: 8px;
    --radius-sm: 4px;
}

html {
    font-size: 15px;
}

body {
    background: #ffffff;
    color: var(--text-dark);
    font-family: 'Segoe UI','Helvetica Neue','PingFang SC','Hiragino Sans GB','Microsoft YaHei',Arial,sans-serif;
    line-height: 1.6;
}

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

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

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

ul {
    list-style: none;
}

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

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

/* ===== TOP NAVIGATION ===== */
.top-nav-bar {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    padding: 11px 0;
    box-shadow: var(--shadow-md);
}

.top-nav-bar .wrapper-main {
    display: flex;
    align-items: center;
}

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

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

.site-title {
    font-size: 1.52rem;
    font-weight: 900;
    color: var(--accent-gold);
    letter-spacing: -.3px;
    display: block;
}

.domain-info {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: rgba(255,255,255,.12);
    border-radius: 22px;
    padding: 6px 16px;
}

.info-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,.65);
    white-space: nowrap;
}

.info-content {
    font-size: 1.08rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

/* ===== BANNER ===== */
.banner-area {
    margin: 2px 0;
}

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

/* ===== CATEGORY NAVIGATION ===== */
.category-nav {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 2px 0;
    box-shadow: var(--shadow);
}

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

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

.category-label {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: var(--accent-gold);
    font-size: .7rem;
    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-color);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

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

.links-zone a {
    font-size: .84rem;
    color: var(--text-dark);
    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;
}

.links-zone a:hover {
    background: rgba(212, 165, 116, .12);
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

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

/* ===== SEARCH ===== */
.search-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 9px 12px;
    margin: 2px 0;
    box-shadow: var(--shadow);
}

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

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

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

.search-container input[type="text"]:focus {
    border-color: var(--accent-gold);
    background: #ffffff;
}

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

.search-container button:hover {
    background: var(--secondary-green);
}

.search-container button[value="1"] {
    background: var(--accent-gold);
    color: var(--text-dark);
}

.search-container button[value="1"]:hover {
    background: var(--accent-yellow);
}

.search-container button[value="2"] {
    background: var(--secondary-green);
}

.search-container button[value="2"]:hover {
    background: var(--primary-green);
}

/* ===== HOT KEYWORDS ===== */
.hotkey-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin: 2px 0;
    box-shadow: var(--shadow);
}

.hotkey-box h4 {
    font-size: .84rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 6px;
}

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

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

.keyword-tag:hover {
    background: rgba(212, 165, 116, .2);
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

/* ===== CONTENT SECTION ===== */
.media-block {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px;
    margin: 2px 0;
    box-shadow: var(--shadow);
}

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

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

.block-title h3 {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-dark);
}

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

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

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

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

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

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

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

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

.media-info {
    padding: 6px 8px 8px;
}

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

.media-info h5 a {
    color: var(--text-dark);
}

.media-info h5 a:hover {
    color: var(--accent-gold);
}

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

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

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

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

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

/* ===== FOOTER ===== */
.footer-links-area {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 9px 12px;
    margin: 2px 0;
    box-shadow: var(--shadow);
}

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

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

.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(--text-light);
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    text-decoration: none;
    transition: all .15s ease;
}

.friend-links a:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background: rgba(212, 165, 116, .05);
}

.copyright-section {
    text-align: center;
    padding: 8px 0 12px;
    color: var(--text-light);
    font-size: .75rem;
}

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

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

.detail-content {
    font-size: .9rem;
    line-height: 1.95;
    padding: 15px 18px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    margin: 2px 0;
    color: var(--text-dark);
}

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

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

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

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 11px 24px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 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;
}

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

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

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

.client-tip a:hover {
    color: var(--accent-yellow);
}

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

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

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

.share-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--accent-gold);
    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-copy-btn:hover {
    background: var(--accent-yellow);
}

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

.on-mobile {
    display: none;
}

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

    .on-desktop {
        display: none;
    }

    .on-mobile {
        display: block;
    }
}

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

    .site-title {
        font-size: 1.16rem;
    }

    .info-content {
        font-size: .96rem;
    }

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

    .category-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;
    }

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

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

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

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

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

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

    .media-cover {
        aspect-ratio: 600 / 350;
    }

    .media-info h5 {
        font-size: .72rem;
    }

    .media-block {
        padding: 9px;
    }

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

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

    .links-zone a {
        font-size: 13px;
    }
}

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

    .links-zone a {
        font-size: 12px;
    }

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