/* ========== VPS 剩余价值计算器 · 最终加固版 ==========
   修复：弹窗隐藏、下拉层级、初始状态、全部兼容
*/

/* ========== 全局变量 ========== */
:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: #eff6ff;
    --brand-light: #dbeafe;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --line: #e2e8f0;
    --line-soft: #f1f5f9;
    --bg: #f8fafc;
    --card: #ffffff;
    --warn: #f97316;
    --good: #059669;
    --danger: #dc2626;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px 0 rgba(15, 23, 42, .05), 0 1px 3px 0 rgba(15, 23, 42, .06);
    --shadow-lg: 0 10px 25px -5px rgba(37, 99, 235, .12);
    --shadow-dropdown: 0 8px 24px -4px rgba(15, 23, 42, .15);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    padding: 16px 16px 40px;
    background: var(--bg);
    color: var(--ink);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-dark); text-decoration: none; }
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; }

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

/* ========== 顶部 ========== */
.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .3);
    flex: none;
}
.brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ink);
    line-height: 1.2;
}
.brand .tagline {
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
}
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 15px;
    font-weight: 700;
    color: var(--muted);
}
.stats .today { color: var(--brand-dark); }
.stats .total { color: var(--warn); }
.stats i { width: 16px; text-align: center; }

/* ========== 布局 ========== */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 16px;
    align-items: start;
}
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.card {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    transition: box-shadow .2s ease, border-color .2s ease;
    position: relative;
    z-index: 1;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.section-label {
    margin: 0 0 12px;
    font-size: 13px;
    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: 13.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 6px;
    line-height: 20px;
    min-height: 20px;
}
.field-label.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.field-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    line-height: 1.3;
    background: #f8fafc;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    outline: none;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.field-input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.core-input {
    font-size: 22px;
    font-weight: 800;
    height: 54px;
    padding: 0 14px;
    border-width: 2px;
    border-color: var(--brand-light);
    background: #fff;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-renew { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; margin-bottom: 14px; }

.grid-cycle { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cycle-btn {
    border: 1.5px solid var(--line);
    background: #fff;
    color: var(--faint);
    font-weight: 800;
    font-size: 15px;
    border-radius: var(--radius-sm);
    padding: 8px 0;
    cursor: pointer;
    width: 100%;
    transition: all .15s ease;
}
.cycle-btn:hover { 
    border-color: var(--brand-light); 
    color: var(--brand-dark);
    background: var(--brand-soft);
}
.cycle-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
}

.mini-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    height: 20px;
    color: var(--muted);
    transition: color .15s ease;
}
.mini-toggle:hover { color: var(--brand-dark); }
.mini-toggle input { accent-color: var(--brand); width: 14px; height: 14px; margin: 0; }

.custom-rate {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid var(--line);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
}
.custom-rate span { font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.custom-rate .field-input { height: 34px; padding: 0 10px; font-size: 15px; background: #fff; }

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--faint);
    cursor: pointer;
    transition: color .15s ease;
}
.link-btn:hover, .link-btn.on { color: var(--brand-dark); }

.settle-box {
    background: var(--brand-soft);
    border: 1px solid var(--brand-light);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 14px;
}
.settle-label { font-size: 14px; font-weight: 800; color: var(--brand-dark); margin-bottom: 6px; }
.bind-hint { font-size: 13px; font-weight: 700; color: var(--brand-dark); margin-top: 8px; }

