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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
}

.input-section,
.control-section,
.output-section {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #555;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: #c9151e;
    box-shadow: 0 0 0 2px rgba(201, 21, 30, 0.1);
}

.control-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#process-btn {
    background-color: #c9151e;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 120px;
}

#process-btn:hover {
    background-color: #b8131a;
}

#process-btn:active {
    background-color: #a71117;
}

.settings {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

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

.setting-item label {
    margin-bottom: 0;
    white-space: nowrap;
}

input[type="number"] {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

input[type="number"]:focus {
    outline: none;
    border-color: #c9151e;
    box-shadow: 0 0 0 2px rgba(201, 21, 30, 0.1);
}

input[type="number"].disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 使用说明样式 */
.instructions {
    width: 100%;
    max-width: 800px;
    margin: 40px auto 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.instructions h3 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
}

.instructions ol {
    padding-left: 20px;
    margin: 0;
}

.instructions li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.5;
}

/* 页脚样式 */
.footer {
    width: 100%;
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    color: #666;
    font-style: italic;
}

.footer p {
    margin: 0;
}


#output-text {
    background-color: #f9f9f9;
    border-color: #e0e0e0;
}

/* 文言文预设内容选择区样式 */
/* 主样式定义 - 确保水平居中显示 */
.classic-texts-section {
    max-width: 1000px;
    margin: 40px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.classic-texts-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.texts-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

#back-to-texts {
    background: none;
    border: none;
    color: #c9151e;
    cursor: pointer;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#back-to-texts:hover:not(.hidden) {
    background-color: #f9f9f9;
}

#back-to-texts.hidden {
    display: none;
}

#current-text-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.texts-content {
    min-height: 200px;
}

.content-view {
    display: none;
}

.content-view.active {
    display: block;
}

.texts-content h4 {
    margin-bottom: 15px;
    color: #333;
}

/* 学期选择器样式 */
#semester-selector {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

#semester-selector:focus {
    outline: none;
    border-color: #c9151e;
    box-shadow: 0 0 0 2px rgba(201, 21, 30, 0.1);
}

/* 文本列表样式 */
#texts-list-ul {
    list-style-type: none;
}

#texts-list-ul li {
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #fff;
}

#texts-list-ul li:hover {
    background-color: #f9f9f9;
    border-color: #c9151e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

#texts-list-ul li.selected {
    background-color: #f9f9f9;
    border-color: #c9151e;
    box-shadow: 0 0 0 2px rgba(201, 21, 30, 0.1);
}

/* 文本信息样式 */
.text-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.text-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.text-author {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.text-category {
    font-size: 13px;
    color: #999;
}

.text-description {
    font-size: 14px;
    color: #555;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    line-height: 1.5;
}

/* 段落选择区样式 */
#paragraphs-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.placeholder-text {
    text-align: center;
    color: #999;
    padding: 40px;
    grid-column: 1 / -1;
}

.paragraph-card {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    transition: all 0.3s;
}

.paragraph-card:hover {
    border-color: #c9151e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.paragraph-card h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.paragraph-preview {
    height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

.select-paragraph-btn, .select-all-btn {
    width: 100%;
    padding: 10px;
    background-color: #c9151e;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.select-paragraph-btn:hover, .select-all-btn:hover {
    background-color: #b8131a;
}

.select-all-btn {
    grid-column: 1 / -1;
    margin-bottom: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .control-section {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    #process-btn {
        width: 100%;
    }
    
    .settings {
        justify-content: space-between;
    }
    
    .classic-texts-section {
        padding: 20px;
    }
    
    #paragraphs-container {
        grid-template-columns: 1fr;
    }
}

/* 合并经典文本区域标题样式 */
.classic-texts-section h3 {
    text-align: center;
    margin: 0 0 20px 0;
    color: #333;
    border-bottom: 2px solid #c9151e;
    padding-bottom: 10px;
}

/* 导航区域样式 */
.texts-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

#back-to-texts {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

#back-to-texts:hover {
    background-color: #e0e0e0;
    color: #333;
}

#current-text-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex-grow: 1;
}

/* 内容区域样式 */
.texts-content {
    height: 400px;
    position: relative;
}

.content-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

.content-view.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

/* 篇目列表样式 */
#texts-list-view {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#texts-list-view h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #c9151e;
    text-align: center;
}

#texts-list-ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#texts-list-ul li {
    padding: 10px;
    margin-bottom: 8px;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#texts-list-ul li:hover {
    background-color: #fff;
    transform: translateX(5px);
}

#texts-list-ul li.selected {
    background-color: #c9151e;
    color: white;
    font-weight: bold;
}

/* 段落列表样式 */
#paragraphs-list-view {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 通用类 */
.hidden {
    display: none !important;
}

.paragraphs-list h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #c9151e;
    text-align: center;
}

.placeholder-text {
    text-align: center;
    color: #888;
    font-style: italic;
    margin-top: 50px;
}

/* 段落卡片样式 */
.paragraph-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.paragraph-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.paragraph-card h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.paragraph-preview {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
    white-space: pre-wrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 按钮样式 */
.select-paragraph-btn,
.select-all-btn {
    background-color: #c9151e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.select-paragraph-btn:hover,
.select-all-btn:hover {
    background-color: #b8131a;
}

.select-all-btn {
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
    font-weight: bold;
}
    
    textarea {
        height: 150px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .settings {
        flex-direction: column;
        gap: 15px;
    }
    
    .setting-item {
        justify-content: space-between;
    }
    
    input[type="number"] {
        width: 70px;
    }
}