/* =========================================
   🎨 配色系统 (SaaS 高级空气感版)
   ========================================= */
:root {
    --bg-body: #f4f5f8;       /* 稍微偏冷的高级灰，让纯白卡片更凸显 */
    --bg-card: #ffffff;       /* 绝对纯白卡片 */
    --bg-header: #f8fafc;     /* 极浅的表头，增加微小层次 */
    --text-main: #0f172a;     /* 加深文字颜色，对比度拉满，阅读不费力 */
    --text-muted: #64748b;
    --border: #e2e8f0;
    --c1: #0f766e;    /* 稍微压暗的主题绿，看起来更稳重专业 */
    --c1-bg: rgba(15, 118, 110, 0.08);
    --c2: #4f46e5;
    --c2-bg: rgba(79, 70, 229, 0.08);
    --radius: 12px;   
    /* ✨ 终极魔法：双层空气感阴影，卡片瞬间悬浮！ */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] {
    /* 🔙 欢迎回到原配！最经典的科技蓝灰底色 */
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-header: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --c1: #2dd4bf;
    --c1-bg: rgba(45, 212, 191, 0.15);
    --c2: #818cf8;
    --c2-bg: rgba(129, 140, 248, 0.15);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* =========================================
   🏢 全域排版与导航列
   ========================================= */
body { font-family: 'Inter', sans-serif; background: var(--bg-body); color: var(--text-main); margin: 0; padding: 0; line-height: 1.5; transition: background 0.3s ease; }
.container { max-width: 1000px; margin: 0 auto; padding: 20px; }

.navbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; padding: 15px 0; }
.logo { font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 700; color: var(--text-main); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--text-muted); font-weight: 400; }
.theme-toggle-btn { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--text-muted); font-size: 13px; font-weight: 500; }

/* 预设的电脑版大按钮 */
.nav-donate-btn { padding: 6px 14px; border-radius: 6px; background: #ff5e5b; color: #fff; text-decoration: none; font-size: 13px; font-weight: 700; font-family: 'Inter', sans-serif; display: flex; align-items: center; gap: 6px; transition: transform 0.2s; white-space: nowrap; }
.nav-donate-btn:hover { transform: scale(1.05); }

/* 手机版的小萤幕模式 */
@media (max-width: 500px) {
    .nav-donate-btn { padding: 6px 10px; }
    .nav-donate-btn .donate-text { display: none; }
    .nav-donate-btn::after { content: "Support"; }
}

/* =========================================
   🚀 英雄标题与搜寻引擎
   ========================================= */
.hero-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 20px; text-align: center; margin-bottom: 40px; box-shadow: var(--shadow); }
.hero-title { font-size: 2rem; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.03em; }
.hero-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 30px; }

.compare-inputs { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.input-group { position: relative; flex: 1; min-width: 220px; max-width: 320px; }
input { width: 100%; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-body); color: var(--text-main); outline: none; box-sizing: border-box; font-family: 'Inter', sans-serif; transition: all 0.2s; }
input:focus { border-color: var(--c1); box-shadow: 0 0 0 3px var(--c1-bg); background: var(--bg-card); }
.btn-search { background: var(--text-main); color: var(--bg-body); border: none; padding: 12px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: opacity 0.2s; }
.btn-search:hover { opacity: 0.9; }
.vs-badge { font-family: 'JetBrains Mono', monospace; font-weight: 800; font-style: italic; color: var(--text-muted); opacity: 0.5; }

