﻿:root {
    /* 默认深色主题 */
    --bg-primary: #0a0e14;
    --bg-secondary: #111820;
    --bg-tertiary: #1a2330;
    --bg-card: #151c28;
    --border: #2a3544;
    --border-light: #3a4554;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #5c6670;
    --accent: #00d4aa;
    --accent-dim: #00a88a;
    --accent-glow: rgba(0, 212, 170, 0.15);
    --warning: #f0a020;
    --error: #f85149;
    --info: #58a6ff;
    /* 曲线颜色 */
    --color-sat-liquid: #3b82f6;
    --color-sat-vapor: #ef4444;
    --color-quality: #10b981;
    --color-isotherm: #f59e0b;
    --color-isentrope: #8b5cf6;
    --color-point: #00d4aa;
    --connection-color: #00d4aa;
}

/* 浅色主题 - 优化版 */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #0ea5e9;
    --accent-dim: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.1);
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    /* 曲线颜色 - 浅色优化 */
    --color-sat-liquid: #2563eb;
    --color-sat-vapor: #dc2626;
    --color-quality: #16a34a;
    --color-isotherm: #d97706;
    --color-isentrope: #8b5cf6;
    --color-point: #0ea5e9;
    --connection-color: #0ea5e9;
}

/* 蓝色主题 */
[data-theme="blue"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --border: #475569;
    --border-light: #64748b;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-dim: #3b82f6;
    --accent-glow: rgba(96, 165, 250, 0.15);
    --warning: #fbbf24;
    --error: #f87171;
    --info: #60a5fa;
    --color-sat-liquid: #60a5fa;
    --color-sat-vapor: #f87171;
    --color-quality: #34d399;
    --color-isotherm: #fbbf24;
    --color-isentrope: #8b5cf6;
    --color-point: #60a5fa;
    --connection-color: #60a5fa;
}

/* 绿色主题 */
[data-theme="green"] {
    --bg-primary: #064e3b;
    --bg-secondary: #0f766e;
    --bg-tertiary: #115e59;
    --bg-card: #0f766e;
    --border: #134e4a;
    --border-light: #1e7a6f;
    --text-primary: #d1fae5;
    --text-secondary: #a7f3d0;
    --text-muted: #6ee7b7;
    --accent: #10b981;
    --accent-dim: #059669;
    --accent-glow: rgba(16, 185, 129, 0.15);
    --warning: #fbbf24;
    --error: #f87171;
    --info: #10b981;
    --color-sat-liquid: #10b981;
    --color-sat-vapor: #ef4444;
    --color-quality: #f59e0b;
    --color-isotherm: #3b82f6;
    --color-isentrope: #8b5cf6;
    --color-point: #10b981;
    --connection-color: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.bg-decoration, .grid-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

    .bg-decoration::before {
        content: '';
        position: absolute;
        inset: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(ellipse at 20% 20%, rgba(0, 212, 170, 0.03) 0%, transparent 50%);
    }

.grid-bg {
    background-image: linear-gradient(rgba(42, 53, 68, 0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(42, 53, 68, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
}

.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}


.panel-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .panel-title svg {
        width: 24px;
        height: 24px;
        color: var(--accent);
    }

.panel-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #5c6670;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-group {
    margin-bottom: 4px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.select-wrapper {
    position: relative;
}

    .select-wrapper::after {
        content: '';
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        border: 5px solid transparent;
        border-top-color: #5c6670;
        pointer-events: none;
    }

.form-select {
    width: 100%;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
}

    .form-select:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-glow);
    }

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-custom svg {
    width: 12px;
    height: 12px;
    color: var(--bg-primary);
    opacity: 0;
    transition: all 0.2s;
}

.checkbox-input:checked + .checkbox-custom svg {
    opacity: 1;
}

.checkbox-label {
    font-size: 13px;
    color: var(--text-secondary);
    user-select: none;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
}

    .form-input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-glow);
    }

.input-unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #5c6670;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn svg {
        width: 18px;
        height: 18px;
    }

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: var(--bg-primary);
}

    .btn-primary:hover {
        background: var(--accent-dim);
    }

