/* ===== 基础变量 ===== */
:root {
    --primary: #1a5f7a;
    --primary-light: #2d8bb4;
    --primary-dark: #0f3d4f;
    --accent: #c9a227;
    --accent-light: #e6c65c;
    --success: #2d7a5f;
    --warning: #d4a017;
    --danger: #a94442;
    --bg-main: #f5f5f5;
    --bg-sidebar: #1a2634;
    --bg-card: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #5a6a7a;
    --text-light: #e8e4dc;
    --border-color: #d4cfc4;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== 主布局 ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: 520px;
    min-width: 520px;
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #0f1a24 100%);
    color: var(--text-light);
    padding: 24px;
    overflow-y: auto;
    max-height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-header {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

.sidebar-header h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.sidebar-header p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ===== 模式切换标签 ===== */
.mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.mode-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.mode-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.mode-tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(26, 95, 122, 0.4);
}

.mode-tab span {
    font-size: 1.1rem;
}

/* 报告区域容器 */
.report-section {
    animation: fadeIn 0.3s ease;
}

/* 提示文字 */
.section-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    font-style: italic;
}

/* ===== 输入区块 ===== */
.input-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.input-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-light);
}

.input-section h2 .icon {
    font-size: 1.1rem;
}

/* ===== 表单网格 ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group select option {
    background: var(--bg-sidebar);
    color: #fff;
}

/* ===== Radio 和 Checkbox ===== */
.radio-group,
.checkbox-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.radio-group input,
.checkbox-group input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ===== 课程目标卡片 ===== */
.objective-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.objective-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.objective-card-header h3 {
    font-size: 0.95rem;
    color: var(--accent-light);
    font-weight: 600;
}

.btn-remove {
    background: rgba(169, 68, 66, 0.3);
    border: none;
    color: #ff8a8a;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: rgba(169, 68, 66, 0.5);
}

/* 历史记录区域 */
.history-section {
    background: rgba(45, 122, 95, 0.1) !important;
    border-color: rgba(45, 122, 95, 0.3) !important;
}

/* 年级报告设置区域 */
.grade-section {
    background: rgba(26, 95, 122, 0.15) !important;
    border-color: rgba(26, 95, 122, 0.4) !important;
}

.grade-section h2 {
    color: #7ec8e3 !important;
}

.history-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.history-tab {
    flex: 1;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.history-tab.active {
    background: rgba(45, 122, 95, 0.4);
    border-color: rgba(45, 122, 95, 0.6);
    color: #fff;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.history-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    padding: 20px;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.history-item.active {
    background: rgba(45, 122, 95, 0.3);
    border: 1px solid rgba(45, 122, 95, 0.5);
}

.history-item.selected {
    background: rgba(45, 122, 95, 0.25);
    border: 1px solid rgba(45, 122, 95, 0.5);
}

/* 历史记录选择栏 */
.history-selection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 8px;
}

.selected-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.btn-select-all {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-select-all:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* 历史记录项复选框 */
.history-item-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    padding: 4px;
    cursor: pointer;
}

.history-item-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2d7a5f;
}

.history-item-info {
    flex: 1;
    min-width: 0;
    margin-right: auto;
}

