/* ================= 1. 全局变量配置 (想改颜色看这里) ================= */
:root {
    /* 主色调：绿色 */
    --primary: #10b981; 
    /* 深绿色：用于强调 */
    --primary-dark: #059669; 
    /* 亮绿色：用于装饰 */
    --accent: #34d399;
    /* 背景渐变色 */
    --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    /* 玻璃拟态背景：半透明白色 */
    --surface-glass: rgba(255, 255, 255, 0.85);
    /* 边框颜色 */
    --surface-border: 1px solid rgba(255, 255, 255, 0.9);
    /* 文字颜色 */
    --text-main: #064e3b; 
    --text-sub: #64748b;
}

/* 清除浏览器默认边距 */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* 页面主体样式 */
body { font-family: 'Inter', sans-serif; background: var(--bg-gradient); color: var(--text-main); height: 100vh; overflow: hidden; position: relative; }

/* 背景上的漂浮圆球装饰 */
.bg-decoration { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.6; animation: float 10s infinite alternate; }
/* 圆球1 */
.orb-1 { width: 400px; height: 400px; background: #86efac; top: -10%; left: -10%; }
/* 圆球2 */
.orb-2 { width: 300px; height: 300px; background: #6ee7b7; bottom: -10%; right: -5%; animation-delay: 2s; }
/* 圆球漂浮动画 */
@keyframes float { from { transform: translate(0,0); } to { transform: translate(20px, 30px); } }

/* APP 主布局容器 */
.app-container { display: flex; height: 100vh; width: 100vw; backdrop-filter: blur(5px); }

/* ================= 2. 左侧栏样式 ================= */
.sidebar { width: 360px; background: var(--surface-glass); border-right: var(--surface-border); display: flex; flex-direction: column; z-index: 10; backdrop-filter: blur(20px); }

/* 品牌LOGO区域 */
.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; display: flex; align-items: center; justify-content: center; color: white; font-size: 18px; }
.brand-text span { font-weight: 700; font-size: 18px; letter-spacing: -0.5px; }
.badge { font-size: 10px; background: #ecfdf5; color: var(--primary-dark); padding: 2px 6px; border-radius: 4px; font-weight: 600; margin-top: 2px; }

/* 表单滚动区域 */
.scrollable-form { flex: 1; overflow-y: auto; padding: 24px; }
/* 美化滚动条 */
.scrollable-form::-webkit-scrollbar { width: 5px; }
.scrollable-form::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* 表单分块 */
.form-section { margin-bottom: 32px; }
.form-section h3 { font-size: 12px; font-weight: 600; color: var(--text-sub); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* 输入组布局 */
.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; gap: 10px; }
.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: rgba(255,255,255,0.6); font-size: 14px; transition: 0.3s; color: #333; }
.floating-input input:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }
.floating-input label { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 13px; pointer-events: none; transition: 0.3s; }
/* 当输入框有焦点或有值时，标签上浮 */
.floating-input input:focus ~ label, .floating-input input:not(:placeholder-shown) ~ label { top: 0; left: 8px; font-size: 10px; color: var(--primary); background: white; padding: 0 4px; }

/* 下拉框样式 */
.select-wrapper { position: relative; width: 100%; }
.select-label { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; display: block; font-weight: 500; }
select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: rgba(255,255,255,0.6); font-size: 13px; cursor: pointer; appearance: none; color: #333; }
.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.3); }
/* 主按钮样式 */
.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; justify-content: center; gap: 8px; transition: 0.3s; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); }
.btn-primary-glow:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4); }
.btn-primary-glow:active { transform: scale(0.98); }

/* ================= 3. 右侧内容区域 ================= */
.main-content { flex: 1; padding: 40px; overflow-y: auto; position: relative; }

/* ================= 4. 模具开合动画样式 ================= */
.loading-overlay { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.98); z-index: 100; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.3s; }
.hidden { display: none !important; }

/* 动画容器 */
.mold-animation-wrapper {
    position: relative;
    width: 240px;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

/* 模具板公共样式 */
.mold-plate {
    height: 120px;
    border-radius: 4px;
    position: relative;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.1);
}

/* 定模 (Fixed Side) - 左侧不动 */
.fixed-side {
    width: 60px;
    background: linear-gradient(to right, #e2e8f0 0%, #cbd5e1 100%);
    border: 1px solid #94a3b8;
    z-index: 2;
    margin-right: 2px; /* 闭合时的缝隙 */
}
.guide-hole {
    width: 14px; height: 14px;
    background: #475569;
    border-radius: 50%;
    position: absolute;
    right: 5px;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.5);
}
.guide-hole.top { top: 20px; }
.guide-hole.bottom { bottom: 20px; }

