/* A4纸背单词法应用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

header h1 {
    color: #2c3e50;
    font-size: 1.8em;
}

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

#timer {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: bold;
    background: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
}

.timer-display button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

#start-timer {
    background: #27ae60;
    color: white;
}

#pause-timer {
    background: #f39c12;
    color: white;
}

#reset-timer {
    background: #e74c3c;
    color: white;
}

/* 主内容区域 */
main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* A4纸容器 */
.a4-paper-container {
    display: flex;
    justify-content: center;
}

.a4-paper {
    width: 100%;
    max-width: 800px;
    height: 1000px;
    background: white;
    border: 2px solid #ddd;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    background-image: linear-gradient(#ffffff 99%, #e0e0e0 100%);
    background-size: 100% 30px;
}

.a4-paper.lined {
    background-image: linear-gradient(to bottom, #ffffff 99%, #e0e0e0 100%);
    background-size: 100% 30px;
}

.a4-paper.grid {
    background-image: 
        linear-gradient(rgba(0,0,0,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
}

#paper-title {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    text-align: center;
    font-size: 1.2em;
    color: #666;
}

.words-on-paper {
    position: absolute;
    top: 60px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    align-content: start;
}

.paper-word {
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9em;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.paper-word.known {
    background: #d4edda;
    border-color: #c3e6cb;
}

.paper-word.familiar {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.paper-word.unknown {
    background: #f8d7da;
    border-color: #f5c6cb;
}

/* 单词学习面板 */
.word-learning-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
}

.word-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    border: 2px dashed #dee2e6;
}

.word-card h2 {
    font-size: 2em;
    margin-bottom: 10px;
    color: #2c3e50;
}

.word-card p {
    font-size: 1.2em;
    color: #666;
}

.word-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.word-actions button {
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
}

.btn-known {
    background: #28a745;
    color: white;
}

.btn-familiar {
    background: #ffc107;
    color: #212529;
}

.btn-unknown {
    background: #dc3545;
    color: white;
}

.progress-section {
    margin: 20px 0;
}

.progress-section h3 {
    margin-bottom: 10px;
    color: #495057;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #007bff;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 5px;
    text-align: center;
    font-weight: bold;
}

.stats-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stats-section h3 {
    margin-bottom: 10px;
    color: #495057;
}

/* 导航栏 */
.navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.navigation button {
    flex: 1;
    min-width: 100px;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #6c757d;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
}

.navigation button:hover {
    background: #5a6268;
}

.navigation button.active {
    background: #007bff;
}

/* 应用内容区域 */
.app-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: none;
}

.app-section.active {
    display: block;
}

/* 设置区域 */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setting-group label {
    font-weight: bold;
    margin-bottom: 5px;
}

.setting-group select,
.setting-group input {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* 统计卡片 */
.stat-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.stat-card h3 {
    margin-bottom: 10px;
    color: #495057;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .a4-paper {
        height: 500px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .word-card h2 {
        font-size: 1.5em;
    }
    
    .navigation {
        justify-content: center;
    }
}

/* 动画效果 */
@keyframes highlight {
    0% { transform: scale(1); background-color: transparent; }
    50% { transform: scale(1.1); background-color: #ffff99; }
    100% { transform: scale(1); background-color: transparent; }
}

.highlight-animation {
    animation: highlight 0.5s ease;
}

/* 循环复习效果 */
.review-highlight {
    background-color: #ffff99 !important;
    transition: background-color 0.5s ease;
}