/* 贷款风险分析系统 - Web Demo 样式 */
/* Modern Design System inspired by VoltAgent awesome-design-md */

/* ========================================
   CSS 变量 - 现代化设计系统
   ======================================== */
:root {
    /* Primary Colors - 专业蓝色系 */
    --primary-50: #E3F2FD;
    --primary-100: #BBDEFB;
    --primary-500: #2196F3;
    --primary-600: #1976D2;
    --primary-700: #1565C0;
    --primary-800: #0D47A1;

    /* Semantic Colors */
    --success: #4CAF50;
    --success-light: #E8F5E9;
    --success-dark: #2E7D32;
    --warning: #FF9800;
    --warning-light: #FFF3E0;
    --warning-dark: #E65100;
    --danger: #F44336;
    --danger-light: #FFEBEE;
    --danger-dark: #C62828;
    --info: #2196F3;
    --info-light: #E3F2FD;

    /* Neutral Colors */
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    /* Legacy aliases */
    --primary-color: var(--primary-500);
    --primary-dark: var(--primary-600);
    --success-color: var(--success);
    --warning-color: var(--warning);
    --danger-color: var(--danger);

    /* Text & Background */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-700);
    --text-tertiary: var(--gray-500);
    --bg-primary: var(--gray-50);
    --bg-secondary: #ffffff;
    --bg-tertiary: var(--gray-100);
    --border-color: var(--gray-300);
    --border-light: var(--gray-200);

    /* Shadows - 层次化阴影系统 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 6px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-xl: 0 10px 40px rgba(0,0,0,0.16);
    --shadow-colored: 0 4px 12px rgba(33, 150, 243, 0.25);
    --shadow-colored-hover: 0 6px 20px rgba(33, 150, 243, 0.35);

    --shadow: var(--shadow-md);
    --shadow-hover: var(--shadow-lg);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius: var(--radius-lg);

    /* Typography */
    --font-size: 14px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   Reset & Base
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   应用容器
   ======================================== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--gray-100) 100%);
}

/* ========================================
   标题栏 - 现代化渐变
   ======================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.header h1 {
    font-size: calc(var(--font-size) * 2);
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-label {
    font-size: var(--font-size);
    opacity: 0.9;
    margin-right: 4px;
}

.zoom-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size);
    font-weight: 500;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.zoom-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.zoom-btn.active {
    background: white;
    color: var(--primary-700);
    border-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ========================================
   主内容区 - 三栏布局
   ======================================== */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr 340px;
    flex: 1;
    overflow: hidden;
    gap: 1px;
    background: var(--border-light);
}

/* ========================================
   侧边栏 - 抽屉式设计
   ======================================== */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

/* Tab 切换按钮 - 现代化样式 */
.drawer-tabs {
    display: flex;
    background: var(--gray-100);
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
    gap: 8px;
}

.drawer-tab {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: calc(var(--font-size) * 0.95);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.drawer-tab:hover:not(:disabled) {
    background: var(--primary-100);
    color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-colored);
}

.drawer-tab.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: var(--shadow-colored);
}

.drawer-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-200);
    box-shadow: none;
}

/* 抽屉内容区 */
.drawer-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.drawer-content.active {
    display: flex;
}

/* 抽屉头部 - 渐变背景 */
.drawer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    border-bottom: 1px solid var(--primary-200, #90CAF9);
}

.drawer-header-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-title {
    font-weight: 700;
    font-size: calc(var(--font-size) * 1.05);
    color: var(--primary-800, #1565C0);
}

.drawer-count {
    font-size: calc(var(--font-size) * 0.85);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.current-dir-line {
    padding: 8px 16px;
    font-size: calc(var(--font-size) * 0.82);
    color: var(--text-tertiary);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.back-btn {
    padding: 6px 12px;
    border: 1px solid var(--primary-color);
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: calc(var(--font-size) * 0.9);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.back-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   贷款列表样式 - 卡片化设计
   ======================================== */
.loan-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: var(--gray-50);
}

.loan-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--gray-50));
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.loan-item:hover {
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-colored);
}

