/* ==========================================================================
   黄金积存与定投收益计算器 · 靛蓝 + 金（deep ink hero / sticky result panel）
   ========================================================================== */

.gp-page {
    --gp-bg: #f2f5fa;
    --gp-card: #ffffff;
    --gp-card-2: #f7f9fc;
    --gp-ink: #0f1a2b;
    --gp-ink-2: #3d4c62;
    --gp-mut: #78869a;
    --gp-line: #e3e9f2;
    --gp-line-2: #cfd9e6;
    --gp-gold: #a97c22;
    --gp-gold-2: #8a6318;
    --gp-gold-soft: rgba(169, 124, 34, .12);
    --gp-blue: #1e3a5f;
    --gp-green: #0f7a58;
    --gp-red: #bf3b2e;
    --gp-shadow: 0 14px 34px -24px rgba(16, 26, 43, .45);
    --gp-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --gp-mono: ui-monospace, "SFMono-Regular", "Consolas", "Roboto Mono", monospace;

    background: var(--gp-bg);
    color: var(--gp-ink);
    font-family: var(--gp-sans);
    line-height: 1.7;
    padding-bottom: 56px;
}

:root[data-theme="dark"] .gp-page {
    --gp-bg: #0a1018;
    --gp-card: #111a26;
    --gp-card-2: #16212f;
    --gp-ink: #e8eef8;
    --gp-ink-2: #b6c3d6;
    --gp-mut: #8595aa;
    --gp-line: #1e2a3a;
    --gp-line-2: #2b3a4d;
    --gp-gold: #e0b562;
    --gp-gold-2: #f0c97e;
    --gp-gold-soft: rgba(224, 181, 98, .14);
    --gp-blue: #9dc0ea;
    --gp-green: #56c79b;
    --gp-red: #f0867c;
    --gp-shadow: 0 14px 34px -24px rgba(0, 0, 0, .9);
}

.gp-page * { box-sizing: border-box; }

.gp-wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Hero ---------- */
.gp-hero {
    position: relative;
    padding: 22px 0 38px;
    background:
        radial-gradient(90% 120% at 82% 0%, rgba(224, 181, 98, .18), transparent 58%),
        linear-gradient(135deg, #0b1626 0%, #122238 52%, #16283f 100%);
    color: #eef3fa;
    overflow: hidden;
}
.gp-hero::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #c69a3c, #f0d59a, #c69a3c, transparent);
    opacity: .8;
}

