﻿/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: none;
}

html, body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

:root {
    /* 主色调 - 中国风朱砂红 */
    --primary-color: #C41E3A;
    --primary-light: #E85D75;
    --primary-dark: #9A1830;
    
    /* 辅助色 - 琥珀金 */
    --secondary-color: #D4A574;
    --secondary-light: #E8C9A8;
    --secondary-dark: #B8935F;
    
    /* 背景色 - 宣纸质感 */
    --bg-color: #F5F0E6;
    --bg-gradient-start: #FDF8F0;
    --bg-gradient-end: #F0E6D3;
    
    /* 文字色 */
    --text-color: #2C2C2C;
    --text-light: #5C5C5C;
    --text-muted: #8B8680;
    
    /* 功能色 */
    --correct-color: #2E7D32;
    --wrong-color: #C62828;
    --hint-color: #1565C0;
    
    /* 纸张白 */
    --white: #FFFCF8;
    --paper-shadow: rgba(139, 69, 19, 0.08);
    
    /* 阴影系统 */
    --shadow-sm: 0 2px 4px rgba(139, 69, 19, 0.06);
    --shadow: 0 4px 12px rgba(139, 69, 19, 0.1);
    --shadow-lg: 0 8px 30px rgba(139, 69, 19, 0.15);
    --shadow-xl: 0 12px 40px rgba(139, 69, 19, 0.2);
    
    /* 动画曲线 */
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

html, body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(212, 165, 116, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(196, 30, 58, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    /* --vh 由 JS 动态设置，兼容手机地址栏；dvh 作为现代浏览器回退 */
    height: calc(var(--vh, 1vh) * 100);
    height: 100dvh;
    width: 100vw;
    color: var(--text-color);
    overflow: hidden;
    position: relative;
}

/* 宣纸纹理叠加 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 15px;
}

/* ==================== 屏幕切换 ==================== */
/* 所有screen默认隐藏，用fixed定位铺满视口 */
.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    /* --vh 兼容手机地址栏 */
    height: calc(var(--vh, 1vh) * 100);
    height: 100dvh;
    overflow: hidden;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(212, 165, 116, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(196, 30, 58, 0.04) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    z-index: 1;
}

/* 激活的screen显示为flex，垂直居中 */
.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: fadeIn 0.5s var(--ease-smooth);
}

/* 屏幕切换动画 */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.98) translateY(10px);
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0);
    }
}

/* 水墨扩散进入效果 */
@keyframes inkSpread {
    0% {
        opacity: 0;
        filter: blur(20px);
        transform: scale(1.1);
    }
    50% {
        opacity: 0.5;
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

/* active screen 内的 container 撑满并居中内容 */
.screen.active .container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    height: 100%;
    max-height: calc(var(--vh, 1vh) * 100);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* 删除旧的淡入动画，已合并到上面的定义 */

/* ==================== 开始界面 ==================== */
#start-screen .container {
    text-align: center;
    align-items: center;
    gap: 12px;
}

.game-title {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-shadow: 
        2px 2px 0px rgba(196, 30, 58, 0.1),
        4px 4px 8px rgba(0, 0, 0, 0.08);
    letter-spacing: 4px;
    font-weight: 700;
    position: relative;
    animation: titleFloat 3s ease-in-out infinite;
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
}

.subtitle::before,
.subtitle::after {
    content: '❖';
    color: var(--secondary-color);
    margin: 0 12px;
    opacity: 0.6;
    font-size: 0.8rem;
}

.player-info {
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding: 14px 24px;
    background: var(--white);
    border-radius: 25px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(212, 165, 116, 0.3);
    position: relative;
    transition: all 0.3s var(--ease-smooth);
}

.player-info:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.player-info::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
    opacity: 0.5;
}

.player-name {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.3rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* 限时挑战按钮 */
.btn-timed {
    background: linear-gradient(135deg, #4CAF50 0%, #00BCD4 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
}

.btn-timed:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.4);
}

.stats-preview {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 14px 40px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s var(--ease-bounce);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    font-weight: 500;
    letter-spacing: 1px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 
        0 4px 15px rgba(196, 30, 58, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(196, 30, 58, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-color);
    border: 2px solid var(--secondary-color);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: var(--white);
    border-color: transparent;
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-secondary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-small {
    padding: 5px 15px;
    font-size: 0.9rem;
    background: var(--hint-color);
    color: var(--white);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 10px;
}

/* ==================== 难度选择界面 ==================== */
#difficulty-screen .container {
    align-items: stretch;
    gap: 12px;
}

#difficulty-screen h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 4px;
    font-size: 1.5rem;
}

.screen-desc {
    text-align: center;
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.grade-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.grade-btn {
    padding: 14px 10px;
    background: var(--white);
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s var(--ease-bounce);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.grade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.grade-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.grade-btn:hover::before {
    opacity: 0.6;
}

.grade-btn.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #FFF5F5 0%, #FFEBEE 100%);
    box-shadow: 
        0 4px 15px rgba(196, 30, 58, 0.2),
        inset 0 0 0 1px rgba(196, 30, 58, 0.1);
    animation: selectedPulse 2s ease-in-out infinite;
}

@keyframes selectedPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(196, 30, 58, 0.2), inset 0 0 0 1px rgba(196, 30, 58, 0.1); }
    50% { box-shadow: 0 6px 20px rgba(196, 30, 58, 0.3), inset 0 0 0 1px rgba(196, 30, 58, 0.15); }
}

.grade-name {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color);
}

.grade-count {
    font-size: 0.75rem;
    color: #888;
    margin-top: 3px;
}

.question-count-selection {
    background: var(--white);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.question-count-selection h3 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 1rem;
}

