/**
 * 文档题目提取 - 样式文件
 * Document Question Extract CSS
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 100%;
    margin: 0;
    background: #f5f5f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === 顶部导航栏 === */
.header {
    background: white;
    color: #1f2937;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-button {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
}

.back-button:hover {
    background: #f3f4f6;
    color: #374151;
}

/* === 主内容区域 === */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* === 左侧文档列表面板 === */
.document-list-panel {
    width: 240px;
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.document-list-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.document-list-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.upload-btn-small {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.document-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.document-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.document-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.document-item.active {
    background: #ede9fe;
    border-color: #667eea;
}

.document-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-item-info {
    font-size: 11px;
    color: #6b7280;
}

/* === PDF预览面板 === */
.pdf-viewer-panel {
    flex: 1;
    background: #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-viewer-header {
    background: white;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdf-viewer-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* 页码跳转控制区域 */
.page-jump-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

/* PDF画布包装器 - 用于放置左右箭头 */
.pdf-canvas-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    background: #f3f4f6;
}

/* 左右翻页箭头按钮 */
.page-arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    font-size: 32px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-arrow-btn:hover:not(:disabled) {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.05);
}

.page-arrow-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-arrow-btn.left {
    left: 20px;
}

.page-arrow-btn.right {
    right: 20px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.zoom-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    color: #374151;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.zoom-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.zoom-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.zoom-level {
    font-size: 12px;
    color: #6b7280;
    min-width: 45px;
    text-align: center;
    font-weight: 500;
}

.page-nav-btn {
    padding: 4px 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: all 0.2s;
}

.page-nav-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.page-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 13px;
    color: #6b7280;
    min-width: 80px;
    text-align: center;
}

.pdf-canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    position: relative;
}

/* 美化滚动条 */
.pdf-canvas-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.pdf-canvas-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.pdf-canvas-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
    transition: background 0.2s;
}

.pdf-canvas-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.pdf-canvas-container::-webkit-scrollbar-corner {
    background: #f1f1f1;
}

.pdf-canvas-inner {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

/* Canvas样式 */
#pdfCanvasContainer canvas {
    display: block;
    max-width: none;
    height: auto;
    margin: 20px;
}

/* === 上传占位符 === */
.upload-placeholder {
    text-align: center;
    padding: 80px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.upload-placeholder-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 24px;
}

.upload-placeholder-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.upload-placeholder-text {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 32px;
    line-height: 1.6;
}

.upload-placeholder-btn {
    padding: 12px 32px;
    background: #2C3E50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.2);
}

.upload-placeholder-btn:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.upload-placeholder-hint {
    margin-top: 16px;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
}

.test-pdf-link {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.test-pdf-link:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

/* === 文字内容面板 === */
.text-content-panel {
    flex: 1;
    background: white;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.text-content-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-content-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.text-content-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.text-content-item {
    line-height: 1.8;
    color: #374151;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

.text-content-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* === 预览模式切换按钮 === */
.preview-mode-toggle {
    display: flex;
    gap: 8px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.mode-btn {
    padding: 6px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.2s;
    font-weight: 500;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #374151;
}

.mode-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* === 题目列表预览样式 === */
.questions-preview-section {
    flex: 1;
    overflow: hidden;
    padding: 16px;
    background: white;
    display: flex;
    flex-direction: column;
}

.questions-preview-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.questions-page-indicator {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.questions-page-indicator span {
    color: #667eea;
}

.btn-toggle-view-small {
    padding: 4px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #374151;
    transition: all 0.2s;
}

.btn-toggle-view-small:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.questions-preview-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.questions-preview-body.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.questions-preview-body.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.question-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s;
    cursor: pointer;
}

.question-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.question-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.question-number {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-page-info {
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
}

.question-content {
    font-size: 15px;
    color: #1f2937;
    margin-bottom: 12px;
    line-height: 1.6;
}

.question-stem {
    font-weight: 600;
    margin-bottom: 12px;
    color: #1f2937;
}

.question-options {
    margin-top: 12px;
    padding-left: 8px;
}

.question-option {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    padding: 6px 0;
    line-height: 1.6;
}

.question-option:last-child {
    margin-bottom: 0;
}

.option-label {
    font-weight: 600;
    color: #667eea;
    margin-right: 8px;
    min-width: 20px;
    flex-shrink: 0;
}

.option-text {
    color: #374151;
    flex: 1;
}

.question-answer {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-start;
}

.answer-label {
    font-weight: 600;
    color: #10b981;
    margin-right: 8px;
    flex-shrink: 0;
}

.answer-content {
    color: #1f2937;
    font-weight: 500;
    flex: 1;
}

.question-explanation {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.explanation-label {
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 8px;
    display: block;
}

.explanation-content {
    color: #374151;
    background: #f9fafb;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    margin-top: 6px;
}

.no-questions-message {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.no-questions-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* === 右侧功能选项面板 === */
/* === 合并后的题目列表面板 === */
.merged-questions-panel {
    width: 320px;
    background: white;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.merged-questions-panel.hidden {
    display: none;
}

.merged-questions-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    flex-shrink: 0;
}

.merged-questions-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.merged-questions-count {
    font-size: 13px;
    color: #6b7280;
}

.merged-questions-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.merged-question-item {
    margin-bottom: 12px;
    transition: all 0.2s;
}

.merged-question-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.options-panel {
    width: 480px;
    background: white;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.function-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.function-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.function-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* === 表单样式 === */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.section-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
    margin-bottom: 0;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* === 按钮组样式 === */
.button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.option-btn {
    flex: 1;
    min-width: 90px;
    padding: 10px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.option-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.option-btn.active {
    background: #ede9fe;
    border-color: #a78bfa;
    color: #7c3aed;
}

/* === 操作按钮 === */
.btn-extract {
    width: 100%;
    padding: 12px;
    background: #2C3E50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-extract:hover:not(:disabled) {
    background: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.btn-extract:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-extract-small {
    width: 100%;
    padding: 8px 16px;
    background: #2C3E50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-extract-small:hover:not(:disabled) {
    background: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.btn-extract-small:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* === 加载状态 === */
.loading {
    text-align: center;
    padding: 24px;
    color: #6b7280;
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 12px;
    font-size: 13px;
}

.progress-container {
    max-width: 400px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: progress-shimmer 1.5s infinite;
}

@keyframes progress-shimmer {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

.progress-text {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
}

/* === 工具类 === */
.hidden {
    display: none;
}

/* === 滚动条样式 === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