.gp-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.gp-crumb { font-size: 12.5px; color: rgba(238, 243, 250, .62); }
.gp-crumb a { color: rgba(238, 243, 250, .82); text-decoration: none; }
.gp-crumb a:hover { color: #f0d59a; text-decoration: underline; text-underline-offset: 3px; }
.gp-crumb i { margin: 0 7px; font-style: normal; color: rgba(238, 243, 250, .35); }
.gp-crumb b { color: #fff; font-weight: 600; }

.gp-theme {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid rgba(238, 243, 250, .24);
    border-radius: 8px;
    background: rgba(10, 18, 30, .45);
}
.gp-theme button {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(238, 243, 250, .74);
    font-family: var(--gp-sans);
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .18s, color .18s;
}
.gp-theme button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.gp-theme button[aria-pressed="true"] {
    background: linear-gradient(180deg, #f0d59a, #d9b168);
    color: #26200f;
}
.gp-theme button:focus-visible { outline: 2px solid #f0d59a; outline-offset: 2px; }

.gp-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, .8fr);
    gap: 34px;
    align-items: center;
    margin-top: 28px;
}

.gp-kicker {
    margin: 0 0 10px;
    font-family: var(--gp-mono);
    font-size: 11.5px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #d9b168;
}

.gp-h1 {
    margin: 0;
    font-size: 42px;
    line-height: 1.26;
    letter-spacing: -.02em;
    font-weight: 800;
    color: #fff;
}

.gp-lede {
    margin: 14px 0 0;
    max-width: 40em;
    font-size: 15px;
    line-height: 1.9;
    color: rgba(238, 243, 250, .78);
}
.gp-lede strong { color: #f0d59a; font-weight: 700; }

.gp-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}
.gp-quick li {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 126px;
    padding: 9px 14px;
    border: 1px solid rgba(238, 243, 250, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .05);
    backdrop-filter: blur(4px);
}
.gp-quick span { font-size: 11.5px; color: rgba(238, 243, 250, .6); }
.gp-quick b {
    font-family: var(--gp-mono);
    font-size: 17px;
    font-weight: 700;
    color: #f5e3bb;
    font-variant-numeric: tabular-nums;
}

/* 金价刻度装饰 */
.gp-ladder {
    position: relative;
    border: 1px solid rgba(238, 243, 250, .18);
    border-radius: 12px;
    background: rgba(8, 15, 26, .55);
    padding: 12px 16px 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.gp-ladder-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 11px;
    letter-spacing: .16em;
    color: rgba(238, 243, 250, .6);
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(238, 243, 250, .12);
}
.gp-ladder-head em { font-style: normal; letter-spacing: .04em; color: #d9b168; }
.gp-ladder-body { position: relative; height: 208px; margin-top: 6px; }
.gp-ladder-body .ld-tick {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(-50%);
    font-family: var(--gp-mono);
    font-size: 10.5px;
    color: rgba(238, 243, 250, .5);
}
.gp-ladder-body .ld-line {
    flex: 1;
    height: 1px;
    background: rgba(238, 243, 250, .16);
}
.gp-ladder-body .ld-mark {
    position: absolute;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    transform: translateY(-50%);
    font-family: var(--gp-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 0 2px 14px;
    background: linear-gradient(90deg, rgba(8, 15, 26, 0), rgba(8, 15, 26, .95) 24%);
}
.gp-ladder-body .ld-mark::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}
.gp-ladder-body .ld-mark.now { color: #f0d59a; }
.gp-ladder-body .ld-mark.cost { color: #8fc0f0; }
.gp-ladder-body .ld-mark.cost {
    border-top: 1px dashed currentColor;
}
.gp-ladder-body .ld-mark.now {
    border-bottom: 1px dashed currentColor;
}
.gp-ladder-note {
    margin: 4px 0 0;
    font-size: 10.5px;
    color: rgba(238, 243, 250, .5);
}

/* ---------- 主体 ---------- */
.gp-body { padding-top: 26px; }

.gp-work {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, .95fr);
    gap: 22px;
    align-items: start;
}

.gp-form {
    border: 1px solid var(--gp-line-2);
    border-radius: 12px;
    background: var(--gp-card);
    box-shadow: var(--gp-shadow);
    overflow: hidden;
}
.gp-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 13px 18px;
    border-bottom: 1px solid var(--gp-line);
    background: linear-gradient(180deg, var(--gp-card-2), transparent);
}
.gp-form-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .02em;
}
.gp-mode {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--gp-line-2);
    border-radius: 8px;
    background: var(--gp-card-2);
}
.gp-mode button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--gp-mut);
    font-family: var(--gp-sans);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .18s, color .18s, box-shadow .18s;
}
.gp-mode button[aria-selected="true"] {
    background: var(--gp-card);
    color: var(--gp-ink);
    box-shadow: 0 1px 3px rgba(16, 26, 43, .16);
}
.gp-mode button:focus-visible { outline: 2px solid var(--gp-gold); outline-offset: 2px; }

