/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.title-icon {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}

/* 按钮样式 */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #c41e3a, #a01729);
    color: white;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-outline {
    background: transparent;
    color: #c41e3a;
    border: 2px solid #c41e3a;
}

.btn-outline:hover {
    background: #c41e3a;
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

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

.btn-text {
    font-weight: 600;
}

/* 主要内容区 */
.main-content {
    flex: 1;
    padding: 2rem;
}

/* 模式选择器 */
.mode-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.8rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(196, 30, 58, 0.1), transparent);
    transition: left 0.5s;
}

.mode-btn:hover::before {
    left: 100%;
}

.mode-btn:hover {
    border-color: #c41e3a;
    color: #c41e3a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.2);
}

.mode-btn.active {
    background: linear-gradient(135deg, #c41e3a, #a01729);
    color: white;
    border-color: #c41e3a;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

/* 进度指示器 */
.progress-container {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c41e3a, #ff6b6b);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 12.5%;
}

.progress-text {
    font-weight: 600;
    color: #c41e3a;
    min-width: 60px;
    text-align: center;
}

/* 内容模式 */
.content-mode {
    animation: fadeIn 0.5s ease;
}

.content-mode.hidden {
    display: none;
}

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

/* 完整模式 - 网格布局 */
.regulations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
}

.regulation-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #c41e3a;
    transition: all 0.3s ease;
    position: relative;
}

.regulation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-number {
    background: linear-gradient(135deg, #c41e3a, #a01729);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.card-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}

/* 单项学习模式 */
.single-item-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.item-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #c41e3a;
}

.item-controls {
    display: flex;
    gap: 0.5rem;
}

.item-content {
    font-size: 1.1rem;
    line-height: 2;
    color: #333;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #c41e3a;
    transition: all 0.3s ease;
}

/* 简化的关键词高亮效果 */
.item-content.highlighted .keyword {
    background-color: #c41e3a;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    margin: 0 0.1rem;
    display: inline-block;
}

.item-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 测试模式 */
.test-container, .quiz-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.test-header, .quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.test-header h3, .quiz-header h3 {
    font-size: 1.5rem;
    color: #c41e3a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.random-indicator {
    font-size: 0.8rem;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1976d2;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: normal;
    border: 1px solid rgba(25, 118, 210, 0.2);
}

.test-score, .quiz-stats {
    display: flex;
    gap: 1rem;
    font-weight: 600;
}

.quiz-stats span {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1976d2;
    border: 1px solid rgba(25, 118, 210, 0.2);
}

.test-content, .quiz-content {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.test-question {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #c41e3a;
}

.test-text {
    line-height: 2.2;
    font-size: 1.1rem;
}

/* 优化的填空输入框 */
.inline-input {
    display: inline-block;
    min-width: 120px;
    padding: 0.5rem 1rem;
    border: 2px solid #c41e3a;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    font-family: inherit;
    text-align: center;
    margin: 0 0.3rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.2);
    position: relative;
}

.inline-input::placeholder {
    color: #c41e3a;
    opacity: 0.6;
}

.inline-input:focus {
    outline: none;
    border-color: #ff6b6b;
    background: rgba(196, 30, 58, 0.05);
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.1);
    transform: scale(1.05);
}

.inline-input.correct {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    color: #28a745;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.inline-input.incorrect {
    border-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    color: #dc3545;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.correct-answer {
    color: #28a745;
    font-weight: 600;
    margin-left: 0.8rem;
    opacity: 0;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.correct-answer.show {
    opacity: 1;
    animation: slideInBounce 0.5s ease;
}

@keyframes slideInBounce {
    0% {
        opacity: 0;
        transform: translateX(-20px) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateX(5px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.test-actions, .quiz-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 问答模式 */
.quiz-question {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #c41e3a;
}

.quiz-answer {
    background: linear-gradient(135deg, #e8f5e8, #f1f8f1);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    margin-bottom: 1rem;
}

.quiz-keywords {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.keyword-tag {
    display: inline-block;
    background: linear-gradient(135deg, #c41e3a, #a01729);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin: 0.2rem;
    box-shadow: 0 2px 4px rgba(196, 30, 58, 0.3);
    transition: all 0.3s ease;
}

.keyword-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(196, 30, 58, 0.4);
}

/* 底部样式 */
.footer {
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e0e0e0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.study-stats {
    display: flex;
    gap: 2rem;
    font-weight: 500;
    color: #666;
}

.footer-actions {
    display: flex;
    gap: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .header {
        padding: 1rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .mode-selector {
        justify-content: center;
    }
    
    .mode-btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
    
    .regulations-grid {
        grid-template-columns: 1fr;
    }
    
    .regulation-card {
        padding: 1rem;
    }
    
    .single-item-container,
    .test-container,
    .quiz-container {
        padding: 1.5rem;
    }
    
    .item-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .item-controls {
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .study-stats {
        justify-content: center;
    }
    
    .test-actions,
    .quiz-actions,
    .item-actions {
        flex-direction: column;
    }
    
    .inline-input {
        min-width: 100px;
        margin: 0.2rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.2rem;
    }
    
    .title-icon {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .mode-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .card-content,
    .item-content {
        font-size: 0.95rem;
    }
    
    .study-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .inline-input {
        min-width: 80px;
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
}


/* 免责声明样式 */
.disclaimer {
    background: linear-gradient(135deg, #c41e3a 0%, #8b1538 100%);
    color: white;
    padding: 2rem;
    margin-top: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.disclaimer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.disclaimer h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffeb3b;
}

.disclaimer p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.disclaimer p:last-child {
    margin-bottom: 0;
}

.disclaimer strong {
    font-weight: 700;
    color: #ffeb3b;
}

/* 响应式设计 - 免责声明 */
@media (max-width: 768px) {
    .disclaimer {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .disclaimer h3 {
        font-size: 1.3rem;
    }
    
    .disclaimer p {
        font-size: 0.9rem;
    }
}

