/* ====== 全局 ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


:root {
    --blue: #00479d;
    --cyan: #06B6D4;
    --cyan-light: #22D3EE;
    --green: #16A34A;
    --yellow: #F59E0B;
    --red: #DC2626;
    --bg: #F0F4FF;
    --surface: #fff;
    --border: #E2E8F0;
    --text: #1E293B;
    --muted: #64748B;
    --shadow: 0 4px 24px rgba(10, 36, 99, .10);
    --radius: 12px;
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ====== 顶部导航 ====== */
.calc-nav {
    background: #fff;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, .2);
}

.calc-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.calc-nav-logo {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #fff, var(--cyan-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.calc-nav-title {
    font-size: 14px;
    color: var(--text);
    padding-left: 16px;
    border-left: 1px solid var(--text);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--blue);
    font-size: 13px;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, .2);
    transition: all .2s;
}

.back-btn:hover {
    background: var(--blue);
    color: #fff;
}

/* ====== 主体布局 ====== */
.calc-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 20px;
}

.calc-grid {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 20px;
    align-items: start;
}

/* ====== 面板 ====== */
.panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    color: var(--blue);
}

/* ====== 输入分组 ====== */
.input-section {
    margin-bottom: 22px;
}

.fa-chevron-down {
    transition: all .3s;
    cursor: pointer;
}

.fa-chevron-down.active {
    transform: rotate(180deg);
}

.input-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--surface);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--blue);
    border-radius: 6px;
}

.title-box {
    gap: 7px;
    display: flex;
    align-items: center;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.input-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.input-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.input-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.input-group input,
.input-group select {
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 13.5px;
    font-family: inherit;
    transition: all .2s;
    background: #FAFBFF;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
    background: #fff;
}

.input-unit {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

/* ====== 状态栏 ====== */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #F8FAFC;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 12.5px;
    color: var(--muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
    display: inline-block;
    margin-right: 6px;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .4;
    }
}

/* ====== 结果区域（弹窗通过后显示） ====== */
#results-area {
    display: none;
}

#results-area.unlocked {
    display: block;
}

/* ====== 解锁提示 ====== */
.unlock-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
    text-align: center;
}

.unlock-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, .3);
}

.unlock-prompt h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.unlock-prompt p {
    color: var(--muted);
    font-size: 14px;
    max-width: 320px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.unlock-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 16px rgba(37, 99, 235, .35);
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, .45);
}

/* ====== 结果卡片 ====== */
.result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.result-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.result-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.result-card {
    padding: 16px 14px;
    border-radius: 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.result-card .rc-label {
    font-size: 11.5px;
    opacity: .85;
    margin-bottom: 6px;
}

.result-card .rc-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.result-card .rc-unit {
    font-size: 12px;
    margin-left: 3px;
    opacity: .8;
}

.rc-blue {
    background: var(--blue);
    color: #fff;
}

.rc-green {
    background: linear-gradient(135deg, #065F46, #16A34A);
    color: #fff;
}

.rc-pink {
    background: linear-gradient(135deg, #9D174D, #EC4899);
    color: #fff;
}

.rc-cyan {
    background: linear-gradient(135deg, #164E63, #0891B2);
    color: #fff;
}

.rc-orange {
    background: linear-gradient(135deg, #92400E, #F59E0B);
    color: #fff;
}

.rc-purple {
    background: linear-gradient(135deg, #4C1D95, #7C3AED);
    color: #fff;
}

/* ====== K0 审计链 ====== */
.k0-audit {
    background: #FFFBEB;
    border: 1px solid #FCD34D;
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
}

.k0-audit-title {
    font-weight: 700;
    color: #92400E;
    margin-bottom: 10px;
    font-size: 13px;
}

.k0-audit-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed #FCD34D;
    font-size: 12.5px;
}

.k0-audit-row:last-child {
    border-bottom: none;
}

.k0-audit-row span:last-child {
    font-weight: 600;
    color: var(--text);
}

/* ====== 设计验证 ====== */
.check-pass {
    background: #F0FDF4;
    color: #166534;
    padding: 8px 12px;
    border-radius: 7px;
    margin: 4px 0;
    font-size: 12.5px;
    border: 1px solid #BBF7D0;
}

.check-warn {
    background: #FFFBEB;
    color: #92400E;
    padding: 8px 12px;
    border-radius: 7px;
    margin: 4px 0;
    font-size: 12.5px;
    border: 1px solid #FDE68A;
}

.check-fail {
    background: #FEF2F2;
    color: #991B1B;
    padding: 8px 12px;
    border-radius: 7px;
    margin: 4px 0;
    font-size: 12.5px;
    border: 1px solid #FECACA;
}

/* ====== 图表 ====== */
.chart-section {
    margin-top: 20px;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.chart-box {
    background: #F8FAFC;
    border-radius: 10px;
    padding: 16px;
}

.chart-box-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin-bottom: 12px;
}

.chart-wrap {
    position: relative;
    height: 200px;
}

/* ====== 手机号门控弹窗 ====== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 36, 99, .65);
    z-index: 2000;
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
    animation: modalIn .35s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(37, 99, 235, .35);
}

.modal-box h3 {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.modal-box p {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    line-height: 1.7;
    margin-bottom: 28px;
}

.modal-form-group {
    margin-bottom: 16px;
}

.modal-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

.modal-input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all .2s;
}

.modal-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

.modal-input.error {
    border-color: var(--red);
}

.code-row {
    display: flex;
    gap: 10px;
}

.code-row .modal-input {
    flex: 1;
}

.send-code-btn {
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: var(--blue);
    color: #fff;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    min-width: 100px;
}

.send-code-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .4);
}

.send-code-btn:disabled {
    background: #94A3B8;
    cursor: not-allowed;
    transform: none;
}

.modal-submit-btn {
    width: 100%;
    padding: 13px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 16px rgba(37, 99, 235, .35);
    margin-top: 8px;
}

.modal-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, .45);
}

.modal-privacy {
    text-align: center;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.modal-privacy i {
    color: var(--green);
}

.modal-error {
    font-size: 12px;
    color: var(--red);
    margin-top: 4px;
    display: none;
}

/* ====== 计算成功提示 ====== */
.unlock-success {
    background: linear-gradient(135deg, #F0FDF4, #DCFCE7);
    border: 1px solid #BBF7D0;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.unlock-success i {
    color: var(--green);
    font-size: 20px;
}

.unlock-success span {
    font-size: 13.5px;
    color: #166534;
    font-weight: 600;
}

/* ====== 响应式 ====== */
@media (max-width: 1100px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .calc-wrap {
        padding: 16px 12px;
    }

    .input-grid-4 {
        grid-template-columns: 1fr 1fr;
    }

    .input-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .modal-box {
        padding: 28px 20px;
        margin: 16px;
    }

    .calc-nav-title {
        display: none;
    }
}