.push-row {
    background: #f8fafc;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.push-row .push-title { font-size: 15px; font-weight: 700; color: var(--muted); }
.push-row .push-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.push-row .push-fee { width: 84px; height: 40px; padding: 0 10px; background: #fff; }

/* ========== 下拉（最高层级+防冒泡） ========== */
.csel-wrap { 
    position: relative; 
    display: inline-block;
    z-index: 999;
}
.csel-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 44px;
    padding: 0 12px;
    background: #f8fafc;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    /* 注意：width:100% 只给 .csel-block 用，行内下拉（Push 区/中介费）用自适应宽度，
       否则 flex 子项会被撑满整行导致错位 */
}
.csel-btn:hover { border-color: var(--brand-light); background: #fff; }
.csel-btn i { font-size: 12px; color: var(--faint); transition: transform .2s ease; }

.csel-dropdown {
    position: absolute;
    z-index: 9999;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-dropdown);
    padding: 4px;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    animation: dropdown-in .18s ease-out;
}
.csel-dropdown.open { display: block; }

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.csel-option {
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    /* 修复（2026-10-15）：选项文字强制不换行。"AA平摊中介"比按钮宽，
       面板又是 min-width:100% 与按钮等宽，不加这行会被挤成两行错位；
       不换行后面板会自动撑宽到容下最长选项 */
    white-space: nowrap;
    transition: background .12s ease, color .12s ease;
}
.csel-option:hover { background: var(--brand-soft); color: var(--brand-dark); }
.csel-option.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }

.csel-wrap.csel-block { display: block; width: 100%; }
.csel-wrap.csel-block .csel-btn { width: 100%; height: 44px; }
.csel-wrap.csel-block .csel-dropdown { left: 0; right: 0; }

.menu-wrap { position: relative; flex: 1 1 auto; min-width: 0; z-index: 999; }
.menu-wrap > .btn { width: 100%; }
.menu-wrap .caret { font-size: 12px; opacity: .8; margin-left: 2px; }
.menu-dropdown { left: 0; right: auto; min-width: 180px; }
.menu-dropdown .csel-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.menu-dropdown .csel-option i { width: 16px; text-align: center; color: var(--faint); font-size: 15px; }
.menu-dropdown .csel-option:hover i { color: var(--brand-dark); }

/* ========== 日期 ========== */
input[type="date"],
input[type="datetime-local"] {
    height: 44px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--ink) !important;
    padding: 0 12px !important;
    background: #f8fafc !important;
    border: 1.5px solid var(--line) !important;
    border-radius: var(--radius-sm) !important;
    width: 100%;
    box-sizing: border-box;
}
input[type="date"]:focus,
input[type="datetime-local"]:focus {
    border-color: var(--brand) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12) !important;
    outline: none !important;
}

.date-field { position: relative; }
.date-field .fa-calendar-days {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--faint);
    pointer-events: none;
    font-size: 15px;
    z-index: 3;
}

.flatpickr-calendar {
    font-family: inherit !important;
    border-radius: var(--radius) !important;
    border: 1px solid var(--line-soft) !important;
    box-shadow: var(--shadow-dropdown) !important;
    font-size: 15px !important;
    z-index: 10000 !important;
}
.flatpickr-day.today {
    background: var(--brand) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-color: var(--brand) !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .3) !important;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--brand) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-color: var(--brand) !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .3) !important;
}

/* ========== 结果面板 ========== */
.result-panel {
    position: sticky;
    top: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    border: 1px solid #dbeafe;
    border-top: 4px solid var(--brand);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 20px 18px 18px;
    color: var(--ink);
    z-index: 2;
}
.result-hero { text-align: center; margin-bottom: 16px; }
.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: 48px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink);
    word-break: break-all;
}

.premium-box {
    text-align: center;
    margin-bottom: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}
.premium-box .premium-title { margin: 0 0 4px; font-size: 14px; font-weight: 800; }
.premium-box .premium-value { font-size: 28px; font-weight: 800; line-height: 1.15; }
.is-premium { color: var(--warn); }
.is-discount { color: var(--good); }

.result-rows { border-top: 1px solid #e2e8f0; padding-top: 6px; }
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}
.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: 16px; 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: 16px; }
.progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.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: #e2e8f0; border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar {
    background: linear-gradient(90deg, var(--brand), #60a5fa);
    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: 4px; }

.ratio-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e2e8f0; }
.ratio-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}
.ratio-track { height: 10px; background: #e2e8f0; border-radius: 99px; overflow: hidden; display: flex; }
.ratio-track > div { height: 100%; transition: width .5s ease; }
.bar-value { background: var(--brand); }
.bar-premium { background: var(--warn); }
.ratio-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.ratio-legend span.dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; margin-right: 6px; }
.dot-value { background: var(--brand); }
.dot-premium { background: var(--warn); }

