:root {
    --silk-light: #E8DDB8;
    --silk-mid: #DED19B;
    --silk-dark: #C9B77A;
    --brocade-border: #5C3A1E;
    --gold-line: #D4A843;
    --paper-bg: #F5ECD7;
    --paper-dark: #EDE0C8;
    --ink-black: #2C2418;
    --cinnabar: #C23B22;
    --ivory-light: #FFF8E7;
    --ivory-dark: #E8D5A3;
    --silk-thread: rgba(100, 70, 30, 0.08);
    --silk-thread-h: rgba(100, 70, 30, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', '华文楷书', 'KaiTi', 'STKaiti', serif;
    background:
        repeating-linear-gradient(
            transparent 0px, transparent 1px,
            var(--silk-thread) 1px, var(--silk-thread) 2px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px, transparent 1px,
            var(--silk-thread-h) 1px, var(--silk-thread-h) 2px
        ),
        linear-gradient(145deg,
            var(--silk-light) 0%,
            var(--silk-mid) 35%,
            var(--silk-dark) 70%,
            #C9B77A 100%
        );
    background-attachment: fixed;
    color: var(--ink-black);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    animation: silkAging 60s ease infinite;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80px 60px at 20% 30%, rgba(100, 70, 30, 0.06), transparent),
        radial-gradient(ellipse 60px 80px at 70% 60%, rgba(100, 70, 30, 0.04), transparent),
        radial-gradient(ellipse 100px 70px at 50% 80%, rgba(100, 70, 30, 0.05), transparent);
    z-index: 0;
}

@keyframes silkAging {
    0% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(0.5deg); }
    100% { filter: hue-rotate(0deg); }
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
    position: relative;
    z-index: 1;
}

@media (min-width: 768px) {
    .main-container {
        padding: 20px;
    }
}

@media (min-width: 1024px) {
    .main-container {
        padding: 30px;
    }
}

.hero-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    min-height: 240px;
    position: relative;
    gap: 16px;
}

.hero-nav-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--brocade-border);
    background: linear-gradient(135deg, var(--paper-bg), var(--paper-dark));
    color: var(--ink-black);
    font-size: 18px;
    font-family: 'Noto Serif SC', '华文楷书', 'KaiTi', serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 20;
}

.hero-nav-btn::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid var(--gold-line);
    opacity: 0.5;
    pointer-events: none;
}

.hero-nav-btn:hover {
    background: linear-gradient(135deg, var(--paper-dark), var(--silk-dark));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.hero-nav-btn:active {
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: scale(0.95);
}

.hero-nav-btn.prev-btn {
    border-radius: 4px 0 0 4px;
}

.hero-nav-btn.next-btn {
    border-radius: 0 4px 4px 0;
}

@media (min-width: 768px) {
    .hero-nav-btn {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
}

@media (max-width: 400px) {
    .hero-nav-btn {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}

.brocade-stack {
    position: relative;
    width: 160px;
    height: 210px;
    cursor: pointer;
}

@media (min-width: 768px) {
    .brocade-stack {
        width: 180px;
        height: 230px;
    }
}

@media (min-width: 1024px) {
    .brocade-stack {
        width: 200px;
        height: 250px;
    }
}

.brocade-card {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid var(--brocade-border);
    background: var(--paper-bg);
    box-shadow:
        inset 0 0 0 1px var(--gold-line),
        0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.4s ease, opacity 0.4s ease, width 0.4s ease-in-out;
    display: flex;
}

.brocade-card .card-left {
    width: 33%;
    background: var(--paper-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    position: relative;
    border-right: 1px solid rgba(139, 105, 20, 0.2);
}

.brocade-card .card-left .card-number {
    font-size: 18px;
    color: var(--cinnabar);
    font-weight: 400;
    writing-mode: vertical-rl;
    letter-spacing: 4px;
    margin-bottom: 6px;
}

.brocade-card .card-left .card-title {
    font-size: 12px;
    color: var(--ink-black);
    writing-mode: vertical-rl;
    letter-spacing: 2px;
    font-weight: 400;
    max-height: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .brocade-card .card-left .card-number {
        font-size: 20px;
    }
    .brocade-card .card-left .card-title {
        font-size: 13px;
        max-height: 140px;
    }
}

.brocade-card .card-right {
    width: 67%;
    position: relative;
    overflow: hidden;
}

.brocade-card .card-right img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.6) saturate(0.4) contrast(1.1) blur(0.3px);
}

.brocade-card .card-right::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px, transparent 2px,
            rgba(200, 180, 140, 0.1) 2px, rgba(200, 180, 140, 0.1) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px, transparent 2px,
            rgba(200, 180, 140, 0.08) 2px, rgba(200, 180, 140, 0.08) 3px
        );
    pointer-events: none;
}

