/* ===================== 全局重置 ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a56db;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --risk-high: #dc2626;
    --risk-medium: #f59e0b;
    --risk-low: #16a34a;
    --risk-high-bg: #fef2f2;
    --risk-medium-bg: #fffbeb;
    --risk-low-bg: #f0fdf4;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===================== 顶部导航 ===================== */
.top-bar {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(26, 86, 219, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 36px;
}

.logo-text h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.logo-text p {
    font-size: 13px;
    opacity: 0.85;
    margin: 0;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
}

.status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse 2s infinite;
}

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

/* ===================== 主容器 ===================== */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px;
    flex: 1;
    width: 100%;
}

/* ===================== 上传区域 ===================== */
.upload-section {
    margin-bottom: 24px;
}

.upload-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.upload-card h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.upload-hint {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 24px;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafbfc;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary-light);
    background: #eff6ff;
}

.drop-zone.dragover {
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    width: 56px;
    height: 56px;
    color: var(--primary-light);
}

.drop-text {
    color: var(--text-light);
    font-size: 15px;
}

.btn-select {
    display: inline-block;
    padding: 10px 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-select:hover {
    background: var(--primary-dark);
}

.file-name {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
    margin-top: 8px;
}

/* ===================== 审核维度展示 ===================== */
.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 28px 0;
}

.dimension-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.dim-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

/* ===================== 按钮 ===================== */
.btn-analyze {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-analyze:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
}

.btn-analyze:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.btn-analyze.active {
    background: var(--primary-dark);
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.ai-notice {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
}

/* ===================== 进度区域 ===================== */
.progress-section {
    margin-bottom: 24px;
}

.progress-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

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

.progress-header h3 {
    font-size: 18px;
    color: var(--primary-dark);
}

.progress-percent {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.progress-steps .step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8fafc;
    transition: all 0.3s;
}

.progress-steps .step.active {
    color: var(--primary);
    background: #eff6ff;
    font-weight: 600;
}

.progress-steps .step.done {
    color: var(--risk-low);
    background: var(--risk-low-bg);
}

/* ===================== 审核结果 ===================== */
.summary-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.summary-header h2 {
    font-size: 24px;
    color: var(--primary-dark);
}

.summary-meta {
    font-size: 13px;
    color: var(--text-light);
    text-align: right;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    background: #f8fafc;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.stat-high .stat-value { color: var(--risk-high); }
.stat-medium .stat-value { color: var(--risk-medium); }
.stat-low .stat-value { color: var(--risk-low); }
.stat-total .stat-value { color: var(--primary); }

.overall-risk {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.overall-risk.high {
    background: var(--risk-high-bg);
    color: var(--risk-high);
    border: 1px solid #fecaca;
}

.overall-risk.medium {
    background: var(--risk-medium-bg);
    color: var(--risk-medium);
    border: 1px solid #fde68a;
}

.overall-risk.low {
    background: var(--risk-low-bg);
    color: var(--risk-low);
    border: 1px solid #bbf7d0;
}

/* ===================== 维度结果卡片 ===================== */
.dimensions-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.dimension-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border-left: 4px solid var(--border);
}

.dimension-card.risk-high { border-left-color: var(--risk-high); }
.dimension-card.risk-medium { border-left-color: var(--risk-medium); }
.dimension-card.risk-low { border-left-color: var(--risk-low); }

.dim-card-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.dim-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
}

.dim-card-title .num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
}

.risk-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.risk-tag.high { background: var(--risk-high-bg); color: var(--risk-high); }
.risk-tag.medium { background: var(--risk-medium-bg); color: var(--risk-medium); }
.risk-tag.low { background: var(--risk-low-bg); color: var(--risk-low); }

.dim-card-body {
    padding: 20px 24px;
}

.finding-list, .suggestion-list {
    list-style: none;
    margin-bottom: 16px;
}

.finding-list li, .suggestion-list li {
    padding: 10px 12px 10px 36px;
    position: relative;
    font-size: 14px;
    line-height: 1.7;
    border-radius: 6px;
    margin-bottom: 8px;
}

.finding-list li {
    background: var(--risk-high-bg);
    color: #991b1b;
}

.finding-list li::before {
    content: "⚠";
    position: absolute;
    left: 12px;
    top: 10px;
    font-size: 14px;
}

.suggestion-list li {
    background: #eff6ff;
    color: #1e40af;
}

.suggestion-list li::before {
    content: "✎";
    position: absolute;
    left: 12px;
    top: 10px;
    font-size: 14px;
}

.section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.no-issues {
    padding: 16px;
    text-align: center;
    color: var(--risk-low);
    font-size: 14px;
    background: var(--risk-low-bg);
    border-radius: 8px;
}

.key-excerpts {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-light);
}

.key-excerpts .excerpt-item {
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}

.key-excerpts .excerpt-item:last-child {
    border-bottom: none;
}

/* ===================== 新版问题展示卡片 ===================== */
.finding-list {
    list-style: none;
    margin-bottom: 16px;
}

.finding-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-left: 4px solid var(--risk-high);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}

.finding-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.finding-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.finding-row:last-child {
    margin-bottom: 0;
}

