/* 流程模拟器样式 — CSLAB 风格重构 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f5f5f5;
    --bg-light: #ffffff;
    --bg-card: #ffffff;
    --primary: #1976d2;
    --primary-dark: #1565c0;
    --accent: #2e7d32;
    --text: #212121;
    --text-dim: #757575;
    --border: #e0e0e0;
    --danger: #d32f2f;
    --warning: #f57c00;
    --sidebar-w: 240px;
    --panel-w: 300px;
    --topbar-h: 56px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

/* ==================== 顶部导航栏 ==================== */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-center { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-language-switch {
    height: 34px;
    min-width: 96px;
    padding: 0 30px 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.topbar-language-switch:hover,
.topbar-language-switch:focus {
    border-color: var(--primary);
    outline: none;
}

.btn-icon {
    width: 36px; height: 36px; border: none;
    background: none; color: var(--text); font-size: 18px;
    cursor: pointer; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-card); }
.btn-icon-svg {
    display: inline-flex;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}
.btn-icon-svg--menu {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/menu-toggle.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/menu-toggle.svg');
}
.btn-icon-svg--run {
    width: 14px;
    height: 14px;
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/run.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/run.svg');
}
.btn-icon-svg--ai {
    width: 15px;
    height: 15px;
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/ai-assistant.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/ai-assistant.svg');
}
.btn-icon-svg--close {
    width: 14px;
    height: 14px;
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/close.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/close.svg');
}
.btn-icon-svg--ai-float {
    width: 12px;
    height: 12px;
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/ai-assistant.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/ai-assistant.svg');
}
.ui-icon-svg {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}
.ui-icon-svg--reconnect {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/reconnect.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/reconnect.svg');
}
.ui-icon-svg--auto-arrange {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/auto-arrange.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/auto-arrange.svg');
}
.ui-icon-svg--align-horizontal {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/align-horizontal.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/align-horizontal.svg');
}
.ui-icon-svg--align-vertical {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/align-vertical.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/align-vertical.svg');
}
.ui-icon-svg--stream-labels {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/stream-labels.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/stream-labels.svg');
}
.ui-icon-svg--delete {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/delete.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/delete.svg');
}
.ui-icon-svg--compare {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/compare.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/compare.svg');
}
.ui-icon-svg--profile {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/profile.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/profile.svg');
}
.ui-icon-svg--convergence {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/convergence.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/convergence.svg');
}
.ui-icon-svg--chevron-down {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/chevron-down.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/chevron-down.svg');
}
.ui-icon-svg--chevron-right {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/chevron-right.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/chevron-right.svg');
}
.ui-icon-svg--swap-horizontal {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/swap-horizontal.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/swap-horizontal.svg');
}
.ui-icon-svg--swap-vertical {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/swap-vertical.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/swap-vertical.svg');
}
.placeholder-icon-svg {
    display: inline-flex;
    width: 52px;
    height: 52px;
    opacity: 0.4;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}
.placeholder-icon-svg--document {
    -webkit-mask-image: url('/process-sim/assets/sidebar-icons/document.svg');
    mask-image: url('/process-sim/assets/sidebar-icons/document.svg');
}

.app-logo {
    font-size: 16px; color: var(--primary); font-weight: 700;
    letter-spacing: 0.5px;
}
.project-name {
    font-size: 13px; color: var(--text-dim);
    padding: 4px 10px; background: var(--bg-card);
    border-radius: 4px; border: 1px solid var(--border);
}

.btn-run {
    padding: 7px 18px; border: none; border-radius: 6px;
    background: var(--primary-dark); color: #fff;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background 0.2s;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-run:hover { background: var(--primary); color: #fff; }
.btn-tool {
    padding: 6px 14px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text);
    border-radius: 5px; cursor: pointer; font-size: 13px;
}
.btn-tool:hover { background: var(--border); }
.btn-ai {
    padding: 6px 14px; border: 1px solid #7c4dff;
    background: #7c4dff; color: #fff;
    border-radius: 5px; cursor: pointer; font-size: 13px;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-ai:hover { background: #9c6fff; }

/* ==================== 主体布局 ==================== */
.app-body {
    display: flex;
    height: calc(100vh - var(--topbar-h));
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-light);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    transition: width 0.25s ease, opacity 0.25s ease;
    overflow: hidden;
}
.sidebar.collapsed {
    width: 0; border-right: none; opacity: 0;
    pointer-events: none;
}
.sidebar-nav {
    flex: 1; overflow-y: auto; padding: 8px 0;
}
.sidebar-footer {
    padding: 10px 16px; border-top: 1px solid var(--border);
    font-size: 11px; color: var(--text-dim);
}

/* 菜单分组 */
.menu-group {}
.menu-group-header {
    display: flex; align-items: center; gap: 8px;
    min-height: 38px;
    padding: 8px 16px; cursor: pointer;
    font-size: 12px; color: var(--text); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    user-select: none;
}
.menu-group-header:hover { color: var(--text); }
.menu-group-header .menu-group-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center; justify-content: center;
    flex-shrink: 0; line-height: 1;
}
.menu-group.collapsed .menu-group-arrow { transform: rotate(-90deg); }
.menu-group.collapsed .menu-group-children { display: none; }
.menu-group-children { padding: 0; }

/* 菜单项 */
.menu-item {
    display: flex; align-items: center; gap: 8px;
    min-height: 38px;
    padding: 9px 16px 9px 20px;
    cursor: pointer; font-size: 13px; color: var(--text);
    border-left: 3px solid transparent;
    transition: all 0.15s;
    user-select: none;
}
.menu-item:hover {
    background: rgba(25,118,210,0.06); color: var(--text);
}
.menu-item.active {
    color: var(--primary); border-left-color: var(--primary);
    background: rgba(25,118,210,0.08);
}
.menu-group-header .menu-icon,
.menu-item .menu-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
    line-height: 1;
    text-align: center;
}
.menu-icon-svg {
    background-color: currentColor;
    -webkit-mask-image: var(--menu-icon);
    mask-image: var(--menu-icon);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 18px 18px;
    mask-size: 18px 18px;
}
.menu-label {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}
.menu-item-child { padding-left: 36px; }

/* ==================== 内容区 ==================== */
.content-area {
    flex: 1; overflow: auto; position: relative;
}

/* 视图面板 */
.view-panel { display: none; height: 100%; }
.view-panel.active { display: flex; flex-direction: column; }

/* ==================== 设置卡片视图 ==================== */
.settings-view {
    padding: 24px 32px; overflow-y: auto; flex: 1;
}
.settings-view h2 {
    font-size: 18px; color: var(--primary); margin-bottom: 20px; font-weight: 600;
}
.setting-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 20px; margin-bottom: 20px;
}
.setting-card h3 {
    font-size: 14px; color: var(--text); margin-bottom: 14px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.setting-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.setting-field label {
    display: block; font-size: 11px; color: var(--text-dim);
    margin-bottom: 4px; font-weight: 500;
}
.setting-field select,
.setting-field input {
    width: 100%; padding: 7px 10px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 5px;
    color: var(--text); font-size: 13px; font-family: monospace;
}
.setting-field select:focus,
.setting-field input:focus { border-color: var(--primary); outline: none; }
.setting-actions {
    display: flex; gap: 8px; margin-top: 16px;
}
.setting-actions .btn-apply {
    padding: 8px 20px; border: none; border-radius: 5px;
    background: var(--primary-dark); color: #fff;
    cursor: pointer; font-size: 13px;
}
.setting-actions .btn-apply:hover { background: var(--primary); color: #fff; }
.setting-actions .btn-reset {
    padding: 8px 20px; border: 1px solid var(--border); border-radius: 5px;
    background: var(--bg-card); color: var(--text);
    cursor: pointer; font-size: 13px;
}
.setting-actions .btn-reset:hover { background: var(--border); }

.reaction-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.reaction-page-header h2 {
    margin: 0;
}
.reaction-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.reaction-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.reaction-scope-tabs {
    display: flex;
    gap: 18px;
    align-items: center;
}
.reaction-scope-tab {
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 0 10px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.reaction-scope-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.reaction-toolbar-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    max-width: 420px;
}
.reaction-create-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.reaction-create-hint {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-dim);
    text-align: right;
}
.reaction-kind-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.reaction-kind-chip {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-dim);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
}
.reaction-kind-chip.active {
    color: var(--primary);
    border-color: rgba(31, 111, 235, 0.32);
    background: rgba(31, 111, 235, 0.08);
}
.reaction-add-btn {
    border: none;
    background: #1f6feb;
    color: #fff;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(31, 111, 235, 0.16);
}
.reaction-add-btn span {
    font-size: 18px;
    line-height: 1;
}
.reaction-table-card,
.reaction-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.reaction-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.reaction-summary-table th,
.reaction-summary-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.reaction-summary-table th {
    color: var(--primary);
    background: rgba(31, 111, 235, 0.10);
    font-size: 13px;
    font-weight: 700;
}
.reaction-summary-table tbody tr:last-child td {
    border-bottom: none;
}
.reaction-table-row--active {
    background: rgba(31, 111, 235, 0.04);
}
.reaction-table-meta {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.5;
}
.reaction-table-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 28px 16px;
}
.reaction-help-card {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px dashed rgba(31, 111, 235, 0.28);
    background: rgba(31, 111, 235, 0.04);
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.7;
}
.reaction-inline-link {
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.reaction-delete-btn {
    border: none;
    background: transparent;
    color: #ff5a52;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}
.reaction-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(31, 111, 235, 0.06), rgba(31, 111, 235, 0.01));
}
.reaction-detail-header h3 {
    margin: 4px 0 0;
    font-size: 18px;
    color: var(--text);
}
.reaction-detail-summary {
    max-width: 50%;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-dim);
    text-align: right;
}
.reaction-detail-kicker {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.reaction-workflow-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 20px 0;
}
.reaction-workflow-step {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-dim);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}
.reaction-workflow-step span {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(31, 111, 235, 0.08);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.reaction-workflow-step.active {
    border-color: rgba(31, 111, 235, 0.32);
    background: rgba(31, 111, 235, 0.08);
    color: var(--primary);
}
.reaction-detail-tabs {
    display: flex;
    gap: 8px;
}
.reaction-detail-tab {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-dim);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}
.reaction-detail-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.reaction-detail-body {
    padding: 20px;
}
.reaction-detail-grid,
.reaction-stoich-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 16px;
}
.reaction-stoich-grid {
    margin-top: 16px;
}
.reaction-help-text {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(31, 111, 235, 0.06);
    color: var(--text-dim);
    font-size: 12px;
}
.reaction-workspace-empty {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.reaction-empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.reaction-empty-flow {
    font-size: 13px;
    color: var(--text-dim);
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(31, 111, 235, 0.05);
}
.reaction-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    z-index: 1180;
}
.reaction-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 920px);
    max-height: 84vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.24);
    z-index: 1181;
    display: flex;
    flex-direction: column;
    color: #333;
}
.reaction-modal--compact {
    width: min(92vw, 420px);
}
.reaction-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
}
.reaction-modal-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
}
.reaction-modal-close:hover {
    color: #ef5350;
}
.reaction-modal-body {
    padding: 20px 24px 16px;
    overflow-y: auto;
}
.reaction-modal-form-row,
.reaction-modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}
.reaction-modal-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 18px;
}
.reaction-modal-column {
    border: 1px solid #a6a6a6;
    border-radius: 12px;
    padding: 16px 20px 20px;
    position: relative;
}
.reaction-modal-column-title {
    position: absolute;
    top: -11px;
    left: 16px;
    padding: 0 8px;
    background: #fff;
    color: #555;
    font-size: 13px;
    font-weight: 600;
}
.reaction-modal-add-btn {
    margin-top: 4px;
    margin-bottom: 12px;
    border: none;
    background: #2f80ff;
    color: #fff;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.reaction-modal-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.reaction-modal-table-head,
.reaction-modal-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(88px, 0.8fr) 40px;
    gap: 12px;
    align-items: center;
}
.reaction-modal-table-head {
    padding: 10px 8px;
    background: #f7f9fc;
    color: #555;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid #eceff4;
}
.reaction-modal-row {
    padding: 8px 0;
    border-bottom: 1px solid #efefef;
}
.reaction-modal-row select,
.reaction-modal-row input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d9dde6;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #333;
}
.reaction-modal-remove-btn {
    border: none;
    background: none;
    color: #ff4d4f;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
}
.reaction-modal-empty {
    padding: 20px 0;
    text-align: center;
    color: #999;
    font-size: 12px;
}
.reaction-modal-footer {
    padding: 12px 24px 22px;
    display: flex;
    justify-content: center;
}
.reaction-create-modal-note {
    margin-bottom: 14px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}