.btn-secondary {
    width: 100%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}


.points-list {
    margin-top: 20px;
    max-height: 350px; /* 固定最大高度 */
    overflow-y: auto; /* 垂直滚动 */
    border: 1px solid #e2e8f0;
    padding: 10px;
    margin-bottom: 10px;
}

.point-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.point-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.point-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-point);
    box-shadow: 0 0 8px var(--color-point);
}

.point-coords {
    color: var(--text-secondary);
}

.point-remove {
    background: none;
    border: none;
    color: #5c6670;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

    .point-remove:hover {
        color: #f85149;
        background: rgba(248, 81, 73, 0.1);
    }


.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.chart-section {
    flex: 1;
    position: relative;
    background: var(--bg-secondary);
    margin: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
}

.chart-subtitle {
    font-size: 12px;
    color: #5c6670;
    margin-top: 2px;
}

.chart-actions {
    display: flex;
    gap: 8px;
}
.top-controls .control-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    margin-left: 10px;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
}


.chart-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}

    .chart-action-btn:hover {
        background: var(--bg-secondary);
        border-color: var(--accent);
        transform: translateY(-2px);
    }

    .chart-action-btn svg {
        width: 30px;
        height: 30px;
    }

.chart-container {
    flex: 1;
    padding: 16px;
    min-height: 400px;
}

#phChart {
    width: 100%;
    height: 100%;
    min-height: 400px;
    cursor: crosshair;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.legend-item {
    display: flex;

    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-line {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.properties-panel {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    padding: 16px 20px;
}

.properties-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .properties-title svg {
        width: 14px;
        height: 14px;
        color: var(--accent);
    }

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.property-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.property-label {
    font-size: 11px;
    color: #5c6670;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.property-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 500;
}

.property-unit {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 4px;
}
/*-- 流体状态--*/
.status-badge {
    display: inline-flex;
    padding: 4px 10px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 20px;
}

    .status-badge.liquid {
        background: rgba(59, 130, 246, 0.15);
        color: #60a5fa;
    }

    .status-badge.vapor {
        background: rgba(239, 68, 68, 0.15);
        color: #f87171;
    }

    .status-badge.twophase {
        background: rgba(16, 185, 129, 0.15);
        color: #34d399;
    }

    .status-badge.supercritical {
        background: rgba(16, 185, 129, 0.15);
        color: #8b5cf6;
    }

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

    .toast.show {
        transform: translateY(0);
        opacity: 1;
    }

    .toast.error {
        border-color: #f85149;
    }

    .toast.success {
        border-color: var(--accent);
        background: var(--accent-glow);
    }

.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #5c6670;
    padding: 40px;
}

/* 主题选择器样式 */
.theme-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 2px;
}

.theme-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .theme-btn:hover {
        background: var(--bg-secondary);
        border-color: var(--accent);
        transform: translateY(-2px);
    }

    .theme-btn svg {
        width: 30px;
        height: 30px;
    }


/* 连线功能控制容器 */
.connection-controls {
    display: flex;
    align-items: center; /* 垂直居中 */
    gap: 15px; /* 元素间距 */
    margin-top: 12px;
}

/* 颜色选择框容器 */
.color-control {
    display: flex;
    align-items: center;
}
/* 连线颜色选择器样式 */
.input-wrapper.color-input {
    padding-right: 0;
}

.color-input input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 图例中的连线项 */
#connectionLegend {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }

    .control-panel {
        width: 100%;
        min-width: auto;
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
/* ========================================
   多页面导航样式
   ======================================== */
.page-navigation {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    position: relative;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

.nav-btn:hover {
    background: var(--color-primary);
    color: var(--color-bg-dark);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--color-primary);
    color: var(--color-bg-dark);
    border-color: var(--color-primary);
}

.nav-btn .badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--color-warning);
    color: var(--color-bg-dark);
    border-radius: 4px;
    margin-left: 5px;
}

/* 页面容器 */
.page-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg-dark);
    z-index: 1000;
    display: none;
}

