/* VPS 剩余价值计算器 · vps.ss
   1) 字号整体放大  2) 右侧剩余价值面板改为浅色主题 */

:root {
    --brand: #00bfa5;
    --brand-dark: #009e88;
    --brand-soft: #e6faf6;
    --ink: #16233b;
    --ink-2: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --line: #e2e8f0;
    --line-soft: #eef2f7;
    --bg: #eef2f7;
    --card: #ffffff;
    --warn: #d97706;
    --good: #16a34a;
    --danger: #ef4444;
    --radius: 18px;
    --shadow: 0 2px 10px rgba(15, 35, 60, .05);
    --shadow-lg: 0 12px 40px rgba(15, 35, 60, .09);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 20px 16px 48px;
    background: var(--bg);
    color: var(--ink);
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); }

input, select, button, textarea { font-family: inherit; }

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input[type="number"] { -moz-appearance: textfield; }

input[type="date"], input[type="datetime-local"] {
    padding-left: 12px;
    padding-right: 6px;
    min-width: 0;
}

input::-webkit-calendar-picker-indicator {
    margin-left: 0;
    padding: 0;
    width: 18px;
    cursor: pointer;
}

.wrap { max-width: 1220px; margin: 0 auto; }

/* ---------- 顶部 ---------- */
.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 6px 18px rgba(0, 191, 165, .28);
    flex: none;
}

.brand h1 {
    margin: 0;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ink);
}

.brand .tagline {
    margin: 2px 0 0;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--faint);
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
}

.stats .today { color: var(--brand-dark); }
.stats .total { color: #f59e0b; }
.stats i { width: 18px; text-align: center; }

/* ---------- 布局 ---------- */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 20px;
    align-items: start;
}

.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.card {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-label {
    margin: 0 0 14px;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
}

.card-head .section-label { margin-bottom: 0; }

/* ---------- 表单 ---------- */
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 7px;
}

.field-label.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.field-input {
    width: 100%;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.field-input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 191, 165, .12);
}

.core-input {
    font-size: 22px;
    font-weight: 800;
    padding: 14px 16px;
    border-width: 2px;
    border-color: #b7ecdf;
    background: #fff;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-renew { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; margin-bottom: 18px; }
.grid-cycle { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }

.cycle-btn {
    border: 1.5px solid var(--line);
    background: #fff;
    color: var(--faint);
    font-weight: 800;
    font-size: 15px;
    border-radius: 11px;
    padding: 11px 0;
    cursor: pointer;
    width: 100%;
    transition: all .15s;
}

.cycle-btn:hover { border-color: #bfe9e0; color: var(--brand-dark); }

.cycle-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 5px 16px rgba(0, 191, 165, .35);
}

.mini-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    color: var(--muted);
}

.mini-toggle input { accent-color: var(--brand); width: 15px; height: 15px; }

.custom-rate {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    background: #f8fafc;
    border: 1px solid var(--line);
    padding: 7px;
    border-radius: 12px;
}

.custom-rate span { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.custom-rate .field-input { padding: 7px 10px; font-size: 15px; background: #fff; }

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--faint);
    cursor: pointer;
    transition: color .15s;
}

.link-btn:hover, .link-btn.on { color: var(--brand-dark); }