.count-options {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.count-btn {
    padding: 6px 14px;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.count-btn:hover {
    background: #e0e0e0;
}

.count-btn.active {
    background: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ==================== 游戏界面 ==================== */
#game-screen .container {
    justify-content: flex-start;
    padding-top: 10px;
}

.progress-bar {
    position: relative;
    height: 28px;
    background: linear-gradient(180deg, #E8E0D5 0%, #D5C8B8 100%);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    margin-top: 10px;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.1),
        0 1px 0 rgba(255,255,255,0.5);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 50%, var(--primary-dark) 100%);
    border-radius: 14px;
    transition: width 0.6s var(--ease-smooth);
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.3) 50%,
        transparent 100%
    );
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: var(--text-color);
}

.score-display {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    margin-bottom: 12px;
    padding: 8px 15px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.question-area {
    background: var(--white);
    border-radius: 15px;
    padding: 15px;
    box-shadow: var(--shadow-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.poem-info {
    text-align: center;
    margin-bottom: 10px;
}

.poem-info h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 3px;
}

.poem-author {
    color: #888;
    font-size: 0.85rem;
}

.poem-content {
    background: 
        linear-gradient(135deg, #FFFDF5 0%, #FFF9E6 50%, #FFF5D6 100%);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 12px;
    font-family: 'KaiTi', 'STKaiti', 'FangSong', serif;
    font-size: 1.2rem;
    line-height: 2;
    text-align: center;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.8),
        0 2px 8px rgba(139, 69, 19, 0.08);
    border: 1px solid rgba(212, 165, 116, 0.3);
    position: relative;
}

.poem-content::before {
    content: '「';
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 1.5rem;
    color: var(--secondary-color);
    opacity: 0.4;
}

.poem-content::after {
    content: '」';
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 1.5rem;
    color: var(--secondary-color);
    opacity: 0.4;
}

.poem-line {
    margin: 10px 0;
}

.poem-line.blank {
    color: var(--hint-color);
    font-weight: bold;
    border-bottom: 2px dashed var(--hint-color);
    padding: 5px 20px;
    display: inline-block;
}

.options-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow-y: auto;
}

.option-btn {
    padding: 14px 18px;
    background: linear-gradient(135deg, #FAFAFA 0%, #F5F5F5 100%);
    border: 2px solid #E0D5C8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s var(--ease-bounce);
    text-align: left;
    font-size: 1.05rem;
    font-family: 'KaiTi', 'STKaiti', 'FangSong', serif;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--secondary-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.option-btn:hover {
    background: linear-gradient(135deg, #FFF 0%, #F8F8F8 100%);
    border-color: var(--secondary-color);
    transform: translateX(8px) scale(1.01);
    box-shadow: var(--shadow);
}

.option-btn:hover::before {
    opacity: 0.6;
}

.option-btn.selected {
    border-color: var(--hint-color);
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.option-btn.selected::before {
    background: var(--hint-color);
    opacity: 1;
}

.option-btn.correct {
    border-color: var(--correct-color);
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    animation: correctPulse 0.6s var(--ease-bounce);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.option-btn.correct::before {
    background: var(--correct-color);
    opacity: 1;
}

.option-btn.wrong {
    border-color: var(--wrong-color);
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    animation: shake 0.5s ease;
}

.option-btn.wrong::before {
    background: var(--wrong-color);
    opacity: 1;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.05) translateY(-2px); }
    60% { transform: scale(1.02) translateY(-1px); }
    100% { transform: scale(1) translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px) rotate(-1deg); }
    30% { transform: translateX(8px) rotate(1deg); }
    45% { transform: translateX(-5px) rotate(-0.5deg); }
    60% { transform: translateX(5px) rotate(0.5deg); }
    75% { transform: translateX(-2px); }
}

/* ==================== 反馈界面 ==================== */
#feedback-screen .container {
    justify-content: center;
    align-items: center;
}

.feedback-content {
    text-align: center;
    padding: 30px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    animation: feedbackPop 0.5s ease;
}

@keyframes feedbackPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.feedback-text {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.feedback-correct {
    color: var(--correct-color);
}

.feedback-wrong {
    color: var(--wrong-color);
}

/* ==================== 结算界面 ==================== */
#result-screen .container {
    justify-content: center;
    align-items: center;
}

.result-content {
    text-align: center;
    width: 100%;
}

#result-title {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    background: var(--white);
    padding: 15px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

.result-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 3px;
}

.result-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* ==================== 奖状样式 - 古风卷轴 ==================== */
.certificate-area {
    margin: 15px 0;
}

.certificate-area.hidden {
    display: none;
}

.certificate {
    max-width: 420px;
    margin: 0 auto;
    animation: certificateUnroll 1.2s var(--ease-smooth);
    position: relative;
}

@keyframes certificateUnroll {
    0% { 
        transform: scaleY(0.1) scaleX(0.8); 
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    60% { 
        transform: scaleY(1.05) scaleX(1.02); 
    }
    100% { 
        transform: scaleY(1) scaleX(1); 
        opacity: 1; 
    }
}

.certificate-border {
    background: linear-gradient(180deg, 
        #8B4513 0%, 
        #A0522D 8px, 
        #D4A574 8px, 
        #E8C9A8 12px,
        #FFF8DC 12px,
        #FFFEF0 95%,
        #E8C9A8 calc(100% - 12px),
        #D4A574 calc(100% - 8px),
        #A0522D calc(100% - 8px),
        #8B4513 100%
    );
    padding: 20px 12px;
    border-radius: 4px;
    box-shadow: 
        var(--shadow-xl),
        inset 0 0 30px rgba(139, 69, 19, 0.1);
    position: relative;
}

/* 卷轴轴头 */
.certificate-border::before,
.certificate-border::after {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    height: 24px;
    background: linear-gradient(180deg, 
        #654321 0%, 
        #8B4513 30%, 
        #A0522D 50%, 
        #8B4513 70%, 
        #654321 100%
    );
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.certificate-border::before {
    top: -12px;
}

.certificate-border::after {
    bottom: -12px;
}

.certificate-inner {
    background: 
        linear-gradient(90deg, 
            rgba(212, 165, 116, 0.1) 0%, 
            transparent 5%, 
            transparent 95%, 
            rgba(212, 165, 116, 0.1) 100%
        ),
        linear-gradient(180deg, #FFFEF8 0%, #FFF8DC 100%);
    padding: 25px 20px;
    border-radius: 2px;
    text-align: center;
    border: 1px solid rgba(212, 165, 116, 0.3);
    position: relative;
}

/* 内边框装饰 */
.certificate-inner::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(196, 30, 58, 0.2);
    border-radius: 2px;
    pointer-events: none;
}

.certificate-header {
    font-size: 0.9rem;
    color: var(--primary-color);
    letter-spacing: 6px;
    margin-bottom: 12px;
    font-weight: 500;
    position: relative;
}

.certificate-header::before,
.certificate-header::after {
    content: '◆';
    color: var(--secondary-color);
    margin: 0 10px;
    font-size: 0.6rem;
    vertical-align: middle;
}

.certificate-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    letter-spacing: 4px;
}

.certificate-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    margin-bottom: 20px;
    font-style: italic;
}

.certificate-content {
    font-size: 0.95rem;
    line-height: 2;
    margin-bottom: 20px;
    color: var(--text-color);
    font-family: 'KaiTi', 'STKaiti', serif;
}

.cert-name {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.15rem;
    border-bottom: 1px dashed var(--secondary-color);
    padding: 0 5px;
}

.cert-award {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 12px;
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(196, 30, 58, 0.2);
}

.certificate-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(212, 165, 116, 0.3);
}