.finding-label {
    flex-shrink: 0;
    min-width: 72px;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.6;
}

.finding-label.original {
    background: #fef3c7;
    color: #92400e;
}

.finding-label.issue {
    background: #fee2e2;
    color: #991b1b;
}

.finding-label.suggestion {
    background: #dbeafe;
    color: #1e40af;
}

.finding-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}

.finding-content.original-text {
    color: #78350f;
    background: #fffbeb;
    padding: 6px 10px;
    border-radius: 4px;
    font-style: italic;
}

.finding-content.issue-text {
    color: #991b1b;
}

.finding-content.suggestion-text {
    color: #1e40af;
    background: #eff6ff;
    padding: 6px 10px;
    border-radius: 4px;
}

/* 兼容旧版列表样式 */
ul.finding-list {
    list-style: none;
    margin-bottom: 16px;
}

ul.finding-list li {
    padding: 10px 12px 10px 36px;
    position: relative;
    font-size: 14px;
    line-height: 1.7;
    border-radius: 6px;
    margin-bottom: 8px;
    background: var(--risk-high-bg);
    color: #991b1b;
}

ul.finding-list li::before {
    content: "⚠";
    position: absolute;
    left: 12px;
    top: 10px;
    font-size: 14px;
}

/* ===================== 操作按钮 ===================== */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-export, .btn-reset {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-export {
    background: var(--card-bg);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-export:hover {
    background: var(--primary);
    color: #fff;
}

.btn-reset {
    background: #f1f5f9;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-reset:hover {
    background: #e2e8f0;
}

/* ===================== 合同原文预览 ===================== */
.contract-preview {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.contract-preview summary {
    padding: 16px 24px;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 15px;
    user-select: none;
}

.contract-text {
    padding: 0 24px 20px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-light);
    white-space: pre-wrap;
    word-break: break-all;
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin: 0 24px 20px;
}

/* ===================== 错误提示 ===================== */
.error-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--risk-high);
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* ===================== 页脚 ===================== */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

.footer-note {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.7;
}

/* ===================== 导航菜单 ===================== */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 12px;
}

