/* ==========================================================================
   SenrMold AI System - V8.0 Style Core (3D CAD 驱动)
   ========================================================================== */

/* 1. 变量配置 */
:root {
    --primary: #2f6bff; --primary-dark: #1d4ed8; --accent: #14c8a8; --accent-2: #14c8a8;
    --accent-grad: linear-gradient(135deg, #2f6bff, #14c8a8);
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    --surface-glass: rgba(255, 255, 255, 0.85);
    --surface-solid: #ffffff;
    --surface: var(--surface-glass);
    --surface-border: 1px solid rgba(255, 255, 255, 0.9);
    --border: rgba(20, 40, 80, 0.10);
    --text-main: #1e293b; --text-sub: #64748b; --text-soft: #64748b;
    --card-bg: rgba(255,255,255,0.7);
    --panel-bg: rgba(255,255,255,0.6);
    --input-bg: rgba(255,255,255,0.5);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --viewer-bg: radial-gradient(circle at 50% 35%, #f1f5ff 0%, #e2e8f0 100%);
    --viewer-ghost: rgba(30,41,59,0.06);
    --drop-border: rgba(47,107,255,0.35);
    --nav-h: 62px;
}

/* 暗色主题 */
:root[data-theme="dark"] {
    --primary: #4d86ff; --primary-dark: #3b82f6; --accent: #1fe0bd; --accent-2: #1fe0bd;
    --accent-grad: linear-gradient(135deg, #4d86ff, #1fe0bd);
    --bg-gradient: linear-gradient(135deg, #0b1120 0%, #131c33 100%);
    --surface-glass: rgba(20, 28, 46, 0.75);
    --surface-solid: #131a26;
    --surface: var(--surface-glass);
    --surface-border: 1px solid rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.10);
    --text-main: #e2e8f0; --text-sub: #94a3b8; --text-soft: #94a3b8;
    --card-bg: rgba(17, 25, 42, 0.72);
    --panel-bg: rgba(30, 41, 63, 0.55);
    --input-bg: rgba(15, 23, 42, 0.6);
    --shadow-sm: 0 4px 10px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 30px -6px rgba(0, 0, 0, 0.55);
    --viewer-bg: radial-gradient(circle at 50% 35%, #1e293b 0%, #0b1120 100%);
    --viewer-ghost: rgba(148,163,184,0.12);
    --drop-border: rgba(77,134,255,0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient); color: var(--text-main);
    height: 100vh; overflow: hidden; position: relative;
    transition: background 0.4s ease, color 0.3s ease;
}

/* 2. 背景与布局 */
.bg-decoration { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; animation: float 10s infinite alternate; }
.orb-1 { width: 400px; height: 400px; background: #c7d2fe; top: -10%; left: -10%; }
.orb-2 { width: 300px; height: 300px; background: #ddd6fe; bottom: -10%; right: -5%; animation-delay: 2s; }
.orb-3 { width: 200px; height: 200px; background: #bae6fd; top: 40%; left: 40%; animation-delay: 4s; }
@keyframes float { from { transform: translate3d(0,0,0); } to { transform: translate3d(20px, 30px, 0); } }

.app-container { display: flex; height: calc(100vh - var(--nav-h)); width: 100vw; }

/* 3. 侧边栏 */
.sidebar { width: 380px; background: var(--surface-glass); border-right: var(--surface-border); display: flex; flex-direction: column; z-index: 10; backdrop-filter: blur(20px); }
.brand { height: 80px; display: flex; align-items: center; padding: 0 24px; border-bottom: var(--surface-border); gap: 12px; }
.logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 8px; color: white; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text span:first-child { font-weight: 800; font-size: 18px; letter-spacing: -0.5px; }
.badge { font-size: 10px; background: #eff6ff; color: var(--primary); padding: 1px 6px; border-radius: 4px; font-weight: 600; width: fit-content; }
.badge.gold { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #b45309; border: 1px solid #fcd34d; }
:root[data-theme="dark"] .badge.gold { color: #fbbf24; border-color: #92400e; }

.sync-status { padding: 8px 24px; font-size: 11px; color: var(--text-sub); display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity 0.3s; }
.sync-status i { color: #22c55e; }

.scrollable-form { flex: 1; overflow-y: auto; padding: 24px; }
.scrollable-form::-webkit-scrollbar { width: 4px; }
.scrollable-form::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.form-section { margin-bottom: 32px; }
.form-section h3 { font-size: 12px; font-weight: 700; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; position: relative; padding-left: 14px; }
.form-section h3::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 15px; border-radius: 4px; background: var(--accent-grad); }

/* 高级面板折叠动画 */
.hidden-panel { display: none; }
.hidden-panel.active { display: block; animation: slideDown 0.3s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.input-group { display: flex; gap: 10px; margin-bottom: 16px; }
.three-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; }
.mt-4 { margin-top: 16px; }

/* 表单组件 */
.floating-input { position: relative; width: 100%; }
.floating-input input { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: var(--input-bg); font-size: 14px; transition: 0.2s; font-family: 'Inter', sans-serif; color: var(--text-main); }
.floating-input input:focus { outline: none; border-color: var(--primary); background: var(--input-bg); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), inset 0 0 0 1px var(--primary); }
.floating-input label { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 13px; pointer-events: none; transition: 0.2s; }
.floating-input input:focus ~ label, .floating-input input:not(:placeholder-shown) ~ label { top: 0; left: 8px; font-size: 10px; color: var(--primary); background: var(--surface-glass); padding: 0 4px; height: auto; }
.select-wrapper { position: relative; width: 100%; }
.select-label { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; display: block; font-weight: 600; }
select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: var(--input-bg); font-size: 13px; cursor: pointer; appearance: none; color: var(--text-main); }
:root[data-theme="dark"] select { background: var(--input-bg); }
.arrow-icon { position: absolute; right: 12px; bottom: 12px; font-size: 10px; color: #94a3b8; pointer-events: none; }
.action-area { padding: 20px; border-top: var(--surface-border); background: rgba(255,255,255,0.4); backdrop-filter: blur(10px); }
:root[data-theme="dark"] .action-area { background: rgba(15,23,42,0.4); }
.btn-primary-glow { width: 100%; padding: 14px; border: none; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: 0.3s; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); font-size: 15px; }
.btn-primary-glow:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4); }

/* ===== 3D 导入区 ===== */
.import-section { }
.drop-zone { border: 2px dashed var(--drop-border); border-radius: 14px; padding: 22px 16px; text-align: center; cursor: pointer; transition: 0.25s; background: var(--panel-bg); }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: rgba(59,130,246,0.08); transform: translateY(-2px); }
.dz-icon { font-size: 28px; color: var(--primary); margin-bottom: 8px; }
.dz-text { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.dz-formats { font-size: 10px; color: var(--text-sub); letter-spacing: 0.5px; font-family: 'JetBrains Mono', monospace; }
.import-status { font-size: 11px; margin-top: 8px; min-height: 14px; color: var(--text-sub); }
.import-status.error { color: #ef4444; }
.import-status.ok { color: #16a34a; }

.model-metrics { margin-top: 14px; background: var(--panel-bg); border: 1px solid var(--surface-border); border-radius: 12px; padding: 14px; animation: slideDown 0.3s ease-out; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric { background: var(--card-bg); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.metric span { font-size: 10px; color: var(--text-sub); }
.metric strong { font-size: 13px; color: var(--text-main); font-family: 'JetBrains Mono', monospace; }
.metric-extra { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.unit-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-sub); }
.unit-row input { width: 70px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: var(--input-bg); color: var(--text-main); font-size: 12px; font-family: 'JetBrains Mono', monospace; }
.unit-hint { font-size: 9px; opacity: 0.8; }
.suggest-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--accent); background: rgba(139,92,246,0.1); padding: 6px 8px; border-radius: 6px; }
.btn-clear-model { width: 100%; margin-top: 10px; padding: 8px; border: 1px solid #fca5a5; border-radius: 8px; background: rgba(239,68,68,0.06); color: #ef4444; font-size: 12px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-clear-model:hover { background: rgba(239,68,68,0.14); }

/* 4. 主内容区 */
.main-content { flex: 1; padding: 40px; overflow-y: auto; position: relative; scroll-behavior: smooth; }
.hidden { display: none !important; }
.fade-in-up { animation: fadeInUp 0.5s ease-out backwards; }
@keyframes fadeInUp { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }

/* 5. 工业风注塑机动画 (GPU Optimized) */
.loading-overlay { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.98); z-index: 50; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.4s; }
:root[data-theme="dark"] .loading-overlay { background: rgba(11,17,32,0.97); }
.im-container { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; transform: scale(1.1); }
.im-machine { position: relative; width: 400px; height: 160px; display: flex; align-items: center; }
.im-platen.moving, .im-screw, .im-product, .im-ejector-pin { will-change: transform; }

.im-injection-unit { position: absolute; left: 0; top: 50px; width: 140px; z-index: 2; }
.im-hopper { position: absolute; top: -25px; left: 20px; width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 25px solid #94a3b8; z-index: 3; }
.im-granules { position: absolute; top: -25px; left: -5px; width: 10px; height: 10px; background: #f59e0b; border-radius: 50%; opacity: 0; animation: feed-granules 4s linear infinite; }
.im-barrel { width: 120px; height: 24px; background: #475569; border-radius: 4px 0 0 4px; position: relative; overflow: hidden; border: 2px solid #334155; }
.im-screw { width: 140px; height: 100%; background: repeating-linear-gradient(45deg, #64748b, #64748b 5px, #475569 5px, #475569 10px); position: absolute; top: 0; left: -20px; animation: screw-cycle 4s ease-in-out infinite; }

.im-clamping-unit { position: absolute; right: 0; width: 260px; height: 120px; display: flex; align-items: center; }
.im-tie-bar { position: absolute; width: 100%; height: 6px; background: #cbd5e1; border-radius: 3px; z-index: 0; }
.im-tie-bar.top { top: 20px; } .im-tie-bar.bottom { bottom: 20px; }
.im-platen { width: 25px; height: 90px; background: #334155; border-radius: 4px; position: absolute; z-index: 2; box-shadow: 2px 2px 5px rgba(0,0,0,0.1); }
.im-platen.fixed { left: 20px; }
.im-platen.moving { left: 160px; animation: mold-cycle 4s infinite; }
.im-mold { width: 15px; height: 50px; background: #e2e8f0; border: 1px solid #94a3b8; position: absolute; top: 20px; }
.im-mold.fixed-half { right: -15px; border-radius: 0 4px 4px 0; }
.im-mold.moving-half { left: -15px; border-radius: 4px 0 0 4px; }
.im-ejector-pin { position: absolute; left: -10px; top: 43px; width: 20px; height: 4px; background: #94a3b8; opacity: 0; animation: eject-cycle 4s ease-in-out infinite; }
.im-product-wrap { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.im-product { position: absolute; left: 48px; top: 55px; width: 10px; height: 30px; background: transparent; border-radius: 2px; z-index: 5; animation: product-cycle 4s ease-in-out infinite; }
.im-base { position: absolute; bottom: 0; left: 10%; width: 80%; height: 10px; background: #e2e8f0; border-radius: 5px; z-index: 0; }

@keyframes mold-cycle {
    0% { transform: translate3d(0,0,0); animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
    10% { transform: translate3d(-105px,0,0); }
    15% { transform: translate3d(-106px,0,0); }
    60% { transform: translate3d(-105px,0,0); }
    70% { transform: translate3d(-90px,0,0); animation-timing-function: ease-in; }
    85% { transform: translate3d(0,0,0); } 100% { transform: translate3d(0,0,0); }
}
@keyframes screw-cycle {
    0%, 15% { transform: translate3d(0,0,0); }
    22% { transform: translate3d(28px,0,0); }
    45% { transform: translate3d(28px,0,0); }
    65% { transform: translate3d(0,0,0); } 100% { transform: translate3d(0,0,0); }
}
@keyframes product-cycle {
    0% { opacity: 0; transform: scale(0.8); }
    22% { opacity: 1; background: #ff4d4d; width: 0; left: 52px; transform: scale(1); }
    28% { opacity: 1; background: #ff4d4d; width: 12px; left: 52px; }
    40% { background: #a855f7; } 60% { background: #3b82f6; }
    70% { left: 52px; opacity: 1; transform: translate3d(15px,0,0); }
    85% { left: 52px; opacity: 1; transform: translate3d(105px,0,0); }
    88% { opacity: 1; transform: translate3d(115px,-5px,0) rotate(15deg); }
    95% { opacity: 0; transform: translate3d(135px,80px,0) rotate(90deg); } 100% { opacity: 0; }
}
@keyframes eject-cycle {
    0%, 85% { opacity: 0; transform: translate3d(0,0,0); }
    87% { opacity: 1; transform: translate3d(12px,0,0); }
    92% { opacity: 0; transform: translate3d(0,0,0); } 100% { opacity: 0; }
}
@keyframes feed-granules { 0%, 45% { transform: translate3d(0,0,0); opacity: 0; } 55% { transform: translate3d(0,10px,0); opacity: 1; } 65% { transform: translate3d(0,20px,0); opacity: 0; } 100% { opacity: 0; } }

.loading-status { text-align: center; }
.loading-status h3 { font-size: 14px; font-weight: 600; color: var(--text-sub); margin-bottom: 10px; }
.progress-track { width: 200px; height: 4px; background: #e2e8f0; border-radius: 2px; margin: 0 auto; overflow: hidden; }
:root[data-theme="dark"] .progress-track { background: #1e293b; }
.progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, #2f6bff, #14c8a8); transition: width 0.3s linear; }

/* 6. 仪表盘 */
.empty-state.center-box { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 60%; text-align: center; color: var(--text-sub); }
.icon-circle { width: 80px; height: 80px; background: #eff6ff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--primary); margin-bottom: 20px; }
:root[data-theme="dark"] .icon-circle { background: rgba(59,130,246,0.12); }
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 40px; }
.main-title { font-size: 28px; color: var(--text-main); font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
.meta-info { display: flex; gap: 8px; }
.tag { font-size: 11px; padding: 4px 10px; border-radius: 6px; font-weight: 600; }
.tag.pro { background: #dbeafe; color: var(--primary-dark); }
:root[data-theme="dark"] .tag.pro { background: rgba(59,130,246,0.18); color: #93c5fd; }
.tag.date { background: #f1f5f9; color: var(--text-sub); }
:root[data-theme="dark"] .tag.date { background: rgba(148,163,184,0.12); }
.hero-price-card { background: var(--accent-grad); padding: 20px 30px; border-radius: 16px; box-shadow: 0 10px 25px -5px rgba(47, 107, 255, 0.4); text-align: right; color: white; min-width: 200px; }
.price-label { font-size: 10px; opacity: 0.8; display: block; margin-bottom: 4px; letter-spacing: 1px; }
#resUnitPrice { background: linear-gradient(to bottom, #fff, #bfdbfe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.price-value-wrapper h2 { font-size: 36px; font-family: 'JetBrains Mono', monospace; font-weight: 700; margin: 0; line-height: 1; }
.price-badge { font-size: 10px; background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 4px; display: inline-block; margin-top: 6px; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; }
.grid-column { display: flex; flex-direction: column; gap: 24px; }
.glass-card { background: var(--card-bg); backdrop-filter: blur(12px); border: 1px solid var(--surface-border); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm); }
.glass-card h3 { font-size: 14px; margin-bottom: 20px; color: var(--text-main); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 12px; position: relative; padding-left: 14px; }
.glass-card h3::before { content: ""; position: absolute; left: 0; top: 14px; width: 4px; height: 16px; border-radius: 4px; background: var(--accent-grad); }
:root[data-theme="dark"] .glass-card h3 { border-bottom-color: rgba(255,255,255,0.08); }

.params-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.param-box { background: var(--panel-bg); padding: 12px 16px; border-radius: 10px; border: 1px solid var(--surface-border); position: relative; transition: 0.2s; }
.param-box:hover { background: var(--card-bg); border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.box-header { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; }
.param-box strong { font-size: 18px; color: var(--text-main); display: block; }
.param-box strong.small { font-size: 16px; font-family: 'JetBrains Mono', monospace; }
.text-gradient { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; }
.clean-tooltip { position: absolute; bottom: 105%; left: 50%; transform: translateX(-50%) translateY(5px); width: 200px; background: #1e293b; color: white; border-radius: 6px; padding: 8px 12px; font-size: 11px; opacity: 0; pointer-events: none; transition: 0.2s; z-index: 10; text-align: center; }
:root[data-theme="dark"] .clean-tooltip { background: #0b1120; border: 1px solid rgba(255,255,255,0.1); }
.interactive:hover .clean-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }

.cycle-bar-wrapper { margin-top: 15px; display: flex; flex-direction: column; gap: 5px; }
.cycle-text { font-size: 11px; color: var(--text-sub); text-align: center; background: var(--panel-bg); padding: 6px; border-radius: 6px; }
.warning-text { color: #d97706; background: #fef3c7; }
:root[data-theme="dark"] .warning-text { color: #fbbf24; background: rgba(217,119,6,0.18); }
.chart-container { height: 220px; position: relative; display: flex; align-items: center; justify-content: center; }

.cost-list { list-style: none; }
.cost-list li { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px dashed #e2e8f0; }
:root[data-theme="dark"] .cost-list li { border-bottom-color: rgba(255,255,255,0.08); }
.label-group { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-main); font-weight: 500; }
.icon-box { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.icon-box.blue { background: #dbeafe; color: #2563eb; } .icon-box.red { background: #fee2e2; color: #ef4444; } .icon-box.purple { background: #f3e8ff; color: #9333ea; } .icon-box.yellow { background: #fef3c7; color: #d97706; } .icon-box.gray { background: #f1f5f9; color: #475569; }
:root[data-theme="dark"] .icon-box.blue { background: rgba(37,99,235,0.2); } .icon-box.red { background: rgba(239,68,68,0.2); } .icon-box.purple { background: rgba(147,51,234,0.2); } .icon-box.yellow { background: rgba(217,119,6,0.2); } .icon-box.gray { background: rgba(71,85,105,0.3); }
.val { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 14px; color: var(--text-main); }
.final-total { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 2px solid #cbd5e1; align-items: center; }
:root[data-theme="dark"] .final-total { border-top-color: rgba(255,255,255,0.15); }
.final-total strong { font-size: 24px; color: var(--primary-dark); font-family: 'JetBrains Mono', monospace; }

/* 底部操作区 & AI卡片 */
.footer-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.ai-disclaimer-card { display: flex; align-items: center; gap: 12px; background: linear-gradient(to right, rgba(47, 107, 255, 0.05), rgba(20, 200, 168, 0.05)); border: 1px solid rgba(47, 107, 255, 0.2); padding: 12px 16px; border-radius: 12px; text-decoration: none; transition: all 0.3s ease; margin-bottom: 8px; cursor: pointer; }
.ai-disclaimer-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15); background: var(--card-bg); }
.ai-icon { width: 32px; height: 32px; background: #eff6ff; color: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
:root[data-theme="dark"] .ai-icon { background: rgba(59,130,246,0.15); }
.ai-content { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ai-title { font-size: 12px; font-weight: 700; color: var(--text-main); font-family: 'JetBrains Mono', monospace; }
.ai-desc { font-size: 11px; color: var(--text-sub); }
.ai-arrow { font-size: 12px; color: #cbd5e1; transition: transform 0.3s; }
.ai-disclaimer-card:hover .ai-arrow { transform: translateX(4px); color: var(--primary); }

.btn-export { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: white; color: var(--text-main); font-weight: 600; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; }
:root[data-theme="dark"] .btn-export { background: var(--card-bg); border-color: rgba(255,255,255,0.15); }
.btn-export:hover { background: #f8fafc; border-color: var(--text-sub); }
:root[data-theme="dark"] .btn-export:hover { background: rgba(255,255,255,0.05); }

/* ===== 3D 查看器卡片 (产品 + 模具) ===== */
.model-viewer-card { margin-bottom: 24px; overflow: hidden; }
.mv-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mv-header h3 { border: none !important; margin: 0 !important; padding: 0 !important; }
.mv-controls { display: flex; gap: 6px; }
.mv-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--surface-border); background: var(--panel-bg); color: var(--text-sub); cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.mv-btn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.mv-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 10px rgba(59,130,246,0.3); }
.mv-canvas-wrap { position: relative; width: 100%; height: 360px; border-radius: 12px; overflow: hidden; background: var(--viewer-bg); border: 1px solid var(--surface-border); }
.mold-wrap { height: 320px; }
#modelCanvas, #moldCanvas { display: block; width: 100%; height: 100%; }
.mv-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-sub); text-align: center; padding: 20px; pointer-events: none; }
.mv-placeholder i { font-size: 40px; opacity: 0.35; color: var(--primary); }
.mv-placeholder p { font-size: 14px; font-weight: 600; color: var(--text-main); }
.mv-ph-sub { font-size: 11px; opacity: 0.7; }
.mold-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-sub); font-size: 13px; pointer-events: none; }
.mold-caption { margin-top: 12px; font-size: 11px; color: var(--text-sub); text-align: center; font-family: 'JetBrains Mono', monospace; background: var(--panel-bg); padding: 8px; border-radius: 8px; }

/* 主题切换按钮 */
.theme-toggle { display: flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; background: var(--surface); border: 1px solid var(--border); color: var(--text-main); padding: 9px 14px; border-radius: 999px; font-size: 14px; transition: 0.25s; }
.theme-toggle:hover { transform: translateY(-1px); color: var(--primary); border-color: var(--primary); box-shadow: var(--shadow-sm); }

/* ===== 统一导航模块（产品 / 模具 共用） ===== */
:root { --nav-h: 62px; }
html { scroll-behavior: smooth; }
.topnav { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--nav-h); padding: 0 22px; background: var(--surface); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); border-bottom: 1px solid var(--border); }
.nav-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text-main); }
.nav-logo { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-grad); color: #fff; font-weight: 800; font-size: 15px; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(47,107,255,0.35); }
.nav-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.nav-brand-text b { font-size: 15px; letter-spacing: .3px; }
.nav-brand-text span { font-size: 11px; color: var(--text-soft); }
.nav-links { display: flex; gap: 4px; background: var(--surface-solid); padding: 5px; border-radius: 999px; border: 1px solid var(--border); }
.nav-link { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-soft); text-decoration: none; transition: .2s; white-space: nowrap; }
.nav-link:hover { color: var(--accent); }
.nav-link.active { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 16px rgba(47,107,255,0.30); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* 页内分区导航（长页面） */
.section-nav { position: sticky; top: 0; z-index: 50; display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 4px; margin-bottom: 14px; background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.section-nav a { padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); text-decoration: none; border: 1px solid var(--border); background: var(--surface-solid); transition: .2s; }
.section-nav a:hover { color: var(--accent); border-color: var(--accent); }
.section-nav a.active { background: var(--accent-grad); color: #fff; border-color: transparent; }

/* 回到顶部 */
.back-top { position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; background: var(--accent-grad); color: #fff; font-size: 17px; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(47,107,255,0.35); opacity: 0; transform: translateY(14px); pointer-events: none; transition: .3s; z-index: 90; }
.back-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-top:hover { transform: translateY(-2px); }

@media print { .bg-decoration, .sidebar, .btn-export, .theme-toggle, .model-viewer-card, .mold-card, .topnav, .section-nav, .back-top { display: none; } }

@media (max-width: 1024px) {
    .app-container { flex-direction: column; overflow-y: auto; height: auto; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid white; height: auto; flex-shrink: 0; }
    .main-content { padding: 20px; min-height: 100vh; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .hero-price-card { text-align: center; padding: 20px; margin-top: 20px; width: 100%; }
    .dashboard-header { flex-direction: column; align-items: stretch; gap: 0; }
    .three-cols { grid-template-columns: 1fr 1fr 1fr; }
}
