@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=ZCOOL+XiaoWei&display=swap');
:root {
    --primary: #8B4513;
    --primary-light: #A0522D;
    --primary-dark: #6B3410;
    --accent: #D4A574;
    --accent-light: #E8C9A0;
    --bg-cream: #FDF5E6;
    --bg-warm: #FAF0E6;
    --text-dark: #3E2723;
    --text-mid: #5D4037;
    --text-light: #8D6E63;
    --gold: #C9A96E;
    --gold-light: #E0C992;
    --green: #4CAF50;
    --green-dark: #388E3C;
    --orange: #FF9800;
    --orange-dark: #F57C00;
    --red: #E53935;
    --red-dark: #C62828;
    --purple: #7E57C2;
    --shadow: rgba(139, 69, 19, 0.15);
    --shadow-strong: rgba(139, 69, 19, 0.25);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif SC', 'ZCOOL XiaoWei', 'SimSun', 'STSong', serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    position: relative;
    min-height: 100vh;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(212, 165, 116, 0.15) 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, rgba(201, 169, 110, 0.1) 0%, transparent 50%), radial-gradient(ellipse at 50% 80%, rgba(139, 69, 19, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.bg-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238B4513' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.95), rgba(107, 52, 16, 0.95));
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px var(--shadow-strong);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.app-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-right {
    display: flex;
    gap: 8px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--gold-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.nav-btn:active {
    transform: scale(0.95);
}

.main-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

#page-learn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--poem-bg, none);
    background-size: contain;
    background-position: center;
    background-repeat: repeat-y;
    opacity: 0.9;
    filter: blur(3px);
    z-index: -1;
    border-radius: var(--radius-lg);
    transition: opacity 0.3s ease;
}

#page-learn {
    position: relative;
    overflow: hidden;
}

.page {
    display: none;
    animation: fadeSlideIn 0.4s ease-out;
}

.page.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.home-header {
    text-align: center;
    margin-bottom: 24px;
}

.date-display {
    font-size: 1.1rem;
    color: var(--text-mid);
    font-weight: 400;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.progress-bar-wrap {
    position: relative;
    margin: 0 auto;
    max-width: 400px;
}

.progress-bar {
    height: 8px;
    background: rgba(139, 69, 19, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--primary-light));
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.progress-text {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 6px;
}

.home-status {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.status-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    padding: 16px 8px;
    text-align: center;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid rgba(139, 69, 19, 0.08);
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow-strong);
}

.status-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.status-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

.btn-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--gold-light);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.2rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.3);
    letter-spacing: 2px;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(139, 69, 19, 0.4);
}

.btn-start:active {
    transform: translateY(0);
}

.btn-start-icon {
    font-size: 1.4rem;
}

.btn-start.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.home-done {
    text-align: center;
    padding: 40px 20px;
    animation: bounceIn 0.6s ease-out;
}

.done-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.home-done p {
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 600;
}

.done-sub {
    font-size: 0.9rem !important;
    color: var(--text-light) !important;
    font-weight: 400 !important;
    margin-top: 8px;
}

.btn-advance-review {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(255, 152, 0, 0.3);
    letter-spacing: 2px;
}

.btn-advance-review:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 152, 0, 0.4);
}

.btn-advance-review:active {
    transform: translateY(0);
}

.btn-advance-icon {
    font-size: 1.2rem;
}

.btn-continue {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--gold-light);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.3);
    letter-spacing: 2px;
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(139, 69, 19, 0.4);
}

.btn-continue:active {
    transform: translateY(0);
}

.btn-continue-icon {
    font-size: 1.2rem;
}

.poem-image-wrap {
    margin-top: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.poem-image-wrap:hover {
    box-shadow: 0 4px 20px var(--shadow-strong);
}

.poem-image-wrap::after {
    content: '🔍 点击查看大图';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    color: white;
    font-size: 0.75rem;
    text-align: center;
    opacity: 0;
    transition: var(--transition);
}

.poem-image-wrap:hover::after {
    opacity: 1;
}

.poem-image {
    width: 100%;
    display: block;
    border-radius: var(--radius);
    transition: transform 0.3s ease;
}

.poem-image-wrap.no-image {
    display: none;
}

.btn-show-poem {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--gold-light);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 2px;
    box-shadow: 0 3px 15px rgba(139, 69, 19, 0.25);
    animation: pulse 2s ease-in-out infinite;
}

.btn-show-poem:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 69, 19, 0.35);
    animation: none;
}

.btn-show-poem:active {
    transform: translateY(0);
}

.poem-detail.collapsed {
    display: none;
}

.poem-detail.expanding {
    animation: fadeSlideIn 0.5s ease-out;
}

.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer.hidden {
    display: none !important;
}

.viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.2s ease;
}

