/* =====================================================================
 * 36 新婚收件地址卡 · DUPLEX ENVELOPE
 * 独立设计：信纸米白 + 邮政蓝；首屏右半是两张带折线与邮票位的信封卡，
 * 中间回寄条；字段按 A / B 页签切换，结果为等宽体可复制地址卡。
 * ===================================================================== */
.nca {
    --ag-bg: #f6f4ee;
    --ag-bg2: #ece8dd;
    --ag-surface: #fffdf7;
    --ag-surface2: #faf7ee;
    --ag-ink: #2d3542;
    --ag-ink2: #596475;
    --ag-muted: #8e929b;
    --ag-line: #e3ded1;
    --ag-line2: #cfc8b6;
    --ag-accent: #2f5c8f;
    --ag-accent2: #b4553f;
    --ag-on: #ffffff;
    --ag-ok: #2a7357;
    --ag-okbg: #e4f2ea;
    --ag-warn: #9a6416;
    --ag-warnbg: #fbefd6;
    --ag-bad: #b34b48;
    --ag-badbg: #fbe9e6;
    --ag-info: #2f5c8f;
    --ag-infobg: #e7eef7;
    --ag-r: 2px;
    --ag-shadow: 0 2px 0 rgba(45, 53, 66, .05), 0 14px 32px rgba(45, 53, 66, .09);
    --ag-h: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
    --ag-b: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --ag-m: "JetBrains Mono", Consolas, monospace;
}
:root[data-theme="dark"] .nca {
    --ag-bg: #15161a;
    --ag-bg2: #1e2026;
    --ag-surface: #1e2129;
    --ag-surface2: #252932;
    --ag-ink: #eceef4;
    --ag-ink2: #b6bdca;
    --ag-muted: #8b909c;
    --ag-line: #30343e;
    --ag-line2: #414653;
    --ag-accent: #8ab4e0;
    --ag-accent2: #e59a86;
    --ag-on: #13151b;
    --ag-ok: #7fd0a7;
    --ag-okbg: #173529;
    --ag-warn: #e5bd73;
    --ag-warnbg: #382c17;
    --ag-bad: #ef9a90;
    --ag-badbg: #3a2220;
    --ag-info: #8ab4e0;
    --ag-infobg: #1c2a3a;
    --ag-shadow: 0 12px 34px rgba(0, 0, 0, .42);
}
.nca { background: var(--ag-bg) repeating-linear-gradient(0deg, transparent 0 27px, rgba(47, 92, 143, .022) 27px 28px); }
.nca h1, .nca h2, .nca h3 { font-family: var(--ag-h); letter-spacing: .015em; }
.nca input, .nca select, .nca textarea {
    width: 100%; background: var(--ag-surface2); color: var(--ag-ink);
    border: 1px solid var(--ag-line2); border-radius: 2px; padding: 8px 10px;
    font-size: 13px; line-height: 1.65; outline: none;
}
.nca input:focus, .nca select:focus, .nca textarea:focus { border-color: var(--ag-accent); box-shadow: inset 0 -2px 0 var(--ag-accent); }
.nca textarea { resize: vertical; font-family: var(--ag-m); font-size: 12.5px; }
.nca label { display: block; font-size: 11.5px; font-weight: 650; color: var(--ag-ink2); margin-bottom: 4px; }
.nca code { background: var(--ag-bg2); color: var(--ag-accent); }

/* ---------- 首屏 ---------- */
.nca-hero { display: grid; grid-template-columns: 1.04fr .96fr; background: var(--ag-surface); border: 1px solid var(--ag-line2); box-shadow: var(--ag-shadow); }
.nca-intro { padding: 30px 30px 22px; border-right: 1px dashed var(--ag-line2); }
.nca-kicker { display: inline-block; font-family: var(--ag-m); font-size: 10px; letter-spacing: .16em; color: var(--ag-accent); border-bottom: 1px solid var(--ag-accent); padding-bottom: 4px; margin-bottom: 16px; }
.nca-hero h1 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.28; margin-bottom: 12px; }
.nca-lede { font-size: 14px; line-height: 2; color: var(--ag-ink2); }
.nca-lede b { color: var(--ag-accent); font-weight: 750; }
.nca-tabs { display: flex; gap: 6px; margin-top: 20px; }
.nca-tab { padding: 7px 16px; border: 1px solid var(--ag-line2); border-bottom-width: 3px; background: var(--ag-surface2); color: var(--ag-ink2); font-size: 12.5px; font-weight: 700; }
.nca-tab.is-on { background: var(--ag-infobg); border-color: var(--ag-accent); color: var(--ag-accent); }
.nca-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.nca-fields .wide { grid-column: 1 / -1; }
.nca-quick-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.nca-intro-note { font-size: 11.5px; line-height: 1.8; color: var(--ag-muted); margin: 13px 0 0; padding-top: 11px; border-top: 1px dotted var(--ag-line2); }
.nca-art { display: block; width: 100%; max-width: 280px; height: auto; margin: 12px 0 0 auto; opacity: .88; }

