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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'KaiTi', 'STKaiti', '楷体', serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    background-attachment: fixed;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.home-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9) 0%, rgba(255, 111, 0, 0.9) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(255, 111, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 1) 0%, rgba(255, 111, 0, 1) 100%);
    border-color: rgba(255, 215, 0, 0.6);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 111, 0, 0.4);
}

header::before {
    content: '🌸';
    position: absolute;
    font-size: 2.5em;
    top: 30px;
    right: 30px;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

header::after {
    content: '🍃';
    position: absolute;
    font-size: 2em;
    top: 50px;
    right: 50px;
    opacity: 0.5;
    animation: float 4s ease-in-out infinite reverse;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

header h1 {
    color: white;
    font-size: 2.8em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: titlePulse 3s ease-in-out infinite;
    background: linear-gradient(90deg, #fff, #ffeaa7, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
}

@keyframes titlePulse {
    0%, 100% {
        background-position: 0% 50%;
        transform: scale(1);
    }
    50% {
        background-position: 100% 50%;
        transform: scale(1.02);
    }
}

.subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2em;
    font-weight: 300;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

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

/* Grade Navigation */
.grade-nav {
    display: flex;
    padding: 20px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-bottom: 3px solid #d35400;
    gap: 10px;
    overflow-x: auto;
    box-shadow: 0 4px 15px rgba(211, 84, 0, 0.1);
}

.grade-btn {
    flex: 1;
    min-width: 90px;
    padding: 12px 20px;
    border: 2px solid transparent;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: #8e44ad;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.grade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(142, 68, 173, 0.1) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.grade-btn:hover {
    background: #fff5f8;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 15px rgba(142, 68, 173, 0.25);
}

.grade-btn:hover::before {
    transform: translateX(100%);
}

.grade-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

.grade-btn.active::after {
    content: '🌸';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.8em;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(5deg); }
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 15px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.3);
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    color: #6c757d;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font-size: 1.1em;
    opacity: 0.5;
}

.filter-btn[data-filter="all"]::before { content: '📖'; }
.filter-btn[data-filter="learned"]::before { content: '✨'; }
.filter-btn[data-filter="favorite"]::before { content: '❤️'; }

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

.filter-btn.active::before {
    opacity: 1;
}

/* Poem List */
.poem-list {
    display: grid;
    gap: 20px;
    animation: staggerIn 0.6s ease;
}

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

.poem-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.poem-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.poem-card:hover {
    border-color: #667eea;
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2);
}

.poem-card:hover::before {
    opacity: 1;
}

.poem-card.favorite::after {
    content: '❤️';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.3em;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 2px 4px rgba(255, 0, 0, 0.2));
}

.poem-card.learned::before {
    content: '✨';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.3em;
    filter: drop-shadow(0 2px 4px rgba(0, 255, 0, 0.2));
}

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

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

.poem-card-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #8b4513;
    margin-bottom: 8px;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    text-shadow: 0 1px 2px rgba(139, 69, 19, 0.1);
}

.poem-card-author {
    color: #d35400;
    font-size: 0.95em;
    margin-bottom: 12px;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    font-style: italic;
}

.poem-card-preview {
    color: #6c757d;
    font-size: 0.95em;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    background: linear-gradient(135deg, #fff9f0 0%, #ffe8e0 100%);
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 4px solid #e67e22;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.1);
    position: relative;
}

.poem-card-preview::after {
    content: '📜';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2em;
    opacity: 0.3;
}

/* Poem Detail */
.poem-detail {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #fffbf0 0%, #fff9f0 100%);
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.4s ease;
}

.poem-detail::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(102, 126, 234, 0.05) 100%);
    pointer-events: none;
    z-index: -1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.back-btn {
    padding: 15px 25px;
    border: 2px solid #e9ecef;
    background: white;
    cursor: pointer;
    font-size: 1em;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin: 15px;
}

.back-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.poem-content {
    flex: 1;
    padding: 40px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.6s ease;
}

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