.page-container.active {
    display: block;
}

.page-content {
    display: none;
    height: 100%;
}

.page-content.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 占位页面样式 */
.page-placeholder {
    text-align: center;
    padding: 40px;
    max-width: 600px;
}

.placeholder-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.page-placeholder h2 {
    font-size: 32px;
    color: var(--color-text);
    margin-bottom: 10px;
}

.page-placeholder p {
    color: var(--color-text-dim);
    margin-bottom: 30px;
}

.placeholder-status {
    margin-bottom: 30px;
}

.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.status-badge.developing {
    background: var(--color-warning);
    color: var(--color-bg-dark);
}

.placeholder-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    text-align: left;
}

.feature-item {
    padding: 15px;
    background: var(--color-bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-size: 14px;
}

/* 固定顶部导航栏 */
.page-navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(17, 24, 32, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

.nav-btn:hover {
    background: var(--color-primary);
    color: var(--color-bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.nav-btn.active {
    background: var(--color-primary);
    color: var(--color-bg-dark);
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

.nav-btn .badge {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--color-warning);
    color: var(--color-bg-dark);
    border-radius: 4px;
    margin-left: 5px;
    font-weight: 600;
}

/* 调整主容器上边距，避免被导航栏遮挡 */
.app-container {
    margin-top: 70px;
}

/* ========================================
   页脚样式
   ======================================== */
.site-footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    border-color: var(--color-primary);
    padding: 30px 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* 广告位 */
.ad-space {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: var(--color-bg-tertiary);
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--color-text-dim);
    font-size: 14px;
}

.ad-label {
    font-weight: 600;
}

.ad-size {
    font-size: 12px;
    opacity: 0.7;
}

/* 版权信息 */
.footer-info {
    text-align: center;
}

.copyright {
    color: var(--color-text);
    font-size: 14px;
    margin-bottom: 10px;
}

.icp {
    color: var(--color-text-dim);
    font-size: 13px;
    margin-bottom: 10px;
}

.icp a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.icp a:hover {
    color: var(--color-secondary);
}

.footer-links {
    color: var(--color-text-dim);
    font-size: 13px;
}

.footer-link {
    color: var(--color-text-dim);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: var(--color-primary);
}

.footer-divider {
    margin: 0 10px;
    color: var(--color-border);
}

/* 访问统计 */
.site-stats {
    display: flex;
    gap: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    width: 100%;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-dim);
    font-size: 13px;
}

.stat-item svg {
    width: 18px;
    height: 18px;
}

.stat-value {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 14px;
}

/* 浅色主题 - 无网格背景 */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #0891b2;
    --accent-dim: #0e7490;
    --accent-glow: rgba(8, 145, 178, 0.1);
    --warning: #d97706;
    --error: #dc2626;
    --info: #2563eb;
}

/* 移除网格背景 */
.grid-bg, .bg-decoration {
    display: none !important;
}

/* 浅色主题下控制面板样式优化 */
[data-theme="light"] .control-panel {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
}

[data-theme="light"] .form-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="light"] .form-section-title {
    color: var(--text-primary);
    border-bottom-color: var(--border);
}

[data-theme="light"] .form-label {
    color: var(--text-secondary);
}

[data-theme="light"] .form-select,
[data-theme="light"] .form-input {
    background: var(--bg-primary);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

[data-theme="light"] .checkbox-item {
    color: var(--text-primary);
}

[data-theme="light"] .checkbox-custom {
    border-color: var(--border);
    background: var(--bg-primary);
}

[data-theme="light"] .checkbox-input:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

[data-theme="light"] .btn {
    background: var(--accent);
    color: #ffffff;
}

[data-theme="light"] .btn:hover {
    background: var(--accent-dim);
}

[data-theme="light"] .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="light"] .properties-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

[data-theme="light"] .property-item {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="light"] .property-label {
    color: var(--text-secondary);
}

[data-theme="light"] .property-value {
    color: var(--accent);
}

[data-theme="light"] .chart-title {
    color: var(--text-primary);
}

