/* =====================================================================
 * 38 纪念日礼物预算 · YEAR / BUDGET SCALE
 * 独立设计：淡紫 + 香槟金；首屏右半是一条按年限推进的刻度尺与三档可点选
 * 区间卡，剩余额度用大号等宽数字；避坑项为圆角标签卡。
 * ===================================================================== */
.agb {
    --ag-bg: #f6f3fb;
    --ag-bg2: #ebe4f6;
    --ag-surface: #ffffff;
    --ag-surface2: #faf7fd;
    --ag-ink: #302a45;
    --ag-ink2: #605877;
    --ag-muted: #928ba6;
    --ag-line: #e6dff1;
    --ag-line2: #d2c6e6;
    --ag-accent: #7658ac;
    --ag-accent2: #b99348;
    --ag-on: #ffffff;
    --ag-ok: #2a7357;
    --ag-okbg: #e4f2ea;
    --ag-warn: #9a6416;
    --ag-warnbg: #fbefd6;
    --ag-bad: #b34b48;
    --ag-badbg: #fbe9e6;
    --ag-info: #7658ac;
    --ag-infobg: #f0eaf9;
    --ag-r: 14px;
    --ag-shadow: 0 12px 32px rgba(48, 42, 69, .09);
    --ag-h: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --ag-b: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --ag-m: "JetBrains Mono", Consolas, monospace;
}
:root[data-theme="dark"] .agb {
    --ag-bg: #15121f;
    --ag-bg2: #201a2f;
    --ag-surface: #1e1930;
    --ag-surface2: #272140;
    --ag-ink: #efeaf9;
    --ag-ink2: #c4b9dc;
    --ag-muted: #9184ad;
    --ag-line: #322a4a;
    --ag-line2: #443a63;
    --ag-accent: #b69ae6;
    --ag-accent2: #e6c57e;
    --ag-on: #120e1d;
    --ag-ok: #7fd0a7;
    --ag-okbg: #173529;
    --ag-warn: #e5bd73;
    --ag-warnbg: #382c17;
    --ag-bad: #ef9a90;
    --ag-badbg: #3a2220;
    --ag-info: #b69ae6;
    --ag-infobg: #271f41;
    --ag-shadow: 0 12px 34px rgba(0, 0, 0, .42);
}
.agb { background: var(--ag-bg) radial-gradient(720px 320px at 90% -2%, rgba(185, 147, 72, .1), transparent 70%) no-repeat; }
.agb h1, .agb h2, .agb h3 { letter-spacing: -.02em; }
.agb input, .agb select, .agb textarea {
    width: 100%; background: var(--ag-surface2); color: var(--ag-ink);
    border: 1px solid var(--ag-line2); border-radius: 9px; padding: 8px 10px;
    font-size: 13px; line-height: 1.6; outline: none;
}
.agb input:focus, .agb select:focus, .agb textarea:focus { border-color: var(--ag-accent); box-shadow: 0 0 0 3px rgba(118, 88, 172, .13); }
.agb textarea { resize: vertical; font-family: var(--ag-m); font-size: 12.5px; }
.agb label { display: block; font-size: 11.5px; font-weight: 650; color: var(--ag-ink2); margin-bottom: 4px; }
.agb code { background: var(--ag-bg2); color: var(--ag-accent); }

/* ---------- 首屏 ---------- */
.agb-hero { display: grid; grid-template-columns: 1.04fr .96fr; background: var(--ag-surface); border: 1px solid var(--ag-line); border-radius: var(--ag-r); overflow: hidden; box-shadow: var(--ag-shadow); }
.agb-intro { padding: 32px 30px 24px; }
.agb-kicker { display: inline-block; font-family: var(--ag-m); font-size: 10px; letter-spacing: .16em; color: var(--ag-accent); background: var(--ag-infobg); border-radius: 999px; padding: 5px 13px; margin-bottom: 16px; }
.agb-hero h1 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 850; margin-bottom: 12px; }
.agb-lede { font-size: 14px; line-height: 2; color: var(--ag-ink2); }
.agb-lede b { color: var(--ag-accent); font-weight: 750; }
.agb-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.agb-quick-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.agb-intro-note { font-size: 11.5px; line-height: 1.8; color: var(--ag-muted); margin: 14px 0 0; padding-top: 11px; border-top: 1px dashed var(--ag-line2); }