.loan-item.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-colored-hover);
}

.loan-item.active .loan-item-meta .score,
.loan-item.active .loan-item-meta .class {
    background: rgba(255,255,255,0.2);
    color: white;
}

.loan-item-id {
    font-weight: 700;
    font-size: calc(var(--font-size) * 1.15);
    letter-spacing: 0.5px;
    color: var(--gray-900);
}

.loan-item.active .loan-item-id {
    color: white;
}

.loan-item-meta {
    display: flex;
    gap: 8px;
    font-size: calc(var(--font-size) * 0.85);
}

.loan-item-meta .score {
    font-weight: 600;
    padding: 2px 8px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}

.loan-item.active .loan-item-meta .score {
    background: rgba(255,255,255,0.2);
    color: white;
}

.loan-item-meta .class {
    padding: 2px 8px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* ========================================
   文件列表样式
   ======================================== */
.file-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: var(--gray-50);
}

.folder-actions {
    padding: 0 0 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.open-folder-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: calc(var(--font-size) * 1);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.open-folder-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.file-folder {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: calc(var(--font-size) * 1);
    color: var(--warning-dark);
}

.folder-icon {
    font-size: calc(var(--font-size) * 1.2);
}

.folder-name {
    flex: 1;
}

.folder-count {
    font-size: calc(var(--font-size) * 0.85);
    color: var(--text-secondary);
    font-weight: normal;
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.folder-files {
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 4px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    font-size: calc(var(--font-size) * 0.95);
}

.file-item:hover {
    background: var(--primary-50);
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.file-icon {
    font-size: calc(var(--font-size) * 1.2);
    flex-shrink: 0;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

/* ========================================
   Toast 提示
   ======================================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: calc(var(--font-size) * 1.1);
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 80%;
    word-break: break-all;
    box-shadow: var(--shadow-xl);
}

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

/* ========================================
   中间面板 - 最终评级理由
   ======================================== */
.center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow: hidden;
    min-width: 0;
}

.center-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--success-light), #C8E6C9);
    border-bottom: 1px solid var(--border-color);
}

.center-header h3 {
    font-size: calc(var(--font-size) * 1.2);
    color: var(--success-dark);
    font-weight: 700;
}

.center-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--gray-50);
}

.center-actions {
    display: flex;
    gap: 10px;
    padding: 12px 18px;
    background: var(--gray-100);
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.reasons-textarea-full {
    width: 100%;
    height: 100%;
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: calc(var(--font-size) * 1.08);
    line-height: 1.9;
    resize: none;
    font-family: inherit;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    white-space: pre-wrap;
}

.reasons-textarea-full:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-colored);
}

/* ========================================
   按钮样式 - 现代化设计
   ======================================== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size);
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-small {
    padding: 6px 12px;
    font-size: calc(var(--font-size) * 0.9);
}

.btn-block {
    width: 100%;
    height: 100%;
    font-size: calc(var(--font-size) * 1.1);
    padding: 14px 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: var(--shadow-colored-hover);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--gray-400), var(--gray-500));
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--gray-500), var(--gray-600));
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-dark), #1B5E20);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark), #8E0000);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-ai {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========================================
   详情面板
   ======================================== */
.detail-panel {
    width: 340px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid var(--border-color);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
}

/* 右侧 Tab 切换 */
.right-tabs {
    display: flex;
    background: var(--gray-100);
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
    gap: 8px;
}

.right-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: calc(var(--font-size) * 0.9);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.right-tab:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

.right-tab.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: var(--shadow-colored);
}

.right-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--gray-50);
}

.right-panel {
    display: none;
    flex-direction: column;
    height: 100%;
}

.right-panel.active {
    display: flex;
}