.gp-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
    padding: 16px 18px 18px;
}
.gp-f {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.gp-f[hidden] { display: none; }
.gp-f > span:first-child {
    font-size: 12px;
    color: var(--gp-ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gp-input {
    display: flex;
    align-items: baseline;
    gap: 5px;
    padding: 7px 10px;
    border: 1px solid var(--gp-line-2);
    border-radius: 8px;
    background: var(--gp-card-2);
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.gp-input:focus-within {
    border-color: var(--gp-gold);
    background: var(--gp-card);
    box-shadow: 0 0 0 3px var(--gp-gold-soft);
}
.gp-input input {
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--gp-ink);
    font-family: var(--gp-mono);
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    outline: none;
    padding: 0;
}
.gp-input input::-webkit-outer-spin-button,
.gp-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gp-input input[type="number"] { -moz-appearance: textfield; }
.gp-input em {
    flex: none;
    font-style: normal;
    font-size: 11px;
    color: var(--gp-mut);
    white-space: nowrap;
}

.gp-err {
    margin: 0;
    padding: 10px 18px;
    border-top: 1px solid color-mix(in srgb, var(--gp-red) 28%, transparent);
    background: color-mix(in srgb, var(--gp-red) 8%, transparent);
    color: var(--gp-red);
    font-size: 13px;
    font-weight: 600;
}
.gp-err[hidden] { display: none; }

.gp-samples {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 18px;
    border-top: 1px dashed var(--gp-line-2);
    background: var(--gp-card-2);
}
.gp-samples > span { font-size: 11.5px; color: var(--gp-mut); letter-spacing: .1em; }
.gp-samples button {
    appearance: none;
    cursor: pointer;
    padding: 5px 12px;
    border: 1px solid var(--gp-line-2);
    border-radius: 999px;
    background: var(--gp-card);
    color: var(--gp-ink-2);
    font-family: var(--gp-sans);
    font-size: 12px;
    transition: border-color .16s, background .16s, color .16s;
}
.gp-samples button:hover {
    border-color: var(--gp-gold);
    background: var(--gp-gold-soft);
    color: var(--gp-gold-2);
}
.gp-samples button:focus-visible { outline: 2px solid var(--gp-gold); outline-offset: 2px; }

.gp-tip {
    margin: 0;
    padding: 10px 18px 14px;
    font-size: 11.5px;
    line-height: 1.8;
    color: var(--gp-mut);
    border-top: 1px dashed var(--gp-line);
}

/* ---------- 结果面板 ---------- */
.gp-result {
    position: sticky;
    top: 82px;
    border-radius: 12px;
    padding: 18px 18px 16px;
    background:
        radial-gradient(120% 100% at 100% 0%, rgba(224, 181, 98, .16), transparent 60%),
        linear-gradient(160deg, #10203a, #0b1526);
    color: #eef3fa;
    border: 1px solid rgba(224, 181, 98, .28);
    box-shadow: 0 20px 40px -30px rgba(10, 20, 36, .9);
    overflow: hidden;
}

.gp-result-top {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(238, 243, 250, .14);
}
.gp-result-top span {
    font-size: 11.5px;
    letter-spacing: .12em;
    color: rgba(238, 243, 250, .62);
}
.gp-result-top b {
    font-family: var(--gp-mono);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #f5e3bb;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}
.gp-result-top em {
    align-self: flex-start;
    font-style: normal;
    font-family: var(--gp-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid currentColor;
    color: rgba(238, 243, 250, .7);
}
.gp-result-top em.is-pos { color: #86e0b4; }
.gp-result-top em.is-neg { color: #ff9d92; }

.gp-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 14px 0 12px;
}
.gp-result-grid div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.gp-result-grid span { font-size: 11px; color: rgba(238, 243, 250, .58); }
.gp-result-grid b {
    font-family: var(--gp-mono);
    font-size: 14.5px;
    font-weight: 700;
    color: #eef3fa;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gp-result-grid b.is-pos { color: #86e0b4; }
.gp-result-grid b.is-neg { color: #ff9d92; }

.gp-verdict {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    border-left: 3px solid #e0b562;
    font-size: 12.5px;
    line-height: 1.75;
    color: rgba(238, 243, 250, .86);
}
.gp-verdict.is-warn { border-left-color: #ff9d92; color: #ffd7d2; }
.gp-result-note {
    margin: 10px 0 0;
    font-size: 10.5px;
    line-height: 1.7;
    color: rgba(238, 243, 250, .5);
}

/* ---------- 面板 ---------- */
.gp-panel {
    margin-top: 22px;
    border: 1px solid var(--gp-line-2);
    border-radius: 12px;
    background: var(--gp-card);
    box-shadow: var(--gp-shadow);
    overflow: hidden;
}
.gp-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--gp-line);
    background: linear-gradient(180deg, var(--gp-card-2), transparent);
}
.gp-panel-head h2 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: .03em;
    padding-left: 10px;
    border-left: 3px solid var(--gp-gold);
}
.gp-panel-head > span,
.gp-panel-meta { font-size: 11.5px; color: var(--gp-mut); }
.gp-panel-meta { display: inline-flex; align-items: center; gap: 6px; }
.gp-swipe { font-style: normal; font-weight: 700; color: var(--gp-gold); }
.gp-swipe[hidden] { display: none; }

/* ---------- 图表 ---------- */
.gp-chart { padding: 10px 12px 0; }
.gp-chart svg { display: block; width: 100%; height: auto; }
.gp-chart .cv-grid { stroke: var(--gp-line); stroke-width: 1; }
.gp-chart .cv-axis { stroke: var(--gp-line-2); stroke-width: 1; }
.gp-chart .cv-price { stroke: var(--gp-gold); stroke-width: 2.2; fill: none; }
.gp-chart .cv-cost { stroke: var(--gp-blue); stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.gp-chart .cv-now { stroke: var(--gp-green); stroke-width: 1.4; stroke-dasharray: 3 4; }
.gp-chart .cv-now.is-neg { stroke: var(--gp-red); }
.gp-chart .cv-txt { fill: var(--gp-mut); font-size: 10px; font-family: var(--gp-mono); }
.gp-chart .cv-flag { font-size: 10.5px; font-family: var(--gp-sans); font-weight: 700; fill: var(--gp-gold); }
.gp-chart .cv-flag-blue { fill: var(--gp-blue); }
.gp-chart .cv-flag-now { fill: var(--gp-green); }
.gp-chart .cv-flag-now.is-neg { fill: var(--gp-red); }
.gp-chart .cv-dot { fill: var(--gp-gold); }
.gp-chart-note {
    margin: 0;
    padding: 8px 16px 12px;
    border-top: 1px dashed var(--gp-line);
    font-size: 11.5px;
    color: var(--gp-mut);
}

/* ---------- 表格 ---------- */
.gp-tablewrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.gp-tablewrap-tall { max-height: 430px; overflow-y: auto; }
.gp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.gp-table th,
.gp-table td {
    padding: 8px 14px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--gp-line);
    font-family: var(--gp-mono);
    font-variant-numeric: tabular-nums;
    color: var(--gp-ink-2);
}
.gp-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    font-family: var(--gp-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--gp-mut);
    background: var(--gp-card-2);
}
.gp-table th:first-child,
.gp-table td:first-child { text-align: left; }
.gp-table tbody tr:last-child td { border-bottom: 0; }
.gp-table tbody tr:hover { background: var(--gp-gold-soft); }
.gp-table tbody tr.is-base { background: color-mix(in srgb, var(--gp-gold) 10%, transparent); }
.gp-table tbody tr.is-base td { color: var(--gp-ink); font-weight: 700; }
.gp-table td.is-neg { color: var(--gp-red); }
.gp-table td.is-pos { color: var(--gp-green); }
.gp-empty { text-align: center !important; font-family: var(--gp-sans) !important; color: var(--gp-mut); }

/* ---------- 说明 + FAQ ---------- */
.gp-note-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 26px;
    padding: 16px 18px 6px;
}
.gp-note-grid > div {
    padding: 10px 0 12px;
    border-top: 1px solid var(--gp-line);
}
.gp-note-grid h3 {
    margin: 0 0 6px;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--gp-ink);
}
.gp-note-grid p {
    margin: 0;
    font-size: 13px;
    line-height: 1.85;
    color: var(--gp-ink-2);
}

.gp-faq { padding: 4px 18px 10px; }
.gp-faq details { border-top: 1px solid var(--gp-line); }
.gp-faq summary {
    position: relative;
    cursor: pointer;
    padding: 11px 26px 11px 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--gp-ink);
    list-style: none;
}
.gp-faq summary::-webkit-details-marker { display: none; }
.gp-faq summary::after {
    content: "+";
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--gp-mono);
    font-size: 16px;
    color: var(--gp-gold);
    transition: transform .2s;
}
.gp-faq details[open] summary::after { content: "−"; }
.gp-faq details > div {
    padding: 0 0 13px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--gp-ink-2);
}

.gp-disclaimer {
    margin: 0;
    padding: 12px 18px;
    border-top: 1px dashed var(--gp-line-2);
    background: var(--gp-card-2);
    font-size: 11.5px;
    line-height: 1.8;
    color: var(--gp-mut);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    .gp-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .gp-hero-side { max-width: 420px; }
    .gp-work { grid-template-columns: minmax(0, 1fr); }
    .gp-result { position: static; }
    .gp-h1 { font-size: 36px; }
}

@media (max-width: 820px) {
    .gp-h1 { font-size: 30px; }
    .gp-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gp-note-grid { grid-template-columns: minmax(0, 1fr); }
    .gp-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .gp-wrap { padding: 0 15px; }
    .gp-hero { padding: 16px 0 28px; }
    .gp-h1 { font-size: 25px; line-height: 1.32; }
    .gp-lede { font-size: 13.5px; }
    .gp-quick li { flex: 1 1 auto; min-width: 100px; padding: 8px 10px; }
    .gp-quick b { font-size: 14.5px; }
    .gp-result-top b { font-size: 27px; }
    .gp-ladder-body { height: 168px; }
    .gp-panel-head { flex-wrap: wrap; row-gap: 3px; }
    .gp-panel-head h2 { white-space: nowrap; }
    .gp-panel-head > span:not(.gp-panel-meta) { display: none; }
    .gp-panel-meta > span { display: none; }
    .gp-panel-meta { margin-left: auto; }
    .gp-table th, .gp-table td { padding: 7px 10px; }
}

@media (max-width: 420px) {
    .gp-h1 { font-size: 23px; }
    .gp-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .gp-input input { font-size: 15px; }
    .gp-result { padding: 15px 14px 13px; }
    .gp-result-grid { gap: 9px 10px; }
    .gp-result-grid b { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .gp-page * { transition: none !important; }
}
