/* ========================================
   GSlab 地源热泵计算系统 - 科技感样式
   ======================================== */

/* CSS 变量定义 */
:root {
    /* 主题色 */
    --primary-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    --accent-cyan: #00d4ff;
    --accent-purple: #7c3aed;
    --accent-blue: #3b82f6;

    /* 背景色 */
    --bg-dark: #0a0e17;
    --bg-card: rgba(15, 23, 42, 0.7);
    --bg-card-hover: rgba(20, 30, 50, 0.8);
    --bg-input: rgba(30, 41, 59, 0.6);

    /* 边框色 */
    --border-glow: rgba(0, 212, 255, 0.3);
    --border-subtle: rgba(100, 116, 139, 0.3);

    /* 文字色 */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #00d4ff;

    /* 尺寸 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* 阴影 */
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);

    /* 字体 */
    --font-main: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* 基础重置 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* 背景动态效果 */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.3) 0%, transparent 70%);
    top: -150px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.3) 0%, transparent 70%);
    top: 50%;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
    bottom: -100px;
    left: 30%;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(20px, 30px) scale(1.02);
    }
}

/* 主容器 */
.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glow);
    box-shadow: var(--shadow-glow);
    margin-bottom: 20px;
    backdrop-filter: blur(20px);
}

/* 顶部 Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glow);
    box-shadow: var(--shadow-glow);
    margin-bottom: 20px;
    backdrop-filter: blur(20px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-icon {
    width: 48px;
    height: 48px;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(0, 212, 255, 0.8));
    }
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title-group h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.header-title-group .header-separator {
    color: var(--text-muted);
    font-size: 1.2rem;
    opacity: 0.5;
}

.header-title-group .subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.header-center .slogan {
    font-size: 1.15rem;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
    opacity: 0.9;
    font-style: italic;
    white-space: nowrap;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 主内容区 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
}

/* 卡片通用样式 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(124, 58, 237, 0.05) 100%);
    border-bottom: 1px solid var(--border-subtle);
}

.card-icon {
    font-size: 1rem;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 16px;
}

/* 输入区域 */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 36px;
}

.input-row label {
    flex: 0 0 180px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.param-symbol {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-accent);
    min-width: 50px;
    text-align: right;
}

input[type="number"] {
    width: 90px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-align: right;
    transition: all 0.2s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15), inset 0 0 10px rgba(0, 212, 255, 0.05);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

/* 只读输入框样式 */
input[type="number"].readonly {
    background: rgba(20, 30, 45, 0.5);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

input[type="number"].readonly:focus {
    border-color: var(--border-subtle);
    box-shadow: none;
}

/* 禁用的单选按钮组 */
.radio-group.disabled {
    opacity: 0.7;
}

.radio-group.disabled .radio-label {
    cursor: not-allowed;
}

.unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 65px;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 20px;
    flex: 1;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.radio-label:hover {
    color: var(--text-primary);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-subtle);
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}

.radio-label input[type="radio"]:checked+.radio-custom {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.radio-label input[type="radio"]:checked+.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
}

/* 钻孔排列输入 */
.array-input {
    gap: 6px;
}

.array-input input {
    width: 60px;
    text-align: center;
}

.array-separator {
    color: var(--text-muted);
    font-size: 1rem;
}

/* 计算区域 */
.calculation-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 计算方法选项卡 */
.method-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.method-tab {
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.method-tab:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--border-glow);
}

.method-tab.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

/* 运行参数网格 */
.operation-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 按钮组 */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--border-glow);
    color: var(--text-primary);
}

/* 负荷输入按钮 */
.btn-load {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(59, 130, 246, 0.15) 100%);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-load:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(59, 130, 246, 0.25) 100%);
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

/* ASHRAE算法按钮 */
.btn-ashrae {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(239, 68, 68, 0.15) 100%);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.btn-ashrae:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(239, 68, 68, 0.25) 100%);
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

/* IGSHPA算法按钮 */
.btn-igshpa {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.15) 100%);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.btn-igshpa:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(236, 72, 153, 0.25) 100%);
    border-color: #a78bfa;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

/* 底部负荷输入按钮（绿色） */
.load-button-group {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.btn-load-bottom {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(34, 197, 94, 0.2) 100%);
    color: #10b981;
    border: 2px solid rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.btn-load-bottom:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(34, 197, 94, 0.35) 100%);
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(16, 185, 129, 0.4);
}

/* 负荷曲线卡片 */
.load-chart-card {
    border-color: rgba(16, 185, 129, 0.3);
}

.load-chart-card .card-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.08) 100%);
}

#load-chart {
    width: 100%;
    height: 180px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.load-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.load-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-unit {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-icon {
    font-size: 0.9rem;
}

/* 结果卡片 */
.result-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-detail {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px;
    overflow-y: auto;
    max-height: 200px;
    border: 1px solid var(--border-subtle);
}

.result-detail pre {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

.result-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(124, 58, 237, 0.08) 100%);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glow);
}

.result-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    min-width: 120px;
    text-align: right;
}

.cooling .result-value {
    color: #3b82f6;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.heating .result-value {
    color: #ef4444;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.result-unit {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 底部 */
.footer {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 20px;
}

.footer-divider {
    margin: 0 8px;
    opacity: 0.5;
}

.copyright {
    color: var(--accent-cyan);
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 1100px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .input-row label {
        flex: 0 0 160px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 13px;
    }

    .container {
        padding: 12px;
    }

    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .input-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .input-row label {
        flex: none;
        text-align: left;
    }

    .input-group {
        width: 100%;
    }

    input[type="number"] {
        flex: 1;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}

/* 加载动画 */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.loading {
    background: linear-gradient(90deg,
            rgba(0, 212, 255, 0.1) 0%,
            rgba(0, 212, 255, 0.3) 50%,
            rgba(0, 212, 255, 0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}