.brocade-card .card-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 20px rgba(92, 58, 30, 0.15);
    pointer-events: none;
    z-index: 1;
}

.ivory-tag {
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 44px;
    background: linear-gradient(135deg, var(--ivory-light), var(--ivory-dark));
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ivory-tag::after {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--cinnabar);
    border-radius: 50%;
}

.jade-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 2px solid var(--cinnabar);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cinnabar);
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    background: rgba(245, 236, 215, 0.9);
}

.jade-stamp.stamping {
    animation: stampDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes stampDown {
    0% {
        transform: translate(-50%, -50%) scale(2) rotate(-15deg);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, -50%) scale(0.9) rotate(2deg);
        opacity: 1;
    }
    80% {
        transform: translate(-50%, -50%) scale(1.05) rotate(-1deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes stampFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.brocade-card.rolling-up {
    animation: scrollUp 0.4s ease-in-out forwards;
}

.brocade-card.unrolling {
    animation: scrollDown 0.4s ease-in-out forwards;
}

@keyframes scrollUp {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-100%) translateY(0);
        opacity: 0;
    }
}

@keyframes scrollDown {
    0% {
        transform: translateX(100%) translateY(0);
        opacity: 0;
    }
    100% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

.hero-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brocade-border);
    opacity: 0.3;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-dot.active {
    opacity: 1;
    background: var(--cinnabar);
    box-shadow: 0 0 6px rgba(194, 59, 34, 0.4);
}

.folio-section {
    margin-top: 30px;
}

.folio-section-title {
    font-family: 'Noto Serif SC', '华文楷书', 'KaiTi', serif;
    font-weight: 400;
    font-size: 20px;
    color: var(--ink-black);
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
}

.folio-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
}

.folio-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 768px) {
    .folio-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

.folio-card {
    background: linear-gradient(180deg, var(--paper-bg), var(--paper-dark));
    border: 1px solid var(--silk-dark);
    border-left: 3px solid var(--brocade-border);
    padding: 16px 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 80px;
}

.folio-card::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: rgba(139, 105, 20, 0.15);
    pointer-events: none;
}

.folio-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.folio-card:active {
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
}

.folio-card.expanded {
    max-height: 300px;
    animation: folioExpand 0.5s ease-out forwards;
}

@keyframes folioExpand {
    0% {
        max-height: 80px;
    }
    100% {
        max-height: 300px;
    }
}

.folio-card .folio-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.folio-card .folio-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    filter: sepia(0.4) saturate(0.6) contrast(1.05);
    border: 1px solid rgba(139, 105, 20, 0.3);
    flex-shrink: 0;
}

.folio-card .folio-info {
    flex: 1;
    min-width: 0;
}