.viewer-container {
    position: relative;
    z-index: 1;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.viewer-image {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

.viewer-image:active {
    cursor: grabbing;
}

.viewer-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.viewer-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.viewer-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.viewer-btn:active {
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}

.poem-card {
    background: rgba(255, 255, 255, 0.55);
    text-shadow: 0px 0px 12px #ffffff;
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: 0 4px 30px var(--shadow);
    border: 1px solid rgba(139, 69, 19, 0.08);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    animation: cardSlideIn 0.5s ease-out;
    backdrop-filter: blur(10px);
}

.poem-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--primary-light), var(--gold));
}

.poem-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--gold), var(--accent));
    color: white;
}

.poem-badge.review {
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
}

.poem-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 3px;
    opacity: 0.9;
}

.poem-author {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 24px;
    letter-spacing: 2px;
    opacity: 0.8;
}

.poem-content {
    text-align: center;
    line-height: 2.8;
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    letter-spacing: 2px;
    opacity: 0.95;
}

.poem-content .line {
    display: block;
    margin-bottom: 4px;
}

.poem-content .keyword {
    color: var(--primary);
    font-weight: 600;
    position: relative;
}

.poem-content .keyword-num {
    font-size: 0.6rem;
    color: var(--primary-light);
    vertical-align: super;
    margin-left: 1px;
}

.poem-pinyin {
    display: none;
}

.poem-content ruby {
    ruby-position: over;
}

.poem-content rt {
    font-size: 0.55em;
    color: var(--text-light);
    font-weight: 400;
    letter-spacing: 0;
    font-family: 'Noto Serif SC', serif;
}

.section-title {
    font-size: 0.85rem;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid var(--gold);
}

.poem-notes {
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.08), rgba(212, 165, 116, 0.05));
    border-radius: var(--radius);
    border-left: 3px solid var(--gold);
    opacity: 0.9;
}

.poem-notes::before {
    content: '📝 词句注释';
    display: block;
    font-size: 0.85rem;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 10px;
}

.poem-notes .note-item {
    font-size: 0.85rem;
    color: var(--text-mid);
    line-height: 1.8;
    margin-bottom: 4px;
}

.note-item .note-key {
    color: var(--primary);
    font-weight: 600;
}

.poem-analysis {
    padding: 16px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.05), rgba(139, 69, 19, 0.02));
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-light);
    opacity: 0.9;
}

.poem-analysis::before {
    content: '💡 通俗解析';
    display: block;
    font-size: 0.85rem;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 10px;
}

.poem-analysis p {
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.8;
}

.action-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: linear-gradient(to top, var(--bg-cream) 85%, transparent);
    padding: 12px 16px 20px;
    max-width: 680px;
    margin: 0 auto;
    animation: fadeSlideIn 0.3s ease-out;
}

.main-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

#page-learn .poem-card {
    margin-bottom: 180px;
}

.btn-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-action::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-action:active::after {
    width: 200px;
    height: 200px;
}

.btn-icon {
    font-size: 1.5rem;
}

.btn-know {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    color: var(--green-dark);
    border-color: rgba(76, 175, 80, 0.3);
}

.btn-know:hover {
    background: linear-gradient(135deg, #C8E6C9, #A5D6A7);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-fuzzy {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    color: var(--orange-dark);
    border-color: rgba(255, 152, 0, 0.3);
}

.btn-fuzzy:hover {
    background: linear-gradient(135deg, #FFE0B2, #FFCC80);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.btn-forget {
    background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
    color: var(--red-dark);
    border-color: rgba(229, 57, 53, 0.3);
}

.btn-forget:hover {
    background: linear-gradient(135deg, #FFCDD2, #EF9A9A);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

.btn-action:active {
    transform: translateY(0) scale(0.97);
}

.btn-mastered {
    display: block;
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px dashed var(--text-light);
    border-radius: var(--radius);
    color: var(--text-light);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-mastered:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: rgba(126, 87, 194, 0.05);
}

.page-title-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.page-title-bar h2 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    letter-spacing: 2px;
}

.btn-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(139, 69, 19, 0.2);
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.btn-back:hover {
    background: var(--primary);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.stat-block {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    padding: 20px 8px;
    text-align: center;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid rgba(139, 69, 19, 0.08);
    backdrop-filter: blur(5px);
}

.stat-big {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

.memory-chart {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 2px 12px var(--shadow);
    margin-bottom: 28px;
    backdrop-filter: blur(5px);
}

.memory-chart h3 {
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-label {
    width: 60px;
    font-size: 0.75rem;
    color: var(--text-mid);
    text-align: right;
    flex-shrink: 0;
}

.chart-bar-bg {
    flex: 1;
    height: 20px;
    background: rgba(139, 69, 19, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

.chart-count {
    width: 30px;
    font-size: 0.75rem;
    color: var(--text-light);
    flex-shrink: 0;
}

.poem-list-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 2px 12px var(--shadow);
    backdrop-filter: blur(5px);
}

.poem-list-section h3 {
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.poem-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 16px;
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 20px;
    background: transparent;
    color: var(--text-mid);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-btn:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

.poem-list {
    max-height: 400px;
    overflow-y: auto;
}

.poem-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.06);
    transition: var(--transition);
}

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

.poem-list-item:hover {
    background: rgba(139, 69, 19, 0.03);
}

.poem-list-info {
    flex: 1;
}

.poem-list-title {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 600;
}

.poem-list-author {
    font-size: 0.75rem;
    color: var(--text-light);
}

.poem-list-status {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.status-unlearned {
    background: rgba(139, 69, 19, 0.08);
    color: var(--text-light);
}

.status-learning {
    background: rgba(255, 152, 0, 0.15);
    color: var(--orange-dark);
}

.status-mastered {
    background: rgba(126, 87, 194, 0.15);
    color: var(--purple);
}

.data-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.data-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 2px 12px var(--shadow);
    text-align: center;
    border: 1px solid rgba(139, 69, 19, 0.08);
    backdrop-filter: blur(5px);
}

.data-card-danger {
    border-color: rgba(229, 57, 53, 0.15);
}

.data-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.data-card h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.data-card p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.6;
}

.btn-data-action {
    padding: 10px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--gold-light);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-data-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.btn-data-action:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), var(--red-dark)) !important;
    color: white !important;
}

.btn-danger:hover {
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3) !important;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 28px;
    background: rgba(62, 39, 35, 0.9);
    color: white;
    border-radius: 30px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    display: block !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: bounceIn 0.3s ease-out;
    backdrop-filter: blur(10px);
}

.modal h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
    text-align: center;
}

