* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.header {
    background-color: #4CAF50;
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.nav-btn {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn.active {
    background-color: white;
    color: #4CAF50;
}

.main {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background-color: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 法律选择器样式 */
.law-selector {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
}

.law-selector h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

#lawSelect {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#lawSelect:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.search-bar input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-bar button {
    padding: 0.5rem 1rem;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.book-list h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
}

#chapterList {
    list-style: none;
}

#chapterList li {
    background-color: white;
    margin-bottom: 0.5rem;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

#chapterList li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#chapterList li h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #4CAF50;
}

#chapterList li p {
    font-size: 0.9rem;
    color: #666;
}

/* 弹窗遮罩层 */
.article-detail-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.article-detail-overlay.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
}

/* 弹窗内容 */
.article-detail {
    background-color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

/* 弹窗动画 */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

#articleTitle {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

#articleContent {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #333;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-primary:hover, .btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.review-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sync-buttons {
    display: flex;
    gap: 0.5rem;
}

.review-list {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

/* 适配小屏幕 */
@media (max-width: 480px) {
    .review-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sync-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .sync-buttons button {
        flex: 1;
    }
}

.review-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.review-item:last-child {
    border-bottom: none;
}

.review-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #4CAF50;
}

.review-item p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.review-item .review-date {
    font-size: 0.8rem;
    color: #999;
}

.review-actions {
    margin-top: 0.5rem;
}

.review-actions button {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-right: 0.5rem;
}

.btn-easy {
    background-color: #4CAF50;
    color: white;
}

.btn-medium {
    background-color: #FFC107;
    color: white;
}

.btn-hard {
    background-color: #F44336;
    color: white;
}

/* 删除按钮样式 */
.btn-delete {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #999;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.btn-delete:hover {
    background-color: #ffebee;
    color: #f44336;
    transform: scale(1.1);
}

.footer {
    background-color: white;
    color: #666;
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    margin-top: 2rem;
    border-top: 1px solid #eee;
}

/* 一键到顶按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.back-to-top:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* 适配小屏幕 */
@media (max-width: 480px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 0.5rem;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    #chapterList li {
        padding: 0.8rem;
    }
    
    .article-detail {
        padding: 1rem;
    }
}