.folio-card .folio-title {
    font-family: 'Noto Serif SC', '华文楷书', 'KaiTi', serif;
    font-weight: 400;
    font-size: 15px;
    color: var(--ink-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folio-card .folio-tag {
    display: inline-block;
    border: 1px dashed var(--gold-line);
    padding: 1px 6px;
    background: rgba(194, 59, 34, 0.08);
    color: var(--cinnabar);
    font-size: 10px;
    margin-top: 4px;
}

.folio-card .folio-desc {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(44, 36, 24, 0.7);
    line-height: 1.6;
    display: none;
}

.folio-card.expanded .folio-desc {
    display: block;
}

.folio-card .folio-play-link {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 16px;
    background: var(--brocade-border);
    color: var(--paper-bg);
    text-decoration: none;
    font-size: 12px;
    border-radius: 2px;
    transition: background 0.3s ease;
    display: none;
}

.folio-card.expanded .folio-play-link {
    display: inline-block;
}

.folio-card .folio-play-link:hover {
    background: var(--cinnabar);
}

.site-footer {
    background: linear-gradient(180deg, var(--silk-dark), #8B6914);
    color: var(--paper-bg);
    padding: 40px 20px;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-patterns {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.window-pattern {
    width: 50px;
    height: 50px;
    border: 2px solid var(--gold-line);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: candlePulse 3s ease-in-out infinite;
}

.window-pattern.square {
    border-radius: 2px;
}

.window-pattern.diamond {
    transform: rotate(45deg);
    border-radius: 2px;
    width: 40px;
    height: 40px;
}

.window-pattern.begonia {
    border-radius: 50% 0 50% 0;
}

.window-pattern .candle-glow {
    width: 8px;
    height: 8px;
    background: var(--gold-line);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(212, 168, 67, 0.6);
}

.window-pattern.diamond .candle-glow {
    transform: rotate(-45deg);
}

.silk-knot {
    width: 30px;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold-line) 0px,
        var(--gold-line) 4px,
        transparent 4px,
        transparent 8px
    );
    position: relative;
}

.silk-knot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border: 1px solid var(--gold-line);
    border-radius: 50%;
}

@keyframes candlePulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(212, 168, 67, 0.6), 0 0 40px rgba(212, 168, 67, 0.2);
    }
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--paper-bg);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    position: relative;
    padding: 6px 12px;
}

.footer-link:hover {
    color: var(--gold-line);
}

.footer-link:active {
    color: var(--cinnabar);
}

.footer-link:active::after {
    content: '鉴藏';
    position: absolute;
    bottom: -4px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: rgba(194, 59, 34, 0.7);
    color: white;
    font-size: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    animation: stampFade 1.5s ease-out forwards;
    z-index: 10;
}

@keyframes stampFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.footer-copyright {
    padding-top: 16px;
    border-top: 1px solid rgba(212, 168, 67, 0.2);
}

.footer-copyright p {
    color: rgba(245, 236, 215, 0.5);
    font-size: 12px;
}

.ad-container {
    text-align: center;
    padding: 8px 0;
}

.ad-container > div {
    text-align: center;
    color: var(--ink-black);
    font-size: 12px;
}

.hero-hint {
    text-align: center;
    font-size: 12px;
    color: rgba(44, 36, 24, 0.5);
    margin-top: 8px;
    font-style: italic;
}

.brocade-card .card-aging {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background:
        linear-gradient(to right, rgba(92, 58, 30, 0.08) 0%, transparent 3%),
        linear-gradient(to left, rgba(92, 58, 30, 0.08) 0%, transparent 3%),
        linear-gradient(to bottom, rgba(92, 58, 30, 0.06) 0%, transparent 5%),
        linear-gradient(to top, rgba(92, 58, 30, 0.1) 0%, transparent 5%);
}

.brocade-card .card-inner-border {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid var(--gold-line);
    pointer-events: none;
    z-index: 3;
    opacity: 0.5;
}

@media (max-width: 400px) {
    .brocade-stack {
        width: 140px;
        height: 190px;
    }
    .brocade-card .card-left .card-number {
        font-size: 16px;
    }
    .brocade-card .card-left .card-title {
        font-size: 11px;
    }
}