.settle-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid #e2e8f0; }
.settle-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.check-label { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--muted); }
.check-label input { accent-color: var(--brand); width: 16px; height: 16px; }
.check-label:hover { color: var(--ink-2); }
.settle-head .csel-btn { height: 36px; padding: 0 10px; font-size: 14px; font-weight: 700; color: var(--ink-2); }

.final-box {
    border-radius: var(--radius-sm);
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all .3s ease;
}
.final-box.active { 
    background: rgba(37, 99, 235, .06); 
    border-color: rgba(37, 99, 235, .3); 
}
.final-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; 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: 28px; font-weight: 800; color: var(--ink); line-height: 1.15; }
.final-box.active .final-label,
.final-box.active .final-extra,
.final-box.active .final-value { color: var(--brand-dark); }

.actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.btn {
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: all .15s ease;
    padding: 11px 16px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }

.btn-primary { 
    background: var(--brand); 
    color: #fff; 
    box-shadow: 0 4px 12px rgba(37, 99, 235, .3); 
}
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }

.btn-ghost { background: #f1f5f9; color: var(--ink-2); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-icon { padding: 11px 14px; }
.btn-sm { padding: 8px 12px; font-size: 14px; border-radius: 8px; }
.actions .btn-share { flex: 1 1 auto; }

/* ========== 汇率面板 ========== */
.rate-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rate-title { margin: 0; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rate-title i { color: var(--brand); margin-right: 5px; }
.rate-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--brand-soft);
    color: var(--brand-dark);
}
.badge.warn { background: #fff7ed; color: #c2410c; }
.rate-source { font-size: 13px; font-weight: 700; color: var(--faint); }
.rate-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rate-cell {
    text-align: center;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-soft);
    background: #f8fafc;
    transition: all .15s ease;
}
.rate-cell:hover { border-color: var(--brand-light); background: #fff; }
.rate-cell .code { font-size: 13px; font-weight: 800; letter-spacing: .07em; color: var(--faint); }
.rate-cell .value { font-size: 17px; font-weight: 800; color: var(--ink-2); margin-top: 2px; }
.rate-cell.is-base { border-color: var(--brand-light); background: var(--brand-soft); }
.rate-cell.is-base .code { color: var(--brand-dark); }

/* ========== 分享弹窗（强制默认隐藏） ========== */
#shareModal.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#shareModal.modal.open {
    display: flex !important;
}
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, .6);
    backdrop-filter: blur(4px);
}
.modal-box {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .35);
    padding: 20px;
    animation: modal-in .25s cubic-bezier(.4, 0, .2, 1);
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.modal-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
}
.modal-head h2 i { color: var(--brand); margin-right: 6px; }
.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 0;
    background: #f1f5f9;
    color: var(--ink-2);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}
.modal-close:hover { background: #e2e8f0; color: var(--danger); }

.share-preview {
    display: block;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    margin-bottom: 16px;
    line-height: 0;
}
.share-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.share-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.share-key {
    flex: none;
    width: 90px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.share-key i { color: var(--faint); }
.share-input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-2);
    background: #f8fafc;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    outline: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.share-input:focus {
    border-color: var(--brand);
    background: #fff;
}
.share-note {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
    line-height: 1.5;
}

