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

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: #f0f2f5;
    overflow: hidden;
}

/* Vue v-cloak 防止模板闪烁 */
[v-cloak] {
    display: none !important;
}

/* 加载提示 */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

#loading-screen .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

#loading-screen .loading-text {
    font-size: 18px;
    font-weight: 500;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 - 简洁科技风格 */
.top-navbar {
    height: 60px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

.top-navbar h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-navbar .brand-area {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.top-navbar .brand-logo {
    width: 190px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: transparent;
    flex: 0 0 auto;
}

.top-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.top-navbar .user-info span {
    padding: 5px 15px;
    background: rgba(255,255,255,0.15);
    border-radius: 15px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: inline-block;
        flex-shrink: 0;
    }

    .top-navbar {
        height: 50px;
        padding: 0 10px;
        gap: 8px;
    }

    .top-navbar h1 {
        font-size: 14px;
        gap: 5px;
        flex: 1;
        min-width: 0;
    }

    .top-navbar .brand-logo {
        width: 120px;
        height: 40px;
    }

    .top-navbar .user-info {
        gap: 8px;
    }

    .top-navbar .user-info span {
        padding: 3px 6px;
        font-size: 11px;
        max-width: 70px;
    }

    .top-navbar .user-info .el-button {
        padding: 4px 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    .top-navbar .user-info .el-button span {
        display: inline; /* 确保按钮文字显示 */
    }
}

/* 超小屏幕适配 */
@media (max-width: 360px) {
    .top-navbar {
        padding: 0 8px;
    }

    .top-navbar h1 {
        font-size: 12px;
    }

    .top-navbar .user-info span {
        display: none; /* 超小屏幕隐藏用户名 */
    }

    .top-navbar .user-info .el-button {
        padding: 4px 6px;
        font-size: 10px;
    }
}

/* 主容器 */
.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧导航 */
.sidebar {
    width: 200px;
    background: #fff;
    border-right: 1px solid #e6e6e6;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-menu {
    border-right: none;
    height: 100%;
}

.sidebar-menu .el-menu-item {
    height: 50px;
    line-height: 50px;
}

.sidebar-menu .el-menu-item i {
    margin-right: 8px;
    font-size: 16px;
}

/* 移动端适配时隐藏 */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
}

/* 右侧内容区 */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 70px; /* 为底部固定操作栏留出空间 */
}

/* 配置面板 */
.config-panel {
    background: white;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}


/* 题型选择器 */
.type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.type-selector .el-checkbox-button {
    margin: 0;
}

.type-selector .el-checkbox-button__inner {
    padding: 8px 12px;
    font-size: 13px;
}

.type-selector .el-checkbox-button__inner i {
    margin-right: 4px;
}

/* 确保选中状态显示蓝色背景 */
.type-selector .el-checkbox-button.is-checked .el-checkbox-button__inner {
    background-color: #409eff;
    border-color: #409eff;
    color: #fff;
    box-shadow: -1px 0 0 0 #409eff;
}

.type-selector .el-checkbox-button.is-checked:first-child .el-checkbox-button__inner {
    border-left-color: #409eff;
}

.type-hint {
    font-size: 12px;
    color: #909399;
    margin-top: 8px;
}

/* 底部固定操作栏 */
.fixed-action-bar {
    position: fixed;
    bottom: 0;
    left: 200px; /* 侧边栏宽度 */
    right: 0;
    height: 50px;
    background: #fff;
    border-top: 1px solid #e6e6e6;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.action-bar-content {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

.action-bar-content .el-button {
    margin: 0;
}

.action-bar-stats {
    margin-left: auto;
    padding: 0 15px;
    font-size: 14px;
    color: #606266;
}

.action-bar-stats .stats-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.action-bar-stats strong {
    color: #409eff;
    font-size: 16px;
    font-weight: 600;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .fixed-action-bar {
        left: 0;
    }
}

/* 文档选择器新样式 */
.document-selector-new {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.doc-stats {
    margin-left: auto;
    font-size: 13px;
    color: #606266;
}

.doc-stats strong {
    color: #409eff;
    font-size: 16px;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
    padding: 4px;
}

.doc-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fafafa;
    border: 2px solid #e4e7ed;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.doc-card:hover {
    background: #f0f7ff;
    border-color: #b3d8ff;
}

.doc-card.selected {
    background: #ecf5ff;
    border-color: #409eff;
}

.doc-card > i:first-child {
    font-size: 20px;
    color: #909399;
    flex-shrink: 0;
}

.doc-card.selected > i:first-child {
    color: #409eff;
}

.doc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-name {
    font-size: 13px;
    color: #303133;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.check-icon {
    font-size: 18px;
    color: #409eff;
    opacity: 0;
    transition: opacity 0.3s;
}

.doc-card.selected .check-icon {
    opacity: 1;
}

.doc-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #909399;
    font-size: 14px;
}