.user-name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.btn-login {
    color: #fff;
    text-decoration: none;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 13px;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ===================== 合同类型选择器 ===================== */
.contract-type-selector {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 280px;
}

.type-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.type-select {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.type-select:focus {
    outline: none;
    border-color: var(--primary-light);
}

.type-badge {
    display: inline-block;
    padding: 2px 10px;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 12px;
    font-size: 12px;
}

.type-badge-small {
    display: inline-block;
    padding: 1px 8px;
    background: #f0f4f8;
    color: var(--text-light);
    border-radius: 10px;
    font-size: 11px;
}

.mode-badge {
    display: inline-block;
    padding: 1px 8px;
    background: #f8fafc;
    color: var(--text-light);
    border-radius: 10px;
    font-size: 11px;
}

.perspective-badge {
    display: inline-block;
    padding: 1px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* ===================== 历史记录页面 ===================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 22px;
    color: var(--primary-dark);
}

.page-actions {
    display: flex;
    gap: 10px;
}

.btn-compare, .btn-refresh {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-compare {
    background: var(--primary);
    color: #fff;
}

.btn-compare:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.btn-compare:not(:disabled):hover {
    background: var(--primary-dark);
}

.btn-refresh {
    background: #f1f5f9;
    color: var(--text);
}

.btn-refresh:hover {
    background: #e2e8f0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--border);
    transition: all 0.2s;
}

.history-item.risk-high { border-left-color: var(--risk-high); }
.history-item.risk-medium { border-left-color: var(--risk-medium); }
.history-item.risk-low { border-left-color: var(--risk-low); }

.history-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(2px);
}

.compare-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.history-info {
    flex: 1;
    cursor: pointer;
}

.history-filename {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.history-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.history-risk {
    flex-shrink: 0;
}

.history-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-view, .btn-delete {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-view {
    background: #eff6ff;
    color: var(--primary);
}

.btn-view:hover {
    background: var(--primary);
    color: #fff;
}

.btn-delete {
    background: #fef2f2;
    color: var(--risk-high);
}

.btn-delete:hover {
    background: var(--risk-high);
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 15px;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.error-msg {
    text-align: center;
    padding: 20px;
    color: var(--risk-high);
    font-size: 14px;
}

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

.modal-content {
    background: #fff;
    border-radius: var(--radius);
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 18px;
    color: var(--primary-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px 8px;
    border-radius: 6px;
}

.modal-close:hover {
    background: #f1f5f9;
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.detail-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.finding-item {
    padding: 8px 12px 8px 32px;
    background: var(--risk-high-bg);
    color: #991b1b;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    position: relative;
}

.finding-item::before {
    content: "⚠";
    position: absolute;
    left: 10px;
}

.suggestion-item {
    padding: 8px 12px 8px 32px;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    position: relative;
}

.suggestion-item::before {
    content: "✎";
    position: absolute;
    left: 10px;
}

/* ===================== 对比表格 ===================== */
.compare-title {
    margin: 32px 0 16px;
    color: var(--primary-dark);
}

.compare-content {
    overflow-x: auto;
}

.compare-table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.compare-table th {
    padding: 16px 20px;
    background: var(--primary-dark);
    color: #fff;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
}

.compare-table th small {
    font-weight: 400;
    opacity: 0.8;
}

.compare-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    text-align: center;
}

.compare-table .dim-name {
    text-align: left;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    background: #f8fafc;
}

.cell-risk {
    font-weight: 600;
}

.cell-high { background: var(--risk-high-bg); }
.cell-medium { background: var(--risk-medium-bg); }
.cell-low { background: var(--risk-low-bg); }

.cell-detail {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-light);
    margin-top: 4px;
}

.cell-na {
    color: var(--text-light);
}

/* ===================== 设置页面 ===================== */
.settings-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.settings-card h2 {
    font-size: 20px;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.settings-card h3 {
    font-size: 16px;
    color: var(--text);
    margin: 24px 0 12px;
}

.settings-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 24px;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.form-notice {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 12px;
}

.form-notice.success {
    color: var(--risk-low);
}

.form-notice.error {
    color: var(--risk-high);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.btn-save {
    padding: 12px 32px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save:hover {
    background: var(--primary-dark);
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 14px;
}

.info-item span:first-child {
    color: var(--text-light);
}

.info-item span:last-child {
    font-weight: 600;
    color: var(--text);
}

.user-list {
    margin-bottom: 20px;
}

.user-table {
    overflow-x: auto;
}

.user-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.user-table th {
    padding: 10px 16px;
    background: #f8fafc;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
}

.user-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

/* ===================== 登录页面 ===================== */
.login-body {
    background: linear-gradient(135deg, #1e3a8a, #1a56db);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    font-size: 48px;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--primary-dark);
    margin: 8px 0 4px;
}

.login-logo p {
    font-size: 13px;
    color: var(--text-light);
}

.login-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.login-tab.active {
    background: #fff;
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.login-form .form-group {
    margin-bottom: 16px;
}

.btn-login-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}

.btn-login-submit:hover {
    background: var(--primary-dark);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
}

.login-footer a {
    font-size: 13px;
    color: var(--text-light);
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--primary);
}

/* ===================== 响应式 ===================== */
@media (max-width: 768px) {
    .container { padding: 16px 12px; }
    .upload-card { padding: 24px 16px; }
    .dimensions-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-stats { grid-template-columns: repeat(2, 1fr); }
    .detail-stats { grid-template-columns: repeat(2, 1fr); }
    .progress-steps { flex-direction: column; gap: 6px; }
    .action-buttons { flex-direction: column; }
    .logo-text h1 { font-size: 18px; }
    .logo-text p { font-size: 11px; }
    .top-bar { padding: 12px 16px; flex-wrap: wrap; }
    .nav-menu { gap: 4px; }
    .nav-item { padding: 4px 10px; font-size: 13px; }
    .contract-type-selector { flex-direction: column; align-items: flex-start; }
    .selector-item { width: 100%; min-width: unset; }
    .type-select { width: 100%; }
    .form-row { flex-direction: column; }
    .history-item { flex-wrap: wrap; }
    .history-actions { width: 100%; }
    .settings-card { padding: 24px 16px; }
    .compare-table { font-size: 12px; }
    .compare-table th, .compare-table td { padding: 8px 10px; }
}

/* ===================== AI 预设按钮 ===================== */
.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.preset-btn {
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.preset-btn:hover {
    border-color: var(--primary-light);
    background: #eff6ff;
}

.preset-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.form-notice.success {
    color: #16a34a;
    background: #f0fdf4;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
}

/* ===================== 嵌入模式（OA iframe） ===================== */
body.embed-mode .top-bar {
    padding: 8px 20px;
    min-height: 48px;
}

body.embed-mode .top-bar .logo-text h1 {
    font-size: 16px;
}

body.embed-mode .top-bar .logo-text p {
    font-size: 11px;
}

body.embed-mode .top-bar .logo-icon {
    font-size: 20px;
}

body.embed-mode .nav-item {
    padding: 4px 12px;
    font-size: 13px;
}

body.embed-mode .footer {
    display: none;
}

body.embed-mode .container {
    padding-top: 16px;
    padding-bottom: 32px;
}

body.embed-mode {
    background: var(--bg);
}

/* ===================== 用户审批样式 ===================== */
.pending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.pending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
}

.pending-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pending-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.pending-username {
    font-size: 13px;
    color: var(--text-light);
}

.pending-time {
    font-size: 12px;
    color: var(--text-lighter);
}

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

.btn-approve {
    padding: 6px 16px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-approve:hover {
    background: #15803d;
}

.btn-reject {
    padding: 6px 16px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-reject:hover {
    background: #b91c1c;
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-approved {
    background: #dcfce7;
    color: #16a34a;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-rejected {
    background: #fee2e2;
    color: #dc2626;
}

/* ===================== 删除用户按钮 ===================== */
.btn-delete {
    padding: 6px 16px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.btn-delete-small {
    padding: 4px 12px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-delete-small:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.current-user-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #eff6ff;
    color: #1a56db;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}
