:root {
    --bg-paper: #f4ecd8;
    --text-ink: #2b2b2b;
    --text-light: #6a6053;
    --china-red: #A72126;
    --gold: #b38b4d;
    --transition-speed: 0.8s;
}

body, html {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
    background-color: var(--bg-paper);
    color: var(--text-ink);
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(179, 139, 77, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(167, 33, 38, 0.05) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E"); 
}

.disclaimer {
    position: fixed;
    bottom: 110px;
    right: 40px;
    font-size: 0.75rem;
    color: rgba(43, 43, 43, 0.4);
    z-index: 85;
    text-align: right;
    line-height: 1.5;
    pointer-events: none;
    max-width: 320px;
}

.bottom-poetry {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    color: var(--text-light);
    letter-spacing: 8px;
    font-family: 'STKaiti', 'STSong', serif;
    opacity: 0.5;
    white-space: nowrap;
    z-index: 15;
}

/* 四周窗棂画框 */
.page-border {
    position: fixed; top: 20px; left: 20px; right: 20px; bottom: 20px;
    border: 1px solid rgba(167, 33, 38, 0.4);
    pointer-events: none; z-index: 90;
}
.page-border::before, .page-border::after {
    content: ''; position: absolute; width: 40px; height: 40px;
    border: 2px solid var(--china-red);
}
.page-border::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.page-border::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.page-border-inner::before, .page-border-inner::after {
    content: ''; position: absolute; width: 40px; height: 40px;
    border: 2px solid var(--china-red);
}
.page-border-inner::before { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.page-border-inner::after { top: -2px; right: -2px; border-left: none; border-bottom: none; }

/* 动态落花 */
.petal {
    position: fixed; background: #ffb7c5; border-radius: 15px 0 15px 0;
    opacity: 0.6; pointer-events: none; z-index: 1; animation: fall linear infinite;
}
@keyframes fall {
    0% { transform: translateY(-10vh) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(110vh) translateX(50px) rotate(360deg); opacity: 0; }
}

/* 动态中国结与流苏 */
.tassel-container {
    position: absolute; top: -10px; right: 150px; z-index: 95;
    display: flex; flex-direction: column; align-items: center;
    transform-origin: top center; animation: swing 6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes swing {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}
.tassel-rope { width: 3px; height: 80px; background: var(--china-red); }
.tassel-knot {
    width: 30px; height: 30px; border: 3px solid var(--china-red);
    transform: rotate(45deg); position: relative; background: rgba(244,236,216,0.8);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}
.tassel-knot::before {
    content: ''; position: absolute; top: 4px; left: 4px; right: 4px; bottom: 4px;
    background: var(--china-red);
}
.tassel-threads {
    width: 18px; height: 120px;
    background: repeating-linear-gradient(90deg, var(--china-red), var(--china-red) 1px, transparent 1px, transparent 4px);
    margin-top: 10px; border-radius: 0 0 50% 50%;
}

/* 页面核心布局 */
.page-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: row; align-items: center; justify-content: center;
    z-index: 10;
}

/* 书法排版 */
.poetry {
    position: absolute; left: 180px; top: 15vh;
    writing-mode: vertical-rl; font-size: 1.4rem; color: rgba(43, 43, 43, 0.35);
    letter-spacing: 10px; line-height: 2.5; z-index: 5; font-family: 'STKaiti', 'Noto Serif SC', serif;
}

.site-header {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 40px);
    font-size: 1rem;
    letter-spacing: 8px;
    color: var(--gold);
    font-weight: 400;
    text-align: center;
    border-bottom: 1px solid rgba(179, 139, 77, 0.3);
    padding-bottom: 10px;
    white-space: nowrap;
    z-index: 30;
}

.chapter-title {
    writing-mode: vertical-rl; font-size: 4rem; font-weight: 900;
    color: var(--text-ink); letter-spacing: 25px; margin: 0; margin-right: 80px;
    position: relative; height: 50%; text-shadow: 2px 2px 5px rgba(0,0,0,0.05); z-index: 20;
}
.title-seal {
    display: inline-block; writing-mode: vertical-rl;
    border: 3px solid var(--china-red); color: var(--china-red);
    padding: 15px 8px; font-size: 1.5rem; font-weight: 900; border-radius: 4px;
    margin-top: 40px; letter-spacing: 8px; box-shadow: inset 0 0 5px rgba(167,33,38,0.2);
    background: rgba(167,33,38,0.05);
}

/* 音乐画框列阵 */
.items-wrapper {
    width: 100%; max-width: 1000px;
    display: flex; flex-direction: column; align-items: center;
    z-index: 20; padding: 20px; box-sizing: border-box;
    max-height: 70vh; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--gold) transparent;
}
.items-wrapper::-webkit-scrollbar { width: 4px; }
.items-wrapper::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }

.items-grid {
    display: flex; gap: 40px; flex-wrap: wrap; justify-content: center; width: 100%;
}

.music-item {
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer; transition: transform 0.4s ease; width: 220px;
}