/* ========== 说明区 ========== */
.prose { margin-top: 18px; }
.prose h2 { font-size: 21px; font-weight: 800; margin: 0 0 12px; color: var(--ink); }
.prose h3 { font-size: 17.5px; font-weight: 800; margin: 18px 0 6px; color: var(--ink-2); }
.prose h4 { font-size: 16px; font-weight: 800; margin: 14px 0 4px; color: var(--ink-2); }
.prose p, .prose li { font-size: 16px; color: var(--ink-2); line-height: 1.6; }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose code { background: #f1f5f9; padding: 2px 6px; border-radius: 5px; font-size: 14.5px; }
.formula {
    background: #f8fafc;
    border-left: 4px solid var(--brand);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink-2);
    margin: 0 0 14px;
}

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

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: none;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 99px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .3);
    pointer-events: none;
    max-width: calc(100vw - 40px);
}
.toast i { color: #4ade80; }
.toast.error i { color: #fca5a5; }
.toast.show { display: flex; animation: toast-in .25s ease forwards; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.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: 12px 12px 32px; }
    .card { padding: 14px; }
    .result-panel { padding: 16px 14px; }
    .result-hero .hero-value { font-size: 40px; }
    .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: 24px; }
    .push-row .push-controls { margin-left: 0; width: 100%; }
    .push-row .push-fee { flex: 1; width: auto; }
    .share-row { flex-wrap: wrap; }
    .share-key { width: 100%; }
    .share-input { flex: 1 1 0; }
}

/* ===== 修复（2026-10-14）：下拉面板被下方卡片遮挡 =====
 * 根因：.card 自带 position:relative + z-index:1，每个卡片都是独立的层叠上下文；
 * 下拉面板的 z-index:9999 被锁死在自己卡片内部，面板伸出卡片下沿的部分，
 * 会被后面同级的卡片（z-index 同为 1，但 DOM 顺序在后）盖住，导致显示不全。
 * 修复：当卡片内有下拉面板处于打开状态时，把整张卡片抬到上层（z-index:20），
 * 高于其他卡片（z-index:1）与右侧 sticky 结果面板（z-index:2）。
 * 一条规则覆盖所有下拉：计价币种 / Push 币种 / Push 承担方 / 中介费承担方 / 复制菜单。
 * 关闭下拉后（.open 移除），卡片 z-index 自动恢复为 1，无副作用。
 */
.card:has(.csel-dropdown.open) {
    z-index: 20;
}

/* ========== 重置按钮配色（对标 vps.ss：浅红底 + 红色图标，截图实测 #FDECEC / #EF4444） ========== */
#resetBtn {
    background: #fdecec;
    color: #ef4444;
}
#resetBtn:hover {
    background: #fbdcdc;
    color: #dc2626;
}

/* ===== 修复（2026-10-14）：Push 区币种/承担方下拉错位 =====
 * 根因：.csel-btn 基样式曾带 width:100%（现已移入 .csel-block 专用），
 * Push 区两个下拉是 .push-controls 行内 flex 子项，需自适应宽度、
 * 与输入框同高（40px）并禁止 flex 伸缩，保证三者在同一行对齐；
 * 中介费承担方（.settle-head 内）同理。
 * 下拉面板保持 right:0 右对齐，不会溢出卡片。
 */
.push-controls .csel-wrap,
.settle-head .csel-wrap { flex: 0 0 auto; }
.push-controls .csel-btn { width: auto; height: 40px; }
.settle-head .csel-btn { width: auto; }

/* ===== 修复（2026-10-14）：Push 区/中介费下拉面板错位 =====
 * 根因：行内下拉面板用 right:0 右对齐，但面板 min-width:160px 远宽于按钮
 * （Push 币种按钮约 126px），面板向左多伸出一大截，视觉上与按钮脱节；
 * 移动端窄屏时甚至溢出屏幕左边缘（用户截图实测）。
 * 修复：行内场景面板改左对齐、min-width:100% 与按钮等宽，面板正好落在按钮正下方；
 * 块级币种选择（.csel-block）保持 left:0/right:0 全宽，不受影响。
 */
.push-controls .csel-dropdown,
.settle-head .csel-dropdown {
    left: 0;
    right: auto;
    min-width: 100%;
}

/* ===== 优化（2026-10-15）：顶部品牌区可点击返回首页 =====
 * 把 logo + 标题包成指向 "/" 的链接；样式上保持与原来完全一致
 * （覆盖全局 a 标签的蓝色，不加下划线），hover 时也不变色。
 */
.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}
.brand-link:hover {
    text-decoration: none;
    color: inherit;
}