.reaction-kind-option-list {
    display: grid;
    gap: 10px;
}
.reaction-kind-option {
    border: 1px solid #d7dbe3;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    cursor: pointer;
    text-align: left;
    color: #333;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.reaction-kind-option:hover {
    border-color: rgba(31, 111, 235, 0.35);
    box-shadow: 0 8px 18px rgba(31, 111, 235, 0.08);
}
.reaction-kind-option--active {
    border-color: rgba(31, 111, 235, 0.45);
    background: rgba(31, 111, 235, 0.05);
    box-shadow: 0 10px 22px rgba(31, 111, 235, 0.08);
}
.reaction-kind-option-title {
    font-size: 14px;
    font-weight: 700;
}
.reaction-kind-option-desc {
    font-size: 12px;
    line-height: 1.6;
    color: #687385;
}
.reaction-modal-confirm-btn {
    border: none;
    background: #19b55b;
    color: #fff;
    border-radius: 6px;
    padding: 10px 26px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.reaction-modal-secondary-btn {
    border: 1px solid #d0d7e2;
    background: #fff;
    color: #666;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 13px;
    cursor: pointer;
}
.kinetics-detail-modal {
    width: min(94vw, 760px);
}
.kinetics-detail-modal--powerlaw {
    width: min(97vw, 900px);
    max-height: 94vh;
}
.kinetics-detail-modal--powerlaw .reaction-modal-header {
    padding: 12px 16px;
    font-size: 14px;
}
.reaction-modal-body--powerlaw {
    padding: 8px 12px 4px;
    overflow-y: auto;
    background:
        radial-gradient(circle at top right, rgba(191, 154, 84, 0.14), transparent 34%),
        linear-gradient(180deg, #f7f3eb 0%, #eef3f6 100%);
}
.reaction-modal-form-grid--powerlaw {
    grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
    align-items: end;
}
.kinetics-powerlaw-layout {
    display: grid;
    gap: 6px;
}
.kinetics-powerlaw-hero {
    display: grid;
    grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.22fr);
    gap: 6px;
    align-items: stretch;
}
.kinetics-powerlaw-hero-card {
    display: flex;
    min-width: 0;
    border-radius: 14px;
    align-self: stretch;
}
.kinetics-powerlaw-hero-card--formula .kinetics-formula-card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    margin-top: 0;
    border: none;
    border-radius: 14px;
    padding: 10px 12px;
    background:
        linear-gradient(135deg, rgba(16, 27, 39, 0.98), rgba(29, 58, 76, 0.94)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
    box-shadow: 0 10px 18px rgba(17, 37, 51, 0.14);
}
.kinetics-powerlaw-hero-card--formula .kinetics-formula-title {
    position: static;
    padding: 0;
    margin-bottom: 8px;
    background: transparent;
    color: rgba(219, 230, 238, 0.78);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.kinetics-powerlaw-hero-card--formula .kinetics-formula-equation {
    min-height: 44px;
    justify-content: flex-start;
    padding: 0;
    color: #f4f7f9;
    font-size: 24px;
}
.kinetics-powerlaw-hero-card--context {
    display: grid;
    min-height: 100%;
    align-content: start;
    gap: 6px;
    border: 1px solid rgba(177, 149, 100, 0.34);
    background: linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(245, 239, 228, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    padding: 9px 11px;
}
.kinetics-powerlaw-kicker {
    color: #8c6d36;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.kinetics-powerlaw-title {
    margin-top: 0;
    color: #1f2c38;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.kinetics-powerlaw-copy {
    margin-top: 0;
    color: #5f6773;
    font-size: 10px;
    line-height: 1.3;
}
.kinetics-powerlaw-hero-card--context .reaction-modal-form-grid--powerlaw {
    margin-top: 2px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px 8px;
    align-items: start;
}
.kinetics-powerlaw-hero-card--context .setting-field {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    min-width: 0;
}
.kinetics-powerlaw-hero-card--context .setting-field label {
    margin-bottom: 4px;
    color: #5c6470;
    font-size: 10px;
    letter-spacing: 0.02em;
}
.kinetics-powerlaw-hero-card--context .setting-field input,
.kinetics-powerlaw-hero-card--context .setting-field select {
    background: #fffdfa;
    border-color: #d8cdb8;
    border-radius: 10px;
    padding: 6px 8px;
    min-width: 0;
}
.kinetics-powerlaw-panel .kinetics-rate-card {
    margin-top: 0;
    border-radius: 14px;
    border-color: rgba(160, 175, 191, 0.7);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 22px rgba(39, 57, 73, 0.07);
}
.kinetics-basis-note {
    display: grid;
    gap: 5px;
    margin-top: 2px;
    padding: 8px 10px;
    border: 1px solid rgba(170, 152, 122, 0.36);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.62);
}
.kinetics-basis-note-title {
    color: #6d5832;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.kinetics-basis-note-badge {
    color: #1f2c38;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}
.kinetics-basis-note-copy {
    color: #5f6773;
    font-size: 10px;
    line-height: 1.35;
}
.kinetics-powerlaw-actions {
    display: flex;
    justify-content: flex-end;
}
.kinetics-powerlaw-actions .reaction-modal-secondary-btn {
    min-width: 180px;
}
.kinetics-detail-modal--powerlaw .setting-field label {
    margin-bottom: 6px;
}
.kinetics-detail-modal--powerlaw .setting-field input,
.kinetics-detail-modal--powerlaw .setting-field select {
    padding: 7px 10px;
    font-size: 12px;
}
.kinetics-formula-card,
.kinetics-rate-card {
    border: 1px solid #aeb6c3;
    border-radius: 10px;
    padding: 18px 18px 16px;
    margin-top: 18px;
    position: relative;
    background: #fff;
}
.kinetics-formula-title {
    position: absolute;
    top: -10px;
    left: 14px;
    padding: 0 8px;
    background: #fff;
    color: #506070;
    font-size: 13px;
}
.kinetics-formula-equation {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e6e;
    font-size: 42px;
    font-family: Georgia, "Times New Roman", serif;
}
.kinetics-formula-inline {
    display: inline-block;
    margin-left: 4px;
}
.kinetics-formula-equation--lhhw {
    min-height: 96px;
    gap: 16px;
    justify-content: flex-start;
    padding: 0 26px;
    font-size: 34px;
}
.kinetics-lhhw-left {
    flex-shrink: 0;
}
.kinetics-lhhw-fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 220px;
    line-height: 1.15;
}
.kinetics-lhhw-top,
.kinetics-lhhw-bottom {
    display: block;
    width: 100%;
    text-align: center;
}
.kinetics-lhhw-top {
    padding-bottom: 10px;
    border-bottom: 1px solid #8f98a6;
}
.kinetics-lhhw-bottom {
    padding-top: 10px;
}
.kinetics-pending-note {
    margin-top: 16px;
    padding: 10px 12px;
    border: 1px solid #f2d49b;
    border-radius: 10px;
    background: #fff7e7;
    color: #8c5a18;
    font-size: 13px;
    line-height: 1.6;
}
.kinetics-detail-modal--powerlaw .kinetics-formula-card,
.kinetics-detail-modal--powerlaw .kinetics-rate-card {
    margin-top: 6px;
    padding: 8px 10px 6px;
}
.kinetics-detail-modal--powerlaw .kinetics-formula-card--powerlaw {
    padding-top: 10px;
}
.kinetics-detail-modal--powerlaw .kinetics-formula-title {
    left: 12px;
    top: -9px;
    padding: 0 6px;
    font-size: 12px;
}
.kinetics-detail-modal--powerlaw .kinetics-formula-equation {
    min-height: 56px;
    justify-content: flex-start;
    padding-left: 16px;
    font-size: 28px;
}
.kinetics-detail-modal--powerlaw .kinetics-formula-equation--powerlaw {
    min-height: 50px;
    padding-left: 10px;
    align-items: flex-start;
    padding-top: 10px;
    font-size: 24px;
}
.kinetics-rate-top--powerlaw {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}
.kinetics-rate-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
    gap: 8px 12px;
    align-items: end;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(150, 164, 182, 0.28);
}
.kinetics-rate-title-group {
    min-width: 0;
}
.kinetics-rate-kicker {
    color: #7f8ea0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.kinetics-rate-heading {
    margin-top: 4px;
    color: #1e2a37;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.kinetics-rate-caption {
    color: #657181;
    font-size: 11px;
    line-height: 1.35;
    text-align: right;
}
.kinetics-detail-modal--powerlaw .kinetics-rate-equations {
    gap: 6px;
    margin: 8px 0 6px;
    font-size: 12px;
}
.kinetics-detail-modal--powerlaw .kinetics-rate-equations--powerlaw {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 8px 0 6px;
}
.kinetics-detail-modal--powerlaw .kinetics-rate-line {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
}
.kinetics-rate-line--card {
    padding: 8px 10px;
    border: 1px solid rgba(186, 201, 218, 0.68);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(249, 252, 255, 0.96), rgba(241, 246, 251, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}
.kinetics-rate-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(26, 86, 148, 0.08);
    color: #365573;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.kinetics-rate-expression {
    color: #334253;
    font-family: Georgia, "Times New Roman", serif;
}
.kinetics-detail-modal--powerlaw .kinetics-rate-line span:last-child {
    font-size: 16px;
    line-height: 1.25;
}
.kinetics-detail-modal--powerlaw .kinetics-rate-grid {
    grid-template-columns: 72px minmax(0, 1fr) 120px;
    gap: 6px 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(150, 164, 182, 0.22);
}
.kinetics-detail-modal--powerlaw .kinetics-rate-grid label {
    font-size: 12px;
    color: #425162;
    font-weight: 600;
}
.kinetics-detail-modal--powerlaw .kinetics-rate-grid input,
.kinetics-detail-modal--powerlaw .kinetics-rate-grid select {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 10px;
    border-color: #cfd9e4;
    background: rgba(255, 255, 255, 0.95);
}
.kinetics-detail-modal--powerlaw .kinetics-powerlaw-hero-card--formula .kinetics-formula-card {
    margin-top: 0;
    padding: 8px 10px;
}
.kinetics-detail-modal--powerlaw .kinetics-powerlaw-hero-card--formula .kinetics-formula-title {
    position: static;
    left: auto;
    top: auto;
    padding: 0;
    margin-bottom: 8px;
    font-size: 10px;
}
.kinetics-detail-modal--powerlaw .kinetics-powerlaw-hero-card--formula .kinetics-formula-equation,
.kinetics-detail-modal--powerlaw .kinetics-powerlaw-hero-card--formula .kinetics-formula-equation--powerlaw {
    min-height: 40px;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    font-size: 22px;
}
.kinetics-detail-modal--powerlaw .kinetics-action-row {
    margin-top: 8px;
    justify-content: flex-start;
}
.kinetics-detail-modal--powerlaw .reaction-modal-footer {
    padding: 2px 14px 6px;
}
.kinetics-detail-modal--powerlaw .kinetics-powerlaw-actions .reaction-modal-secondary-btn {
    min-width: 160px;
    padding: 7px 12px;
}
.kinetics-rate-equations {
    display: grid;
    gap: 12px;
    margin: 12px 0 18px;
    color: #737373;
    font-size: 14px;
}
.kinetics-rate-line {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 12px;
    align-items: center;
}
.kinetics-rate-line span:last-child {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
}
.kinetics-rate-grid {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 110px;
    gap: 12px 14px;
    align-items: center;
}
.kinetics-rate-grid label {
    color: #555;
    font-size: 13px;
}
.kinetics-rate-grid input,
.kinetics-rate-grid select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9dde6;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #333;
}
.kinetics-rate-unit {
    min-height: 1px;
}
.kinetics-action-row {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 72px;
}
.kinetics-action-row--single {
    gap: 0;
}
.reaction-expression-modal {
    width: min(94vw, 720px);
}
.reaction-expression-modal--powerlaw {
    width: min(94vw, 660px);
}
.reaction-expression-modal--adsorption {
    width: min(94vw, 760px);
}
.kinetics-expression-card {
    position: relative;
    border: 1px solid #aeb6c3;
    border-radius: 12px;
    padding: 18px 18px 20px;
    background: #fff;
}
.kinetics-expression-card--stacked {
    margin-top: 18px;
}
.kinetics-expression-card-title {
    position: absolute;
    top: -10px;
    left: 16px;
    padding: 0 10px;
    background: #fff;
    color: #506070;
    font-size: 13px;
}
.kinetics-expression-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}
.kinetics-expression-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.kinetics-expression-panel {
    position: relative;
    border: 1px solid #8f98a6;
    border-radius: 10px;
    padding: 14px 14px 16px;
    background: #fff;
}
.kinetics-expression-panel-title {
    position: absolute;
    top: -10px;
    left: 14px;
    padding: 0 8px;
    background: #fff;
    color: #506070;
    font-size: 13px;
    line-height: 1.2;
}
.kinetics-expression-column {
    display: flex;
    flex-direction: column;
}
.kinetics-expression-heading,
.kinetics-expression-subheading {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}
.kinetics-expression-subheading {
    margin-bottom: 8px;
}
.kinetics-expression-table {
    border-bottom: 1px solid #e4e8ee;
}
.kinetics-expression-table-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 12px;
    padding: 14px 12px;
    background: #f6f7f9;
    color: #444;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.kinetics-expression-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #eef1f5;
}
.kinetics-expression-row:last-child {
    border-bottom: none;
}
.kinetics-expression-comp {
    color: #444;
    font-size: 13px;
    line-height: 1.5;
}
.kinetics-expression-comp span {
    display: block;
    color: #8a919d;
    font-size: 11px;
}
.kinetics-expression-row input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9dde6;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #333;
}
.kinetics-expression-empty {
    padding: 34px 12px 36px;
    color: #9aa0aa;
    font-size: 12px;
    text-align: center;
}
.reaction-expression-modal--powerlaw .reaction-modal-body {
    padding: 14px 18px 10px;
    background:
        radial-gradient(circle at top right, rgba(191, 154, 84, 0.14), transparent 34%),
        linear-gradient(180deg, #f7f3eb 0%, #eef3f6 100%);
}
.reaction-expression-modal--powerlaw .kinetics-expression-table {
    border-bottom: none;
}
.reaction-expression-modal--powerlaw .kinetics-expression-table-head {
    padding: 12px 10px;
}
.reaction-expression-modal--powerlaw .kinetics-expression-row {
    padding: 12px 0;
}
.reaction-expression-modal--powerlaw .kinetics-expression-comp {
    text-align: center;
}
.reaction-expression-modal--powerlaw .kinetics-expression-comp span {
    display: none;
}
.reaction-expression-modal--powerlaw .reaction-modal-footer {
    justify-content: center;
}
.kinetics-expression-layout--powerlaw {
    display: grid;
    gap: 14px;
}
.kinetics-expression-hero {
    border-radius: 18px;
    padding: 18px 20px;
    background:
        linear-gradient(135deg, rgba(16, 27, 39, 0.98), rgba(29, 58, 76, 0.94)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
    box-shadow: 0 18px 34px rgba(17, 37, 51, 0.18);
}
.kinetics-expression-hero-kicker {
    color: rgba(219, 230, 238, 0.78);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.kinetics-expression-hero-title {
    margin-top: 10px;
    color: #f4f7f9;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.kinetics-expression-hero-copy {
    margin-top: 10px;
    color: rgba(228, 236, 242, 0.82);
    font-size: 13px;
    line-height: 1.7;
    max-width: 520px;
}
.kinetics-expression-stage {
    border: 1px solid rgba(160, 175, 191, 0.7);
    border-radius: 18px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 28px rgba(39, 57, 73, 0.08);
}
.kinetics-expression-stage-title {
    color: #1f2c38;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}
.reaction-expression-modal--powerlaw .kinetics-expression-panels {
    gap: 14px;
}
.reaction-expression-modal--powerlaw .kinetics-expression-panel {
    border-radius: 16px;
    border-color: rgba(177, 149, 100, 0.28);
    padding: 18px 16px 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
.reaction-expression-modal--powerlaw .kinetics-expression-panel-title {
    left: 16px;
    padding: 0 10px;
    color: #6b5a3c;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.reaction-expression-modal--powerlaw .kinetics-expression-panel--hint {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    background: linear-gradient(180deg, rgba(252, 247, 236, 0.95), rgba(244, 238, 228, 0.9));
}
.reaction-expression-modal--powerlaw .kinetics-expression-table-head {
    border-radius: 12px;
    background: #f3f5f7;
    color: #5a6472;
}
.reaction-expression-modal--powerlaw .kinetics-expression-row input {
    background: #fffdfa;
    border-color: #d8cdb8;
}
.kinetics-adsorption-order {
    max-width: 280px;
}
.kinetics-adsorption-order input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9dde6;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #333;
}
.kinetics-adsorption-constants {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #e4e8ee;
}
.kinetics-adsorption-constants-head,
.kinetics-adsorption-constant-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 12px;
    align-items: center;
}
.kinetics-adsorption-constants-head {
    padding: 14px 12px;
    background: #f6f7f9;
    color: #444;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.kinetics-adsorption-constant-row {
    padding: 14px 0;
    border-bottom: 1px solid #eef1f5;
}
.kinetics-adsorption-constant-row:last-child {
    border-bottom: none;
}
.kinetics-adsorption-constant-row span {
    color: #444;
    font-size: 13px;
}
.kinetics-adsorption-constant-row input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9dde6;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #333;
}

/* 项目信息 */
.project-info-view { padding: 24px 32px; overflow-y: auto; flex: 1; }
.project-info-view .setting-card { max-width: 600px; }

/* 占位视图 */
.placeholder-view {
    flex: 1; display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 12px; color: var(--text-dim);
}
.placeholder-view .placeholder-icon {
    display: inline-flex; align-items: center; justify-content: center;
}
.placeholder-view .placeholder-text { font-size: 14px; }

/* ==================== 流程图视图 ==================== */
.flowsheet-view {
    display: flex; flex-direction: column; flex: 1; height: 100%;
}
.flowsheet-canvas-area {
    display: flex; flex: 1; overflow: hidden;
}
.flowsheet-main { flex: 1; position: relative; overflow: hidden; }
.drawflow-canvas { width: 100%; height: 100%; background: #fafafa; }

/* 底部调色板栏 — 选项卡模式 */
.palette-bottom {
    display: flex; flex-direction: column;
    background: var(--bg-light); border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.palette-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    overflow-x: auto; flex-shrink: 0;
}
.palette-tab {
    padding: 7px 16px; font-size: 12px; color: var(--text-dim);
    cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent;
    transition: all 0.15s; user-select: none;
}
.palette-tab:hover { color: var(--text); background: rgba(25,118,210,0.05); }
.palette-tab.active {
    color: var(--primary); border-bottom-color: var(--primary);
}
.palette-items {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; overflow-x: auto; min-height: 52px;
}
.palette-item {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 6px; cursor: grab; font-size: 12px;
    transition: border-color 0.2s; white-space: nowrap; flex-shrink: 0;
}
.palette-item:hover { border-color: var(--primary); }
.palette-item:active { cursor: grabbing; }
.palette-svg-icon {
    width: 28px; height: 28px; flex-shrink: 0;
}
.palette-icon {
    width: 28px; height: 28px; border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 11px; color: #fff; flex-shrink: 0;
}
.stream-icon { background: #43a047; }
.mixer-icon { background: #1e88e5; }
.heater-icon { background: #e53935; }
.flash-icon { background: #8e24aa; }
.product-icon { background: #ff6f00; }
.fsplit-icon { background: #5c6bc0; }
.dupl-icon { background: #26a69a; }
.decanter-icon { background: #7b1fa2; }
.extractor-icon { background: #00695c; }
.pump-icon { background: #0277bd; }
.compressor-icon { background: #01579b; }
.valve-icon { background: #006064; }

/* ==================== 右侧属性面板（流程图内） ==================== */
.panel-right {
    width: var(--panel-w);
    background: var(--bg-light);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.panel-tabs {
    display: flex; border-bottom: 1px solid var(--border);
}
.tab-btn {
    flex: 1; padding: 8px; background: none; border: none;
    color: var(--text-dim); cursor: pointer; font-size: 12px;
    border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { flex: 1; overflow-y: auto; padding: 12px; }
.hint { color: var(--text-dim); font-size: 12px; text-align: center; margin-top: 40px; }

.node-reference-card {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #d9e7d8;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fbf7 0%, #f2f7f0 100%);
}
.node-reference-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.node-reference-title {
    font-size: 11px;
    font-weight: 700;
    color: #2f5d32;
    letter-spacing: 0.2px;
}
.node-reference-badge {
    padding: 2px 6px;
    border-radius: 999px;
    background: #e3f1de;
    color: #2f6a35;
    font-size: 10px;
    font-weight: 700;
}
.node-reference-note,
.node-reference-footnote {
    font-size: 10px;
    line-height: 1.5;
    color: #617065;
}
.node-reference-footnote {
    margin-top: 8px;
}
.node-reference-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.node-reference-chip,
.node-reference-comp-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #d8e5d5;
    color: #39503f;
    font-size: 10px;
    line-height: 1.4;
}
.node-reference-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #d5e2d3;
}
.node-reference-section-title {
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #507253;
    text-transform: uppercase;
    letter-spacing: 0.35px;
}
.node-reference-item + .node-reference-item {
    margin-top: 8px;
}
.node-reference-item-title {
    font-size: 11px;
    font-weight: 600;
    color: #2f3e31;
    margin-bottom: 4px;
}
.node-reference-metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.node-reference-metric {
    font-size: 10px;
    color: #24512a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.node-reference-phase + .node-reference-phase {
    margin-top: 6px;
}
.node-reference-phase-label {
    font-size: 10px;
    font-weight: 700;
    color: #526356;
    margin-bottom: 4px;
}
.node-reference-phase-composition {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.sim-debug-panel {
    border-top: 1px solid var(--border);
    background: #fbfbfb;
    padding: 10px 12px 12px;
}
.sim-debug-panel summary {
    cursor: pointer;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    user-select: none;
}
.sim-debug-panel[open] summary {
    margin-bottom: 8px;
}
.sim-debug-meta {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 8px;
}
.sim-debug-section + .sim-debug-section {
    margin-top: 10px;
}
.sim-debug-title {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.sim-debug-panel pre {
    margin: 0;
    max-height: 180px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f3f6f8;
    color: #263238;
    font-size: 11px;
    line-height: 1.45;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ==================== Drawflow 节点样式覆盖 — SVG 设备图模式 ==================== */
.drawflow .drawflow-node {
    background: transparent !important; border: none !important;
    border-radius: 0 !important; color: var(--text); min-width: auto !important;
    font-size: 12px; box-shadow: none !important; padding: 0 !important;
    position: absolute;
}
.drawflow .drawflow-node.selected {
    background: transparent !important; border: none !important; box-shadow: none !important;
}
.drawflow .drawflow-node.selected .node-svg-main {
    filter: drop-shadow(0 0 6px rgba(25,118,210,0.7)) drop-shadow(0 0 12px rgba(25,118,210,0.4));
}
.drawflow .drawflow-node:hover .node-svg-main {
    filter: drop-shadow(0 0 4px rgba(25,118,210,0.3));
}
.drawflow .drawflow-node.selected:hover .node-svg-main {
    filter: drop-shadow(0 0 6px rgba(25,118,210,0.7)) drop-shadow(0 0 12px rgba(25,118,210,0.4));
}

/* 端口基础样式：10x10 圆点，默认隐藏，hover 时显示 */
.drawflow .drawflow-node .inputs .input,
.drawflow .drawflow-node .outputs .output {
    background: var(--primary); border: 2px solid #fff;
    width: 10px; height: 10px; border-radius: 50%;
    opacity: 0; transition: opacity 0.2s;
}
.drawflow .drawflow-node:hover .inputs .input,
.drawflow .drawflow-node:hover .outputs .output {
    opacity: 1;
}
.drawflow .drawflow-node .inputs .input:hover,
.drawflow .drawflow-node .outputs .output:hover {
    background: var(--accent); transform: scale(1.4); transition: all 0.15s;
}

/* DWSIM 风格连线：直线段 + 圆角 */
.drawflow .connection .main-path {
    stroke: #4682b4 !important;
    stroke-width: 2px !important;
    fill: none !important;
    pointer-events: stroke;
    stroke-linejoin: round;
    stroke-linecap: round;
}
/* 连线底层白色描边增强对比度 */
.drawflow .connection .main-path {
    filter: drop-shadow(0 0 1.5px rgba(255,255,255,0.9));
}
.drawflow .connection .main-path:hover {
    stroke: var(--primary) !important;
    stroke-width: 3px !important;
}
/* 未计算节点的连线：橙色 */
.drawflow .connection.from-not-calculated .main-path,
.drawflow .connection.to-not-calculated .main-path {
    stroke: #fa8072 !important;
}
/* 已计算的连线：蓝灰色 */
.drawflow .connection.both-calculated .main-path {
    stroke: #4682b4 !important;
}
/* reroute 调整点：默认隐藏，hover 连线时显示 */
.drawflow .connection .point {
    opacity: 0; transition: opacity 0.2s;
    cursor: grab;
    r: 6px;
}
.drawflow .connection:hover .point,
.drawflow .connection.connection-active .point {
    opacity: 1;
}
.drawflow .connection .point.selected,
.drawflow .connection .point.dragging {
    opacity: 1;
    cursor: grabbing;
    r: 8px;
}
.drawflow .connection .point:hover {
    r: 8px;
    fill: var(--primary);
}

/* 连线激活状态：悬停时的视觉反馈 */
.drawflow .connection.connection-active .main-path {
    stroke-width: 3px !important;
    stroke: var(--primary) !important;
    cursor: grab;
}
.drawflow .connection .main-path:active {
    cursor: grabbing;
}

/* 节点内容区可点击（选中/拖动），SVG 图层不拦截端口，强制内容居中对齐 */
.drawflow .drawflow-node .drawflow_content_node {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.drawflow .drawflow-node .node-svg-wrap {
    pointer-events: none;
}
.drawflow .drawflow-node .btn-node-ai-float {
    pointer-events: all;
}

/* 多选效果 */
.drawflow .drawflow-node.multi-selected {
    outline: 2px dashed var(--primary) !important;
    outline-offset: 4px;
    border: none !important;
    box-shadow: none !important;
}

/* SVG 设备图主体 */
.node-svg-wrap {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 80px; height: 80px; margin: 0 auto;
    pointer-events: none;
}
.node-svg-main {
    width: 80px; height: 80px; pointer-events: none;
    transition: filter 0.2s;
}
.node-label {
    font-size: 11px; text-align: center; color: var(--text);
    margin-top: 2px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 100px;
    font-weight: 600;
}
.node-sub-label {
    margin-top: 2px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
}
.node-sub-label.top { color: #1565c0; }
.node-sub-label.bottom { color: #bf360c; }
.node-port-badge {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(0,0,0,0.08);
    color: var(--text);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.node-port-badge.top {
    top: -12px;
    color: #1565c0;
}
.node-port-badge.bottom {
    bottom: -12px;
    color: #bf360c;
}

/* 状态圆点 */
.node-status-dot {
    width: 9px; height: 9px; border-radius: 50%;
    margin: 3px auto 0; transition: background 0.3s, opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    opacity: 0;
}
.node-status-dot.ok {
    background: #43a047;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(67,160,71,0.22);
    opacity: 1;
}
.node-status-dot.error {
    background: #d32f2f;
    border-radius: 2px;
    transform: rotate(45deg);
    box-shadow: 0 0 0 2px rgba(211,47,47,0.2);
    opacity: 1;
}
.node-status-dot.pending { background: #bdbdbd; }

/* 参数 tooltip — hover 时显示 */
.node-params-tooltip {
    position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); margin-top: 4px;
    background: rgba(33,33,33,0.9); color: #fff;
    font-size: 10px; padding: 4px 8px; border-radius: 4px;
    white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity 0.2s;
    z-index: 10;
}
.drawflow .drawflow-node:hover .node-params-tooltip { opacity: 1; }

/* AI 浮动按钮 — hover 时显示 */
.btn-node-ai-float {
    position: absolute; top: -4px; right: -4px;
    background: rgba(124,77,255,0.9); border: none; border-radius: 50%;
    width: 22px; height: 22px; cursor: pointer; color: #fff;
    opacity: 0; transition: opacity 0.2s; z-index: 10;
    padding: 0; pointer-events: all;
    display: inline-flex; align-items: center; justify-content: center;
}
.drawflow .drawflow-node:hover .btn-node-ai-float { opacity: 1; }
.btn-node-ai-float:hover { background: rgba(124,77,255,1); transform: scale(1.1); }

/* ==================== 属性编辑表单 ==================== */
.prop-form { font-size: 12px; }
.prop-form .form-group { margin-bottom: 10px; }
.prop-form label { display: block; color: var(--text-dim); margin-bottom: 3px; font-size: 11px; }
.prop-form input, .prop-form select {
    width: 100%; padding: 5px 8px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 4px;
    color: var(--text); font-size: 12px; font-family: monospace;
}
.prop-form input:focus, .prop-form select:focus { border-color: var(--primary); outline: none; }
.prop-form .btn-apply {
    width: 100%; padding: 6px; margin-top: 8px;
    background: var(--primary-dark); border: none; border-radius: 4px;
    color: #fff; cursor: pointer; font-size: 12px;
}
.prop-form .btn-apply:hover { background: var(--primary); color: #fff; }
.comp-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.comp-table th, .comp-table td {
    padding: 3px 6px; border: 1px solid var(--border);
    font-size: 11px; text-align: left;
}
.comp-table th { background: var(--bg); color: var(--text-dim); }
.comp-table input { width: 80px; }
.btn-add-comp {
    margin-top: 4px; padding: 3px 8px; font-size: 11px;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); border-radius: 3px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}

/* ==================== 结果表格 ==================== */
.results-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 8px; }
.results-table th, .results-table td { padding: 4px 6px; border: 1px solid var(--border); }
.results-table th { background: var(--bg); color: var(--text-dim); position: sticky; top: 0; }
.results-table td { font-family: monospace; }
.results-section { margin-bottom: 16px; }
.results-section h4 { font-size: 12px; color: var(--primary); margin-bottom: 6px; }
.hx-utility-card {
    page-break-inside: avoid;
    break-inside: avoid;
}
.hx-utility-report {
    margin: 6px 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.24);
}
.hx-utility-report-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.88;
}
.hx-utility-report-title {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 700;
}
.hx-utility-report-text {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.55;
}
.hx-utility-report--ok .hx-utility-report-text,
.hx-utility-report--tight .hx-utility-report-text,
.hx-utility-report--bad .hx-utility-report-text {
    color: inherit;
}
.hx-utility-report-summary {
    margin: 0 0 10px;
    padding: 8px 10px;
    border: 1px dashed #b0bec5;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,251,0.98));
    color: var(--text);
}
.hx-utility-report-summary-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.hx-utility-report-summary-text {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.65;
}

/* 结果摘要视图 */
.results-summary-view { padding: 24px 32px; overflow-y: auto; flex: 1; }
.results-summary-view h2 {
    font-size: 18px; color: var(--primary); margin-bottom: 20px; font-weight: 600;
}

/* ==================== AI 面板（浮动） ==================== */
.ai-panel {
    position: fixed; bottom: 20px; right: 20px;
    width: 400px; height: 500px;
    background: var(--bg-light); border: 1px solid var(--border);
    border-radius: 12px; display: flex; flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15); z-index: 1000;
}
.ai-panel-header {
    padding: 10px 16px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 14px; color: var(--primary);
}
.btn-close { background: none; border: none; color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; }
.btn-close:hover { color: var(--danger); }
.ai-messages {
    flex: 1; overflow-y: auto; padding: 12px;
    display: flex; flex-direction: column; gap: 8px;
}
.ai-msg {
    padding: 8px 12px; border-radius: 8px; font-size: 13px;
    max-width: 90%; line-height: 1.5; word-break: break-word;
}
.ai-msg-bot { background: #f0f0f0; align-self: flex-start; }
.ai-msg-user { background: var(--primary-dark); align-self: flex-end; color: #fff; }
.ai-msg-error { background: rgba(239,83,80,0.2); color: var(--danger); align-self: flex-start; }
.ai-input-area {
    padding: 10px; border-top: 1px solid var(--border);
    display: flex; gap: 8px; align-items: flex-end;
}
.ai-input-area textarea {
    flex: 1; padding: 8px 12px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--text); font-size: 13px;
    min-height: 88px;
    resize: vertical;
    font-family: inherit;
}
.ai-input-area textarea:focus { border-color: var(--primary); outline: none; }
.ai-input-area button {
    padding: 8px 16px; background: var(--primary-dark);
    border: none; border-radius: 6px; color: #fff;
    cursor: pointer; font-size: 13px;
}
.ai-input-area button:hover { background: var(--primary); color: #fff; }

/* ==================== 节点对话弹窗 ==================== */
.node-chat-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 420px; height: 380px;
    background: var(--bg-light); border: 1px solid var(--border);
    border-radius: 12px; display: flex; flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15); z-index: 1001;
}
.node-chat-header {
    padding: 10px 16px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 13px;
}
.node-chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.node-chat-input-area {
    padding: 10px; border-top: 1px solid var(--border);
    display: flex; gap: 8px;
}
.node-chat-input-area input {
    flex: 1; padding: 8px 12px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--text); font-size: 13px;
}
.node-chat-input-area input:focus { border-color: var(--primary); outline: none; }
.node-chat-input-area button {
    padding: 8px 16px; background: var(--primary-dark);
    border: none; border-radius: 6px; color: #fff;
    cursor: pointer; font-size: 13px;
}

/* ==================== 节点参数模态框（CSLAB 风格） ==================== */
.node-param-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3); z-index: 1100;
}
.node-param-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 600px; max-width: 90vw; max-height: 80vh;
    background: #fff; border-radius: 8px;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3); z-index: 1101;
    color: #333; font-size: 13px;
}
.npm-header {
    padding: 14px 20px; border-bottom: 1px solid #e0e0e0;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 15px; color: #333;
    flex-shrink: 0;
}
.npm-close {
    background: none; border: none;
    color: #999; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
}
.npm-close:hover { color: #e53935; }
.npm-body {
    display: flex; flex: 1; overflow: hidden; min-height: 0;
}
.npm-sidebar {
    width: 100px; border-right: 1px solid #e0e0e0;
    padding: 12px 0; flex-shrink: 0; background: #fafafa;
}
.npm-sidebar-item {
    padding: 10px 16px; cursor: pointer; font-size: 13px;
    color: #666; border-left: 3px solid transparent;
    transition: all 0.15s; user-select: none;
}
.npm-sidebar-item:hover { color: #1976d2; background: #f0f7ff; }
.npm-sidebar-item.active {
    color: #1976d2; border-left-color: #1976d2;
    background: #e3f2fd; font-weight: 600;
}
.npm-content {
    flex: 1; overflow-y: auto; padding: 20px 24px;
}
.npm-footer {
    padding: 12px 20px; border-top: 1px solid #e0e0e0;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0; background: #fafafa; border-radius: 0 0 8px 8px;
}
.npm-status { font-size: 12px; }
.npm-status.pending { color: #ff9800; }
.npm-status.ok { color: #4caf50; }
.npm-status.error { color: #e53935; }
.npm-btn-apply {
    padding: 8px 28px; border: none; border-radius: 6px;
    background: #1976d2; color: #fff; font-size: 13px;
    font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.npm-btn-apply:hover { background: #1565c0; }
/* 模态框内表单 */
.npm-form-group {
    margin-bottom: 16px;
}
.npm-form-group label {
    display: block; font-size: 12px; color: #888;
    margin-bottom: 5px; font-weight: 500;
}
.npm-form-group input,
.npm-form-group select {
    width: 100%; padding: 8px 12px; background: #fff;
    border: 1px solid #d0d0d0; border-radius: 6px;
    color: #333; font-size: 13px; font-family: monospace;
    transition: border-color 0.2s;
}
.npm-form-group input:focus,
.npm-form-group select:focus {
    border-color: #1976d2; outline: none;
    box-shadow: 0 0 0 2px rgba(25,118,210,0.1);
}
.npm-input-with-unit {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.npm-input-with-unit input {
    flex: 1 1 auto;
    min-width: 0;
}
.npm-input-with-unit select {
    flex: 0 0 116px;
}
.npm-comp-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.npm-comp-table th, .npm-comp-table td {
    padding: 6px 8px; border: 1px solid #e0e0e0;
    font-size: 12px; text-align: left;
}
.npm-comp-table th { background: #f5f5f5; color: #666; font-weight: 600; }
.npm-comp-table input { width: 100%; border: none; background: transparent; padding: 2px 4px; font-family: monospace; font-size: 12px; color: #333; }
.npm-comp-table input:focus { outline: none; background: #e3f2fd; }
.npm-btn-add-comp {
    margin-top: 6px; padding: 4px 12px; font-size: 12px;
    background: #f5f5f5; border: 1px solid #d0d0d0;
    color: #555; border-radius: 4px; cursor: pointer;
}
.npm-btn-add-comp:hover { background: #e3f2fd; border-color: #1976d2; color: #1976d2; }
.npm-btn-remove {
    background: none; border: none; color: #e53935;
    cursor: pointer; padding: 2px 6px;
    display: inline-flex; align-items: center; justify-content: center;
}
.npm-btn-remove:hover { background: #ffebee; border-radius: 3px; }
.npm-comp-summary {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d7e3f4;
    background: #f7fbff;
}
.npm-comp-summary.ok {
    border-color: #c8e6c9;
    background: #f1f8f2;
}
.npm-comp-summary.warning {
    border-color: #ffe0b2;
    background: #fff8ee;
}
.npm-comp-summary.error {
    border-color: #ffcdd2;
    background: #fff5f5;
}
.npm-comp-summary-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}
.npm-comp-summary-text {
    margin-top: 4px;
    font-size: 11px;
    color: #666;
    line-height: 1.5;
}
.npm-comp-summary-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.npm-comp-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(25, 118, 210, 0.08);
    color: #1565c0;
    font-size: 11px;
    font-family: monospace;
}
.npm-local-solver-card {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #dbe7f5;
    border-radius: 10px;
    background: linear-gradient(180deg, #f7fbff 0%, #eef5fc 100%);
}
.npm-local-solver-title {
    font-size: 12px;
    font-weight: 700;
    color: #1f5f9d;
}
.npm-local-solver-note {
    margin-top: 4px;
    margin-bottom: 12px;
    font-size: 11px;
    line-height: 1.5;
    color: #5f7388;
}
/* 模态框内结果展示 */
.npm-result-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
.npm-result-label { color: #888; }
.npm-result-value { color: #1976d2; font-family: monospace; font-weight: 500; }

/* ==================== 反应编辑器样式 ==================== */
.rxn-tab-container { padding: 4px 0; }
.rxn-template-selector {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.rxn-template-header {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
}
.rxn-template-legacy-note {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px dashed #d8b36a;
    background: #fff8ea;
    color: #8a6426;
    font-size: 12px;
}
.rxn-template-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}
.rxn-template-column {
    min-width: 0;
}
.rxn-template-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}
.rxn-template-list {
    min-height: 180px;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
}
.rxn-template-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.rxn-template-item:last-child {
    border-bottom: none;
}
.rxn-template-item input {
    margin-top: 2px;
}
.rxn-template-item-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rxn-template-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.rxn-template-item-meta {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.45;
}
.rxn-template-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.rxn-template-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #90baff;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rxn-template-action-btn:hover {
    background: #6fa5ff;
}
.rxn-template-action-btn--reverse .ui-icon-svg {
    transform: rotate(180deg);
}
.rxn-template-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
}
.rxn-template-empty--panel {
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--bg-card);
}
.rxn-template-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rxn-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    background: var(--bg-card);
}
.rxn-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}
.rxn-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}
.rxn-equation {
    flex: 1;
    font-size: 12px;
    color: var(--text-dim);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rxn-btn-delete {
    background: none; border: none;
    color: var(--danger);
    cursor: pointer; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
}
.rxn-btn-delete:hover { color: #ff8a80; }
.rxn-card-body { padding: 12px 14px; }
.rxn-section-label {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 8px;
}
.rxn-stoich-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}
.rxn-stoich-table thead th {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}
.rxn-stoich-table tbody td {
    padding: 6px 8px;
    font-size: 12px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.rxn-reactant .rxn-comp-name { color: #ff8a80; font-weight: 600; }
.rxn-product .rxn-comp-name { color: #69f0ae; font-weight: 600; }
.rxn-coeff-input {
    width: 70px;
    padding: 4px 8px;
    font-size: 12px;
    font-family: monospace;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
}
.rxn-coeff-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(25,118,210,0.15);
}
.rxn-btn-remove {
    background: none; border: none;
    color: var(--danger); cursor: pointer;
    padding: 2px 6px;
    display: inline-flex; align-items: center; justify-content: center;
}
.rxn-btn-remove:hover { background: rgba(239,83,80,0.15); border-radius: 3px; }
.rxn-add-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 8px 0;
}
.rxn-select {
    flex: 1;
    padding: 5px 8px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-light);
    color: var(--text);
}
.rxn-select:focus {
    outline: none;
    border-color: var(--primary);
}
.rxn-btn-add {
    padding: 4px 10px;
    font-size: 14px;
    font-weight: 700;
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.rxn-btn-add:hover { opacity: 0.85; }
.rxn-params-row {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.rxn-param-field {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rxn-param-field label {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    font-weight: 600;
}

/* ==================== 流股对比弹窗 ==================== */
.stream-compare-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3); z-index: 1200;
}
.stream-compare-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(90vw, 920px); max-height: 80vh;
    background: #fff; border-radius: 8px;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3); z-index: 1201;
    color: #333; font-size: 13px;
}
.scm-header {
    padding: 12px 20px; border-bottom: 1px solid #e0e0e0;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 15px; color: #333; flex-shrink: 0;
}
.scm-header-actions { display: flex; align-items: center; gap: 8px; }
.scm-btn-add {
    padding: 5px 14px; border: 1px solid #1976d2; border-radius: 5px;
    background: #e3f2fd; color: #1976d2; font-size: 12px;
    cursor: pointer; font-weight: 600;
}
.scm-btn-add:hover { background: #bbdefb; }
.scm-body {
    flex: 1; overflow: auto; padding: 0; min-height: 0;
}
.scm-table {
    width: 100%; border-collapse: collapse; font-size: 12px;
    table-layout: fixed;
}
.scm-table th, .scm-table td {
    padding: 5px 8px; border: 1px solid #e0e0e0;
    text-align: right; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.scm-table th {
    background: #f5f5f5; color: #555; font-weight: 600;
    position: sticky; top: 0; z-index: 2;
}
.scm-table td:first-child,
.scm-table th:first-child {
    text-align: left; position: sticky; left: 0;
    background: #fafafa; z-index: 1; min-width: 110px; width: 110px;
}
.scm-table th:first-child { z-index: 3; background: #f5f5f5; }
.scm-table td:nth-child(2),
.scm-table th:nth-child(2) {
    text-align: center; min-width: 80px; width: 80px;
    position: sticky; left: 110px; background: #fafafa; z-index: 1;
}
.scm-table th:nth-child(2) { z-index: 3; background: #f5f5f5; }
.scm-table td.scm-val { font-family: monospace; color: #1976d2; }
.scm-section-header {
    cursor: pointer; user-select: none;
    background: #f0f7ff !important; color: #1976d2 !important;
    font-weight: 600 !important; text-align: left !important;
}
.scm-section-header:hover { background: #e3f2fd !important; }
.scm-section-header td {
    text-align: left !important; color: #1976d2; font-weight: 600;
    background: #f0f7ff;
}
.scm-section-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.scm-section-chevron {
    width: 12px;
    height: 12px;
}
.segment-drag-indicator-icon {
    width: 32px;
    height: 32px;
    color: #007bff;
}
.scm-comp-row td:first-child { padding-left: 20px; color: #666; }
.scm-stream-hdr { position: relative; min-width: 100px; }
.scm-stream-hdr .scm-remove-btn {
    position: absolute; top: 2px; right: 2px;
    background: none; border: none; color: #ccc; cursor: pointer;
    padding: 0 3px;
    display: inline-flex; align-items: center; justify-content: center;
}
.scm-stream-hdr .scm-remove-btn:hover { color: #e53935; }
.scm-unit-select {
    background: transparent; border: 1px solid #d0d0d0; border-radius: 3px;
    color: #555; font-size: 10px; padding: 1px 2px; cursor: pointer;
    max-width: 70px;
}
.scm-unit-select:focus { outline: none; border-color: #1976d2; }
/* 添加流股下拉 */
.scm-add-dropdown {
    position: fixed; z-index: 1300;
    background: #fff; border: 1px solid #d0d0d0; border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15); max-height: 200px;
    overflow-y: auto; min-width: 160px;
}
.scm-add-dropdown .scm-add-item {
    padding: 7px 14px; font-size: 12px; color: #333;
    cursor: pointer; white-space: nowrap;
}
.scm-add-dropdown .scm-add-item:hover { background: #e3f2fd; color: #1976d2; }
.scm-add-dropdown .scm-add-empty {
    padding: 10px 14px; font-size: 12px; color: #999; text-align: center;
}
/* 物流汇总表流股名可点击 */
.scm-stream-link {
    color: #1976d2; cursor: pointer; text-decoration: underline;
    text-decoration-style: dotted;
}
.scm-stream-link:hover { color: #0d47a1; text-decoration-style: solid; }
/* 流股对比按钮 */
.scm-compare-btn {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 6px; padding: 1px 6px;
    font-size: 11px; background: #e3f2fd; color: #1976d2;
    border: 1px solid #bbdefb; border-radius: 3px; cursor: pointer;
    vertical-align: middle;
}
.scm-compare-btn:hover { background: #bbdefb; }

/* ==================== 框选 & 多选 & 右键菜单 ==================== */
.box-select-rect {
    position: fixed; pointer-events: none; z-index: 500;
    background: rgba(25,118,210,0.1); border: 1px solid var(--primary);
}
.ctx-menu {
    position: fixed; z-index: 1500;
    background: var(--bg-light); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    min-width: 160px; padding: 4px 0;
}
.ctx-menu-item {
    padding: 8px 16px; font-size: 13px; color: var(--text);
    cursor: pointer; user-select: none; white-space: nowrap;
    display: flex; align-items: center; gap: 10px;
}
.ctx-menu-item:hover { background: rgba(25,118,210,0.08); color: var(--primary); }
.ctx-menu-label { flex: 1; line-height: 1.4; }
.ctx-menu-separator {
    height: 1px; background: var(--border); margin: 4px 0;
}
.ctx-menu-danger { color: var(--danger); }
.ctx-menu-danger:hover { background: rgba(239,83,80,0.15); color: var(--danger); }

/* ==================== 加载遮罩 ==================== */
.loading-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: 2000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px; color: #fff; font-size: 14px;
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== 用户信息和登录 ==================== */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-login {
    padding: 6px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--primary-dark);
}

.btn-logout {
    padding: 4px 10px;
    background: none;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-logout:hover {
    background: var(--bg);
    color: var(--text);
}

/* 登录弹窗 */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    background: var(--bg-light);
    border-radius: 12px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 16px;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-dim);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-tab:hover:not(.active) {
    background: var(--bg);
}

#auth-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-msg {
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

.btn-auth-submit {
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-auth-submit:hover {
    background: var(--primary-dark);
}

/* ==================== 物流信息标签 ==================== */
.stream-info-label {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #4682b4;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    color: #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 100;
    max-width: 80px;
    text-align: center;
    transition: all 0.2s;
}

.stream-info-label:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: none;
}

.stream-flow {
    font-weight: 600;
    color: #1976d2;
}

.stream-temp {
    color: #e53935;
    font-size: 10px;
}

/* 物流详情 tooltip */
.stream-tooltip {
    position: fixed;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0;
    font-size: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    max-width: 280px;
    min-width: 200px;
}

.stream-tooltip-header {
    padding: 10px 14px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.stream-tooltip-body {
    padding: 12px 14px;
}

.stream-tooltip-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.stream-tooltip-section {
    font-weight: 600;
    color: var(--text-dim);
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 11px;
}

.stream-prop {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.stream-prop .label {
    color: var(--text-dim);
}

.stream-prop .value {
    color: var(--text);
    font-weight: 500;
    font-family: monospace;
}

/* ==================== 收敛过程弹窗 ==================== */
.convergence-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.convergence-modal-content {
    background: var(--bg-light);
    border-radius: 12px;
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.convergence-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 16px;
}

.convergence-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.convergence-info {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
}

.conv-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.conv-info-item .label {
    font-size: 11px;
    color: var(--text-dim);
}

.conv-info-item .value {
    font-weight: 600;
    font-size: 14px;
}

.conv-info-item .value.converged {
    color: var(--accent);
}

.conv-info-item .value.not-converged {
    color: var(--warning);
}

.convergence-chart-container {
    height: 300px;
    position: relative;
}

.convergence-table {
    width: 100%;
    border-collapse: collapse;
}

.convergence-table th,
.convergence-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: center;
}

.convergence-table th {
    background: var(--bg);
    font-weight: 600;
}

/* ==================== RadFrac 分布图弹窗 ==================== */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-modal-content {
    background: var(--bg-light);
    border-radius: 12px;
    width: 700px;
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 16px;
}

.profile-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.profile-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
}

.profile-tab {
    padding: 8px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.profile-tab:first-child {
    border-radius: 6px 0 0 6px;
}

.profile-tab:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.profile-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.profile-tab:hover:not(.active) {
    background: var(--bg);
}

.profile-chart-container {
    height: 350px;
    position: relative;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-table th,
.profile-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: center;
}

.profile-table th {
    background: var(--bg);
    font-weight: 600;
}

/* ==================== 结果视图按钮样式 ==================== */
.btn-view-convergence,
.btn-view-profile {
    padding: 8px 16px;
    border: 1px solid var(--primary);
    background: var(--bg-light);
    color: var(--primary);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-view-convergence:hover,
.btn-view-profile:hover {
    background: var(--primary);
    color: white;
}

.conv-status-converged {
    color: var(--accent);
    font-weight: 600;
}

.conv-status-not-converged {
    color: var(--warning);
    font-weight: 600;
}

/* ==================== 连接线拐点编辑手柄 ==================== */
/* 拐点手柄样式 */
.bend-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #007bff;
    border-radius: 50%;
    cursor: grab;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: all;
    transition: all 0.15s ease;
}

.bend-handle:hover {
    background: #007bff;
    transform: translate(-50%, -50%) scale(1.3);
}

.bend-handle.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.5);
    background: #007bff;
}

/* 连接线选中状态 */
.drawflow .connection.selected {
    stroke: #007bff !important;
    stroke-width: 3px !important;
}

/* 选中的连接线虚线动画 */
.drawflow .connection.selected path {
    stroke-dasharray: 5, 3;
    animation: dashAnimation 1s linear infinite;
}

@keyframes dashAnimation {
    to {
        stroke-dashoffset: -8;
    }
}

/* ==================== draw.io 风格的线段拖动指示器 ==================== */
.segment-hover-indicator {
    cursor: ns-resize; /* 默认南北方向光标 */
    transition: opacity 0.2s;
}

.segment-hover-indicator:hover {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1.2);
}

/* ==================== 分析工具 ==================== */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.analysis-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(250px, 0.82fr);
    gap: 12px;
    align-items: stretch;
}

.analysis-toolbar__config {
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.analysis-toolbar__rows {
    display: grid;
    gap: 8px;
    width: 100%;
}

.analysis-toolbar__row {
    display: grid;
    grid-template-columns: minmax(96px, auto) minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: end;
}

.analysis-toolbar__row-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-self: center;
    min-width: 0;
}

.analysis-toolbar__eyebrow {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.analysis-toolbar__section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.analysis-toolbar__meta-hint,
.analysis-toolbar__note {
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-dim);
}

.analysis-toolbar__note {
    max-width: 180px;
    align-self: center;
}

.analysis-toolbar__summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.analysis-toolbar__summary-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

.analysis-grid--input {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    gap: 10px;
}

.analysis-grid--output {
    grid-template-columns: minmax(220px, 1.3fr) minmax(120px, 0.7fr);
    gap: 10px;
}

.analysis-toolbar__row-actions {
    margin-top: 0;
    flex-wrap: wrap;
    align-items: center;
}

.analysis-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    gap: 16px;
    align-items: stretch;
}

.analysis-panel {
    min-width: 0;
}

.analysis-panel--chart {
    display: flex;
    flex-direction: column;
}

.analysis-panel--detail {
    display: flex;
    flex-direction: column;
}

@media (max-width: 1100px) {
    .analysis-toolbar {
        grid-template-columns: 1fr;
    }

    .analysis-toolbar__row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .analysis-grid--input,
    .analysis-grid--output {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .analysis-toolbar__note {
        max-width: none;
    }

    .analysis-workbench {
        grid-template-columns: 1fr;
    }
}

.analysis-chart-shell {
    position: relative;
    min-height: 360px;
    height: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(247,248,250,0.95));
}

.analysis-chart-shell canvas {
    width: 100% !important;
    height: 100% !important;
}

.analysis-chart-shell--compact {
    min-height: 240px;
    height: 240px;
}

@media (max-width: 768px) {
    .analysis-chart-shell--compact {
        min-height: 200px;
        height: 200px;
    }
}

.analysis-summary {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    line-height: 1.7;
    font-size: 13px;
}

.analysis-summary.warning {
    border-color: #ffcc80;
    background: #fff8e8;
}

.analysis-summary--compact {
    min-height: 72px;
    font-size: 12px;
    line-height: 1.55;
}

.analysis-detail {
    flex: 1;
    min-height: 240px;
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    padding: 0 2px 2px;
}

.analysis-detail .results-table {
    margin-top: 0;
}

.restore-notice {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(560px, 100%);
}

.restore-notice--error {
    border-color: #ffcdd2;
    background: #fff5f5;
}

.restore-notice-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.restore-notice-text {
    color: var(--text);
}

.restore-notice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.analysis-empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

.analysis-status {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

.analysis-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.phase-envelope-toprow {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.phase-envelope-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
    gap: 16px;
    align-items: stretch;
}

.phase-envelope-panel {
    min-width: 0;
}

.phase-envelope-panel--controls,
.phase-envelope-panel--summary,
.phase-envelope-panel--chart,
.phase-envelope-panel--detail {
    display: flex;
    flex-direction: column;
}

.phase-envelope-panel--summary-fit {
    align-self: start;
}

.phase-envelope-panel--top-fixed {
    height: 292px;
    min-height: 292px;
    max-height: 292px;
}

.phase-envelope-panel--summary-scroll {
    overflow: hidden;
}

.phase-envelope-panel--chart-fill,
.phase-envelope-panel--detail {
    min-height: 360px;
}

.phase-envelope-panel__header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.phase-envelope-panel__header h3 {
    margin: 0;
}

.phase-envelope-panel__hint {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-dim);
}

.phase-envelope-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 12px;
}

.phase-envelope-actions {
    margin-top: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.phase-envelope-summary {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.phase-envelope-summary-shell {
    display: grid;
    gap: 10px;
}

.phase-envelope-summary-shell--scroll {
    height: 100%;
    max-height: 100%;
    overflow: auto;
    padding-right: 4px;
}

.phase-envelope-summary-main {
    font-size: 13px;
    line-height: 1.7;
}

.phase-envelope-summary-extra {
    display: grid;
    gap: 10px;
}

.phase-envelope-summary-note {
    font-size: 12px;
    line-height: 1.65;
    color: var(--text-dim);
    padding: 10px 12px;
    border: 1px solid rgba(25, 118, 210, 0.14);
    border-radius: 10px;
    background: rgba(25, 118, 210, 0.04);
}

.phase-envelope-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.phase-envelope-summary-item {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.phase-envelope-summary-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.phase-envelope-summary-value {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    word-break: break-word;
}

.phase-envelope-chart-shell {
    min-height: 250px;
}

.phase-envelope-chart-shell--fill {
    flex: 1;
    min-height: 320px;
    height: 100%;
}

.phase-envelope-detail-shell {
    flex: 1;
    min-height: 0;
}

.phase-envelope-detail-shell .phase-detail-panel {
    height: 100%;
}

.phase-workspace-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.phase-workspace-toolbar h3 {
    margin: 0;
}

.phase-detail-panel {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    height: 100%;
}

.phase-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.phase-detail-btn {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.phase-detail-btn:hover {
    border-color: rgba(25, 118, 210, 0.28);
    background: rgba(25,118,210,0.06);
    color: var(--primary-dark);
}

.phase-detail-note {
    font-size: 12px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.phase-detail-note-outside {
    margin-bottom: 14px;
}

.phase-meta-table {
    margin-top: 0;
    margin-bottom: 12px;
}

.phase-meta-table th {
    width: 108px;
    background: rgba(15, 23, 42, 0.04);
}

.phase-table-shell {
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-light);
}

.phase-curve-table {
    margin-top: 0;
    min-width: 100%;
}

.phase-curve-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f3f6fa;
    white-space: nowrap;
}

.phase-curve-table td {
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .phase-envelope-toprow,
    .phase-envelope-workbench,
    .analysis-split {
        grid-template-columns: 1fr;
    }

    .phase-envelope-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .phase-table-shell {
        max-height: 360px;
    }
}

.prop-sheet-card {
    padding: 18px 18px 14px;
    background:
        linear-gradient(180deg, rgba(237, 244, 255, 0.55), rgba(255, 255, 255, 0) 88px),
        var(--bg-card);
}

.prop-sheet-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.prop-sheet-title {
    font-size: 15px;
    font-weight: 700;
    color: #1857a4;
    margin-bottom: 4px;
}

.prop-sheet-subtitle {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.6;
}

.prop-sheet-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.prop-sheet-stat {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(25, 118, 210, 0.16);
    background: rgba(25, 118, 210, 0.07);
    color: #1857a4;
    font-size: 12px;
    font-weight: 600;
}

.prop-sheet-export-btn {
    min-width: 78px;
}

.prop-sheet-scroll {
    overflow: auto;
    border: 1px solid #d7e1ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.prop-sheet {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.prop-sheet thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: linear-gradient(180deg, #edf4ff, #dfeaf9);
    color: #1a5dc0;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    padding: 14px 12px;
    border-bottom: 2px solid #2d73db;
    white-space: nowrap;
}

.prop-sheet tbody th,
.prop-sheet tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #e7edf5;
    background: #fff;
}

.prop-sheet tbody tr:nth-child(odd) th,
.prop-sheet tbody tr:nth-child(odd) td {
    background: #fcfdff;
}

.prop-sheet-attr {
    min-width: 210px;
    color: #31445b;
    font-size: 13px;
    font-weight: 600;
}

.prop-sheet-unit {
    min-width: 150px;
}

.prop-sheet-sticky-col,
.prop-sheet-sticky-unit {
    position: sticky;
    z-index: 3;
}

.prop-sheet-sticky-col {
    left: 0;
}

.prop-sheet-sticky-unit {
    left: 210px;
}

.prop-sheet tbody .prop-sheet-sticky-col,
.prop-sheet tbody .prop-sheet-sticky-unit {
    background: inherit;
    box-shadow: 1px 0 0 #e7edf5;
}

.prop-sheet thead .prop-sheet-sticky-col,
.prop-sheet thead .prop-sheet-sticky-unit {
    z-index: 5;
    box-shadow: 1px 0 0 rgba(45, 115, 219, 0.12);
}

.prop-sheet-comp-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prop-sheet-comp-name {
    font-size: 13px;
    font-weight: 700;
    color: #1a5dc0;
}

.prop-sheet-comp-sub {
    font-size: 11px;
    font-weight: 500;
    color: #6f7f93;
}

.prop-sheet-unit-select,
.prop-sheet-input input {
    width: 100%;
    height: 34px;
    border: 1px solid #cfd9e6;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #f7f9fc);
    color: #41556d;
    font-size: 13px;
}

.prop-sheet-unit-select {
    padding: 0 32px 0 12px;
}

.prop-sheet-input {
    display: block;
    min-width: 148px;
}

.prop-sheet-input input {
    padding: 0 12px;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
}

.prop-sheet-input input[readonly] {
    cursor: default;
}

@media (max-width: 960px) {
    .reaction-page-header,
    .reaction-topbar,
    .reaction-detail-header {
        flex-direction: column;
        align-items: stretch;
    }

    .reaction-toolbar-actions,
    .reaction-create-hint,
    .reaction-detail-summary {
        max-width: none;
        text-align: left;
    }

    .reaction-workflow-steps {
        grid-template-columns: 1fr;
    }

    .reaction-modal {
        width: min(96vw, 920px);
    }

    .reaction-modal-form-row,
    .reaction-modal-form-grid,
    .reaction-modal-columns {
        grid-template-columns: 1fr;
    }

    .kinetics-powerlaw-hero {
        grid-template-columns: 1fr;
    }

    .kinetics-powerlaw-hero-card--context .reaction-modal-form-grid--powerlaw {
        grid-template-columns: 1fr;
    }

    .kinetics-powerlaw-actions {
        justify-content: stretch;
    }

    .kinetics-powerlaw-actions .reaction-modal-secondary-btn {
        width: 100%;
    }

    .kinetics-rate-line,
    .kinetics-rate-grid {
        grid-template-columns: 1fr;
    }

    .kinetics-rate-header,
    .kinetics-detail-modal--powerlaw .kinetics-rate-equations--powerlaw {
        grid-template-columns: 1fr;
    }

    .kinetics-rate-caption {
        text-align: left;
    }

    .kinetics-formula-equation--lhhw,
    .kinetics-action-row {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .kinetics-lhhw-fraction {
        min-width: 0;
        width: 100%;
    }

    .kinetics-expression-columns {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .prop-sheet-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .prop-sheet-actions {
        justify-content: space-between;
    }
}

@media print {
    body {
        background: #fff;
        overflow: visible;
    }

    .topbar,
    .sidebar {
        display: none !important;
    }

    .app-body,
    .content-area,
    .view-panel,
    .settings-view,
    .results-section,
    .hx-utility-card {
        overflow: visible !important;
        height: auto !important;
    }

    .hx-utility-card {
        background: #fff !important;
        border-color: #cfd8dc !important;
    }

    .hx-utility-report {
        box-shadow: none;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .hx-utility-report-summary {
        background: #fff;
        border-style: solid;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .scm-print-expand-details > .scm-print-expand-content {
        display: block !important;
    }

    .scm-print-expand-summary {
        cursor: default !important;
    }

    .scm-print-expand-summary::-webkit-details-marker {
        display: none;
    }
}