.doc-empty i {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.doc-actions {
    display: flex;
    gap: 8px;
}

/* 页面容器样式 */
.page-container {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.page-header {
    font-size: 20px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.page-header i {
    font-size: 24px;
    color: #667eea;
}

.policy-list {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 公众留言样式 */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message-item {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s;
}

.message-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.message-date {
    color: #8a8a8a;
    font-size: 14px;
    font-weight: 500;
    min-width: 100px;
}

.message-title {
    font-size: 18px;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    flex: 1;
    transition: color 0.3s;
}

.message-title:hover {
    color: #409eff;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.consult-section,
.reply-section {
    padding: 15px;
    border-radius: 6px;
}

.consult-section {
    background: #f9f9f9;
    border-left: 3px solid #409eff;
}

.reply-section {
    background: #f0f9ff;
    border-left: 3px solid #67c23a;
}

.section-label {
    color: #184B7A;
    font-size: 15px;
    display: block;
    margin-bottom: 8px;
}

.section-text {
    color: #333;
    font-size: 14px;
    line-height: 1.8;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.reply-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e1f0ff;
    font-size: 13px;
}

.reply-date {
    color: #8a8a8a;
}

.reply-org {
    color: #184B7A;
    font-weight: 500;
}

/* iframe 页面样式 */
.iframe-page {
    height: 100%;
    width: 100%;
    position: relative;
}

.iframe-container {
    width: 100%;
    height: calc(100vh - 60px); /* 减去顶部导航栏高度 */
    position: relative;
    overflow: hidden;
    background: #fff;
}

.external-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    /* 隐藏顶部内容，向上偏移 */
    margin-top: -120px;
    height: calc(100% + 120px);
}

.document-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.document-selector__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.document-selector__buttons .el-button + .el-button {
    margin-left: 8px;
}

.document-selector__stats {
    font-size: 12px;
    color: #606266;
}

.document-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.document-selector__list {
    border: 1px solid #e4e7ed;
    border-radius: 6px;
    padding: 10px;
    background: #fcfcfd;
    position: relative;
}

.document-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.document-item {
    padding: 10px;
    border-radius: 6px;
    background: #f5f7fa;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.document-item.is-selected {
    border-color: #409eff;
    background: #f0f9ff;
    box-shadow: 0 2px 6px rgba(64,158,255,0.2);
}

.document-item__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.document-item__title {
    font-weight: 600;
    color: #303133;
}

.document-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    color: #909399;
}

.document-item__filename {
    font-size: 12px;
    color: #909399;
}

.document-empty,
.document-loading {
    text-align: center;
    padding: 20px 0;
    color: #909399;
    font-size: 13px;
}

.document-empty i,
.document-loading i {
    margin-right: 6px;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e4e7ed;
}

/* 题目卡片 */
.question-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 10px; /* Reduced gap */
}

.question-card {
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 1px solid #e4e7ed;
    min-height: 400px; /* Minimum height */
    height: auto; /* Adaptive height */
    display: flex;
    flex-direction: column;
}

.question-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.question-body {
    flex: 1;
    overflow: visible; /* Allow content to expand */
    padding-right: 0;
    margin-bottom: 15px;
}

.question-footer {
    flex: none; /* Don't force percentage height */
    background: #f9fafc;
    border-top: 1px solid #e4e7ed;
    margin: 0 -10px -10px -10px;
    padding: 15px;
    border-radius: 0 0 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: visible; /* Allow content to expand */
}

.footer-section {
    display: block;
    height: auto;
    overflow: visible;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px dashed #ebeef5;
    padding-bottom: 15px;
}

.footer-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.footer-label {
    font-size: 13px;
    font-weight: 600;
    color: #606266;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    height: auto;
}

.success-text { color: #67c23a; }
.warning-text { color: #e6a23c; }

/* Override previous box styles inside footer */
.question-footer .source-box, 
.question-footer .answer-box, 
.question-footer .analysis-box {
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    min-height: auto;
    max-height: none;
}

.question-footer .collapsible-header {
    background: transparent;
    margin: 0 0 8px 0;
    padding: 0;
    justify-content: space-between;
    height: auto;
}

.question-footer .collapsible-header:hover {
    background: transparent;
    opacity: 0.8;
}

.question-footer .collapsible-content {
    padding: 0 0 0 22px; /* Indent content */
    color: #303133;
    font-size: 13px;
    line-height: 1.6;
    flex: none;
    overflow-y: visible;
}

.source-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 22px;
    flex: none;
    overflow-y: visible;
}

.source-file-tag {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-color: #e4e7ed;
    background-color: white;
    color: #606266;
    margin: 0;
}

.question-card.selected {
    border: 2px solid #409eff;
    background: #f0f7ff;
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
}

.question-card.generating {
    border: 2px dashed #409eff;
    background: #f0f9ff;
    opacity: 0.8;
}

@keyframes rotating {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.generating-indicator {
    margin-top: 10px;
    padding: 10px;
    background: rgba(64, 158, 255, 0.1);
    border-radius: 4px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e4e7ed;
}

.question-number {
    width: 28px;
    height: 28px;
    background: #409eff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.question-content {
    font-size: 16px;
    line-height: 1.8;
    color: #303133;
    margin-bottom: 15px;
    font-weight: 500;
}

.question-options {
    margin: 10px 0 0 0;
}

.option-item {
    padding: 8px 12px;
    margin: 6px 0;
    background: #f5f7fa;
    border-radius: 4px;
    border-left: 3px solid #dcdfe6;
    font-size: 14px;
    color: #606266;
    line-height: 1.6;
}

.answer-box {
    background: #f0f9ff;
    padding: 15px;
    border-radius: 6px;
    margin: 12px 0;
    border-left: 4px solid #67c23a;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    max-height: 220px;
    overflow: hidden;
    overflow-y: auto;
}

.analysis-box {
    background: #fef0f0;
    padding: 15px;
    border-radius: 6px;
    margin: 12px 0;
    border-left: 4px solid #e6a23c;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    max-height: 220px;
    overflow: hidden;
    overflow-y: auto;
}

/* 底部固定栏 */
.bottom-bar {
    height: 60px;
    background: white;
    border-top: 1px solid #e4e7ed;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    gap: 10px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
}

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

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

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

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

/* Element UI 自定义 */
.el-form-item {
    margin-bottom: 18px;
}

.el-tag {
    margin-right: 8px;
}

/* 文档来源和关键词样式 */
.source-box, .keywords-box {
    margin: 12px 0;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.8;
    border-left: 4px solid #909399;
    display: flex;
    flex-direction: column;
    min-height: 80px;
    max-height: 180px;
    overflow: hidden;
    overflow-y: auto;
}

.source-box strong, .keywords-box strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

/* 折叠样式 */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    padding: 0;
    margin-bottom: 10px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapsible-header i {
    transition: transform 0.3s;
    font-size: 14px;
    margin-left: auto;
}

.collapsible-content {
    padding: 0;
    margin-top: 8px;
    line-height: 1.8;
    animation: slideDown 0.3s ease;
    flex: 1;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 配置卡片样式 */
.config-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.config-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #e4e7ed;
    transition: all 0.3s;
}

.config-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.config-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.config-card-title i {
    color: #409eff;
    font-size: 18px;
}

.config-card-title small {
    font-weight: 400;
    color: #909399;
    font-size: 12px;
}

.config-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #e4e7ed;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.config-panel-title h2 {
    margin: 0;
    font-size: 20px;
    color: #1f2d3d;
}

.config-panel-title p {
    margin: 4px 0 0;
    color: #606266;
    font-size: 13px;
}

.config-panel-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 新的布局结构 */
.config-layout-split {
    display: flex;
    gap: 20px;
    align-items: stretch; /* Ensure columns have equal height */
}

.config-column-left {
    flex: 1; /* Takes up remaining space, usually wider for documents */
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0; /* Prevent flex item from overflowing */
}

.config-column-right {
    width: 320px; /* Fixed width for settings and actions */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 让文档配置卡片撑满左侧剩余高度（如果需要） */
.document-config-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.document-selector.redesigned {
    flex: 1; /* Make the list expand */
    display: flex;
    flex-direction: column;
}

.document-selector__list {
    flex: 1; /* List takes up space */
    max-height: 400px; /* Limit height but allow scroll */
    overflow-y: auto;
}

/* 操作面板样式 */
.action-card {
    background: #f0f9ff; /* Highlight background */
    border: 1px solid #b3d8ff;
    margin-top: auto; /* Push to bottom if parent has height */
}

.action-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-buttons-grid .el-button {
    margin: 0 !important; /* Override Element UI default margins */
    height: 40px;
    font-size: 14px;
}

/* 移动端适配 */
@media (max-width: 992px) {
    .config-layout-split {
        flex-direction: column;
    }
    
    .config-column-right {
        width: 100%;
    }
}

.question-type-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.config-metric-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.metric-item--inline {
    flex: 1;
    min-width: 240px;
}

.metric-item--difficulty .el-radio-group {
    display: inline-flex;
}

.metric-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #303133;
}

.metric-control {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.metric-hint {
    font-size: 12px;
    color: #909399;
}

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

.document-mode-switch {
    margin-bottom: 16px;
}

.document-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ebeef5;
}

.document-toolbar__group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.document-toolbar__stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #606266;
}

.document-toolbar__stats strong {
    color: #409eff;
}

.document-toolbar__stats .divider {
    color: #dcdfe6;
}

.document-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.document-selector.redesigned {
    border: 1px solid #e4e7ed;
    border-radius: 10px;
    padding: 16px;
    background: #fdfdff;
}

.random-selector .metric-item {
    margin-bottom: 16px;
}

.random-selector .metric-item:last-child {
    margin-bottom: 0;
}

.random-selector {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 12px;
}

.document-config-card {
    height: 100%;
}

@media (max-width: 900px) {
    .config-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .config-panel-actions {
        width: 100%;
        justify-content: flex-start;
    }
}


.type-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.param-grid {
    display: grid;
    gap: 16px;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-item label {
    font-size: 13px;
    color: #606266;
    font-weight: 500;
}

.param-tip {
    font-size: 12px;
    color: #909399;
    margin-top: 4px;
}

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

.config-tip {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f4f4f5;
    border-radius: 6px;
    font-size: 12px;
    color: #606266;
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-tip i {
    color: #409eff;
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 20px 0;
}

.generate-btn {
    min-width: 140px;
    font-weight: 600;
}

/* 题目布局 */
.question-layout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
    align-items: start;
}

.question-main {
    min-width: 0;
}

.question-aside {
    min-width: 0;
}

.question-content {
    font-size: 15px;
    line-height: 1.8;
    color: #303133;
    margin-bottom: 12px;
    font-weight: 500;
}

.question-options {
    margin: 0;
}

.option-item {
    padding: 8px 12px;
    margin: 6px 0;
    background: #f5f7fa;
    border-radius: 6px;
    border-left: 3px solid #dcdfe6;
    font-size: 14px;
    color: #606266;
    line-height: 1.6;
    transition: all 0.2s;
    cursor: pointer; /* Enable pointer cursor */
}

.option-item:hover {
    background: #ecf5ff;
    border-left-color: #409eff;
}

.option-item.selected {
    background: #ecf5ff;
    border-left-color: #409eff;
    color: #409eff;
    font-weight: 500;
}

.option-item.correct {
    background: #f0f9eb;
    border-left-color: #67c23a;
    color: #67c23a;
    font-weight: 500;
}

.option-item.wrong {
    background: #fef0f0;
    border-left-color: #f56c6c;
    color: #f56c6c;
    font-weight: 500;
}

.judgment-options {
    display: flex;
    gap: 15px;
    margin: 10px 0;
}


.answer-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e6f7ff 100%);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #67c23a;
    transition: all 0.3s;
}

.answer-box:hover {
    box-shadow: 0 2px 8px rgba(103, 194, 58, 0.2);
}

.analysis-box {
    background: linear-gradient(135deg, #fffbf0 0%, #fff7e6 100%);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #e6a23c;
    transition: all 0.3s;
}

.analysis-box:hover {
    box-shadow: 0 2px 8px rgba(230, 162, 60, 0.2);
}

.source-box {
    background: #f5f7fa;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
}

.source-section {
    margin-bottom: 8px;
}

.source-section:last-child {
    margin-bottom: 0;
}

.source-section strong {
    display: block;
    color: #606266;
    margin-bottom: 6px;
    font-size: 12px;
}

.source-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    margin: -12px -12px 8px -12px;
    background: rgba(255,255,255,0.5);
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.collapsible-header:hover {
    background: rgba(255,255,255,0.8);
}

.collapsible-header strong {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.collapsible-header i {
    font-size: 14px;
}

.collapsible-content {
    padding: 8px 12px;
    line-height: 1.7;
    font-size: 13px;
    color: #606266;
}

/* 历史记录样式 */
.history-item-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 5px 0;
}

.history-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-item-info strong {
    color: #303133;
}

.history-item-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.history-item-count {
    color: #909399;
    font-size: 13px;
}

.history-item-date {
    color: #909399;
    font-size: 12px;
}

.history-delete-btn {
    margin-left: 10px;
}

/* 默认显示PC端视图，隐藏移动端视图 */
.history-mobile-view {
    display: none;
}

.history-pc-view {
    display: flex;
}

/* 移动端简化元数据样式 */
.history-mobile-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #909399;
    margin-top: 5px;
}

/* 历史记录表格容器 */
.history-table-container {
    padding: 15px;
    background: #f9f9f9;
}

/* 表格内题目内容单元格 */
.question-content-cell {
    line-height: 1.6;
}

.content-text {
    font-size: 14px;
    color: #303133;
    margin-bottom: 8px;
    word-break: break-word;
}

.options-list {
    margin-top: 8px;
    padding-left: 10px;
}

.option-item-small {
    font-size: 13px;
    color: #606266;
    padding: 3px 0;
    line-height: 1.5;
}

/* 答案文本样式 */
.answer-text {
    color: #67c23a;
    font-weight: 600;
    font-size: 14px;
}

/* 源文件单元格 */
.source-files-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.source-file-tag-small {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-source, .no-analysis {
    color: #c0c4cc;
    font-size: 12px;
}

/* 解析弹窗样式 */
.analysis-popover {
    line-height: 1.8;
}

.analysis-popover strong {
    color: #e6a23c;
    display: block;
    margin-bottom: 8px;
}

.analysis-popover p {
    margin: 0;
    color: #606266;
    font-size: 14px;
}

/* 历史记录操作按钮区 */
.history-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e4e7ed;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 移动端全局适配 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    /* 隐藏左侧导航栏，使用抽屉代替 */
    .left-sidebar {
        display: none;
    }

    .content-wrapper {
        padding: 10px;
    }

    .config-panel {
        padding: 12px;
    }

    .panel-title {
        font-size: 15px;
        margin-bottom: 15px;
    }

    /* 配置卡片移动端适配 */
    .config-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .config-card {
        padding: 15px;
    }

    .param-grid {
        gap: 12px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .el-button {
        width: 100%;
    }

    /* 题目卡片移动端适配 */
    .question-cards {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .question-card {
        padding: 12px;
    }

    .question-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .question-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .question-content {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .option-item {
        padding: 6px 10px;
        font-size: 13px;
    }

    .answer-box,
    .analysis-box {
        padding: 10px;
    }

    .collapsible-header {
        padding: 6px 10px;
    }

    .collapsible-content {
        padding: 6px 10px;
        font-size: 12px;
    }

    .bottom-bar {
        padding: 0 10px;
        height: 50px;
    }

    .bottom-bar .el-button {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* 移动端隐藏导出Word按钮 */
    .export-word-btn {
        display: none !important;
    }

    /* 历史记录移动端优化 - 完全重新设计 */
    .history-pc-view {
        display: none !important;
    }

    .history-mobile-view {
        display: block !important;
        width: 100%;
    }

    .history-item-header {
        display: block !important;
        padding: 0 !important;
    }

    /* 历史记录表格移动端适配 */
    .history-table-container {
        padding: 10px;
        overflow-x: auto;
    }

    .history-table-container .el-table {
        font-size: 12px;
    }

    .history-table-container .el-table th,
    .history-table-container .el-table td {
        padding: 8px 5px;
    }

    .content-text {
        font-size: 13px;
    }

    .option-item-small {
        font-size: 12px;
    }

    .history-actions {
        flex-direction: column;
    }

    .history-actions .el-button {
        width: 100%;
    }

    /* 移动端历史记录卡片样式 */
    .history-mobile-view strong {
        display: block;
        font-size: 15px !important;
        line-height: 1.6;
        color: #303133;
        margin-bottom: 8px;
        word-break: break-all;
        font-weight: 600;
    }

    .history-mobile-meta {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 12px !important;
        color: #909399;
        padding: 5px 0;
    }

    .history-mobile-meta span {
        white-space: nowrap;
    }

    .history-delete-btn {
        width: 100% !important;
        margin: 10px 0 0 0 !important;
        font-size: 13px !important;
        padding: 8px !important;
    }

    /* 折叠面板样式优化 */
    .el-collapse-item {
        margin-bottom: 12px !important;
        border: 1px solid #e4e7ed !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }

    .el-collapse-item__header {
        padding: 12px 15px !important;
        background: #fff !important;
        border: none !important;
        line-height: 1.5 !important;
        height: auto !important;
    }

    .el-collapse-item__wrap {
        border: none !important;
    }

    .el-collapse-item__content {
        padding: 0 !important;
        background: #f9f9f9 !important;
    }

    /* 历史记录题目详情 - 移动端简化 */
    .el-collapse-item__content > div {
        padding: 10px !important;
        background: #f5f7fa !important;
    }

    .el-collapse-item__content > div > div {
        padding: 12px !important;
        margin-bottom: 10px !important;
        font-size: 14px !important;
        line-height: 1.7;
        background: white !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    }

    /* 题目头部 - 简化显示 */
    .el-collapse-item__content > div > div > div:first-child {
        margin-bottom: 10px !important;
        padding-bottom: 8px !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }

    .el-collapse-item__content > div > div > div:first-child span:first-child {
        display: inline-block;
        width: 24px;
        height: 24px;
        line-height: 24px;
        text-align: center;
        background: #409eff;
        color: white;
        border-radius: 50%;
        font-weight: bold;
        font-size: 13px;
        margin-right: 8px;
    }

    /* 隐藏题目类型和难度标签 */
    .el-collapse-item__content .el-tag {
        display: none !important;
    }

    /* 题目内容 */
    .el-collapse-item__content > div > div > div:nth-child(2) {
        font-size: 14px !important;
        line-height: 1.7 !important;
        color: #303133 !important;
        margin-bottom: 12px !important;
    }

    /* 选项 */
    .el-collapse-item__content > div > div > div:nth-child(3) > div {
        padding: 8px 10px !important;
        margin: 6px 0 !important;
        background: #f9f9f9 !important;
        border-radius: 4px !important;
        font-size: 13px !important;
        color: #606266 !important;
    }

    /* 答案区域 */
    .el-collapse-item__content > div > div > div:nth-child(4) {
        background: #f0f9ff !important;
        padding: 10px !important;
        border-radius: 6px !important;
        margin-bottom: 10px !important;
        border-left: 3px solid #67c23a !important;
    }

    .el-collapse-item__content > div > div > div:nth-child(4) strong {
        font-size: 13px !important;
        color: #67c23a !important;
    }

    /* 解析区域 */
    .el-collapse-item__content > div > div > div:nth-child(5) {
        background: #fffbf0 !important;
        padding: 10px !important;
        border-radius: 6px !important;
        border-left: 3px solid #e6a23c !important;
    }

    .el-collapse-item__content > div > div > div:nth-child(5) strong {
        font-size: 13px !important;
        color: #e6a23c !important;
    }

    /* 加载到出题页面按钮 */
    .el-collapse-item__content > div > div:last-child {
        text-align: center !important;
        padding: 15px 10px !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .el-collapse-item__content > div > div:last-child .el-button {
        width: 100% !important;
        font-size: 13px !important;
    }
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    .left-sidebar {
        display: none;
    }

    .top-navbar h1 {
        font-size: 14px;
    }

    .content-wrapper {
        padding: 8px;
    }

    .config-panel {
        padding: 12px;
    }

    .el-form-item__label {
        font-size: 13px;
    }

    .bottom-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px;
    }

    .bottom-bar .el-button {
        margin: 4px;
    }
}

/* 流式文字预览 */
.streaming-preview {
    margin: 12px 0;
    padding: 10px;
    background: #f5f7fa;
    border-radius: 4px;
    border-left: 3px solid #409EFF;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #606266;
    min-height: 40px;
    word-break: break-all;
    overflow: hidden;
    position: relative;
}

.streaming-content {
    white-space: pre-wrap;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 14px;
    background-color: #409EFF;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.generation-progress-card { margin: 20px 0; padding: 20px 24px; background: #fff; border: 1px solid #d9e8fa; border-radius: 12px; box-shadow: 0 4px 16px rgba(24, 67, 120, .05); }
.generation-progress-heading { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; color: #1d4c7c; }
.generation-progress-card p { margin: 12px 0 6px; color: #40556b; }
.generation-progress-card small { color: #748397; }