.modal p {
    font-size: 0.9rem;
    color: var(--text-mid);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-modal {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-modal-cancel {
    background: rgba(139, 69, 19, 0.08);
    color: var(--text-mid);
}

.btn-modal-cancel:hover {
    background: rgba(139, 69, 19, 0.15);
}

.btn-modal-confirm {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--gold-light);
}

.btn-modal-confirm:hover {
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.poem-list::-webkit-scrollbar {
    width: 4px;
}

.poem-list::-webkit-scrollbar-track {
    background: transparent;
}

.poem-list::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.2);
    border-radius: 2px;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-icon {
    font-size: 3rem;
    animation: float 2s ease-in-out infinite;
    margin-bottom: 16px;
}

.loading-text {
    font-size: 1rem;
    color: var(--text-light);
    letter-spacing: 3px;
}

@media (max-width: 480px) {
    .main-content {
        padding: 12px 12px 30px;
    }
    .home-status {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .status-num {
        font-size: 1.4rem;
    }
    .poem-title {
        font-size: 1.3rem;
    }
    .poem-content {
        font-size: 1.05rem;
    }
    .poem-card {
        padding: 20px 16px;
    }
    .btn-action {
        padding: 12px 8px;
    }
    .btn-icon {
        font-size: 1.3rem;
    }
    .app-title {
        font-size: 1rem;
    }
    .stat-big {
        font-size: 1.5rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .main-content {
        padding: 16px 16px 36px;
    }
}

@media (min-width: 769px) {
    .main-content {
        padding: 24px 20px 50px;
    }
    .poem-card {
        padding: 36px 32px;
    }
}

@media (prefers-color-scheme: dark) {
     :root {
        --bg-cream: #1a1410;
        --bg-warm: #211a14;
        --text-dark: #E8D5C4;
        --text-mid: #C4A882;
        --text-light: #9E8B7A;
        --shadow: rgba(0, 0, 0, 0.3);
        --shadow-strong: rgba(0, 0, 0, 0.5);
    }
    body {
        background: var(--bg-cream);
    }
    .status-card,
    .stat-block,
    .memory-chart,
    .poem-list-section,
    .data-card,
    .poem-card,
    .modal {
        background: rgba(42, 32, 24, 0.55);
        border-color: rgba(201, 169, 110, 0.15);
        backdrop-filter: blur(10px);
    }
    .progress-bar {
        background: rgba(201, 169, 110, 0.15);
    }
    .poem-pinyin {
        background: rgba(201, 169, 110, 0.08);
    }
    .poem-notes {
        background: rgba(201, 169, 110, 0.06);
    }
    .poem-analysis {
        background: rgba(139, 69, 19, 0.1);
    }
    .btn-know {
        background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
    }
    .btn-fuzzy {
        background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), rgba(255, 152, 0, 0.1));
    }
    .btn-forget {
        background: linear-gradient(135deg, rgba(229, 57, 53, 0.2), rgba(229, 57, 53, 0.1));
    }
    .btn-back {
        background: #2a2018;
    }
    .chart-bar-bg {
        background: rgba(201, 169, 110, 0.1);
    }
    .filter-btn {
        border-color: rgba(201, 169, 110, 0.2);
    }
    .poem-list-item:hover {
        background: rgba(201, 169, 110, 0.05);
    }
    .modal-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
    .action-buttons {
        background: linear-gradient(to top, #1a1410 85%, transparent);
    }
}