.agb-scale { padding: 26px 26px 18px; background: linear-gradient(170deg, #f7f2fb, #fdfaf4); border-left: 1px solid var(--ag-line); }
:root[data-theme="dark"] .agb-scale { background: linear-gradient(170deg, #221b33, var(--ag-surface2)); }
.agb-scale-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 2px solid var(--ag-accent); padding-bottom: 9px; }
.agb-scale-hd b { font-size: 16px; }
.agb-scale-hd span { font-family: var(--ag-m); font-size: 11px; font-weight: 700; color: var(--ag-accent2); }
.agb-ruler { position: relative; display: flex; justify-content: space-between; align-items: flex-end; height: 66px; margin: 20px 4px 0; padding-bottom: 8px; border-bottom: 2px solid var(--ag-line2); }
.agb-ruler::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 4px; width: var(--agb-fill, 30%); background: linear-gradient(90deg, var(--ag-accent), var(--ag-accent2)); border-radius: 99px; }
.agb-tick { position: relative; font-family: var(--ag-m); font-size: 9.5px; color: var(--ag-muted); }
.agb-tick::after { content: ""; position: absolute; left: 50%; bottom: -12px; width: 1px; height: 8px; background: var(--ag-line2); }
.agb-tick.is-on { color: var(--ag-accent); font-weight: 800; }
.agb-tick.is-on::after { height: 14px; bottom: -16px; background: var(--ag-accent2); width: 2px; }
.agb-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.agb-tier { padding: 12px 10px; border: 1px solid var(--ag-line2); border-radius: 12px; background: var(--ag-surface); text-align: center; cursor: pointer; transition: transform .12s, border-color .15s, background .15s; }
.agb-tier:hover { transform: translateY(-2px); }
.agb-tier small { display: block; font-size: 10.5px; color: var(--ag-muted); }
.agb-tier b { display: block; font-family: var(--ag-m); font-size: 16px; line-height: 1.7; color: var(--ag-accent); }
.agb-tier span { font-size: 10.5px; color: var(--ag-muted); }
.agb-tier.is-on { border-color: var(--ag-accent2); background: var(--ag-infobg); }
.agb-remain { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--ag-surface); border: 1px dashed var(--ag-line2); }
.agb-remain > span { display: block; font-size: 11.5px; color: var(--ag-muted); }
.agb-remain > b { display: block; font-family: var(--ag-m); font-size: 30px; line-height: 1.5; color: var(--ag-accent2); }
.agb-remain small { font-size: 11px; color: var(--ag-muted); }
.agb-art { display: block; width: 100%; max-width: 270px; height: auto; margin: 10px auto 0; opacity: .85; }

/* ---------- 按钮 ---------- */
.agb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 17px; border-radius: 999px; font-size: 13px; font-weight: 750; border: 1px solid transparent; transition: transform .13s, box-shadow .13s, background .13s; }
.agb-btn:hover { transform: translateY(-1px); }
.agb-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.agb-btn-main { background: var(--ag-accent); color: #fff; box-shadow: 0 6px 16px rgba(118, 88, 172, .24); }
.agb-btn-soft { background: var(--ag-infobg); color: var(--ag-accent); border-color: var(--ag-line2); }
.agb-btn-line { background: transparent; color: var(--ag-ink2); border-color: var(--ag-line2); }
.agb-btn-line:hover { border-color: var(--ag-accent); color: var(--ag-accent); }
.agb-btn-mini { padding: 5px 11px; font-size: 11.5px; }

/* ---------- 避坑项 / 区块 ---------- */
.agb-sec-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 42px 0 16px; }
.agb-sec-hd h2 { font-size: 21px; display: flex; align-items: center; gap: 11px; }
.agb-sec-hd h2 i { font-family: var(--ag-m); font-style: normal; font-size: 10.5px; color: #fff; background: var(--ag-accent); border-radius: 8px; padding: 3px 8px; }
.agb-sec-hd span { font-size: 12px; color: var(--ag-muted); }
.agb-pitfalls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.agb-pit { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; background: var(--ag-surface); border: 1px solid var(--ag-line); border-left: 3px solid var(--ag-line2); border-radius: 12px; cursor: pointer; }
.agb-pit input { width: 15px; height: 15px; flex: none; margin-top: 3px; accent-color: var(--ag-accent); }
.agb-pit b { display: block; font-size: 13px; }
.agb-pit small { display: block; font-size: 11px; color: var(--ag-muted); line-height: 1.65; margin-top: 2px; }
.agb-pit.is-on { border-left-color: var(--ag-ok); background: var(--ag-okbg); }
.agb-err { margin-top: 12px; padding: 10px 13px; border-radius: 9px; background: var(--ag-badbg); color: var(--ag-bad); font-size: 12.5px; }
.agb-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }

