/* 全局与变量定义 */
:root {
    --primary: #1890ff;
    --primary-light: #e6f7ff;
    --primary-dark: #096dd9;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --text-main: #1f2329;
    --text-sub: #646a73;
    --text-light: #8f959e;
    --border-color: #dee0e3;
    --bg-page: #f5f6f7;
    --bg-card: #ffffff;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 70px;
}

/* 顶部导航 */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}
.header.hidden {
    display: none !important;
}
.header-inner {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.app-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.app-logo {
    font-size: 20px;
}
.app-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.app-sub {
    font-size: 11px;
    color: #fff;
    background: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.header-actions .btn-mini {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
}

/* 页面主体 */
.main-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 12px;
}

/* 底部版权页脚（四个 Tab 共用，位于固定导航栏之上） */
.app-footer {
    margin-top: 20px;
    padding: 14px 0 10px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.app-footer-copy {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.5px;
}
.app-footer-sub {
    margin-top: 4px;
    font-size: 10.5px;
    color: var(--text-sub);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* 顶部横幅 */
.banner-card {
    background: linear-gradient(135deg, #1890ff 0%, #0050b3 100%);
    color: #ffffff;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.25);
}
.banner-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}
.banner-desc {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.4;
}

/* 分组标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 2px;
}
.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-badge {
    font-size: 11px;
    color: var(--text-light);
}

/* 重点要求：计算模块一行三个，四行（共12个） */
.calc-grid-3cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.calc-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 6px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 96px;
}
.calc-item:active {
    transform: scale(0.96);
    background-color: #fafafa;
}
.calc-icon {
    font-size: 24px;
    margin-bottom: 6px;
}
.calc-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.calc-tag {
    font-size: 10px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.calc-badge-hot {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ff4d4f;
    color: #fff;
    font-size: 9px;
    padding: 0 4px;
    border-radius: 8px;
    transform: scale(0.85);
}

/* 前端选型 / 选型计算入口网格 (与"计算"菜单同一套「卡片网格 → 全屏子页」交互) */
.calc-grid-2cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.calc-item-lg {
    padding: 16px 10px;
    min-height: 112px;
}
.calc-item-lg .calc-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.calc-item-lg .calc-name {
    font-size: 13px;
}
.calc-item-lg .calc-tag {
    font-size: 11px;
    line-height: 1.35;
    white-space: normal;
}

/* 选型计算子页面（全屏二级页，点开后充满屏幕） */
.calc-subpanel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f6f8;
    z-index: 1200;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.calc-subpanel.active {
    display: block;
    animation: slideUp 0.22s ease-out;
}
/* 二级页顶部标题栏：与「计算」菜单弹窗 .modal-header 保持完全一致的操作方式
   （左侧标题 + 右上角 ✕ 关闭），两个菜单不再出现「左返回 / 右关闭」两种手势 */
.subpanel-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    padding-top: calc(12px + constant(safe-area-inset-top));
    padding-top: calc(12px + env(safe-area-inset-top));
    background: #fafafa;
    border-bottom: 1px solid var(--border-color);
}
.subpanel-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    padding-right: 8px;
}
/* 与 .modal-close 同款外观 */
.subpanel-close {
    font-size: 16px;
    line-height: 1;
    color: #5a607f;
    border: none;
    background: #eceff3;
    cursor: pointer;
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.subpanel-close:active {
    background: #dfe3e8;
}
.subpanel-body {
    padding: 12px 14px calc(32px + env(safe-area-inset-bottom));
}

/* 前端选型筛选项样式 (IPC选型 - 基础参数部分) */
.filter-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-card);
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}
.filter-row {
    margin-bottom: 10px;
}
.filter-row:last-child {
    margin-bottom: 0;
}
.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filter-chip {
    padding: 4px 9px;
    font-size: 11px;
    background: #f0f2f5;
    color: var(--text-main);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.filter-chip.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

/* 搜索栏与对比条 */
.search-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    margin-bottom: 12px;
}
.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    background: transparent;
    padding-left: 6px;
}