.nca-envelope { padding: 26px 24px 18px; background: #eef2f8; }
:root[data-theme="dark"] .nca-envelope { background: #171d27; }
.nca-env-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 2px solid var(--ag-accent); padding-bottom: 9px; }
.nca-env-hd b { font-size: 16px; }
.nca-env-hd span { font-family: var(--ag-m); font-size: 11px; color: var(--ag-accent); font-weight: 700; }
.nca-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.nca-env { position: relative; min-height: 168px; padding: 14px 15px; background: var(--ag-surface); border: 1px solid var(--ag-line2); }
.nca-env::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 34px; background: linear-gradient(160deg, var(--ag-bg2) 0 50%, transparent 50%), linear-gradient(20deg, var(--ag-bg2) 0 50%, transparent 50%); opacity: .7; pointer-events: none; }
.nca-env .tag { position: relative; font-family: var(--ag-m); font-size: 9.5px; letter-spacing: .12em; color: var(--ag-accent); }
.nca-env h3 { position: relative; font-size: 16px; margin: 10px 0 6px; }
.nca-env p { position: relative; margin: 0; font-size: 11.8px; line-height: 1.8; color: var(--ag-ink2); overflow-wrap: anywhere; }
.nca-env .meta { position: relative; margin-top: 8px; font-family: var(--ag-m); font-size: 10.5px; color: var(--ag-muted); }
.nca-stamp { position: absolute; right: 10px; top: 8px; width: 40px; height: 32px; border: 1px dashed var(--ag-accent2); color: var(--ag-accent2); font-size: 11px; display: grid; place-items: center; transform: rotate(-6deg); }
.nca-return { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; background: var(--ag-surface); border: 1px dashed var(--ag-line2); }
.nca-return .nca-stamp { position: static; flex: none; transform: rotate(-4deg); }
.nca-return b { font-size: 12.5px; }
.nca-return p { margin: 2px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--ag-muted); }
.nca-env-foot { font-family: var(--ag-m); font-size: 9.5px; letter-spacing: .08em; color: var(--ag-muted); text-align: center; margin-top: 14px; }

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

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

/* ---------- 结果 ---------- */
.nca-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.nca-stat { background: var(--ag-surface); border: 1px solid var(--ag-line2); border-top: 3px solid var(--ag-accent2); padding: 12px 15px; }
.nca-stat small { display: block; font-size: 11px; color: var(--ag-muted); }
.nca-stat b { display: block; font-family: var(--ag-m); font-size: 20px; line-height: 1.5; }
.nca-result-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 14px; }
.nca-panel { background: var(--ag-surface); border: 1px solid var(--ag-line); padding: 18px 20px; min-width: 0; }
.nca-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; }
.nca-panel-hd h3 { font-size: 16px; }
.nca-panel-hd span { font-size: 11px; color: var(--ag-muted); }
.nca-pre { margin: 0; padding: 14px 16px; background: var(--ag-surface2); border: 1px dashed var(--ag-line2); font-family: var(--ag-m); font-size: 12px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ag-ink2); }
.nca-notes { display: grid; gap: 8px; font-size: 12.5px; line-height: 1.85; color: var(--ag-ink2); }
.nca-notes > div { padding: 9px 11px; border-left: 3px solid var(--ag-line2); background: var(--ag-surface2); }
.nca-notes > div.ok { border-left-color: var(--ag-ok); background: var(--ag-okbg); }
.nca-notes > div.no { border-left-color: var(--ag-bad); background: var(--ag-badbg); }
.nca-scroll { overflow-x: auto; margin-top: 16px; }
.nca-table { width: 100%; min-width: 780px; font-size: 12.5px; }
.nca-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; }
.nca-table td { padding: 8px 10px; border-bottom: 1px dotted var(--ag-line); line-height: 1.7; }
.nca-clean { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 11.5px; }
.nca-clean > b { color: var(--ag-ink2); }
.nca-clean #ncaPreview { 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); padding: 6px 9px; overflow-wrap: anywhere; white-space: normal; }
.nca-panel > label { font-size: 12px; margin-bottom: 8px; line-height: 1.8; }
.wg4-read { margin-top: 46px; padding: 26px 28px; background: var(--ag-surface); border: 1px solid var(--ag-line2); border-top: 4px solid var(--ag-accent); }
.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) {
    .nca-hero { grid-template-columns: 1fr; }
    .nca-intro { border-right: 0; border-bottom: 1px dashed var(--ag-line2); }
    .nca-art { display: none; }
    .nca-checks { grid-template-columns: repeat(2, 1fr); }
    .nca-result-grid { grid-template-columns: 1fr; }
    .nca-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .nca-intro, .nca-envelope { padding: 22px 16px; }
    .nca-fields { grid-template-columns: 1fr; }
    .nca-cards { grid-template-columns: 1fr; }
    .nca-checks { grid-template-columns: 1fr; }
    .wg4-read { padding: 20px 18px; }
}