/* 动模 (Moving Side) - 右侧会动 */
.moving-side {
    width: 80px;
    background: linear-gradient(to right, #cbd5e1 0%, #e2e8f0 100%);
    border: 1px solid #94a3b8;
    z-index: 1;
    /* 应用开合动画 */
    animation: mold-open-close 2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

/* 导柱 */
.guide-pin {
    width: 40px; height: 10px;
    background: linear-gradient(to bottom, #94a3b8, #64748b);
    position: absolute;
    left: -35px; /* 伸出的长度 */
    border-radius: 5px 0 0 5px;
}
.guide-pin.top { top: 22px; }
.guide-pin.bottom { bottom: 22px; }

/* 模仁区域示意 */
.core-insert {
    position: absolute;
    top: 50%; left: 0;
    transform: translateY(-50%);
    width: 20px; height: 50px;
    background: #0ea5e9; /* 蓝色模仁 */
    opacity: 0.3;
    border-radius: 0 4px 4px 0;
}

/* 顶针板 */
.ejector-plate {
    position: absolute;
    right: -10px; top: 10px; bottom: 10px;
    width: 10px;
    background: #64748b;
    border-radius: 0 2px 2px 0;
}

/* === 开合动画关键帧 === */
@keyframes mold-open-close {
    0% { transform: translateX(0); }        /* 闭合 */
    30% { transform: translateX(0); }       /* 保持闭合(保压) */
    60% { transform: translateX(60px); }    /* 开模 */
    80% { transform: translateX(60px); }    /* 保持开启(取件) */
    100% { transform: translateX(0); }      /* 再次闭合 */
}

/* 进度条样式 */
.loading-status { text-align: center; }
.loading-status h3 { font-size: 14px; font-weight: 500; color: #64748b; margin-bottom: 10px; }
.progress-track { width: 200px; height: 4px; background: #e2e8f0; border-radius: 2px; margin: 0 auto; overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background: var(--primary); animation: progress 3s linear infinite; }
@keyframes progress { 0% {width: 0%;} 100% {width: 100%;} }

/* ================= 5. 结果显示样式 ================= */
/* 空状态 */
.center-box { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 80%; text-align: center; color: var(--text-sub); }
.icon-circle { width: 80px; height: 80px; background: #ecfdf5; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--primary); margin-bottom: 20px; }

/* 结果面板 */
.result-dashboard { padding-bottom: 40px; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; gap: 20px; }
.main-title { font-size: 32px; color: var(--text-main); font-weight: 800; letter-spacing: -1px; margin-bottom: 8px; }

/* 价格大卡片 */
.hero-price-card {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    padding: 15px 30px; border-radius: 16px; 
    box-shadow: 0 10px 25px -5px rgba(5, 150, 105, 0.4);
    text-align: center; color: white; min-width: 200px;
}
.price-value-wrapper h2 { font-family: 'JetBrains Mono', monospace; font-size: 36px; margin: 5px 0; }
.price-label { font-size: 10px; text-transform: uppercase; opacity: 0.8; }
.tag { font-size: 11px; padding: 3px 10px; border-radius: 12px; font-weight: 600; margin-right: 5px; }
.tag.pro { background: #ecfdf5; color: #047857; }

/* 栅格布局 */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
.grid-column { display: flex; flex-direction: column; gap: 24px; }

/* 玻璃卡片通用样式 */
.glass-card { background: rgba(255,255,255,0.6); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.8); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-sm); }
.glass-card h3 { font-size: 14px; margin-bottom: 16px; color: var(--text-main); display: flex; align-items: center; gap: 8px; }

/* 列表和图表 */
.params-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.param-box { background: rgba(255,255,255,0.5); padding: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.5); }
.box-header { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.param-box strong { font-size: 20px; color: var(--text-main); display: block; }
.text-gradient-green { background: linear-gradient(135deg, #10b981, #059669); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* 流程图 */
.process-timeline { margin-top: 20px; padding-top: 15px; border-top: 1px dashed #e2e8f0; }
.process-step { display: flex; align-items: center; margin-bottom: 8px; font-size: 11px; }
.step-label { width: 70px; color: #64748b; font-weight: 500; }
.step-bar { height: 8px; border-radius: 4px; position: relative; opacity: 0.8; }

/* 费用清单 */
.cost-list { list-style: none; }
.cost-list li { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed #cbd5e1; }
.label-group { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-main); }
.icon-box { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
/* 不同颜色的图标背景 */
.icon-box.gray { background: #f1f5f9; color: #475569; }
.icon-box.blue { background: #dbeafe; color: #2563eb; }
.icon-box.yellow { background: #fef3c7; color: #d97706; }
.icon-box.purple { background: #f3e8ff; color: #9333ea; }
.icon-box.green { background: #ecfdf5; color: #10b981; }

.text-col { display: flex; flex-direction: column; }
.text-col small { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.val { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 14px; }

.final-total { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 2px solid #10b981; align-items: center; }
.final-total strong { font-size: 24px; color: #059669; }
.chart-container { height: 240px; position: relative; }

/* ================= 6. 底部操作按钮区域 ================= */
.footer-actions { 
    margin-top: 25px; padding-top: 20px; 
    border-top: 1px dashed rgba(16, 185, 129, 0.2); 
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* PDF 导出按钮样式 */
.btn-export-pdf {
    width: 100%;
    padding: 12px 20px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 50px;
    color: #64748b;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.3s;
}
.btn-export-pdf:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
}

/* 跳转联系按钮样式 */
.disclaimer-link {
    font-size: 14px; font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border-radius: 50px;
    width: 100%;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: 0.3s;
    letter-spacing: 0.5px;
}
.disclaimer-link:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5); }
.disclaimer-link:active { transform: scale(0.98); }
.disclaimer-link i { animation: slideRight 1.5s infinite; }

/* 箭头滑动动画 */
@keyframes slideRight { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

/* 上浮进入动画 */
.fade-in-up { animation: fadeInUp 0.5s ease-out backwards; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 移动端适配 */
@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; min-height: auto; } 
    .dashboard-grid { grid-template-columns: 1fr; } 
    .dashboard-header { flex-direction: column; text-align: center; }
}