.compare-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}
.compare-text {
    font-size: 12px;
    color: var(--primary-dark);
}
.compare-actions {
    display: flex;
    gap: 8px;
}
.compare-btn {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}
.btn-primary-sm {
    background: var(--primary);
    color: #fff;
}
.btn-outline-sm {
    background: #fff;
    color: var(--text-sub);
    border: 1px solid var(--border-color);
}

/* 产品列表卡片 */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: all 0.2s;
}
.product-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}
.product-model {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}
.product-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}
.product-alias {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 8px;
}
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.product-tag {
    font-size: 10px;
    padding: 2px 6px;
    background: #f5f6f8;
    color: #4e5969;
    border-radius: 3px;
}
.product-specs {
    font-size: 11px;
    color: var(--text-light);
    background: #fbfbfb;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    line-height: 1.5;
}
.product-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #eee;
    padding-top: 8px;
}
.product-foot-btns {
    display: flex;
    gap: 8px;
}
.btn-card {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: #fff;
    cursor: pointer;
    color: var(--text-sub);
}
.btn-card.active {
    background: #e6f7ff;
    color: var(--primary);
    border-color: var(--primary);
}

/* 规范列表卡片 */
.standard-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}
.standard-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}
.standard-code {
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 6px;
    font-weight: 500;
}
.standard-desc {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.4;
}

/* 模态弹窗 —— 全屏子页 (点开后充满屏幕，与小程序原生二级页一致) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none;
    align-items: stretch;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.modal-overlay.active {
    display: flex;
}
.modal-sheet {
    background: #ffffff;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.22s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-header {
    padding: 12px 14px;
    padding-top: calc(12px + constant(safe-area-inset-top));
    padding-top: calc(12px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    flex-shrink: 0;
}
.modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    padding-right: 8px;
}
.modal-close {
    font-size: 16px;
    line-height: 1;
    color: #5a607f;
    border: none;
    background: #eceff3;
    cursor: pointer;
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.modal-close:active {
    background: #dfe3e8;
}
.modal-body {
    padding: 14px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* 表单与输入控件 */
.form-group {
    margin-bottom: 14px;
}
.form-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 6px;
}
.form-label .tip {
    font-weight: normal;
    color: var(--primary);
    font-size: 11px;
}
.form-input, .form-select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    background: #ffffff;
    transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus {
    border-color: var(--primary);
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

/* 计算结果展示区 */
.result-box {
    background: #f0f7ff;
    border: 1px solid #bae0ff;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 14px;
}
.result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.result-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 5px;
}
.result-item:last-child {
    margin-bottom: 0;
}
.result-item .k {
    color: var(--text-sub);
}
.result-item .v {
    font-weight: 600;
    color: var(--text-main);
}
.result-item .v.highlight {
    color: var(--danger);
    font-size: 14px;
}
.result-desc {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #d6e4ff;
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.4;
}

/* 底部固定导航 TabBar */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    height: 52px;
    z-index: 100;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8c8c8c;
    font-size: 10px;
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
}
.tab-item.active {
    color: var(--primary);
}
.tab-icon {
    font-size: 19px;
    margin-bottom: 1px;
}

/* Toast 浮层 */
.toast {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.78);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 2000;
    display: none;
    pointer-events: none;
    text-align: center;
}