.autocomplete-items { position: absolute; border: 1px solid var(--border); border-top: none; z-index: 99; top: 100%; left: 0; right: 0; background: var(--bg-card); border-radius: 0 0 8px 8px; max-height: 250px; overflow-y: auto; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.autocomplete-items div { padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-muted); display: flex; justify-content: space-between; }
.autocomplete-items div strong { color: var(--c1); }
.autocomplete-items div:hover { background: var(--bg-header); color: var(--text-main); }
.autocomplete-active { background-color: var(--c1) !important; color: #ffffff !important; }
.autocomplete-active strong { color: #ffffff !important; }

/* ✨ 阿谦特制：丝滑胶囊风页卡引擎 */
.view-tabs { display: inline-flex; background: var(--bg-body); padding: 6px; border-radius: 100px; border: 1px solid var(--border); gap: 4px; }
.view-tab { display: inline-flex; align-items: center; padding: 8px 24px; border-radius: 100px; font-size: 14px; font-weight: 600; color: var(--text-muted); text-decoration: none; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; }
.view-tab:hover { color: var(--text-main); }
.view-tab.active { background: var(--bg-card); color: var(--c1); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* =========================================
   🗂️ 核心资料卡片与表格 (SBC 专用版)
   ========================================= */
.spec-group-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 24px; overflow: visible; box-shadow: var(--shadow); }
.card-header { background: var(--bg-header); padding: 16px 24px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); border-top-left-radius: calc(var(--radius) - 1px); border-top-right-radius: calc(var(--radius) - 1px); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
.col-header { padding: 12px 24px; border-bottom: 2px solid var(--border); font-weight: 700; color: var(--text-main); width: 35%; }
.col-label { width: 30%; color: var(--text-muted); font-weight: 500; }
td { padding: 14px 24px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.val-col { font-family: 'JetBrains Mono', monospace; color: var(--text-main); font-weight: 500; }
.win-bg { background-color: rgba(16, 185, 129, 0.12); color: #047857; font-weight: 600; }
[data-theme="dark"] .win-bg { background-color: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.spec-tag { display: inline-block; font-size: 12px; background: var(--bg-body); padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border); margin-right: 4px; margin-bottom: 4px; color: var(--text-muted); white-space: nowrap; }

/* 🌟 网格分类容器 (Silo 架构专属) */
.silo-brand-card { padding: 20px; }
.related-card { background: var(--bg-body); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; transition: all 0.2s ease; margin-bottom: 10px; }
.related-card:hover { transform: translateX(4px); border-color: var(--c1); box-shadow: 4px 4px 15px var(--c1-bg); }
.rel-title { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; color: var(--text-main); flex: 1; }
.rel-actions { display: flex; gap: 10px; align-items: center; }
.btn-rel-view { background: var(--bg-header); border: 1px solid var(--border); color: var(--text-main); padding: 6px 16px; border-radius: 6px; font-size: 12px; cursor: pointer; text-align: center; font-weight: 600; text-decoration: none; transition: background 0.2s; }
.btn-rel-view:hover { background: var(--text-main); color: var(--bg-body); }
.btn-rel-vs { background: var(--c1-bg); border: 1px solid var(--c1); color: var(--c1); padding: 6px 16px; border-radius: 6px; font-size: 12px; cursor: pointer; text-align: center; font-weight: 700; text-decoration: none; transition: background 0.2s; }
.btn-rel-vs:hover { background: var(--c1); color: #ffffff; }

/* =========================================
   📐 视觉化仪表盘 (尺寸比较与跑分条)
   ========================================= */
.visualizer-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 24px; overflow: hidden; box-shadow: var(--shadow); }
.vis-dashboard { display: flex; flex-direction: row; min-height: 340px; }
.vis-panel-left { flex: 4; background: var(--bg-header); border-right: 1px solid var(--border); padding: 30px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.vis-panel-right { flex: 6; background: var(--bg-card); padding: 20px; display: flex; align-items: center; justify-content: center; position: relative; }
.vis-item { display: flex; flex-direction: column; gap: 6px; }
.vis-head { font-size: 15px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.vis-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.vis-dot.c1 { background: var(--c1); }
.vis-dot.c2 { background: var(--c2); }
.vis-sub { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono'; }
.vis-track { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.vis-fill { height: 100%; border-radius: 3px; }
.vis-fill.c1 { background: var(--c1); }
.vis-fill.c2 { background: var(--c2); }
.vis-diff { margin-top: 10px; font-size: 12px; color: #10b981; font-weight: 600; background: rgba(16, 185, 129, 0.1); padding: 4px 10px; border-radius: 20px; align-self: flex-start; }
.sensor-rect { stroke-width: 1.5px; transition: all 0.5s ease; }
.rect-c1 { fill: var(--c1-bg); stroke: var(--c1); }
.rect-c2 { fill: var(--c2-bg); stroke: var(--c2); }
.vis-label { font-family: 'JetBrains Mono'; font-size: 11px; font-weight: 600; }

.perf-container { padding: 20px; }
.perf-row { display: flex; align-items: center; margin-bottom: 16px; font-size: 13px; }
.perf-label { width: 120px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.perf-bars { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.bar-wrapper { display: flex; align-items: center; gap: 10px; height: 24px; }
.bar-track { flex: 1; background: var(--bg-body); height: 8px; border-radius: 4px; overflow: hidden; border:1px solid var(--border); }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.fill-c1 { background: var(--c1); }
.fill-c2 { background: var(--c2); }
.score-text { font-family: 'JetBrains Mono'; font-weight: 700; font-size: 12px; width: 40px; text-align: right; }
.perf-note { font-size: 11px; color: var(--text-muted); margin-top: 4px; opacity: 0.8; font-weight: 400; }

/* =========================================
   💡 放大镜与终极 Tooltip 魔法
   ========================================= */
.has-tooltip, .text-tooltip { position: relative; cursor: help; }
.label-tooltip { position: relative; cursor: help; display: inline-flex; align-items: center; gap: 5px; transition: color 0.2s; }
.label-tooltip:hover, .label-tooltip.is-locked { color: var(--text-main); }
.mag-glass { position: relative; width: 9px; height: 9px; border: 1.5px solid var(--text-muted); border-radius: 50%; flex-shrink: 0; transition: border-color 0.2s; box-sizing: border-box; top: -1px; }
.mag-glass::after { content: ""; position: absolute; bottom: -3px; right: -2.5px; width: 4.5px; height: 1.5px; background-color: var(--text-muted); transform: rotate(45deg); transition: background-color 0.2s; border-radius: 1px; }
.label-tooltip:hover .mag-glass, .label-tooltip.is-locked .mag-glass { border-color: var(--c1); }
.label-tooltip:hover .mag-glass::after, .label-tooltip.is-locked .mag-glass::after { background-color: var(--c1); }
.text-tooltip { color: var(--c1); font-weight: 600; border-bottom: 1px dashed var(--c1); }
.spec-tag.has-tooltip { border-color: var(--c1); background: var(--c1-bg); }

#global-tooltip { position: absolute; z-index: 99999; background-color: #1e293b; color: #f8fafc; width: max-content; max-width: 250px; text-align: left; border-radius: 8px; padding: 8px 12px; font-size: 11px; font-family: 'Inter', sans-serif; font-weight: 500; box-shadow: 0 10px 25px rgba(0,0,0,0.2); white-space: normal; line-height: 1.5; pointer-events: none; opacity: 0; visibility: hidden; transform: translate(-50%, 10px); transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s; }
#global-tooltip.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
#global-tooltip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: #1e293b transparent transparent transparent; }
#global-tooltip.is-locked { border: 1px solid var(--c1); box-shadow: 0 5px 20px var(--c1-bg); padding-right: 28px; pointer-events: auto; }
#global-tooltip .lock-icon { display: none; position: absolute; top: 10px; right: 10px; width: 8px; height: 6px; background: var(--c1); border-radius: 1px; }
#global-tooltip .lock-icon::before { content: ""; position: absolute; top: -5px; left: 1px; width: 4px; height: 5px; border: 1.5px solid var(--c1); border-bottom: none; border-radius: 3px 3px 0 0; }
#global-tooltip.is-locked .lock-icon { display: block; }

/* =========================================
   模态框与小工具
   ========================================= */
.hidden { display: none !important; }
.loading-spinner { text-align: center; padding: 60px; color: var(--text-muted); font-family: 'JetBrains Mono'; }
.legal-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 10000; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: all 0.2s ease; }
.legal-modal.active { opacity: 1; pointer-events: auto; }
.legal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; width: 90%; max-width: 550px; padding: 30px; position: relative; box-shadow: 0 20px 40px rgba(0,0,0,0.2); transform: translateY(20px); transition: transform 0.2s ease; max-height: 80vh; display: flex; flex-direction: column; }
.legal-modal.active .legal-box { transform: translateY(0); }
.legal-content { font-size: 13px; color: var(--text-muted); line-height: 1.6; overflow-y: auto; padding-right: 10px; }
.legal-content p { margin-top: 0; margin-bottom: 12px; }
.legal-content strong { color: var(--text-main); }
[data-theme="dark"] #feedback-widget button[title="Report Issue"] { background: rgba(30, 41, 59, 0.8); border-color: #334155; }

/* 📱 手机版响应式断点 */
@media (max-width: 768px) {
    .vis-dashboard { flex-direction: column-reverse; }
    .vis-panel-left { border-right: none; border-top: 1px solid var(--border); }
    .vis-panel-right { min-height: 260px; }
    .compare-inputs { flex-direction: column; }
    
    /* 砍掉手机端强制的 table 修改，让滚动条 table-scroll 自然发挥作用 */
    /* 因为我们在 SBC 设定下，表格通常直接横向滑更清晰，硬拆行反而乱 */
}