.poem-title {
    font-size: 2.2em;
    color: #8b4513;
    text-align: center;
    margin-bottom: 15px;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(139, 69, 19, 0.1);
    background: linear-gradient(135deg, #ffeaa7 0%, #ffecd2 100%);
    padding: 15px 30px;
    border-radius: 15px;
    border: 3px solid #f39c12;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2);
    margin: 0 auto 20px auto;
    max-width: 400px;
}

.poem-author {
    text-align: center;
    color: #e67e22;
    font-size: 1.2em;
    margin-bottom: 30px;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    font-weight: 500;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdf2e9 100%);
    padding: 10px 25px;
    border-radius: 20px;
    border: 2px solid #f39c12;
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.15);
    display: inline-block;
    margin: 0 auto 25px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.poem-text {
    text-align: center;
    font-size: 1.5em;
    line-height: 2.2;
    color: #2c3e50;
    margin-bottom: 30px;
    white-space: pre-line;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 20px;
    background: linear-gradient(135deg, #fffbf0 0%, #fff9f0 100%);
    border-radius: 15px;
    border: 2px solid #f0e6d2;
    box-shadow: inset 0 2px 10px rgba(240, 230, 210, 0.1);
}

.poem-translation {
    background: linear-gradient(135deg, #e8f5e9 0%, #fef9e7 100%);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #d4e157;
    box-shadow: 0 4px 15px rgba(212, 225, 87, 0.1);
    margin-top: 20px;
}

.poem-translation.hidden {
    display: none;
}

.poem-translation h3 {
    color: #27ae60;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-align: center;
    font-weight: bold;
    font-family: 'KaiTi', 'STKaiti', '楷体', serif;
}

.translation-text {
    color: #2c3e50;
    line-height: 2;
    font-size: 1.05em;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    text-align: justify;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 25px;
    background: linear-gradient(135deg, #fff9f0 0%, #ffe8e0 100%);
    border-top: 3px solid #e67e22;
    position: sticky;
    bottom: 0;
    box-shadow: 0 -4px 15px rgba(230, 126, 34, 0.1);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 12px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(102, 126, 234, 0.05) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.action-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.action-btn:hover::before {
    transform: translateX(100%);
}

.action-btn .icon {
    font-size: 1.6em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.action-btn .text {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: 500;
}

.action-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

.action-btn.active .text {
    color: white;
}

.action-btn.active .icon {
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.3));
}

/* Progress Bar */
.progress-bar {
    padding: 25px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-top: 3px solid #00b894;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1em;
    font-weight: 600;
}

.progress-info span:first-child::before {
    content: '📊 ';
    font-size: 1.2em;
}

.progress-track {
    height: 14px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00b894 0%, #55efc4 50%, #00cec9 100%);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 184, 148, 0.3);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .app-container {
        border-radius: 15px;
        min-height: calc(100vh - 20px);
    }

    header h1 {
        font-size: 1.8em;
    }

    .home-btn {
        font-size: 0.8em;
        padding: 8px 15px;
        top: 15px;
        left: 15px;
    }

    .grade-nav {
        padding: 12px;
        gap: 8px;
    }

    .grade-btn {
        padding: 10px 15px;
        font-size: 0.8em;
        min-width: 50px;
    }

    .poem-content {
        padding: 25px 20px;
    }

    .poem-title {
        font-size: 1.5em;
        padding: 12px 20px;
    }

    .poem-text {
        font-size: 1.3em;
        padding: 15px;
    }

    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }

    .action-btn {
        padding: 15px 10px;
    }

    .poem-author {
        padding: 8px 15px;
        margin: 0 auto 15px;
    }

    .filter-bar {
        gap: 8px;
        padding: 12px;
    }

    .filter-btn {
        padding: 8px 18px;
        font-size: 0.85em;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.empty-state .icon {
    font-size: 4em;
    margin-bottom: 20px;
    display: block;
}

.empty-state h3 {
    color: #7f8c8d;
    margin-bottom: 10px;
}