/* ================= 客流勘测选型（三套独立参数面板） ================= */
.flow-header-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 7px;
    padding: 2px;
    margin-bottom: 8px;
}
.flow-header-tab {
    flex: 1;
    text-align: center;
    padding: 6px 2px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.flow-header-tab.active {
    background: #ffffff;
    color: #1e40af;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ================= 客流勘测选型：三套独立参数面板 =================
 * ① 双目垂直客流（门体模型）② 多维客流（区域模型）③ 人数统计·倾斜客流（镜头模型）
 * 三类产品的物理模型互不相干，参数集禁止共用，故各面板独立布局；
 * 同一时刻只显示一个 .flow-pane，由 Selection.setFlowType 切换。
 */
.flow-pane { display: none; }
.flow-pane.active { display: block; }

/* 机型 / 适用相机说明条 */
.fp-cam {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #f8fafc;
    border-left: 3px solid #2563eb;
    border-radius: 0 6px 6px 0;
    padding: 6px 9px;
    margin-bottom: 7px;
}
.fp-cam b { font-size: 12.5px; color: #1e293b; }
.fp-cam span { font-size: 10.5px; color: #64748b; line-height: 1.35; }

/* 小节标题 */
.fp-sec {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 5px;
}

/* 使用场景双选（双目垂直客流专用） */
.fp-scene { display: flex; gap: 6px; margin-bottom: 7px; }
.fp-scene-btn {
    flex: 1;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 7px;
    padding: 5px 7px;
    cursor: pointer;
    transition: all 0.15s;
}
.fp-scene-btn b { display: block; font-size: 12px; color: #334155; }
.fp-scene-btn span { display: block; font-size: 10px; color: #94a3b8; line-height: 1.3; margin-top: 1px; }
.fp-scene-btn.active { border-color: #2563eb; background: #eff6ff; }
.fp-scene-btn.active b { color: #1d4ed8; }
.fp-scene-btn.active span { color: #3b82f6; }

/* 参数录入：两列网格 */
.fp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    margin-bottom: 8px;
}
.fp-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fp-f > span { font-size: 11px; color: #64748b; font-weight: 500; }
.fp-f > span i { font-style: normal; color: #94a3b8; font-size: 10px; }
.fp-f .form-input,
.fp-f .form-select { height: 32px; font-size: 12.5px; padding: 0 8px; width: 100%; min-width: 0; }

/* 算法模式三选（人数统计 / 倾斜客流 / 人员密度） */
.fp-modes { display: flex; gap: 6px; margin-bottom: 8px; }
.fp-mode {
    flex: 1;
    padding: 6px 2px;
    font-size: 11.5px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}
.fp-mode.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    font-weight: 600;
}

/* 开始计算 */
.fp-go { width: 100%; padding: 9px; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }

/* 结果框 */
.fp-result {
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.5;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.fp-result:empty { display: none; }
.fp-result.warn { background: #fffbeb; border-color: #fde68a; }

.fpr-hero { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: #334155; }
.fpr-hero b { color: #1d4ed8; font-size: 12px; }
.fpr-tag {
    background: #2563eb;
    color: #ffffff;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 600;
    line-height: 15px;
    flex-shrink: 0;
}
.fp-result.warn .fpr-tag { background: #d97706; }
.fpr-sep { color: #cbd5e1; }

.fpr-cells { display: flex; gap: 5px; margin-top: 6px; }
.fpr-cell {
    flex: 1;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #eef1f5;
    border-radius: 5px;
    padding: 4px 3px;
    text-align: center;
}
.fpr-cell span { display: block; font-size: 9.5px; color: #94a3b8; white-space: nowrap; }
.fpr-cell b { display: block; font-size: 11.5px; font-weight: 700; color: #0f172a; margin-top: 1px; white-space: nowrap; }
.fpr-cell b .fpr-big { display: inline; font-size: 15px; color: #1d4ed8; }

.fpr-warn { margin-top: 5px; font-size: 10.5px; color: #b45309; line-height: 1.45; }
.fpr-note { margin-top: 3px; font-size: 10px; color: #94a3b8; line-height: 1.45; }

/* ================= 选型计算子页：通用卡片与结果框 ================= */
.card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}
.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f2f5;
}

.calc-result-box {
    margin-top: 14px;
    background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
    border: 1px solid #d6e4ff;
    border-radius: var(--radius-md);
    padding: 14px;
}
.result-highlight {
    text-align: center;
    padding: 12px 10px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
    border-radius: 10px;
    color: #ffffff;
}
.result-highlight .result-number {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
}
.result-highlight .result-unit {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.92;
}
.result-highlight .result-label {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.45;
    opacity: 0.88;
}
.result-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.result-grid .result-item {
    align-items: baseline;
    gap: 10px;
    margin-bottom: 0;
    padding: 7px 10px;
    background: #ffffff;
    border: 1px solid #eef1f5;
    border-radius: 6px;
}
.result-grid .result-k {
    color: #64748b;
    flex-shrink: 0;
}
.result-grid .result-v {
    color: #0f172a;
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}
.calc-result-box .result-desc {
    margin-top: 10px;
    padding: 9px 10px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-top: 1px solid #ffe58f;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.65;
    color: #7c5c00;
}

/* 通用主按钮（选型子页内的"完成设置"等） */
.btn-primary {
    display: inline-block;
    padding: 9px 14px;
    font-size: 13px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}
.btn-primary:active {
    filter: brightness(0.94);
}

/* 底部 TabBar 文字 */
.tab-text {
    font-size: 10px;
    line-height: 1.2;
}

/* ================= 一屏展示：弹窗 / 子页统一压缩 =================
   目标：390x800（含微信 web-view 顶栏）及以上机型，二级菜单无需上下滑动 */
.modal-header {
    padding: 8px 12px;
    padding-top: calc(8px + constant(safe-area-inset-top));
    padding-top: calc(8px + env(safe-area-inset-top));
}
.modal-title {
    font-size: 13.5px;
}
.subpanel-bar {
    padding: 7px 12px;
    padding-top: calc(7px + constant(safe-area-inset-top));
    padding-top: calc(7px + env(safe-area-inset-top));
}

.modal-body,
.subpanel-body {
    padding: 10px 12px;
    padding-bottom: calc(14px + constant(safe-area-inset-bottom));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.modal-body .form-group,
.subpanel-body .form-group {
    margin-bottom: 9px;
}
.modal-body .form-label,
.subpanel-body .form-label {
    font-size: 11.5px;
    margin-bottom: 4px;
}
.modal-body .form-input,
.modal-body .form-select,
.subpanel-body .form-input,
.subpanel-body .form-select {
    height: 34px;
    font-size: 12.5px;
}
.modal-body .form-row-2,
.modal-body .form-row-3,
.subpanel-body .form-row-2,
.subpanel-body .form-row-3 {
    gap: 8px;
}

/* 结果区（result-box 结构） */
.modal-body .result-box,
.subpanel-body .result-box {
    padding: 9px 10px;
    margin-top: 10px;
}
.modal-body .result-title,
.subpanel-body .result-title {
    font-size: 12px;
    margin-bottom: 5px;
}
.modal-body .result-item,
.subpanel-body .result-item {
    font-size: 11.5px;
    margin-bottom: 3px;
}
.modal-body .result-item .v.highlight,
.subpanel-body .result-item .v.highlight {
    font-size: 13px;
}
.modal-body .result-desc,
.subpanel-body .result-desc {
    font-size: 10.5px;
    line-height: 1.42;
    margin-top: 6px;
    padding-top: 5px;
}

/* 子页卡片与选型结果框 */
.subpanel-body .card {
    padding: 10px 12px;
}
.subpanel-body .card-title {
    font-size: 13px;
    margin-bottom: 6px;
    padding-bottom: 6px;
}
.subpanel-body .card-intro {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-sub);
    margin-bottom: 9px;
}
.subpanel-body .calc-result-box {
    margin-top: 10px;
    padding: 10px;
}
.subpanel-body .result-highlight {
    padding: 8px 10px;
    margin-bottom: 8px;
}
.subpanel-body .result-highlight .result-number {
    font-size: 22px;
}
.subpanel-body .result-highlight .result-label {
    font-size: 10.5px;
    margin-top: 3px;
}
.subpanel-body .result-grid {
    gap: 4px;
}
.subpanel-body .result-grid .result-item {
    padding: 5px 8px;
    font-size: 11px;
}
.subpanel-body .calc-result-box .result-desc {
    margin-top: 8px;
    padding: 7px 9px;
    font-size: 10.5px;
    line-height: 1.5;
}
.subpanel-body .btn-primary {
    padding: 7px 14px;
    font-size: 12.5px;
}

/* 小屏再压一档（iPhone SE / 小屏安卓 / 带顶栏的 web-view） */
@media (max-height: 700px) {
    .modal-header,
    .subpanel-bar {
        padding-top: 5px;
        padding-bottom: 5px;
    }
    .modal-title {
        font-size: 13px;
    }
    .subpanel-title {
        font-size: 13px;
    }
    .modal-body,
    .subpanel-body {
        padding: 7px 9px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    .modal-body .form-group,
    .subpanel-body .form-group {
        margin-bottom: 6px;
    }
    .modal-body .form-label,
    .subpanel-body .form-label {
        font-size: 11px;
        margin-bottom: 3px;
    }
    .modal-body .form-input,
    .modal-body .form-select,
    .subpanel-body .form-input,
    .subpanel-body .form-select {
        height: 30px;
        font-size: 12px;
    }
    .modal-body .result-box,
    .subpanel-body .result-box {
        padding: 7px 8px;
        margin-top: 8px;
    }
    .modal-body .result-item,
    .subpanel-body .result-item {
        font-size: 11px;
        margin-bottom: 2px;
    }
    .modal-body .result-desc,
    .subpanel-body .result-desc {
        font-size: 10px;
        line-height: 1.38;
        margin-top: 5px;
        padding-top: 4px;
    }
    .subpanel-body .card {
        padding: 8px 9px;
    }
    .subpanel-body .card-title {
        font-size: 12.5px;
        margin-bottom: 5px;
        padding-bottom: 5px;
    }
    .subpanel-body .card-intro {
        font-size: 10px;
        line-height: 1.4;
        margin-bottom: 6px;
    }
    .subpanel-body .calc-result-box {
        margin-top: 8px;
        padding: 8px;
    }
    .subpanel-body .result-highlight {
        padding: 6px 8px;
        margin-bottom: 6px;
    }
    .subpanel-body .result-highlight .result-number {
        font-size: 18px;
    }
    .subpanel-body .result-highlight .result-label {
        font-size: 10px;
        margin-top: 2px;
    }
    .subpanel-body .result-grid {
        gap: 3px;
    }
    .subpanel-body .result-grid .result-item {
        padding: 4px 7px;
        font-size: 10.5px;
    }
    .subpanel-body .calc-result-box .result-desc {
        margin-top: 6px;
        padding: 6px 8px;
        font-size: 10px;
        line-height: 1.4;
    }
    .flow-header-tab {
        padding: 5px 2px;
    }
    /* 客流三面板：小屏再压一档 */
    .fp-cam { padding: 5px 8px; margin-bottom: 5px; }
    .fp-cam b { font-size: 12px; }
    .fp-cam span { font-size: 10px; }
    .fp-scene { gap: 5px; margin-bottom: 5px; }
    .fp-scene-btn { padding: 4px 6px; }
    .fp-scene-btn b { font-size: 11.5px; }
    .fp-scene-btn span { font-size: 9.5px; }
    .fp-sec { font-size: 10.5px; margin-bottom: 4px; }
    .fp-grid { gap: 5px 7px; margin-bottom: 6px; }
    .fp-f > span { font-size: 10.5px; }
    .fp-f .form-input,
    .fp-f .form-select { height: 28px; font-size: 12px; }
    .fp-modes { gap: 5px; margin-bottom: 6px; }
    .fp-mode { padding: 5px 2px; font-size: 11px; }
    .fp-go { padding: 7px; font-size: 13px; margin-bottom: 6px; }
    .fp-result { padding: 7px 8px; }
    .fpr-cells { gap: 4px; margin-top: 5px; }
    .fpr-cell { padding: 3px 2px; }
    .fpr-cell b .fpr-big { font-size: 14px; }
    .fpr-warn { font-size: 10px; }
    .fpr-note { font-size: 9.5px; }
}