/* 印章装饰 */
.certificate-seal {
    position: absolute;
    bottom: 30px;
    right: 25px;
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    border: 2px solid var(--primary-dark);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 3px;
    box-shadow: 
        2px 2px 4px rgba(0,0,0,0.2),
        inset 0 0 8px rgba(0,0,0,0.1);
    transform: rotate(-8deg);
    opacity: 0.85;
}

/* ==================== 排行榜界面 ==================== */
#leaderboard-screen .container {
    justify-content: flex-start;
    padding-top: 20px;
}

#leaderboard-screen h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.tab-btn {
    padding: 8px 14px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

.leaderboard-list {
    background: var(--white);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    max-height: 280px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank-number {
    width: 32px;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
}

.rank-1 { color: #FFD700; }
.rank-2 { color: #C0C0C0; }
.rank-3 { color: #CD7F32; }

.player-info-rank {
    flex: 1;
    margin-left: 10px;
}

.player-name-rank {
    font-weight: bold;
    color: var(--text-color);
    font-size: 0.95rem;
}

.player-detail {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.complete-time {
    color: #aaa;
    font-size: 0.7rem;
}

.player-score {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* ==================== 游戏说明界面 ==================== */
#help-screen .container {
    justify-content: flex-start;
    padding-top: 20px;
}

#help-screen h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.help-content {
    background: var(--white);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.help-section {
    margin-bottom: 15px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    color: var(--secondary-color);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.help-section p {
    line-height: 1.6;
    color: #555;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* 更新日志样式 */
.help-changelog {
    background: rgba(196, 30, 58, 0.04);
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 3px solid var(--primary-color);
}

.changelog-item {
    margin-bottom: 12px;
}

.changelog-item:last-child {
    margin-bottom: 0;
}

.changelog-ver {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 12px;
    padding: 2px 10px;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.changelog-item ul {
    margin: 4px 0 0 12px;
    padding: 0;
    list-style: none;
}

.changelog-item ul li {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.7;
    position: relative;
    padding-left: 4px;
}

/* 特别鸣谢样式 */
.help-thanks {
    background: rgba(255, 193, 7, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 3px solid #f0ad4e;
}

.help-thanks p {
    font-size: 0.88rem;
    color: #777;
    line-height: 1.7;
    margin: 0;
}





/* ==================== 诗词欣赏界面 ==================== */
#appreciation-screen .container {
    justify-content: flex-start;
    padding-top: 15px;
    overflow: hidden;
}

#appreciation-screen .container h2 {
    flex-shrink: 0;
}

#appreciation-screen .appreciation-grade-select {
    flex-shrink: 0;
}

#appreciation-screen .poem-display {
    flex: 1;
    min-height: 0;
}

#appreciation-screen h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.appreciation-grade-select {
    margin-bottom: 10px;
}

.appreciation-grade-select h3 {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.grade-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.grade-tab-btn {
    padding: 6px 10px;
    border: 2px solid var(--secondary-color);
    background: var(--white);
    color: var(--secondary-color);
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.grade-tab-btn.active,
.grade-tab-btn:hover {
    background: var(--secondary-color);
    color: var(--white);
}

.poem-display {
    background: linear-gradient(135deg, #FFF9F0 0%, #FFF5E6 100%);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid rgba(212, 165, 116, 0.4);
}

/* 诗词卡片 */
.poem-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.poem-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: 2px;
}

.poem-card-author {
    font-size: 0.9rem;
    color: #888;
    margin: 0;
    letter-spacing: 1px;
}

.poem-card-content {
    margin-top: 8px;
    line-height: 2;
}

.poem-card-content p {
    font-size: 1.1rem;
    color: #333;
    margin: 4px 0;
    letter-spacing: 2px;
}

.poem-header {
    background: linear-gradient(135deg, #FFF9F0 0%, #FFF5E6 100%);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(212, 165, 116, 0.3);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.poem-header h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 8px;
    font-weight: bold;
}

.poem-author {
    color: #666;
    font-size: 0.9rem;
}

.poem-content-pinyin {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px;
    background: linear-gradient(180deg, #FFFCF8 0%, #FFF8F0 100%);
    border-radius: 8px;
    border: 1px solid rgba(212, 165, 116, 0.15);
}

.poem-line-pinyin {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pinyin-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 3px;
}

.pinyin-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 24px;
}

.pinyin-text {
    font-size: 0.65rem;
    color: #888;
    margin-bottom: 2px;
    height: 14px;
    line-height: 14px;
}

.hanzi-text {
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.4;
}

.poem-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

#poem-counter {
    font-size: 0.9rem;
    color: #666;
    min-width: 60px;
    text-align: center;
}

.poem-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ==================== 作者信息 ==================== */
.author-info {
    text-align: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.author-info p {
    color: #888;
    font-size: 0.85rem;
}

/* ==================== 版本信息 ==================== */
.version-info {
    text-align: center;
    margin-top: 10px;
    padding-top: 8px;
}

.version-info .version {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.version-info .credits {
    color: #999;
    font-size: 0.75rem;
    font-style: italic;
}

.footer-links {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-text {
    color: #666;
    font-size: 0.75rem;
}

.footer-link {
    color: var(--secondary-color);
    font-size: 0.75rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-separator {
    color: #ccc;
    font-size: 0.75rem;
}

/* ==================== 西西老师角色 ==================== */
.teacher-character {
    position: fixed;
    right: -200px;
    bottom: 20px;
    width: 140px;
    height: 180px;
    z-index: 1000;
    transition: right 0.6s var(--ease-bounce);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.teacher-character.show {
    right: 20px;
    animation: teacherBounce 0.6s var(--ease-bounce);
}

@keyframes teacherBounce {
    0% { transform: translateY(20px) scale(0.9); opacity: 0; }
    60% { transform: translateY(-10px) scale(1.05); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.teacher-character.hidden {
    display: none;
}

.teacher-body {
    position: relative;
    width: 100%;
    height: 100%;
    animation: teacherBreathe 3s ease-in-out infinite;
}

@keyframes teacherBreathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.01); }
}

.teacher-face {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #F5D0C5 0%, #E8B4A2 100%);
    border-radius: 50%;
    position: absolute;
    top: 15px;
    left: 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 -3px 8px rgba(0,0,0,0.1),
        0 2px 8px rgba(0,0,0,0.1);
}

.teacher-eyes {
    display: flex;
    gap: 14px;
    margin-top: 18px;
}

.eye {
    width: 9px;
    height: 9px;
    background: #2C2C2C;
    border-radius: 50%;
    position: relative;
    animation: blink 4s ease-in-out infinite;
}

.eye::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
}

@keyframes blink {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

.teacher-mouth {
    width: 26px;
    height: 14px;
    border-bottom: 3px solid #C41E3A;
    border-radius: 0 0 26px 26px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.teacher-mouth.sad {
    border-bottom: none;
    border-top: 3px solid #5C5C5C;
    border-radius: 26px 26px 0 0;
    margin-top: 12px;
}

.teacher-mouth.happy {
    width: 30px;
    height: 16px;
    border-bottom-width: 4px;
}

.teacher-glasses {
    position: absolute;
    top: 22px;
    font-size: 1.8rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.teacher-dress {
    position: absolute;
    bottom: 0;
    left: 25px;
    font-size: 4.5rem;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.1));
}

.teacher-hand {
    position: absolute;
    right: -10px;
    top: 55px;
    font-size: 2.6rem;
    animation: handWave 0.6s ease infinite alternate;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
    transform-origin: bottom left;
}

@keyframes handWave {
    from { transform: rotate(-25deg) scale(1); }
    to { transform: rotate(25deg) scale(1.1); }
}

.teacher-bubble {
    position: absolute;
    top: -60px;
    left: -90px;
    background: linear-gradient(135deg, #FFF 0%, #FFFEF8 100%);
    padding: 12px 18px;
    border-radius: 18px;
    box-shadow: 
        0 4px 15px rgba(0,0,0,0.1),
        0 0 0 1px rgba(212, 165, 116, 0.3);
    font-size: 0.9rem;
    max-width: 180px;
    display: none;
    border: 1px solid rgba(212, 165, 116, 0.2);
}

.teacher-bubble.show {
    display: block;
    animation: bubblePop 0.4s var(--ease-bounce);
}

@keyframes bubblePop {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    70% { transform: scale(1.1) rotate(3deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.teacher-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #FFF transparent transparent;
}

.teacher-bubble::before {
    content: '';
    position: absolute;
    bottom: -11px;
    right: 29px;
    border-width: 11px 11px 0;
    border-style: solid;
    border-color: rgba(212, 165, 116, 0.3) transparent transparent;
}

/* ==================== 特效层 ==================== */
.effects-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

/* 星星特效 - 升级版 */
.star {
    position: absolute;
    font-size: 2.2rem;
    animation: starFloat 2.5s var(--ease-out) forwards;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

@keyframes starFloat {
    0% { 
        transform: scale(0) rotate(-180deg); 
        opacity: 0;
        filter: drop-shadow(0 0 0 transparent);
    }
    20% { 
        transform: scale(1.3) rotate(0deg); 
        opacity: 1;
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
    }
    50% { 
        transform: scale(1.1) rotate(90deg) translateY(-30px); 
        opacity: 1;
    }
    100% { 
        transform: scale(0.8) rotate(360deg) translateY(-150px); 
        opacity: 0;
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0));
    }
}

/* 烟花特效 - 升级版 */
.firework {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: firework 1.2s var(--ease-out) forwards;
}

@keyframes firework {
    0% { 
        transform: scale(0); 
        opacity: 1;
    }
    30% {
        transform: scale(1);
        opacity: 1;
    }
    100% { 
        transform: scale(25); 
        opacity: 0;
    }
}

/* 粒子爆炸效果 */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
}

@keyframes particleBurst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* 飘落花瓣效果 */
.petal {
    position: absolute;
    font-size: 1.2rem;
    opacity: 0.7;
    animation: petalFall linear forwards;
    pointer-events: none;
}

@keyframes petalFall {
    0% {
        transform: translateY(-20px) rotate(0deg) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(360deg) translateX(50px);
        opacity: 0;
    }
}

/* 墨滴扩散效果 */
.ink-drop {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,0,0,0.3) 0%, transparent 70%);
    animation: inkSpread 1s ease-out forwards;
    pointer-events: none;
}

@keyframes inkSpread {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* 光晕脉冲效果 */
.glow-pulse {
    position: absolute;
    border-radius: 50%;
    animation: glowPulse 1.5s ease-out forwards;
    pointer-events: none;
}

@keyframes glowPulse {
    0% {
        transform: scale(0);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.6);
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: scale(2);
        opacity: 0;
        box-shadow: 0 0 30px 20px rgba(255, 215, 0, 0);
    }
}

/* ==================== 填空玩法样式 ==================== */
.count-hint {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 8px;
}

.blank-count-selection {
    background: var(--white);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.blank-count-selection h3 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 1rem;
}

.blank-options {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.blank-btn {
    padding: 6px 14px;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.blank-btn:hover {
    background: #e0e0e0;
}

.blank-btn.active {
    background: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

/* 填空输入区域 */
.fill-input-area {
    margin-top: 15px;
}

.fill-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
}

.fill-input-container label {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: bold;
}

.fill-input {
    width: 100%;
    max-width: 200px;
    padding: 12px 20px;
    font-size: 1.5rem;
    text-align: center;
    border: 3px solid #ddd;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

.fill-input:focus {
    border-color: var(--secondary-color);
}

.fill-submit-btn {
    padding: 10px 30px;
    font-size: 1rem;
}

/* 填空行样式 */
.fill-blank-line {
    background: #FFF9E6;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
}

.blank-slot {
    display: inline-block;
    min-width: 40px;
    text-align: center;
    color: var(--secondary-color);
    font-weight: bold;
    letter-spacing: 2px;
}

.blank-correct {
    color: var(--correct-color);
    font-weight: bold;
}

.blank-wrong {
    color: var(--wrong-color);
    font-weight: bold;
    text-decoration: line-through;
}

/* 填空框样式 */
.blank-box {
    display: inline-block;
    min-width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-bottom: 2px solid var(--secondary-color);
    margin: 0 4px;
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 1.2rem;
    vertical-align: middle;
}

/* ==================== 诗人传记样式 ==================== */
.poet-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    max-height: 55vh;
    overflow-y: auto;
    padding: 4px;
}

.poet-card {
    background: var(--white);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    border: 1.5px solid var(--secondary-light);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.poet-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.poet-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.poet-card-name {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 2px;
}

.poet-card-dynasty {
    font-size: 0.75rem;
    color: #888;
}

/* 诗人弹窗 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px 20px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
    padding: 4px;
}

.modal-close:hover {
    color: var(--primary-color);
}

.poet-modal-card {
    text-align: left;
}

.poet-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.poet-modal-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    font-size: 1.6rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.poet-modal-title h3 {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 2px;
}

.poet-modal-title p {
    font-size: 0.85rem;
    color: #888;
}

.poet-modal-years {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--secondary-light);
}

.poet-modal-bio {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 14px;
}

.poet-modal-works h4 {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.poet-modal-works p {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.6;
}

/* ==================== 诗词接龙样式 ==================== */
.chain-top-bar {
    display: flex;
    justify-content: space-between;
    background: var(--white);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
}

.chain-chain-display {
    background: linear-gradient(135deg, #FFF9F0, #FFF5E6);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-x: auto;
    border: 1px solid var(--secondary-light);
    max-height: 100px;
}

.chain-link-item {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

.chain-link-item:first-child {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.95rem;
}

.chain-prompt-box {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 12px;
}

/* 诗句接龙样式 */
.chain-quiz-line {
    font-family: 'KaiTi', 'STKaiti', 'FangSong', serif;
    font-size: 1.3rem;
    color: var(--primary-color);
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #FFFDF5 0%, #FFF9E6 100%);
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
    margin: 10px 0;
    line-height: 1.8;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 8px rgba(139, 69, 19, 0.08);
}

.chain-target-char {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0 4px;
    letter-spacing: 2px;
}

.chain-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.chain-option-btn {
    background: var(--white);
    border: 2px solid var(--secondary-light);
    border-radius: 10px;
    padding: 12px 8px;
    font-size: 0.95rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
}

.chain-option-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.02);
}

.chain-tip {
    text-align: center;
    font-size: 0.85rem;
    min-height: 20px;
    margin-bottom: 10px;
}

.chain-tip.correct {
    color: var(--correct-color);
    font-weight: bold;
}

.chain-tip.wrong {
    color: var(--wrong-color);
}

.chain-result-chain {
    background: var(--white);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 14px 0;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.8;
    box-shadow: var(--shadow-sm);
}

/* ==================== 限时挑战样式 ==================== */
.timed-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.timed-hp-bar {
    flex: 1;
    height: 14px;
    background: #eee;
    border-radius: 7px;
    overflow: hidden;
    margin-right: 10px;
}

.timed-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #e53935, #ff7043);
    border-radius: 7px;
    width: 100%;
    transition: width 0.3s;
}

.timed-hp-label {
    font-size: 0.9rem;
    color: var(--wrong-color);
    font-weight: bold;
    margin-right: 12px;
}

.timed-score-box {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.timed-timer-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.timed-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #43a047, #76ff03);
    border-radius: 4px;
    width: 100%;
    transition: width 0.1s linear, background 0.5s;
}

.timed-timer-fill.warning {
    background: linear-gradient(90deg, #ffa000, #ffea00);
}

.timed-timer-fill.danger {
    background: linear-gradient(90deg, #e53935, #ff5722);
}

.timed-timer-text {
    position: absolute;
    right: 6px;
    top: -18px;
    font-size: 0.75rem;
    color: #888;
}

/* 限时挑战填空线样式 */
.timed-screen .blank-line {
    display: inline-block;
    min-width: 80px;
    border-bottom: 2px dashed var(--secondary-color);
    margin: 0 8px;
    color: var(--secondary-color);
    font-family: 'KaiTi', 'STKaiti', 'FangSong', serif;
    font-size: 1.2rem;
}


.blank-box.blank-correct {
    border-bottom-color: var(--correct-color);
    color: var(--correct-color);
}

/* 单字输入框 */
.single-char-input {
    width: 60px !important;
    max-width: 60px !important;
    font-size: 2rem !important;
    padding: 10px !important;
}

/* ==================== 背景音乐控制 ==================== */
.bgm-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

#bgm-toggle {
    padding: 8px 15px;
    background: var(--white);
    border: 2px solid var(--secondary-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#bgm-toggle:hover {
    background: var(--secondary-color);
    color: var(--white);
}

#bgm-toggle.muted {
    opacity: 0.5;
    text-decoration: line-through;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .player-info {
        font-size: 1rem;
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .menu-buttons {
        gap: 10px;
    }
    
    .btn {
        padding: 10px 25px;
        font-size: 1rem;
    }
    
    .grade-selection {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .grade-btn {
        padding: 10px 5px;
    }
    
    .grade-name {
        font-size: 0.9rem;
    }
    
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
    }
    
    .result-item {
        padding: 8px;
    }
    
    .result-value {
        font-size: 1.3rem;
    }
    
    .poem-content {
        font-size: 1rem;
        padding: 10px;
        line-height: 1.6;
    }
    
    .option-btn {
        font-size: 0.95rem;
        padding: 10px 12px;
    }
    
    .question-area {
        padding: 12px;
    }
    
    .poem-info h3 {
        font-size: 1.2rem;
    }
    
    .certificate-inner {
        padding: 12px;
    }
    
    .certificate-title {
        font-size: 1.5rem;
    }
    
    .certificate-content {
        font-size: 0.85rem;
    }
    
    .teacher-character {
        width: 90px;
        height: 120px;
    }
    
    .teacher-face {
        width: 50px;
        height: 50px;
        left: 20px;
        top: 10px;
    }
    
    .teacher-dress {
        font-size: 3rem;
        left: 10px;
    }
    
    .teacher-eyes {
        gap: 8px;
        margin-top: 10px;
    }
    
    .eye {
        width: 6px;
        height: 6px;
    }
    
    .teacher-bubble {
        top: -40px;
        left: -60px;
        padding: 8px 10px;
        font-size: 0.75rem;
        max-width: 130px;
    }
}

/* ==================== 动画效果 ==================== */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 屏幕震动效果 */
.screen-shake {
    animation: screenShake 0.5s ease;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ==================== 古风装饰元素 ==================== */

/* 云纹装饰 */
.cloud-decoration {
    position: fixed;
    pointer-events: none;
    z-index: 2;
    opacity: 0.15;
    font-size: 3rem;
    animation: cloudFloat 20s ease-in-out infinite;
}

.cloud-decoration.top-left {
    top: 5%;
    left: 5%;
}

.cloud-decoration.top-right {
    top: 8%;
    right: 5%;
    animation-delay: -10s;
}

.cloud-decoration.bottom-left {
    bottom: 10%;
    left: 3%;
    animation-delay: -5s;
}

.cloud-decoration.bottom-right {
    bottom: 5%;
    right: 8%;
    animation-delay: -15s;
}

@keyframes cloudFloat {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(10px) translateY(-5px); }
    50% { transform: translateX(-5px) translateY(5px); }
    75% { transform: translateX(5px) translateY(-3px); }
}

/* 印章效果 */
.seal {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border: 3px solid var(--primary-dark);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 2px;
    box-shadow: 
        2px 2px 4px rgba(0,0,0,0.2),
        inset 0 0 10px rgba(0,0,0,0.1);
    transform: rotate(-5deg);
    opacity: 0.9;
}

/* 卷轴装饰 */
.scroll-decoration {
    position: relative;
    padding: 20px 30px;
    background: linear-gradient(180deg, 
        #F5F0E6 0%, 
        #FFFDF8 10%, 
        #FFFDF8 90%, 
        #F5F0E6 100%
    );
    border-left: 8px solid #8B4513;
    border-right: 8px solid #8B4513;
    box-shadow: 
        inset 0 0 20px rgba(139, 69, 19, 0.1),
        0 4px 15px rgba(0,0,0,0.1);
}

.scroll-decoration::before,
.scroll-decoration::after {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    height: 12px;
    background: linear-gradient(180deg, #654321 0%, #8B4513 50%, #654321 100%);
    border-radius: 6px;
}

.scroll-decoration::before {
    top: -6px;
}

.scroll-decoration::after {
    bottom: -6px;
}

/* 水墨边框 */
.ink-border {
    position: relative;
    padding: 20px;
    background: var(--white);
    border-radius: 8px;
}

.ink-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(139, 69, 19, 0.1) 50%, 
        transparent 70%
    );
    border-radius: 10px;
    z-index: -1;
}

/* 竹简纹理 */
.bamboo-texture {
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 28px,
            rgba(139, 69, 19, 0.05) 28px,
            rgba(139, 69, 19, 0.05) 30px
        ),
        linear-gradient(180deg, #F5F0E6 0%, #FFFDF8 100%);
}

/* 书法字体优化 */
.calligraphy {
    font-family: 'KaiTi', 'STKaiti', 'FangSong', 'SimSun', serif;
    letter-spacing: 0.1em;
    line-height: 1.8;
}

/* ══════════════════════════════════════════════════════════
   🗺️ 主题关卡 - 全局CSS变量
   ══════════════════════════════════════════════════════════ */

:root {
    --theme-primary: #C41E3A;
    --theme-secondary: #D4A574;
    --theme-bg: linear-gradient(135deg, #FDF8F0 0%, #F0E6D3 100%);
    --theme-card: rgba(196, 30, 58, 0.08);
    --theme-accent: #C41E3A;
}

/* 主题背景覆盖 */
body[data-theme] {
    background: var(--theme-bg) !important;
}

/* 主题关卡主入口按钮 */
.btn-theme-main {
    background: linear-gradient(135deg, #7b5ea7 0%, #4a4a9a 100%);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(123, 94, 167, 0.4);
    transition: all 0.25s var(--ease-smooth);
    letter-spacing: 0.05em;
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 8px;
    text-align: center;
}
.btn-theme-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 94, 167, 0.55);
    background: linear-gradient(135deg, #9b7ec7 0%, #5a5ab8 100%);
}

/* ══════════════════════════════════════════════════════════
   主题选择界面 (theme-select-screen)
   ══════════════════════════════════════════════════════════ */

#theme-select-screen {
    overflow-y: auto;
    overflow-x: hidden;
    align-items: flex-start;
    padding: 10px 0;
    /* 覆盖 .screen 的 overflow:hidden，确保可以滚动 */
    -webkit-overflow-scrolling: touch;
}

.theme-select-container {
    width: 100%;
    max-width: 860px;
    padding-bottom: 24px;
}

.ts-header {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 10px;
}

.ts-title {
    font-size: 1.7rem;
    font-weight: 800;
    background: linear-gradient(135deg, #7b5ea7, #c41e3a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.ts-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ts-group {
    margin-bottom: 22px;
}

.ts-group-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
    padding: 0 4px;
}

.ts-group-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    position: relative;
}
.ts-group-label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

.ts-group-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ts-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

/* 主题卡片 */
.ts-card {
    border-radius: 16px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ts-card.unlocked {
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.ts-card.unlocked:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.ts-card.locked {
    background: rgba(200, 200, 200, 0.15);
    border-color: rgba(150, 150, 150, 0.2);
    cursor: not-allowed;
    opacity: 0.75;
}

.ts-card-icon {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 4px;
}

.ts-card-name {
    font-size: 1rem;
    font-weight: 700;
}

.ts-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    flex: 1;
}

.ts-card-stars {
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-top: 4px;
}

.ts-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 4px;
}

.ts-status {
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
}
.ts-status.new    { background: rgba(196, 30, 58, 0.1); color: #c41e3a; }
.ts-status.cleared{ background: rgba(46, 125, 50, 0.1); color: #2e7d32; }
.ts-status.perfect{ background: rgba(255, 193, 7, 0.15); color: #e65100; }
.ts-status.locked { background: rgba(150,150,150,0.1); color: #888; font-size: 0.68rem; }

.ts-best {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 通关彩带 */
.ts-ribbon {
    position: absolute;
    top: 10px;
    right: -14px;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 20px 3px 8px;
    transform: rotate(35deg);
    transform-origin: top right;
    z-index: 2;
}

.ts-ribbon.cleared-ribbon {
    background: rgba(46, 125, 50, 0.85);
    color: #fff;
}

.ts-ribbon.perfect-ribbon {
    background: linear-gradient(90deg, #ff9800, #e65100);
    color: #fff;
}


.ts-collection {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 14px 18px;
    margin-top: 10px;
    border: 1px solid rgba(196, 30, 58, 0.1);
}

.ts-col-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.ts-badges {
    font-size: 1.4rem;
    letter-spacing: 4px;
    margin-bottom: 6px;
}

.ts-titles {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

.ts-global-stats {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(196, 30, 58, 0.1);
    flex-wrap: wrap;
}

.ts-global-stats span {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(196, 30, 58, 0.06);
    border-radius: 20px;
    padding: 3px 10px;
    font-weight: 600;
}



.ts-footer {
    margin-top: 16px;
    text-align: center;
}

/* ══════════════════════════════════════════════════════════
   主题游戏界面 (theme-game-screen)
   ══════════════════════════════════════════════════════════ */

#theme-game-screen {
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--theme-bg) !important;
    transition: background 0.6s ease;
}

.theme-game-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 顶部信息栏 */
.tg-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    flex-shrink: 0;
    z-index: 20;
    gap: 10px;
}

.tg-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.tg-exit-btn {
    background: none;
    border: 1.5px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.tg-exit-btn:hover {
    background: rgba(196, 30, 58, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tg-theme-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--theme-accent, var(--primary-color));
}

.tg-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.tg-progress-bar {
    width: 100%;
    max-width: 200px;
    height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.tg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-primary, #c41e3a), var(--theme-secondary, #d4a574));
    border-radius: 3px;
    transition: width 0.4s var(--ease-smooth);
    width: 0%;
}

.tg-progress-text {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.tg-right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.tg-score-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1;
}

.tg-score {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--theme-accent, var(--primary-color));
    line-height: 1;
}

/* 连击显示 */
.theme-combo {
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: #e65100;
    padding: 4px 0;
    min-height: 28px;
    transition: all 0.3s;
    position: relative;
    z-index: 10;
}
.theme-combo.active {
    font-size: 1.15rem;
    animation: comboPop 0.4s var(--ease-bounce);
    color: #d32f2f;
    text-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

@keyframes comboPop {
    0% { transform: scale(0.7); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 题目区域 */
.tg-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 80px;
}

.tg-question-area {
    max-width: 700px;
    margin: 0 auto;
}

/* 题目卡片 */
.t-question {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    border: 1.5px solid rgba(0,0,0,0.05);
}

.boss-question {
    border-color: rgba(196, 30, 58, 0.3);
    box-shadow: 0 4px 20px rgba(196, 30, 58, 0.12);
}

.boss-tag {
    display: inline-block;
    background: linear-gradient(135deg, #c41e3a, #ff4444);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.35);
}

.t-poem-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.t-poem-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--theme-accent, var(--primary-color));
    font-family: 'KaiTi', 'STKaiti', serif;
}

.t-poem-author {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.t-poem-body {
    background: var(--theme-card, rgba(196, 30, 58, 0.04));
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-left: 3px solid var(--theme-primary, #c41e3a);
}

.t-poem-line {
    font-size: 1rem;
    color: var(--text-color);
    line-height: 2;
    font-family: 'KaiTi', 'STKaiti', serif;
    letter-spacing: 0.08em;
}

.t-blank-line {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 2;
    letter-spacing: 3px;
    font-style: italic;
    border-bottom: 2px dashed var(--theme-primary, #c41e3a);
    margin: 2px 0;
    padding-bottom: 2px;
    color: var(--theme-accent, var(--primary-color));
    opacity: 0.6;
}

/* 选项按钮 */
.t-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.t-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s var(--ease-smooth);
    font-size: 0.95rem;
    color: var(--text-color);
    width: 100%;
}

.t-option-btn:hover:not(:disabled) {
    border-color: var(--theme-primary, #c41e3a);
    background: var(--theme-card, rgba(196, 30, 58, 0.04));
    transform: translateX(4px);
}

.t-option-btn:disabled { cursor: default; }

.opt-letter {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--theme-primary, #c41e3a), var(--theme-secondary, #d4a574));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.opt-text {
    font-family: 'KaiTi', 'STKaiti', serif;
    letter-spacing: 0.05em;
}

/* 选项反馈状态 */
.t-opt-correct {
    border-color: #2e7d32 !important;
    background: rgba(46, 125, 50, 0.08) !important;
}
.t-opt-correct .opt-letter {
    background: #2e7d32 !important;
}

.t-opt-wrong {
    border-color: #c62828 !important;
    background: rgba(198, 40, 40, 0.08) !important;
}
.t-opt-wrong .opt-letter {
    background: #c62828 !important;
}

/* 反馈提示 */
.theme-feedback {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s var(--ease-bounce);
    z-index: 100;
    white-space: nowrap;
}

.theme-feedback.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.theme-feedback.correct {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: white;
    box-shadow: 0 4px 20px rgba(46, 125, 50, 0.4);
}

.theme-feedback.wrong {
    background: linear-gradient(135deg, #c62828, #ef5350);
    color: white;
    box-shadow: 0 4px 20px rgba(198, 40, 40, 0.4);
}

.theme-feedback.boss {
    background: linear-gradient(135deg, #e65100, #ff8f00);
    color: white;
    box-shadow: 0 4px 20px rgba(230, 81, 0, 0.4);
}

/* fadeInUp 动画 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   主题结算界面 (theme-result-screen)
   ══════════════════════════════════════════════════════════ */

#theme-result-screen {
    background: linear-gradient(135deg, #fdf8f0, #f0e6d3);
}

.theme-result-container {
    text-align: center;
    max-width: 520px;
}

.tr-title {
    font-size: 1.7rem;
    font-weight: 800;
    background: linear-gradient(135deg, #7b5ea7, #c41e3a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.tr-theme-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.tr-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.tr-stat-card {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 14px;
    padding: 14px 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.04);
}

.tr-stat-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.tr-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 4px;
}

.tr-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* 奖励区域 */
.tr-reward {
    margin-bottom: 20px;
}
.tr-reward.hidden { display: none; }

.tr-new-reward {
    background: linear-gradient(135deg, #fff8e1, #fff3e0);
    border: 2px solid #ffd54f;
    border-radius: 16px;
    padding: 16px 20px;
    animation: rewardPop 0.6s var(--ease-bounce);
}

@keyframes rewardPop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.tr-badge {
    font-size: 2.5rem;
    margin-bottom: 6px;
}

.tr-title-earn {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e65100;
}

.tr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════
   主题粒子特效
   ══════════════════════════════════════════════════════════ */

@keyframes particleFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(50vh) translateX(calc(var(--drift) * 0.5)) rotate(180deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(110vh) translateX(var(--drift)) rotate(360deg);
        opacity: 0;
    }
}

/* ══════════════════════════════════════════════════════════
   响应式适配
   ══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .ts-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .ts-card {
        min-height: 130px;
    }
    .ts-card-icon { font-size: 1.8rem; }
    .ts-card-name { font-size: 0.9rem; }

    .tr-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tg-theme-label { display: none; }

    .t-option-btn {
        padding: 10px 12px;
        font-size: 0.88rem;
    }

    .t-poem-title { font-size: 1rem; }
    .t-poem-line, .t-blank-line { font-size: 0.95rem; }
}


/* 诗词卡片 */
.poem-card {
    background: linear-gradient(135deg, #FFFDF8 0%, #F8F4ED 100%);
    border: 1px solid rgba(212, 165, 116, 0.4);
    border-radius: 12px;
    padding: 25px;
    position: relative;
    box-shadow: 
        0 4px 12px rgba(139, 69, 19, 0.08),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

.poem-card::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    opacity: 0.1;
    border-radius: 50%;
}

/* 装饰角标 */
.corner-decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--secondary-color);
    opacity: 0.4;
}

.corner-decoration.top-left {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.corner-decoration.top-right {
    top: 10px;
    right: 10px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 8px 0 0;
}

.corner-decoration.bottom-left {
    bottom: 10px;
    left: 10px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 8px;
}

.corner-decoration.bottom-right {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}