.settle-box {
    background: var(--brand-soft);
    border: 1px solid #c7f0e7;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.settle-label { font-size: 13px; font-weight: 800; color: #0f8a78; margin-bottom: 7px; }

.bind-hint { font-size: 12.5px; font-weight: 700; color: #0f8a78; margin-top: 11px; }

.push-row {
    background: #f8fafc;
    border: 1px solid var(--line-soft);
    border-radius: 13px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.push-row .push-title { font-size: 14px; font-weight: 700; color: var(--muted); }
.push-row .push-controls { display: flex; align-items: center; gap: 9px; margin-left: auto; flex-wrap: wrap; }
.push-row .push-fee { width: 92px; padding: 9px 11px; background: #fff; }

/* 统一下拉样式：所有下拉选项均使用自定义 csel-wrap，不使用系统原生 select 样式 */
.csel-wrap { position: relative; display: inline-block; }

.csel-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 9px 12px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.csel-btn:hover { border-color: #bfe9e0; }
.csel-btn:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 191, 165, .12); }

.csel-btn i { font-size: 10px; color: var(--faint); }

/* 计价币种：占满宽度，视觉上与其他 field-input 一致 */
.csel-wrap.csel-block { display: block; width: 100%; }

.csel-wrap.csel-block .csel-btn {
    width: 100%;
    justify-content: space-between;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
}

.csel-wrap.csel-block .csel-dropdown { left: 0; right: 0; }

.csel-dropdown {
    position: absolute;
    z-index: 60;
    top: calc(100% + 5px);
    right: 0;
    background: #fff;
    border: 1.5px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    min-width: 132px;
    padding: 5px;
    display: none;
    max-height: 260px;
    overflow-y: auto;
}

.csel-dropdown.open { display: block; }

.csel-option {
    padding: 9px 13px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
}

.csel-option:hover { background: var(--brand-soft); color: var(--brand-dark); }
.csel-option.active { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- 右侧结果面板（浅色主题） ---------- */
.result-panel {
    position: sticky;
    top: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f3faf8 100%);
    border: 1px solid #dceee9;
    border-bottom: 4px solid var(--brand);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 26px 24px;
    color: var(--ink);
}

.result-hero { text-align: center; margin-bottom: 22px; }

.result-hero .hero-label {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--brand-dark);
}

.result-hero .hero-value {
    font-size: 52px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink);
    word-break: break-all;
}

.premium-box {
    text-align: center;
    margin-bottom: 22px;
    padding-top: 16px;
    border-top: 1px solid #e4eeeb;
}

.premium-box .premium-title { margin: 0 0 3px; font-size: 13px; font-weight: 800; }
.premium-box .premium-value { font-size: 30px; font-weight: 800; }
.is-premium { color: var(--warn); }
.is-discount { color: var(--good); }

.result-rows { border-top: 1px solid #e4eeeb; padding-top: 8px; }

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #edf3f1;
}

.result-row:last-child { border-bottom: 0; }

.result-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.result-value { font-size: 17px; font-weight: 800; color: var(--ink-2); text-align: right; }
.result-row.accent .result-label, .result-row.accent .result-value { color: var(--brand-dark); }
.result-value.soft { color: var(--faint); }

.progress-block { margin-top: 24px; }

.progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.progress-head .p-title { color: var(--muted); }
.progress-head .p-days { color: var(--brand-dark); font-size: 18px; font-weight: 800; }
.progress-head .p-days.expired { color: var(--danger); }

.progress-track { background: #e3edea; border-radius: 99px; height: 8px; overflow: hidden; }

.progress-bar {
    background: linear-gradient(90deg, var(--brand), #4bd9c4);
    border-radius: 99px;
    height: 100%;
    width: 0;
    transition: width .8s cubic-bezier(.4, 0, .2, 1);
}

.progress-hint { text-align: right; font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 5px; }

.ratio-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e4eeeb; }

.ratio-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.ratio-track { height: 13px; background: #e3edea; border-radius: 99px; overflow: hidden; display: flex; }
.ratio-track > div { height: 100%; transition: width .5s ease; }
.bar-value { background: var(--brand); }
.bar-premium { background: #fbbf24; }

.ratio-legend { display: flex; gap: 18px; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.ratio-legend span.dot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; margin-right: 6px; }
.dot-value { background: var(--brand); }
.dot-premium { background: #fbbf24; }

.settle-block { margin-top: 24px; padding-top: 18px; border-top: 1px solid #e4eeeb; }

.settle-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }

.check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--muted); }
.check-label input { accent-color: var(--brand); width: 17px; height: 17px; }
.check-label:hover { color: var(--ink-2); }

.settle-head .csel-btn { padding: 7px 9px; font-size: 13px; font-weight: 700; color: var(--ink-2); }

.final-box {
    border-radius: 14px;
    padding: 16px;
    background: #f6f8fa;
    border: 1px solid #e6ecea;
    transition: background .3s, border-color .3s;
}

.final-box.active { background: rgba(0, 191, 165, .1); border-color: rgba(0, 191, 165, .35); }

.final-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.final-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.final-extra { font-size: 13px; font-weight: 700; color: var(--faint); }
.final-value { text-align: right; font-size: 30px; font-weight: 800; color: var(--ink); }
.final-box.active .final-label,
.final-box.active .final-extra,
.final-box.active .final-value { color: var(--brand-dark); }

.actions { display: flex; gap: 10px; margin-top: 24px; }

.btn {
    border: 0;
    border-radius: 13px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s;
    padding: 15px 18px;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary { flex: 1; background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(0, 191, 165, .3); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #eef2f7; color: var(--ink-2); }
.btn-danger { background: #fdecec; color: var(--danger); }

/* ---------- 汇率面板 ---------- */
.rate-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.rate-title { margin: 0; font-size: 14.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rate-title i { color: var(--brand); margin-right: 6px; }

.rate-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.badge {
    font-size: 12.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--brand-soft);
    color: #0f8a78;
}

.badge.warn { background: #fff7ed; color: #c2410c; }
.rate-source { font-size: 12.5px; font-weight: 700; color: var(--faint); }

.rate-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }

.rate-cell {
    text-align: center;
    padding: 11px 6px;
    border-radius: 13px;
    border: 1px solid var(--line-soft);
    background: #f8fafc;
}

.rate-cell .code { font-size: 12.5px; font-weight: 800; letter-spacing: .07em; color: var(--faint); }
.rate-cell .value { font-size: 17px; font-weight: 800; color: var(--ink-2); margin-top: 3px; }
.rate-cell.is-base { border-color: #c7f0e7; background: var(--brand-soft); }
.rate-cell.is-base .code { color: #0f8a78; }

/* ---------- SEO 说明区 ---------- */
.prose { margin-top: 26px; }
.prose h2 { font-size: 21px; font-weight: 800; margin: 0 0 12px; color: var(--ink); }
.prose h3 { font-size: 17px; font-weight: 800; margin: 20px 0 6px; color: var(--ink-2); }
.prose p, .prose li { font-size: 16px; color: var(--ink-2); }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose code { background: #f1f5f9; padding: 1px 6px; border-radius: 6px; font-size: 15px; }

.formula {
    background: #f8fafc;
    border-left: 4px solid var(--brand);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink-2);
    margin: 0 0 16px;
}

.site-footer {
    max-width: 1220px;
    margin: 28px auto 0;
    text-align: center;
    font-size: 14px;
    color: var(--faint);
    font-weight: 600;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    display: none;
    align-items: center;
    gap: 9px;
    background: #16233b;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 22px;
    border-radius: 99px;
    box-shadow: 0 14px 40px rgba(15, 35, 60, .3);
    pointer-events: none;
}

.toast i { color: #4bd9c4; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast.show { display: flex; animation: toast-in .25s ease forwards; }

.noscript-submit { margin-top: 16px; }
.hidden { display: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 1023px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
    .result-panel { position: static; }
    .col-result { order: -1; }
}

@media (max-width: 640px) {
    body { padding: 14px 12px 36px; }
    .card { padding: 17px; }
    .result-panel { padding: 20px 17px; }
    .result-hero .hero-value { font-size: 42px; }
    .grid-renew { grid-template-columns: 1fr; }
    .grid-cycle { grid-template-columns: repeat(3, 1fr); }
    .rate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .brand h1 { font-size: 20px; }
    .final-value { font-size: 26px; }
    .push-row .push-controls { margin-left: 0; width: 100%; }
    .push-row .push-fee { flex: 1; width: auto; }
}
