/* style.css - v15.5 (修复对齐 + 隐藏数字输入框箭头 + 修复CSS语法错误) */

/* === 全局变量 === */
:root {
    --primary: #1A73E8;
    --primary-hover: #1557B0;
    --primary-bg: #E8F0FE;
    --text-main: #111827;
    --text-sub: #6B7280;
    --border: #E5E7EB;
    --bg-body: #FFFFFF;
    --bg-sidebar: #F9FAFB;
    --bg-panel: #F3F4F6;
    --radius-lg: 16px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* === 基础重置 === */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
body { font-family: var(--font-sans); color: var(--text-main); height: 100vh; display: flex; flex-direction: column; overflow: hidden; font-size: 16px; }
.material-symbols-rounded { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 24px; display: inline-block; line-height: 1; white-space: nowrap; direction: ltr; }

/* ★★★ 新增：隐藏 number 类型输入框的上下箭头 ★★★ */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield; /* Firefox */
}

/* === Header === */
header { height: 80px; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; background: #fff; flex-shrink: 0; }
.header-content { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.brand-section { display: flex; align-items: center; gap: 16px; }
.logo-box { height: 40px; display: flex; align-items: center; }
.brand-logo { height: 100%; width: auto; object-fit: contain; }
.title-wrapper { display: flex; align-items: center; gap: 12px; }
.app-name { font-size: 20px; font-weight: 700; color: var(--text-main); line-height: 1; margin: 0; }
.version-badge { background: var(--primary-bg); color: var(--primary); font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 600; flex-shrink: 0; margin-top: 2px;}
.user-profile { display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; background: #4F46E5; color: white; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.user-info .status { font-size: 14px; color: var(--primary); margin-left: 20px; }

/* === 布局容器 === */
.layout-container { flex: 1; display: flex; overflow: hidden; width: 100vw; }
.sidebar { flex: 0 0 20%; min-width: 240px; background: var(--bg-sidebar); border-right: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.workspace { flex: 0 0 55%; display: flex; flex-direction: column; position: relative; background: #fff; z-index: 1; min-width: 0;}
.preview-panel { flex: 0 0 25%; min-width: 280px; background: #fff; border-left: 1px solid var(--border); display: flex; flex-direction: column; }

/* === 左侧栏组件 === */
.engine-card { background: white; border: 1px solid var(--border); padding: 12px; border-radius: 10px; display: flex; gap: 10px; position: relative; align-items: center; }
.engine-icon { color: var(--primary); font-size: 24px; }
.engine-info .value { font-weight: 700; font-size: 13px; }
.status-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; position: absolute; top: 12px; right: 12px; }
.status-dot.blinking { animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.section-title { font-size: 16px; font-weight: 600; color: var(--text-sub); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 0; }
.risk-list { display: flex; flex-direction: column; gap: 15px; }
.risk-item { display: flex; align-items: center; gap: 8px; padding: 8px; background: white; border-radius: 6px; border: 1px solid transparent; font-size: 14px; }
.risk-item .icon { font-size: 16px; color: var(--text-sub); }
.risk-item .label { flex: 1; color: var(--text-main); }
.status-badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.status-badge.pending { background: #F3F4F6; color: #9CA3AF; }
.status-badge.safe { background: #ECFDF5; color: #059669; }
.status-badge.warning { background: #FEF2F2; color: #EF4444; }

/* === 工作区组件 === */
.analysis-scroll-area { flex: 1; overflow-y: auto; padding: 32px; scroll-behavior: smooth; }
.empty-state { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: var(--text-sub); animation: fadeIn 0.5s ease; }
.loading-container { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid #E5E7EB; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* === 仪表盘 === */
.dashboard-top-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; align-items: stretch; }
.score-dashboard-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; display: flex; height: auto; min-height: 220px; }
.score-header-bg { width: 40%; background: linear-gradient(135deg, #059669 0%, #047857 100%); color: white; padding: 16px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; flex-shrink: 0; }
.score-number-large { font-size: 48px; font-weight: 800; font-family: var(--font-mono); line-height: 1; }
.score-text-summary p { font-size: 11px; opacity: 0.9; line-height: 1.3; margin-top: 4px; }
.dimension-grid-compact { flex: 1; padding: 16px 20px; background: #fff; display: flex; flex-direction: column; justify-content: space-evenly; gap: 12px; }
.dim-slider-item { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.dim-label { width: 60px; font-weight: 600; color: #374151; }
.dim-slider-input { flex: 1; height: 4px; -webkit-appearance: none; background: #E5E7EB; border-radius: 2px; outline: none; }
.dim-slider-input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: white; border: 2px solid var(--primary); border-radius: 50%; cursor: pointer; }
.dim-score-val { width: 24px; text-align: right; font-weight: 700; color: var(--primary); }
.human-review-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; height: auto; min-height: 220px; display: flex; flex-direction: column; box-shadow: var(--shadow-card); }
.human-comment-area textarea { flex: 1; width: 100%; min-height: 120px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; resize: none; background: #F9FAFB; }
.unified-section-title { font-size: 16px; border-bottom: 2px solid #E5E7EB; padding-bottom: 10px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; color: var(--text-main); font-weight: 700; }

/* === 底部操作栏 === */
.bottom-action-bar { height: 80px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 0 32px; background: white; gap: 12px; flex-shrink: 0; }
.divider-vertical { height: 24px; width: 1px; background: var(--border); margin: 0 8px; }
.action-btn { height: 44px; padding: 0 20px; border-radius: 8px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 4px rgba(26, 115, 232, 0.2); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); }
.btn-primary:disabled { background: #9CA3AF; cursor: not-allowed; box-shadow: none; }
.btn-outline { border: 1px solid var(--border); background: white; color: var(--text-main); }
.btn-outline:hover { background: #F9FAFB; border-color: #D1D5DB; }
.btn-secondary { background: #F3F4F6; color: var(--text-main); border: 1px solid #E5E7EB; }
.weight-list { display: flex; flex-direction: column; gap: 0; padding: 8px 4px; }
.weight-slider-bar { width: 100%; height: 4px; -webkit-appearance: none; background: #E5E7EB; border-radius: 2px; outline: none; margin-top: 2px; margin-bottom: 4px; display: block; }
.weight-slider-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; background: var(--primary); border-radius: 50%; cursor: pointer; }

/* === 弹窗 UI (SaaS Style) === */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); 
    z-index: 1000; display: flex; justify-content: center; align-items: center; 
    animation: fadeIn 0.2s ease;
}
.modal-box { 
    background: #fff; width: 440px; max-width: 90%; 
    border-radius: 20px; box-shadow: var(--shadow-modal); padding: 0; 
    border: 1px solid rgba(255,255,255,0.1); transform: scale(1);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { padding: 24px 32px 16px; background: #fff; border-radius: 20px 20px 0 0; }
.modal-header h3 { margin: 0 0 6px 0; font-size: 20px; color: var(--text-main); font-weight: 700; }
.modal-header p { margin: 0; color: var(--text-sub); font-size: 13px; }
.modal-body { padding: 8px 32px 24px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #374151; }
.form-select { 
    width: 100%; padding: 12px 16px; border: 1px solid #E5E7EB; border-radius: 10px; 
    font-size: 14px; background-color: #F9FAFB; color: var(--text-main);
    transition: all 0.2s; outline: none; cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.form-select:hover { background-color: #fff; border-color: #D1D5DB; }
.form-select:focus { background-color: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.modal-footer { padding: 0 32px 32px; display: flex; justify-content: flex-end; gap: 12px; }

/* === 右侧面板 === */
.panel-header { gap: 10px; height: 48px; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; font-weight: 500; font-size: 16px; background: #fff; }

.image-preview-wrapper { flex: 1; background: var(--bg-panel); display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden; position: relative; }
.image-container-rel { max-width: 100%; max-height: 100%; box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
#poster-image { display: block; max-width: 100%; max-height: 100%; border-radius: 4px; }
.empty-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; width: 100%; cursor: pointer; }
.result-stats { background: #fff; border-top: 1px solid var(--border); }

/* === 右侧信息对齐修复 (保留) === */
.stats-header { 
    height: 48px; 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 20px; 
    font-weight: 500; 
    font-size: 16px; 
    background: #fff; 
}

.stats-header-title {
    display: flex; 
    align-items: center; 
    gap: 10px;
    line-height: 1; 
}

.stats-header-title .material-symbols-rounded {
    font-size: 20px; 
}

.header-filename {
    color: var(--text-sub); 
    font-weight: 400; 
    font-size: 12px;  
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    font-family: var(--font-mono); 
    margin-left: auto;
}

.stats-content-body { padding: 5px 20px; font-size: 12px; }
.stats-content-body li { display: flex; justify-content: space-between; height: 23px; line-height: 23px; }

/* 其他 */
.weight-desc { font-size: 11px; color: #9CA3AF; line-height: 1.2; margin-bottom: 6px; display: block; }
.pdf-content { background: #fff; padding: 20px; border: 1px solid #eee; }
.quant-analysis-panel { padding: 16px; border-top: 1px solid var(--border); background: #fff; display: flex; flex-direction: column; gap: 12px; }
.ctr-card { background: linear-gradient(135deg, #1A73E8 0%, #0D47A1 100%); border-radius: 8px; padding: 12px; color: white; text-align: center; }
.ctr-label { font-size: 11px; opacity: 0.9; margin-bottom: 4px; }
.ctr-value { font-size: 24px; font-weight: 800; font-family: var(--font-mono); line-height: 1; margin-bottom: 4px; }
.ctr-desc { font-size: 10px; opacity: 0.8; }
.eye-track-info { font-size: 12px; color: #374151; display: flex; flex-direction: column; gap: 6px; }
.eye-row { display: flex; justify-content: space-between; }