.history-item-title {
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-date {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.history-item-actions {
    display: flex;
    gap: 4px;
}

.history-item-btn {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.history-item-btn.delete {
    color: #ff8a8a;
}

.history-item-btn.delete:hover {
    background: rgba(169, 68, 66, 0.3);
}

.history-actions {
    margin-top: 10px;
}

.history-actions .btn {
    width: 100%;
}

/* API 设置区域 */
.api-section {
    background: rgba(201, 162, 39, 0.1) !important;
    border-color: rgba(201, 162, 39, 0.3) !important;
}

.api-input-wrapper {
    display: flex;
    gap: 8px;
}

.api-input-wrapper input {
    flex: 1;
}

.btn-toggle-visibility {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-toggle-visibility:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 固定保存按钮 */
.fixed-save-buttons {
    position: fixed;
    left: 20px;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.btn-fixed-save,
.btn-fixed-clear {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-fixed-save {
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
}

.btn-fixed-save:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.5);
}

.btn-fixed-clear {
    background: linear-gradient(135deg, #c62828 0%, #e53935 100%);
}

.btn-fixed-clear:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.5);
}

@media (max-width: 1200px) {
    .fixed-save-buttons {
        left: 10px;
        bottom: 20px;
    }
    
    .btn-fixed-save,
    .btn-fixed-clear {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(169, 68, 66, 0.5);
    color: #ff8a8a;
}

.btn-outline-danger:hover {
    background: rgba(169, 68, 66, 0.2);
}

/* AI生成按钮 */
.textarea-with-ai {
    position: relative;
}

.textarea-with-ai textarea {
    width: 100%;
    padding-bottom: 40px;
}

.btn-ai-generate {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-ai-generate:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-ai-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-ai-generate.loading {
    pointer-events: none;
}

.btn-ai-generate.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 6px;
}

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

/* 提示词编辑器 */
.prompt-editor-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.prompt-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.prompt-tab {
    flex: 1;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.prompt-tab.active {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
    color: #fff;
}

.prompt-panel {
    display: none;
}

.prompt-panel.active {
    display: block;
}

.prompt-panel label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.prompt-panel textarea {
    width: 100%;
    font-size: 0.8rem;
    line-height: 1.5;
    font-family: 'Consolas', 'Monaco', monospace;
}

.prompt-variables {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.variable-tag {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    color: #a5b4fc;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

.btn-small {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
}

.btn-reset {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    width: 100%;
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.objective-card .form-group {
    margin-bottom: 12px;
}

.objective-card .form-group:last-child {
    margin-bottom: 0;
}

/* 达成度数据表格输入 */
.achievement-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.75rem;
}

.achievement-table th,
.achievement-table td {
    padding: 6px 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.achievement-table th {
    background: rgba(26, 95, 122, 0.4);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.7rem;
}

.achievement-table input {
    width: 50px;
    padding: 6px 4px;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #fff;
    font-size: 0.8rem;
}

.achievement-table input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===== 按钮 ===== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-add {
    width: 100%;
    background: rgba(45, 122, 95, 0.3);
    color: #7fd4b8;
    border: 1px dashed rgba(127, 212, 184, 0.4);
    padding: 10px;
}

.btn-add:hover {
    background: rgba(45, 122, 95, 0.5);
    border-color: rgba(127, 212, 184, 0.6);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 95, 122, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #3d9a7a 100%);
    color: #fff;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(45, 122, 95, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    color: var(--primary);
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.action-buttons .btn {
    flex: 1;
}

/* ===== 报告预览区域 ===== */
.report-preview {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-header h2 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.report-container {
    flex: 1;
    background: #ffffff;
    border-radius: var(--radius);
    overflow: auto;
    min-height: 0;
}

.report-content {
    padding: 30px;
    padding-bottom: 20px;
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
}

.report-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-secondary);
    background: #ffffff;
}

.report-placeholder .placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.report-placeholder h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

/* ===== 报告样式 ===== */
.report {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    color: #000;
    line-height: 1.8;
    max-width: 100%;
    box-sizing: border-box;
    background: #ffffff;
}

.report-note {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.report-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #000;
}

.report-subtitle {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #000;
}

/* 报告表格 */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.85rem;
    table-layout: auto;
}

.report-table th,
.report-table td {
    border: 1px solid #333;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
}

.report-table th {
    background: #f0f0f0;
    font-weight: 600;
}

.report-table .header-cell {
    background: #e0e0e0;
    font-weight: 600;
    text-align: center;
}

.report-table .center {
    text-align: center;
}

.report-table .highlight {
    background: #fffde7;
}

.report-table .highlight-green {
    background: #c8e6c9;
    color: #1b5e20;
}

.report-table .highlight-blue {
    background: #bbdefb;
    color: #0d47a1;
}

/* 达成度区间颜色 */
.level-danger { color: #c62828; font-weight: 600; }
.level-warning { color: #ef6c00; font-weight: 600; }
.level-info { color: #1565c0; font-weight: 600; }
.level-success { color: #2e7d32; font-weight: 600; }
.level-excellent { color: #1b5e20; font-weight: 600; }

/* 课程目标区块 */
.objective-section {
    margin: 30px 0;
    padding-bottom: 20px;
    border-bottom: 1px dashed #ccc;
    page-break-inside: avoid;
}

.objective-section:last-of-type {
    border-bottom: none;
}

/* 图表容器 */
.chart-container {
    margin: 25px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    max-width: 100%;
    box-sizing: border-box;
    page-break-inside: avoid;
}

.chart-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.chart-wrapper {
    height: 220px;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

/* 分析文本 */
.analysis-text {
    background: #fff8e1;
    padding: 12px 16px;
    border-left: 4px solid #ff9800;
    margin: 8px 0;
    font-size: 0.85rem;
    line-height: 1.8;
    color: #333;
}

/* 达成度平均值显示 */
.achievement-avg {
    display: inline-block;
    background: #1a5f7a;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 改进建议文本 */
.improvement-text {
    background: #e8f5e9;
    padding: 15px 18px;
    border-left: 4px solid #2e7d32;
    margin: 8px 0;
    font-size: 0.9rem;
    line-height: 2;
    color: #1b5e20;
}

/* 签名区域 */
.signature-section {
    margin-top: 30px;
    padding: 20px 0;
}

.signature-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.signature-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.signature-label {
    font-size: 0.95rem;
    color: #333;
}

.signature-name {
    font-family: 'STKaiti', 'KaiTi', 'Noto Serif SC', serif;
    font-size: 1.2rem;
    color: #1a5f7a;
    font-weight: 600;
    min-width: 80px;
    border-bottom: 1px solid #333;
    padding: 0 10px 2px;
}

.signature-date {
    text-align: center;
    font-size: 0.95rem;
    color: #333;
    margin-top: 15px;
}

/* 报告底部注释 */
.report-note {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    font-size: 0.85rem;
    color: #666;
}

/* 分页符 */
.page-break {
    page-break-before: always;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px dashed #ccc;
}

@media print {
    .page-break {
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }
    
    .signature-name {
        color: #000;
    }
}

/* ===== 响应式 ===== */
@media (max-width: 1400px) {
    .sidebar {
        width: 480px;
        min-width: 480px;
    }
}

@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: unset;
        max-height: none;
        position: relative;
    }

    .report-preview {
        min-height: 100vh;
    }
}

/* ===== PDF导出样式 ===== */
.exporting-pdf .fixed-save-buttons {
    display: none !important;
}

.exporting-pdf {
    width: 750px !important;
    max-width: 750px !important;
    padding: 25px !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
}

.exporting-pdf .report {
    width: 100% !important;
    color: #000000 !important;
    font-size: 14px !important;
    line-height: 1.8 !important;
}

.exporting-pdf .report-title {
    color: #0d4f6a !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
}

.exporting-pdf .report-subtitle {
    color: #222222 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
}

.exporting-pdf .report-table {
    font-size: 13px !important;
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
    margin-bottom: 25px !important;
    page-break-inside: avoid !important;
}

.exporting-pdf .report-table th,
.exporting-pdf .report-table td {
    padding: 10px 12px !important;
    word-wrap: break-word !important;
    border: 1.5px solid #222222 !important;
    color: #000000 !important;
    line-height: 1.6 !important;
    font-weight: 500 !important;
}

.exporting-pdf .report-table th {
    background-color: #e8e8e8 !important;
    font-weight: 700 !important;
}

.exporting-pdf .chart-container {
    width: 100% !important;
    max-width: 620px !important;
    margin: 30px auto !important;
    padding: 20px !important;
    page-break-inside: avoid !important;
    border: 1.5px solid #cccccc !important;
    background: #fafafa !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.exporting-pdf .chart-title {
    color: #333333 !important;
    font-weight: 700 !important;
    margin-bottom: 15px !important;
}

.exporting-pdf .chart-wrapper {
    height: 200px !important;
    width: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

.exporting-pdf .chart-wrapper canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

.exporting-pdf .analysis-text {
    background-color: #fff8e1 !important;
    border-left: 5px solid #ff9800 !important;
    color: #333333 !important;
    padding: 12px 15px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.exporting-pdf .improvement-text {
    background-color: #e8f5e9 !important;
    border-left: 5px solid #4caf50 !important;
    color: #1b5e20 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.exporting-pdf .highlight-green {
    background-color: #c8e6c9 !important;
    color: #1b5e20 !important;
    font-weight: 600 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.exporting-pdf .highlight-blue {
    background-color: #bbdefb !important;
    color: #0d47a1 !important;
    font-weight: 600 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.exporting-pdf .header-cell {
    background-color: #e0e0e0 !important;
    font-weight: 700 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.exporting-pdf .achievement-avg {
    background: #1a5f7a !important;
    color: #ffffff !important;
    padding: 5px 15px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.exporting-pdf .level-danger { color: #c62828 !important; font-weight: 700 !important; }
.exporting-pdf .level-warning { color: #e65100 !important; font-weight: 700 !important; }
.exporting-pdf .level-info { color: #1565c0 !important; font-weight: 700 !important; }
.exporting-pdf .level-success { color: #2e7d32 !important; font-weight: 700 !important; }
.exporting-pdf .level-excellent { color: #1b5e20 !important; font-weight: 700 !important; }

.exporting-pdf .signature-section {
    page-break-inside: avoid !important;
    margin-top: 30px !important;
}

.exporting-pdf .signature-name {
    color: #1a5f7a !important;
    font-weight: 700 !important;
}

.exporting-pdf .objective-section {
    margin: 25px 0 !important;
    padding-bottom: 25px !important;
    border-bottom: 1px dashed #999999 !important;
    page-break-inside: avoid !important;
}

.exporting-pdf .objective-section:last-of-type {
    border-bottom: none !important;
}

.exporting-pdf .page-break {
    page-break-before: always !important;
    border-top: none !important;
    margin-top: 0 !important;
    padding-top: 30px !important;
}

.exporting-pdf .report-note {
    color: #666666 !important;
    font-size: 0.9rem !important;
    margin-top: 20px !important;
}

/* ===== 打印样式 ===== */
@media print {
    /* 隐藏非打印元素 */
    .sidebar,
    .preview-header,
    .fixed-save-buttons,
    .app-container > *:not(.report-preview) {
        display: none !important;
    }
    
    body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .app-container {
        display: block !important;
    }

    .report-preview {
        padding: 0 !important;
        background: #fff !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
    }

    .report-container {
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .report-content {
        padding: 20px 25px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .report {
        font-size: 12pt !important;
        line-height: 1.6 !important;
        color: #000 !important;
    }
    
    .report-title {
        font-size: 18pt !important;
        color: #000 !important;
        font-weight: bold !important;
    }
    
    .report-subtitle {
        font-size: 14pt !important;
        color: #000 !important;
    }

    .report-table {
        page-break-inside: avoid !important;
        font-size: 10pt !important;
        border-collapse: collapse !important;
    }
    
    .report-table th,
    .report-table td {
        border: 1pt solid #000 !important;
        padding: 6pt 8pt !important;
    }
    
    .report-table th {
        background-color: #e0e0e0 !important;
    }

    .chart-container {
        page-break-inside: avoid !important;
        max-width: 100% !important;
        margin: 15pt 0 !important;
    }
    
    .chart-wrapper {
        height: 180px !important;
    }
    
    .objective-section {
        page-break-inside: avoid !important;
    }
    
    .signature-section {
        page-break-inside: avoid !important;
    }
    
    .analysis-text,
    .improvement-text {
        background-color: #f5f5f5 !important;
        border-left: 3pt solid #666 !important;
    }
    
    .highlight-green {
        background-color: #d4edda !important;
    }
    
    .highlight-blue {
        background-color: #cce5ff !important;
    }
    
    /* 强制打印颜色 */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* A4纸边距 */
    @page {
        size: A4;
        margin: 15mm 10mm;
    }
}

/* ===== 滚动条美化 ===== */
.sidebar::-webkit-scrollbar,
.report-container::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.report-container::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.report-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
}

.toast-error {
    background: linear-gradient(135deg, #c62828 0%, #e53935 100%);
}

.toast-info {
    background: linear-gradient(135deg, #1565c0 0%, #1e88e5 100%);
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.objective-card {
    animation: fadeIn 0.3s ease;
}

.report {
    animation: fadeIn 0.4s ease;
}