/* ---------- 结果 ---------- */
.agb-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.agb-stat { background: var(--ag-surface); border: 1px solid var(--ag-line); border-radius: 12px; padding: 12px 15px; }
.agb-stat small { display: block; font-size: 11px; color: var(--ag-muted); }
.agb-stat b { display: block; font-family: var(--ag-m); font-size: 19px; line-height: 1.55; }
.agb-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.agb-panel { background: var(--ag-surface); border: 1px solid var(--ag-line); border-radius: var(--ag-r); padding: 18px 20px; min-width: 0; }
.agb-panel-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--ag-line); padding-bottom: 9px; margin-bottom: 12px; }
.agb-panel-hd h3 { font-size: 16px; }
.agb-panel-hd span { font-size: 11px; color: var(--ag-muted); }
.agb-tier-list { display: grid; gap: 9px; }
.agb-tier-row { padding: 11px 13px; border-left: 3px solid var(--ag-line2); border-radius: 0 9px 9px 0; background: var(--ag-surface2); }
.agb-tier-row b { display: block; color: var(--ag-accent); font-size: 13px; }
.agb-tier-row span { display: block; font-family: var(--ag-m); font-size: 12.5px; }
.agb-tier-row small { font-size: 11px; color: var(--ag-muted); }
.agb-next { margin: 0; padding-left: 20px; font-size: 12.8px; line-height: 1.95; color: var(--ag-ink2); }
.agb-next li { margin-bottom: 7px; }
.agb-next b { color: var(--ag-accent); }
.agb-scroll { overflow-x: auto; margin-top: 16px; }
.agb-table { width: 100%; min-width: 760px; font-size: 12.5px; }
.agb-table th { text-align: left; background: var(--ag-bg2); color: var(--ag-ink2); font-size: 11px; padding: 8px 10px; border-bottom: 2px solid var(--ag-line2); white-space: nowrap; }
.agb-table td { padding: 8px 10px; border-bottom: 1px dotted var(--ag-line); line-height: 1.7; }
.agb-clean { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 11.5px; }
.agb-clean > b { color: var(--ag-ink2); }
.agb-clean #agbPreview { flex: 1 1 100%; font-family: var(--ag-m); font-size: 11px; color: var(--ag-muted); background: var(--ag-surface2); border-left: 2px solid var(--ag-accent2); border-radius: 5px; padding: 6px 9px; overflow-wrap: anywhere; white-space: normal; }
.agb-panel > label { font-size: 12px; margin-bottom: 8px; line-height: 1.8; }
.wg4-read { margin-top: 46px; padding: 26px 28px; border-radius: var(--ag-r); background: var(--ag-surface); border: 1px solid var(--ag-line); }
.wg4-read h2 { font-size: 21px; margin-bottom: 16px; }
.wg4-read p { font-size: 14px; line-height: 2.05; color: var(--ag-ink2); margin-bottom: 14px; }
.wg4-read p:last-child { margin-bottom: 0; }
.wg4-read b { color: var(--ag-accent); }

@media (max-width: 1080px) {
    .agb-hero { grid-template-columns: 1fr; }
    .agb-scale { border-left: 0; border-top: 1px solid var(--ag-line); }
    .agb-art { display: none; }
    .agb-pitfalls { grid-template-columns: repeat(2, 1fr); }
    .agb-result-grid { grid-template-columns: 1fr; }
    .agb-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .agb-intro, .agb-scale { padding: 22px 16px; }
    .agb-fields { grid-template-columns: 1fr 1fr; }
    .agb-pitfalls { grid-template-columns: 1fr; }
    .wg4-read { padding: 20px 18px; }
}