.panel-header-compact {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.question-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-section-title {
    font-size: calc(var(--font-size) * 1);
    font-weight: 800;
    color: var(--text-primary);
}

.sidebar-section-hint {
    margin-top: 2px;
    font-size: calc(var(--font-size) * 0.78);
    color: var(--text-tertiary);
    line-height: 1.4;
}

.panel-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* ========================================
   信息栏
   ======================================== */
.info-bar {
    display: flex;
    gap: 24px;
    padding: 12px 18px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item .label {
    color: var(--text-tertiary);
    font-size: calc(var(--font-size) * 0.85);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value {
    font-weight: 700;
    font-size: calc(var(--font-size) * 1.1);
    color: var(--text-primary);
}

/* ========================================
   贷款基本信息 - 卡片式设计
   ======================================== */
.loan-basic-info {
    background: linear-gradient(135deg, var(--bg-secondary), var(--gray-50));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 8px 12px;
    box-shadow: var(--shadow-sm);
}

.basic-info-title {
    font-size: calc(var(--font-size) * 0.92);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.basic-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.basic-info-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.basic-info-item:hover {
    border-color: var(--primary-200, #90CAF9);
    box-shadow: var(--shadow-sm);
}

.basic-info-item.highlight {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border-color: var(--warning);
    grid-column: span 2;
}

.basic-info-item.overdue {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-color: var(--danger);
}

.basic-info-item.overdue .basic-info-value {
    color: var(--danger-dark);
}

.basic-info-label {
    font-size: calc(var(--font-size) * 0.78);
    color: var(--text-tertiary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.basic-info-value {
    font-size: calc(var(--font-size) * 0.98);
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.basic-info-item.highlight .basic-info-value {
    color: var(--warning-dark);
    font-size: calc(var(--font-size) * 1.08);
}

/* ========================================
   表格样式
   ======================================== */
.questions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.questions-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: calc(var(--font-size) * 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.questions-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
}

.questions-table tr:hover {
    background: var(--primary-50);
}

.status-pending {
    color: var(--warning);
    font-weight: 600;
}

.status-answered {
    color: var(--success);
    font-weight: 600;
}

.status-resolved {
    color: var(--primary-700);
    font-weight: 600;
}

.question-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 1;
    padding-bottom: 4px;
    background: var(--gray-50);
}

.summary-chip {
    padding: 5px 6px;
    border-radius: 999px;
    text-align: center;
    font-size: calc(var(--font-size) * 0.76);
    font-weight: 800;
    white-space: nowrap;
}

.summary-chip.pending {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.summary-chip.answered {
    background: var(--success-light);
    color: var(--success-dark);
}

.summary-chip.resolved {
    background: var(--primary-50);
    color: var(--primary-800);
}

.question-card {
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.question-card.status-answered {
    border-left-color: var(--success);
}

.question-card.status-resolved {
    border-left-color: var(--primary-600);
    background: linear-gradient(135deg, var(--bg-secondary), var(--primary-50));
}

.question-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.question-id-btn {
    border: none;
    background: var(--gray-100);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
    font-weight: 800;
    cursor: pointer;
}

.question-id-btn:hover {
    background: var(--primary-100);
    color: var(--primary-800);
}

.question-status-pill {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--text-secondary);
    font-size: calc(var(--font-size) * 0.78);
    font-weight: 700;
}

.question-content {
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.question-anchor {
    width: 100%;
    text-align: left;
    border: 1px dashed var(--primary-300, #64B5F6);
    background: var(--primary-50);
    color: var(--primary-800);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    margin-bottom: 8px;
    cursor: pointer;
    line-height: 1.5;
    font-size: calc(var(--font-size) * 0.88);
    max-height: 96px;
    overflow: hidden;
}

.question-anchor:hover {
    border-style: solid;
    background: var(--primary-100);
}

.question-anchor-meta {
    display: block;
    margin-top: 6px;
    color: var(--text-tertiary);
    font-size: calc(var(--font-size) * 0.76);
    font-weight: 700;
}

.question-answer-preview {
    color: var(--text-secondary);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    font-size: calc(var(--font-size) * 0.86);
    line-height: 1.5;
}

.question-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.resolved-check {
    color: var(--primary-700);
    font-weight: 800;
    font-size: calc(var(--font-size) * 0.88);
}

.question-focus-pulse {
    animation: questionFocusPulse 0.9s ease-out;
}

@keyframes questionFocusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.45);
    }
    100% {
        box-shadow: 0 0 0 12px rgba(33, 150, 243, 0);
    }
}

/* ========================================
   Q&A 列表
   ======================================== */
.qa-list {
    overflow-y: auto;
    max-height: 100%;
}

.qa-item {
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.qa-item .question {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.qa-item .answer {
    color: var(--text-secondary);
    padding-left: 12px;
    border-left: 2px solid var(--border-light);
    padding-top: 4px;
}

.qa-item .meta {
    font-size: calc(var(--font-size) * 0.8);
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* ========================================
   弹窗样式
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: calc(var(--font-size) * 1.3);
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 4px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--gray-200);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size);
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-colored);
}

.question-display {
    padding: 12px;
    background: var(--primary-50);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--primary-800, #1565C0);
    border: 1px solid var(--primary-200, #BBDEFB);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--gray-50);
}

.modal-large {
    max-width: 650px;
    width: 90%;
}

/* ========================================
   空状态
   ======================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state .empty-text {
    font-size: calc(var(--font-size) * 1.2);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state .empty-hint {
    font-size: calc(var(--font-size) * 0.9);
    opacity: 0.8;
}

/* ========================================
   版本列表
   ======================================== */
.versions-list {
    max-height: 400px;
    overflow-y: auto;
}

.version-item {
    display: flex;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.version-item:hover {
    background: var(--gray-50);
}

.version-info {
    flex: 1;
}

.version-name {
    font-weight: 600;
    font-size: calc(var(--font-size) * 1);
    margin-bottom: 4px;
    color: var(--text-primary);
}

.version-meta {
    font-size: calc(var(--font-size) * 0.8);
    color: var(--text-tertiary);
}

.version-actions {
    display: flex;
    gap: 6px;
}

/* ========================================
   对比选项
   ======================================== */
.compare-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compare-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.compare-option:hover {
    background: var(--primary-50);
    border-color: var(--primary-color);
}

.compare-option input[type="radio"] {
    margin: 0;
    accent-color: var(--primary-color);
}

.specific-version-select {
    margin-left: 24px;
    margin-top: 10px;
}

.specific-version-select.hidden {
    display: none;
}

/* ========================================
   AI 理由显示
   ======================================== */
.ai-reasons-display {
    font-size: calc(var(--font-size) * 0.95);
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

/* ========================================
   修订视图
   ======================================== */
.revision-view {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border-radius: var(--radius-md);
    border: 1px solid var(--warning);
}

.revision-view h4 {
    font-size: calc(var(--font-size) * 1);
    margin-bottom: 12px;
    color: var(--warning-dark);
    font-weight: 600;
}

.revision-view.hidden {
    display: none;
}

.deleted {
    text-decoration: line-through;
    color: var(--danger-dark);
    background: var(--danger-light);
    padding: 2px 6px;
    border-radius: 3px;
}

.inserted {
    color: var(--success-dark);
    background: var(--success-light);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Word-level 修订对比 */
.word-deleted {
    text-decoration: line-through;
    color: var(--danger-dark);
    background: linear-gradient(to right, var(--danger-light), #ffcdd2);
    padding: 1px 4px;
    border-radius: 3px;
    margin: 0 1px;
}

.word-inserted {
    color: var(--success-dark);
    background: linear-gradient(to right, var(--success-light), #C8E6C9);
    padding: 1px 4px;
    border-radius: 3px;
    margin: 0 1px;
    font-weight: 600;
}

#revision-content div {
    line-height: 2;
    margin: 4px 0;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

/* ========================================
   文本选中工具栏
   ======================================== */
.selection-toolbar {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 6px 8px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: flex;
    gap: 4px;
}

.selection-toolbar.hidden {
    display: none;
}

/* ========================================
   问题上下文显示
   ======================================== */
.question-context-display {
    background: var(--primary-50);
    border-left: 3px solid var(--primary-color);
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.question-context-display label {
    font-size: calc(var(--font-size) * 0.85);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-context-display .context-text {
    font-size: calc(var(--font-size) * 0.95);
    color: var(--text-primary);
    margin-top: 6px;
    font-style: italic;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.question-context-display .context-text.context-preview::after {
    content: "（已截断，仍会保存完整引用）";
    display: block;
    margin-top: 6px;
    color: var(--text-tertiary);
    font-size: calc(var(--font-size) * 0.8);
    font-style: normal;
}

/* 问题列表中的引用块 */
.question-context {
    background: var(--primary-50);
    border-left: 3px solid var(--primary-color);
    padding: 8px 12px;
    margin: 8px 0;
    font-size: calc(var(--font-size) * 0.9);
    color: var(--text-secondary);
    font-style: italic;
    max-height: 50px;
    overflow: hidden;
}

.question-locate-btn {
    padding: 4px 8px;
    font-size: calc(var(--font-size) * 0.85);
    background: var(--primary-100);
    color: var(--primary-700);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.question-locate-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   滚动条样式 - 现代化设计
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gray-400), var(--gray-500));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--gray-500), var(--gray-600));
}

/* ========================================
   响应式调整
   ======================================== */
@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 300px minmax(0, 1fr) 320px;
    }

    .sidebar {
        width: 300px;
        min-width: 0;
    }

    .detail-panel {
        width: 320px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 280px minmax(0, 1fr) 300px;
    }

    .sidebar {
        width: 280px;
    }

    .detail-panel {
        width: 300px;
    }
}

@media (max-width: 900px) {
    .app-container {
        height: auto;
        min-height: 100vh;
    }

    .header {
        align-items: flex-start;
        gap: 12px;
        padding: 14px 18px;
    }

    .header h1 {
        font-size: calc(var(--font-size) * 1.45);
        line-height: 1.25;
        max-width: 62%;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .main-content {
        display: grid;
        grid-template-columns: 1fr;
        overflow: visible;
        min-height: auto;
    }

    .sidebar {
        display: flex;
        width: 100%;
        min-width: 0;
        min-height: 520px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .center-panel {
        min-height: 640px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .center-header,
    .center-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .center-actions {
        justify-content: flex-start;
    }

    .detail-panel {
        width: 100%;
        min-height: 640px;
        border-left: none;
    }

    .info-bar {
        gap: 12px;
    }
}

/* ========================================
   动画效果
   ======================================== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 扫描进度动画 */
.scan-progress-modal .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.scan-progress-modal .progress-text {
    color: var(--text-secondary);
    font-size: calc(var(--font-size) * 1.1);
}

/* ========================================
   徽章样式
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: calc(var(--font-size) * 0.8);
    font-weight: 600;
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.badge-info {
    background: var(--info-light);
    color: var(--primary-700);
}

.badge-readonly {
    background: var(--gray-200);
    color: var(--text-secondary);
}

/* ========================================
   文件分类徽章
   ======================================== */
.file-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: calc(var(--font-size) * 0.85);
    font-weight: 600;
    margin-left: 4px;
}

.file-category-badge.contract {
    background: var(--info-light);
    color: var(--primary-700);
}

.file-category-badge.finance {
    background: var(--success-light);
    color: var(--success-dark);
}

.file-category-badge.audit {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.file-category-badge.report {
    background: #F3E5F5;
    color: #6A1B9A;
}

/* ========================================
   隐藏类
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   工具类
   ======================================== */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