/* 团扇/圆窗 封套设计 */
.cover-circle {
    width: 100%; aspect-ratio: 1 / 1; border-radius: 50%;
    border: 2px solid var(--gold); padding: 6px; position: relative;
    background: var(--bg-paper);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12); margin-bottom: 20px; transition: all 0.5s ease;
}
.cover-inner {
    width: 100%; height: 100%; border-radius: 50%;
    transition: transform 1s ease;
    position: relative; overflow: hidden;
    display: flex; justify-content: center; align-items: center;
    color: rgba(255,255,255,0.85); font-size: 3.5rem; font-family: 'STKaiti', serif;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.bg-color-1 { background: linear-gradient(135deg, #4A5D4E, #2A3B30); } 
.bg-color-2 { background: linear-gradient(135deg, #7A9B9F, #4A6B70); } 
.bg-color-3 { background: linear-gradient(135deg, #B598A1, #8A6B74); } 
.bg-color-4 { background: linear-gradient(135deg, #A72126, #7A1115); } 
.bg-color-5 { background: linear-gradient(135deg, #C29A69, #916B3C); } 
.bg-color-6 { background: linear-gradient(135deg, #5C6266, #33383B); } 
.bg-color-7 { background: linear-gradient(135deg, #8C4B4B, #5E2F2F); } 
.bg-color-8 { background: linear-gradient(135deg, #5B6D7A, #3A4A56); } 

.play-icon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.5);
    width: 60px; height: 60px; background: rgba(167,33,38,0.85); border-radius: 50%;
    display: flex; justify-content: center; align-items: center; opacity: 0; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: white; font-size: 24px; z-index: 5; backdrop-filter: blur(4px); box-shadow: 0 0 20px rgba(167,33,38,0.6);
}
.play-icon::after { content: '▶'; margin-left: 5px; }

@media (hover: hover) {
    .music-item:hover .cover-circle { border-color: var(--china-red); transform: translateY(-10px); }
    .music-item:hover .cover-inner { transform: scale(1.1) rotate(5deg); }
    .music-item:hover .play-icon { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.item-title { font-size: 1.4rem; margin-bottom: 8px; font-weight: 900; color: var(--text-ink); letter-spacing: 2px; }
.item-desc { font-size: 0.95rem; color: var(--text-light); margin-bottom: 8px; text-align: center; }
.item-tag { border: 1px solid var(--gold); color: var(--gold); font-size: 0.75rem; padding: 2px 10px; border-radius: 20px; }

.wanjuan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    width: 100%;
}
.wanjuan-item {
    display: flex;
    align-items: center;
    background: rgba(179, 139, 77, 0.08);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}
.wanjuan-item:hover {
    background: rgba(167, 33, 38, 0.05);
    border-color: var(--china-red);
    transform: translateX(5px);
}
.wanjuan-index {
    color: var(--china-red);
    font-weight: 900;
    margin-right: 12px;
    font-size: 0.9rem;
    width: 25px;
}
.wanjuan-name {
    font-size: 1rem;
    letter-spacing: 1px;
    flex: 1;
}

.player-bar {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(244, 236, 216, 0.95); backdrop-filter: blur(15px);
    border-top: 2px solid var(--gold); padding: 15px 40px;
    display: flex; align-items: center; justify-content: space-between;
    box-sizing: border-box; transform: translateY(100%); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100; box-shadow: 0 -10px 40px rgba(0,0,0,0.05);
}
.player-bar.visible { transform: translateY(0); }
.player-bar::before {
    content: ''; position: absolute; top: -5px; left: 0; width: 100%; height: 5px;
    background: url("data:image/svg+xml,%3Csvg width='20' height='5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 5L10 0L20 5' fill='none' stroke='%23C29A69' stroke-width='1'/%3E%3C/svg%3E");
    opacity: 0.5;
}

.player-info { width: 220px; }
.playing-title { font-size: 1.2rem; font-weight: 900; color: var(--china-red); letter-spacing: 2px; }
.playing-artist { font-size: 0.9rem; color: var(--text-light); margin-top: 6px; }

.player-center { flex: 1; margin: 0 18px 0 26px; }
.progress-bar-bg { width: 100%; height: 3px; background: rgba(179,139,77,0.3); border-radius: 2px; position: relative; }
.progress-bar-fill { position: absolute; top: 0; left: 0; height: 100%; width: 0%; background: linear-gradient(90deg, var(--china-red), #e53935); transition: width 0.1s linear; }
.progress-bar-fill::after {
    content: ''; position: absolute; right: -7px; top: -5.5px;
    width: 14px; height: 14px; background: var(--china-red); border-radius: 50%;
    border: 2px solid white; box-shadow: 0 0 8px rgba(167, 33, 38, 0.5);
}

.player-right { width: 320px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-shrink: 0; }
.progress-bar-bg.seek-enabled { cursor: pointer; }
.admin-player-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(167, 33, 38, 0.25);
    background: rgba(255,255,255,0.75);
    color: var(--china-red);
    font: inherit;
    font-size: 1.05rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(167,33,38,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    flex: 0 0 42px;
}
.admin-player-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(167,33,38,0.12);
    background: rgba(255,255,255,0.92);
}
.btn-next {
    display: none;
    background: var(--bg-paper); border: 1px solid var(--china-red); color: var(--china-red);
    padding: 8px 22px; font-family: 'Noto Serif SC', serif; font-size: 1rem; font-weight: 600;
    cursor: pointer; opacity: 0; pointer-events: none; transition: all 0.4s ease;
    position: relative; overflow: hidden; letter-spacing: 2px; box-shadow: 4px 4px 0 rgba(167,33,38,0.1);
    white-space: nowrap; min-width: 250px; text-align: center; flex-shrink: 0;
}
.btn-next.ready { display: inline-flex; align-items: center; justify-content: center; opacity: 1; pointer-events: auto; }
.btn-next.ready:hover { background: var(--china-red); color: var(--bg-paper); box-shadow: 4px 4px 0 rgba(167,33,38,0.3); transform: translate(-2px, -2px); }

/* ================= 移动端优化 ================= */
@media (max-width: 800px) {
    body { overflow-y: auto; }
    .page-container { position: relative; height: auto; min-height: 100vh; flex-direction: column; justify-content: flex-start; padding-top: 80px; padding-bottom: 150px; }
    .site-header { top: 30px; left: 50%; transform: translateX(-50%); font-size: 0.85rem; letter-spacing: 4px; width: max-content; max-width: 80%; }
    .chapter-title { writing-mode: horizontal-tb; margin: 0 0 30px 0; height: auto; font-size: 2.5rem; letter-spacing: 5px; text-align: center; }
    .title-seal { writing-mode: horizontal-tb; margin-top: 0; margin-left: 10px; padding: 4px 10px; font-size: 1.1rem; vertical-align: middle; }
    .tassel-container { right: 60px; left: auto; transform: scale(0.6); top: -20px; }
    .disclaimer { bottom: 180px; right: 20px; font-size: 0.6rem; max-width: 180px; }
    .poetry { display: none; }
    .bottom-poetry { 
        position: relative; 
        bottom: auto; 
        left: auto; 
        transform: none; 
        margin: 40px 0 20px 0; 
        font-size: 0.9rem; 
        letter-spacing: 4px; 
        text-align: center;
        width: 100%;
        opacity: 0.4;
    }
    .items-wrapper { padding: 0 15px; width: 100%; box-sizing: border-box; max-height: none; overflow-y: visible; }
    .items-grid { flex-direction: column; gap: 20px; align-items: center; width: 100%; }
    .music-item { display: grid; grid-template-columns: 80px 1fr; grid-template-rows: auto auto auto; column-gap: 15px; row-gap: 2px; width: 100% !important; max-width: 360px; background: rgba(179,139,77,0.1); padding: 10px 20px 10px 10px; border-radius: 50px 15px 15px 50px; text-align: left; }
    .cover-circle { grid-column: 1; grid-row: 1 / 4; width: 70px; height: 70px; margin-bottom: 0; padding: 3px; }
    .cover-inner { font-size: 1.8rem; }
    .item-title { grid-column: 2; grid-row: 1; font-size: 1.1rem; margin: 0; align-self: end; }
    .item-desc { grid-column: 2; grid-row: 2; font-size: 0.85rem; margin: 0; }
    .item-tag { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 3px; }
    .wanjuan-grid { grid-template-columns: 1fr; }
    .player-bar { padding: 15px; flex-direction: column; align-items: stretch; }
    .player-info { width: 100%; text-align: center; margin-bottom: 10px; }
    .player-center { margin: 0 10px 15px 10px; }
    .player-right { width: 100%; justify-content: center; flex-wrap: wrap; }
    .admin-player-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: 0 0 44px; }
    .btn-next { width: 100%; max-width: 300px; min-width: 0; padding: 12px; font-size: 1.2rem; }
    .btn-next.ready { display: inline-flex; }
}

.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 40px auto;
    background: rgba(245, 240, 230, 0.5);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(179, 139, 77, 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.auth-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(179, 139, 77, 0.4);
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    color: #3b4238;
    box-sizing: border-box;
    transition: border-color 0.3s;
}
.auth-input:focus {
    outline: none;
    border-color: #b38b4d;
}
.auth-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #b38b4d, #9c7842);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(179, 139, 77, 0.3);
}
.auth-links {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-top: 10px;
}
.auth-link {
    color: #b38b4d;
    text-decoration: none;
    cursor: pointer;
}
.auth-link:hover {
    text-decoration: underline;
}

.special-item {
    border: 1px solid #A72126 !important;
}

.special-item .wanjuan-index {
    color: #A72126 !important;
}

.site-footer {
    position: fixed;
    bottom: 30px;
    right: 40px;
    font-size: 0.75rem;
    color: rgba(43, 43, 43, 0.4);
    z-index: 110;
    text-align: right;
    pointer-events: auto;
}
.site-footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}
.site-footer a:hover {
    color: var(--china-red);
    text-decoration: underline;
}

@media (max-width: 800px) {
    .site-footer {
        bottom: 28px;
        right: 28px;
        font-size: 0.65rem;
    }
}