[data-theme="light"] .chart-subtitle {
    color: var(--text-secondary);
}

[data-theme="light"] .theme-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="light"] .site-footer {
    background: var(--bg-secondary);
    border-top-color: var(--border);
}

[data-theme="light"] .ad-space {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

[data-theme="light"] .copyright {
    color: var(--text-primary);
}

[data-theme="light"] .icp,
[data-theme="light"] .footer-links {
    color: var(--text-secondary);
}

/* ========================================
   浅色主题下导航栏样式修复
   ======================================== */
[data-theme="light"] .page-navigation {
    background: rgba(248, 250, 252, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .nav-btn {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

[data-theme="light"] .nav-btn:hover {
    background: #0891b2 !important;
    color: #ffffff !important;
}

[data-theme="light"] .nav-btn.active {
    background: #0891b2 !important;
    color: #ffffff !important;
    border-color: #0891b2 !important;
}

[data-theme="light"] .nav-btn .badge {
    background: #f59e0b !important;
    color: #ffffff !important;
}

/* ========================================
   新版页头样式（参考 psychrosim.com）
   ======================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(17, 24, 32, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1100;
    display: flex;
    align-items: center;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-weight: 600;
    font-size: 18px;
}

.logo svg {
    width: 28px;
    height: 28px;
}

.logo-text {
    white-space: nowrap;
}

.header-divider {
    width: 2px;
    height: 24px;
    background: var(--border);
}

.site-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 调整导航栏位置 */
.page-navigation {
    margin-top: 64px;
}

/* 主内容包装器 */
.main-content-wrapper {
    display: flex;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 64px - 100px);
}



.panel-header {
    display: none;
}

.panel-content {
    padding: 0;
}

/* 图表区域 */
.chart-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.chart-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.chart-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.chart-actions {
    display: flex;
    gap: 10px;
}

.chart-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.chart-action-btn:hover {
    background: var(--accent);
    color: var(--bg-dark);
    border-color: var(--accent);
}

.chart-action-btn.active {
    background: var(--accent);
    color: var(--bg-dark);
    border-color: var(--accent);
}

.chart-action-btn svg {
    width: 18px;
    height: 18px;
}

.chart-actions-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

.chart-container {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    min-height: 500px;
}

#phChart {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

/* 图例 */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-line {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* 物性参数面板 */
.properties-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.properties-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.properties-title svg {
    width: 20px;
    height: 20px;
}

/* 浅色主题页头 */
[data-theme="light"] .site-header {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .site-title {
    color: #1e293b;
}

[data-theme="light"] .logo {
    color: #0891b2;
}

[data-theme="light"] .header-divider {
    background: #e2e8f0;
}

/* ========================================
   修复布局问题
   ======================================== */

/* 页头高度调整 */
.site-header {
    height: 60px;
}

/* 导航栏样式调整 - 改为左对齐，节省空间 */
.page-navigation {
    margin-top: 60px;
    padding: 10px 20px;
    justify-content: flex-start;
    gap: 15px;
}

.nav-btn {
    padding: 8px 16px;
    font-size: 13px;
}

.nav-btn .badge {
    font-size: 10px;
    padding: 2px 6px;
}

/* 主内容区调整 */
.main-content-wrapper {
    margin-top: 0;
    padding: 15px 20px;
    gap: 15px;
}



/* 图表区最大化 */
.chart-section {
    min-width: 0;
    flex: 1;
}

.chart-header {
    padding: 0;
    margin-bottom: 10px;
}

.chart-container {
    padding: 15px;
    min-height: 550px;
}

#phChart {
    min-height: 550px;
}

/* 图表标题调整 */
.chart-title {
    font-size: 16px;
    margin-bottom: 3px;
}

.chart-subtitle {
    font-size: 12px;
}

/* 操作按钮调整 */
.chart-action-btn {
    width: 32px;
    height: 32px;
}

.chart-action-btn svg {
    width: 16px;
    height: 16px;
}

/* 图例调整 */
.chart-legend {
    padding: 12px 15px;
    gap: 15px;
}

.legend-item {
    font-size: 12px;
    gap: 6px;
}

/* 物性参数面板调整 */
.properties-panel {
    padding: 15px;
}

.properties-title {
    font-size: 14px;
    margin-bottom: 15px;
    padding-bottom: 12px;
}

/* 侧边栏表单调整 */
.form-section {
    margin-bottom: 15px;
}

.form-section-title {
    font-size: 13px;
    margin-bottom: 10px;
}

.form-label {
    font-size: 12px;
}

.form-input, .form-select {
    font-size: 13px;
    padding: 8px 10px;
}

.btn {
    padding: 10px 15px;
    font-size: 13px;
}

/* 浅色主题适配 */
[data-theme="light"] .site-header {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ========================================
   彻底修复布局问题
   ======================================== */

/* 主内容包装器 - 修复 flex 布局 */
.main-content-wrapper {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 侧边栏 - 固定宽度 */
.control-panel {
    width: 280px;
    flex-shrink: 0;
    flex-grow: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    height: fit-content;
}

/* 图表区 - 占据剩余空间 */
.chart-section {
    flex: 1;
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 图表容器 - 宽度 100% */
.chart-container {
    flex: 1;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    min-height: 550px;
    box-sizing: border-box;
}

/* ECharts 图表 - 强制宽度 100% */
#phChart {
    width: 100% !important;
    height: 700px !important;
    min-height: 550px;
}

/* 修复页头遮挡 */
body {
    padding-top: 60px;
}

/* 导航栏 */
.page-navigation {
    margin-top: 60px;
    padding: 10px 20px;
    justify-content: flex-start;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

/* 确保所有子元素不超出容器 */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* ========================================
   修复顶部对齐问题
   ======================================== */

/* 确保侧边栏和图表区顶部对齐 */
.main-content-wrapper {
    align-items: flex-start;
    padding-top: 20px;
}

/* 侧边栏顶部间距 */
.control-panel {
    margin-top: 15px;
    padding-top: 15px;
    margin-bottom:35px ;
}

/* 图表区顶部间距 */
.chart-section {
    margin-top: 0;
}

/* 图表标题顶部间距 */
.chart-header {
    margin-top: 0;
    padding-top: 0;
}

/* 表单区域顶部间距 */
.panel-content {
    padding-top: 0;
}

/* 第一个表单区域 */
.form-section:first-child {
    margin-top: 0;
}

/* ========================================
   页头导航样式
   ======================================== */

/* 页头高度增加，容纳导航 */
.site-header {
    height: 70px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* 导航菜单样式 */
.header-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    justify-content: center;
}

.header-nav .nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.header-nav .nav-btn svg {
    width: 18px;
    height: 18px;
}

.header-nav .nav-btn:hover {
    background: rgba(0, 212, 170, 0.1);
    color: var(--accent);
}

.header-nav .nav-btn.active {
    background: var(--accent);
    color: #ffffff;
}

/* 浅色主题导航 */
[data-theme="light"] .header-nav .nav-btn:hover {
    background: rgba(8, 145, 178, 0.1);
    color: #0891b2;
}

[data-theme="light"] .header-nav .nav-btn.active {
    background: #0891b2;
    color: #ffffff;
}

/* 调整主内容区 */
.main-content-wrapper {
    padding-top: 10px;
}

/* 移除旧导航栏样式 */
.page-navigation {
    display: none;
}

/* ========================================
   修复导航栏空白问题
   ======================================== */

/* 隐藏旧导航栏 */
.page-navigation {
    display: none !important;
}

/* 主内容区上移 */
.main-content-wrapper {
    margin-top: 0;
    padding-top: 10px;
}



/* 图表区上移 */
.chart-section {
    margin-top: 0;
}

/* 图表容器上移 */
.chart-container {
    margin-top: 0;
}

/* 图表标题上移 */
.chart-header {
    margin-top: 0;
    padding-top: 0;
}

/* 页头高度 */
.site-header {
    height: 70px;
}

/* body 顶部间距 */
body {
    padding-top: 70px;
}

/* ========================================
   强制移除所有空白
   ======================================== */

/* app-container 无间距 */
.app-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 主内容区无间距 */
.main-content-wrapper {
    margin-top: 0 !important;
    padding-top: 5px !important;
}



/* 图表区无间距 */
.chart-section {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 图表容器无间距 */
.chart-container {
    margin-top: 0 !important;
    padding-top: 10px !important;
}

/* 图表标题无间距 */
.chart-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 10px !important;
}

/* 确保页头紧贴顶部 */
.site-header {
    top: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* body 无额外间距 */
body {
    margin: 0 !important;
    padding-top: 70px !important;
}

/* ========================================
   减少底部空白
   ======================================== */

/* 主内容区最小高度调整 */
.main-content-wrapper {
    min-height: auto !important;
}

/* 图表区高度自适应 */
.chart-section {
    min-height: auto;
}

/* 图表容器高度固定 */
.chart-container {
    min-height: 500px !important;
    max-height: 800px !important;
}

/* 物性参数面板减少底部间距 */
.properties-panel {
    margin-bottom: 20px !important;
}

/* 页脚上移 */
.site-footer {
    margin-top: 0 !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

/* 广告位减少间距 */
.ad-space {
    margin-bottom: 15px !important;
}

/* 版权信息减少间距 */
.footer-info {
    margin-bottom: 10px !important;
}

/* 统计信息减少间距 */
.site-stats {
    margin-top: 10px !important;
    padding-top: 15px !important;
}

/* ========================================
   调整间距 - 更紧凑布局
   ======================================== */

/* 主内容区间隔减少 */
.main-content-wrapper {
    gap: 10px !important;
    padding: 10px 15px !important;
}



.chart-section {
    margin-left: 0 !important;
}

/* 图表区上部间隔减少 */
.chart-section {
    padding-top: 0 !important;
}

/* 图表标题间隔 */
.chart-header {
    margin-bottom: 8px !important;
    padding-bottom: 8px !important;
}

/* 图表容器上部间隔 */
.chart-container {
    padding: 10px !important;
    margin-top: 0 !important;
}

/* 图例间隔 */
.chart-legend {
    padding: 10px 15px !important;
    margin-top: 0 !important;
    gap: 12px !important;
}

/* 物性参数面板间隔 */
.properties-panel {
    padding: 15px !important;
    margin-top: 0 !important;
}

/* 侧边栏表单间隔 */
.form-section {
    margin-bottom: 12px !important;
}

.form-section-title {
    margin-bottom: 8px !important;
}

/* 表单组间隔 */
.form-group {
    margin-bottom: 10px !important;
}

/* 按钮组间隔 */
.btn-group {
    margin-top: 8px !important;
}

/* ========================================
   状态点列表与物性参数对齐
   ======================================== */

/* 状态点列表容器 */
#pointsList {
    min-height: 60px !important;
    max-height: 400px !important;
    height: auto !important;
    padding: 10px !important;
    padding-bottom: 40px !important;  /* 增加底部空间 */
    margin-bottom: 10px !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

/* "暂无状态点"提示 */
#pointsList .no-data {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 60px !important;
}

/* 状态点卡片 */
.point-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: auto !important;
    min-height: 55px !important;
    margin-bottom: 10px !important;
    padding: 12px 15px !important;
    box-sizing: border-box !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
}

/* 最后一个状态点卡片 */
.point-item:last-child {
    margin-bottom: 20px !important;  /* 最后一个卡片额外增加间距 */
}

/* 状态点信息 */
.point-info {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 !important;
    min-width: 0 !important;
}

/* 状态点标记 */
.point-marker {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
}

/* 状态点坐标 */
.point-coords {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
    min-width: 0 !important;
}


/* 物性参数面板调整 */
.properties-panel {
    margin-bottom: 0 !important;
}

/* 物性参数网格调整 */
.properties-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 12px !important;
}

/* 物性参数卡片调整 */
.property-item {
    padding: 12px !important;
    min-height: 80px !important;
}

/* ========================================
   物性参数布局优化
   ======================================== */

/* 恢复 8 个物性参数，上下各 4 个 */
.properties-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
}

/* 或者上下各 6 个（两行）
.properties-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 8px !important;
}
*/

/* 物性参数卡片 */
.property-item {
    padding: 10px !important;
    min-height: auto !important;
}

/* 隐藏新增的 4 个物性参数（恢复 8 个）*/
.property-item:nth-child(9),
.property-item:nth-child(10),
.property-item:nth-child(11),
.property-item:nth-child(12) {
    display: none;
}

/* ========================================
   12 个物性参数，4 列 3 行布局
   ======================================== */

/* 显示所有 12 个物性参数 */
.property-item:nth-child(9),
.property-item:nth-child(10),
.property-item:nth-child(11),
.property-item:nth-child(12) {
    display: block !important;
}

/* 物性参数网格：4 列 */
.properties-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: repeat(3, 1fr) !important;
    gap: 10px !important;
}

/* 物性参数卡片高度统一 */
.property-item {
    min-height: 70px !important;
    padding: 12px !important;
}





/* 物性参数面板底部 margin */
.properties-panel {
    margin-bottom: 10px !important;
}

/* ========================================
   强制底部对齐 - flexbox 布局
   ======================================== */

/* 主内容区使用 flexbox，底部对齐 */
.main-content-wrapper {
    display: flex !important;
    align-items: stretch !important;
}

/* 侧边栏和图表区高度一致 */
.control-panel,
.chart-section {
    height: auto !important;
    min-height: auto !important;
}

/* 状态点列表容器 */
.form-section:last-child {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}



/* 物性参数面板 */
.properties-panel {
    display: flex !important;
    flex-direction: column !important;
}

/* 物性参数标题 */
.properties-title {
    flex-shrink: 0 !important;
    margin-bottom: 15px !important;
}



/* 物性参数卡片统一高度 */
.property-item {
    min-height: 65px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}




/* ========================================
   状态点列表和物性参数对齐修复
   ======================================== */

/* 物性参数网格 - 确保 4 列 3 行 */
#propertiesGrid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: repeat(3, minmax(70px, 1fr)) !important;
    gap: 10px !important;
}

/* 物性参数卡片 */
.property-item {
    min-height: 70px !important;
    padding: 12px !important;
}



/* 物性参数面板底部 */
.properties-panel {
    margin-bottom: 0 !important;
    padding-bottom: 10px !important;
}

/* ========================================
   物性参数换行修复 - 确保所有参数标签和值换行
   ======================================== */

/* 所有物性参数卡片 */
.property-item {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 4px !important;
}

/* 标签独占一行 */
.property-label {
    display: block !important;
    width: 100% !important;
    margin-bottom: 4px !important;
}

/* 值独占一行 */
.property-value {
    display: block !important;
    width: 100% !important;
}

/* 单位 inline */
.property-unit {
    display: inline-block !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    color: var(--text-secondary) !important;
    margin-left: 4px !important;
}


/* ========================================
   页头分隔符 - 增强对比度（最终版）
   ======================================== */

.header-divider {
    width: 2px !important;  /* 增加宽度 */
    height: 30px !important;  /* 增加高度 */
    background: linear-gradient(180deg, 
        rgba(0, 212, 170, 0.3) 0%, 
        rgba(0, 212, 170, 0.8) 50%, 
        rgba(0, 212, 170, 0.3) 100%) !important;  /* 渐变效果 */
    margin: 0 15px !important;  /* 增加左右间距 */
    border-radius: 2px !important;  /* 圆角 */
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.5) !important;  /* 发光效果 */
}

/* 浅色主题下的分隔符 */
[data-theme="light"] .header-divider {
    background: linear-gradient(180deg, 
        rgba(8, 145, 178, 0.3) 0%, 
        rgba(8, 145, 178, 0.8) 50%, 
        rgba(8, 145, 178, 0.3) 100%) !important;
    box-shadow: 0 0 10px rgba(8, 145, 178, 0.5) !important;
}
