/*
 * z0009 - Forest Nature Theme (森林自然)
 * Forest Green: #2D5F2D
 * Warm Brown: #8B6914
 * Tan: #D2B48C
 * Parchment: #FAF3E0
 * Bark: #5C4033
 * Moss: #4A7C59
 * Style: Organic shapes, earthy warmth, wooden frames, leaf motifs, wavy dividers
 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Georgia", "Noto Serif SC", "PingFang SC", "Microsoft YaHei", serif;
    font-size: 14px;
    color: #3B2F20;
    background: #FAF3E0;
    line-height: 1.7;
    /* Subtle paper texture via CSS gradient */
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 50px, rgba(139,105,20,.02) 50px, rgba(139,105,20,.02) 51px),
        repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(139,105,20,.02) 50px, rgba(139,105,20,.02) 51px);
}
a { color: #2D5F2D; text-decoration: none; transition: color .2s; }
a:hover { color: #8B6914; }
img { max-width: 100%; display: block; }

/* ===== Header ===== */
header {
    background: linear-gradient(135deg, #2D5F2D 0%, #4A7C59 40%, #2D5F2D 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(45,95,45,.3);
}
/* Vine border at bottom of header */
header::after {
    content: "";
    display: block;
    height: 6px;
    background: repeating-linear-gradient(90deg,
        #D2B48C 0px, #D2B48C 8px,
        #8B6914 8px, #8B6914 12px,
        #D2B48C 12px, #D2B48C 20px,
        #4A7C59 20px, #4A7C59 24px
    );
}
.hd-wrap {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 16px;
    gap: 14px;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: #FAF3E0;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.logo:hover { color: #D2B48C; }
.logo-leaf { font-size: 22px; margin-right: 4px; }
header nav[aria-label="主导航"] {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow: hidden;
    flex-wrap: nowrap;
}
header nav[aria-label="主导航"] a {
    padding: 6px 16px;
    font-size: 13px;
    color: rgba(250,243,224,.8);
    border-radius: 20px;
    white-space: nowrap;
    transition: all .25s;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
header nav[aria-label="主导航"] a:hover {
    color: #FAF3E0;
    background: rgba(255,255,255,.15);
}
header nav[aria-label="主导航"] a.active {
    color: #2D5F2D;
    background: #D2B48C;
    font-weight: 600;
}
header nav[aria-label="主导航"] a.sub { font-size: 12px; opacity: .65; }
header nav[aria-label="主导航"] a.sub:hover { opacity: 1; }
header nav[aria-label="主导航"] a.sub.active { opacity: 1; background: #C4A06C; }
.hd-search { display: flex; flex-shrink: 0; }
.hd-search input {
    width: 180px;
    height: 34px;
    border: 2px solid rgba(210,180,140,.4);
    border-right: none;
    border-radius: 17px 0 0 17px;
    padding: 0 14px;
    font-size: 13px;
    outline: none;
    background: rgba(250,243,224,.9);
    color: #3B2F20;
    font-family: inherit;
}
.hd-search input:focus {
    background: #fff;
    border-color: #D2B48C;
    box-shadow: 0 0 0 3px rgba(210,180,140,.3);
}
.hd-search button {
    height: 34px;
    padding: 0 18px;
    background: #8B6914;
    color: #FAF3E0;
    border: 2px solid #8B6914;
    border-radius: 0 17px 17px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .2s;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.hd-search button:hover { background: #6B5210; border-color: #6B5210; }
.m-btns { display: none; gap: 8px; flex-shrink: 0; margin-left: auto; }
.m-btns button { background: none; border: none; cursor: pointer; color: #FAF3E0; padding: 4px; }

/* ===== Search Panel (Mobile) ===== */
.search-panel {
    display: none;
    padding: 12px 16px;
    background: linear-gradient(135deg, #3A7A3A, #2D5F2D);
}
.search-panel.show { display: flex; gap: 10px; }
.search-panel input {
    flex: 1;
    height: 38px;
    border: 2px solid rgba(210,180,140,.3);
    border-radius: 19px;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
    background: rgba(250,243,224,.92);
    color: #3B2F20;
    font-family: inherit;
}
.search-panel button {
    height: 38px;
    padding: 0 20px;
    background: #8B6914;
    color: #FAF3E0;
    border: none;
    border-radius: 19px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ===== Mobile Nav ===== */
.m-nav {
    display: none;
    background: linear-gradient(180deg, #3A7A3A, #2D5F2D);
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.m-nav.show { display: flex; }
.m-nav a {
    padding: 6px 16px;
    font-size: 13px;
    color: #FAF3E0;
    border-radius: 20px;
    background: rgba(255,255,255,.12);
    transition: all .2s;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.m-nav a:hover { background: #D2B48C; color: #2D5F2D; }
.m-nav a.sub { font-size: 12px; opacity: .65; }

/* ===== Main Content ===== */
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
main > h1 {
    font-size: 20px;
    font-weight: 700;
    color: #2D5F2D;
    padding: 10px 0 8px;
    margin-bottom: 16px;
    border-bottom: 3px solid #D2B48C;
    font-family: "Georgia", "Noto Serif SC", serif;
}

/* ===== Wavy Section Divider ===== */
.wave-divider {
    height: 24px;
    background: transparent;
    position: relative;
    margin: 8px 0;
}
.wave-divider::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24'%3E%3Cpath d='M0 12 Q150 0 300 12 T600 12 T900 12 T1200 12 V24 H0Z' fill='%232D5F2D' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 1200px 24px;
    background-repeat: repeat-x;
}

/* ===== Section Headers ===== */
.sec-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 16px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2D5F2D 0%, #4A7C59 60%, #3A7A3A 100%);
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(45,95,45,.15);
    position: relative;
    overflow: hidden;
}
/* Leaf pattern overlay on section headers */
.sec-hd::before {
    content: "";
    position: absolute;
    right: -10px;
    top: -10px;
    width: 80px;
    height: 80px;
    background: radial-gradient(ellipse at center, rgba(210,180,140,.15) 0%, transparent 70%);
    border-radius: 50%;
}
.sec-title {
    font-size: 16px;
    font-weight: 700;
    color: #FAF3E0;
    margin: 0;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,.15);
    font-family: "Georgia", "Noto Serif SC", serif;
}
.sec-hd .more {
    font-size: 12px;
    color: #D2B48C;
    font-weight: 600;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.sec-hd .more:hover { color: #FAF3E0; }

/* ===== Video Grid (5-column) ===== */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
a.item {
    display: block;
    background: #FFFDF7;
    border-radius: 16px;
    overflow: hidden;
    transition: transform .3s, box-shadow .3s;
    /* Wooden frame / polaroid feel */
    border: 3px solid #E8DCC8;
    box-shadow: 0 2px 8px rgba(92,64,51,.08), 0 1px 3px rgba(92,64,51,.05);
    padding: 6px 6px 0 6px;
}
a.item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(45,95,45,.15), 0 4px 10px rgba(139,105,20,.1);
    border-color: #D2B48C;
}
a.item .cover {
    display: block;
    position: relative;
    padding-bottom: 140%;
    overflow: hidden;
    background: linear-gradient(145deg, #E8DCC8, #D2C8A8);
    border-radius: 12px;
}
a.item .cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: transform .4s;
}
a.item:hover .cover img { transform: scale(1.04); }
a.item .cover .mark {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: linear-gradient(135deg, #8B6914, #A07A1A);
    color: #FAF3E0;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(139,105,20,.3);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a.item .cover .score-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    background: rgba(45,95,45,.85);
    color: #FAF3E0;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    font-family: -apple-system, sans-serif;
}
a.item .title {
    display: block;
    padding: 10px 6px;
    font-size: 13px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #3B2F20;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    text-align: center;
}
a.item:hover .title { color: #2D5F2D; }

/* ===== Category Tabs ===== */
.cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    padding: 14px 0;
}
.cat-tabs a {
    padding: 7px 20px;
    font-size: 13px;
    border-radius: 24px;
    background: #FFFDF7;
    color: #5C4033;
    border: 2px solid #E8DCC8;
    transition: all .25s;
    font-weight: 500;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.cat-tabs a:hover {
    background: #4A7C59;
    color: #FAF3E0;
    border-color: #4A7C59;
}
.cat-tabs a.active {
    background: #2D5F2D;
    color: #FAF3E0;
    border-color: #2D5F2D;
    box-shadow: 0 3px 10px rgba(45,95,45,.2);
}

/* ===== Breadcrumb ===== */
nav.breadcrumb {
    font-size: 13px;
    color: #8B7355;
    padding: 12px 0;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
nav.breadcrumb a { color: #2D5F2D; font-weight: 500; }
nav.breadcrumb a:hover { color: #8B6914; }

/* ===== Detail Card (Wooden Frame Style) ===== */
.detail-card {
    display: flex;
    gap: 24px;
    background: #FFFDF7;
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 20px;
    border: 3px solid #E8DCC8;
    box-shadow: 0 4px 16px rgba(92,64,51,.08), 0 2px 4px rgba(92,64,51,.04);
    /* Inner shadow to simulate depth */
    position: relative;
}
.detail-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20px;
    box-shadow: inset 0 2px 8px rgba(139,105,20,.06);
    pointer-events: none;
}
.detail-cover { width: 220px; flex-shrink: 0; }
.detail-cover img {
    width: 100%;
    border-radius: 14px;
    border: 3px solid #E8DCC8;
    box-shadow: 0 4px 12px rgba(92,64,51,.12);
}
.detail-info { flex: 1; min-width: 0; }
.detail-info h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #2D5F2D;
    line-height: 1.4;
    border: none;
    padding: 0;
    font-family: "Georgia", "Noto Serif SC", serif;
}
.score {
    display: inline-block;
    background: linear-gradient(135deg, #8B6914, #A07A1A);
    color: #FAF3E0;
    font-size: 15px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(139,105,20,.25);
    font-family: -apple-system, sans-serif;
}
.meta { margin-bottom: 12px; }
.meta p {
    font-size: 13px;
    color: #6B5C4A;
    margin-bottom: 5px;
    line-height: 1.7;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.meta strong { color: #2D5F2D; font-weight: 600; }
.play-action { margin-top: 16px; }
.btn-play {
    display: inline-block;
    padding: 10px 34px;
    background: linear-gradient(135deg, #2D5F2D, #4A7C59);
    color: #FAF3E0;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 700;
    transition: all .25s;
    box-shadow: 0 4px 14px rgba(45,95,45,.25);
    letter-spacing: 1px;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.btn-play:hover {
    background: linear-gradient(135deg, #1A4A1A, #2D5F2D);
    color: #fff;
    box-shadow: 0 6px 20px rgba(45,95,45,.35);
    transform: translateY(-2px);
}
.btn-play.disabled {
    background: #C4B89C;
    cursor: not-allowed;
    color: #fff;
    box-shadow: none;
}
.btn-play.disabled:hover { transform: none; }

/* ===== Vod / Episode ===== */
.vod-group { margin-bottom: 14px; }
.vod-name {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: #2D5F2D;
    margin-bottom: 8px;
    padding-left: 2px;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.ep-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-btn {
    display: inline-block;
    padding: 5px 16px;
    font-size: 12px;
    background: #FFFDF7;
    border: 2px solid #E8DCC8;
    color: #5C4033;
    border-radius: 18px;
    transition: all .25s;
    font-weight: 500;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.ep-btn:hover {
    border-color: #4A7C59;
    color: #2D5F2D;
    background: rgba(74,124,89,.06);
}
.ep-btn.active {
    background: linear-gradient(135deg, #2D5F2D, #4A7C59);
    color: #FAF3E0;
    border-color: #2D5F2D;
    box-shadow: 0 2px 8px rgba(45,95,45,.2);
}

/* ===== Description ===== */
.desc {
    font-size: 14px;
    line-height: 2;
    color: #6B5C4A;
    padding: 14px 20px;
    background: #FFFDF7;
    border-radius: 16px;
    border: 2px solid #E8DCC8;
    margin-top: 8px;
}

/* ===== Player ===== */
.player-box { margin-bottom: 20px; }
.player-wrap {
    position: relative;
    background: #1A1A1A;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16/9;
    border: 4px solid #5C4033;
    box-shadow: 0 6px 24px rgba(92,64,51,.2);
}
.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1A1A1A;
    color: #D2B48C;
    font-size: 14px;
    z-index: 5;
    gap: 10px;
}
.player-loading.hide { display: none; }
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #5C4033;
    border-top-color: #4A7C59;
    border-right-color: #D2B48C;
    border-radius: 50%;
    animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.video-player { width: 100%; height: 100%; }
.video-player iframe { width: 100%; height: 100%; border: none; }

/* ===== Paging ===== */
.paging { padding: 20px 0; text-align: center; }
.paging ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}
.paging a, .paging span {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    background: #FFFDF7;
    border: 2px solid #E8DCC8;
    color: #5C4033;
    border-radius: 18px;
    transition: all .2s;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.paging a:hover { border-color: #4A7C59; color: #2D5F2D; }
.paging .active a, .paging span.current, .paging a.current {
    background: linear-gradient(135deg, #2D5F2D, #4A7C59);
    color: #FAF3E0;
    border-color: #2D5F2D;
    box-shadow: 0 2px 8px rgba(45,95,45,.2);
}
.paging .disabled a { color: #C4B89C; cursor: default; border-color: #E8DCC8; }

/* ===== Search Empty State ===== */
.empty {
    text-align: center;
    padding: 50px 20px;
    font-size: 16px;
    color: #8B7355;
    font-family: "Georgia", "Noto Serif SC", serif;
}

/* ===== Footer ===== */
footer {
    background: linear-gradient(135deg, #2D5F2D 0%, #3A5A2D 50%, #2D5F2D 100%);
    margin-top: 30px;
    position: relative;
}
/* Organic top border for footer */
footer::before {
    content: "";
    display: block;
    height: 6px;
    background: repeating-linear-gradient(90deg,
        #D2B48C 0px, #D2B48C 8px,
        #8B6914 8px, #8B6914 12px,
        #D2B48C 12px, #D2B48C 20px,
        #4A7C59 20px, #4A7C59 24px
    );
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    text-align: center;
}
.footer-links { margin-bottom: 10px; }
.footer-links a {
    color: rgba(250,243,224,.65);
    margin: 0 10px;
    font-size: 13px;
    transition: color .2s;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.footer-links a:hover { color: #D2B48C; }
.footer-inner p {
    font-size: 12px;
    color: rgba(250,243,224,.4);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
    header nav[aria-label="主导航"] a.sub { display: none; }
}

@media (max-width: 768px) {
    .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    header nav[aria-label="主导航"] { display: none; }
    .hd-search { display: none; }
    .m-btns { display: flex; }
    .detail-card { flex-direction: column; padding: 16px; }
    .detail-cover { width: 180px; margin: 0 auto; }
    .hd-wrap { height: 48px; }
    .sec-hd { padding: 8px 16px; margin: 20px 0 12px; }
    a.item { padding: 4px 4px 0 4px; }
    .desc { padding: 12px 14px; }
}

@media (max-width: 480px) {
    .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    main { padding: 12px 10px; }
    .detail-card { padding: 12px; gap: 14px; }
    .detail-cover { width: 140px; }
    .detail-info h1 { font-size: 18px; }
    .sec-hd { padding: 7px 12px; border-radius: 12px; }
    .sec-title { font-size: 14px; }
    .ep-btn { padding: 4px 12px; font-size: 11px; }
    a.item { border-radius: 12px; border-width: 2px; padding: 4px 4px 0 4px; }
    a.item .cover { border-radius: 8px; }
    a.item .cover img { border-radius: 8px; }
    a.item .title { padding: 8px 4px; font-size: 12px; }
    .cat-tabs a { padding: 5px 14px; font-size: 12px; }
    .player-wrap { border-radius: 12px; border-width: 3px; }
    .desc { border-radius: 12px; font-size: 13px; }
}
