:root {
    --blue: #185FA5;
    --blue-dark: #0C447C;
    --text: #1b1b1f;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #ffffff;
    --soft: #f4f6f8;
    --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: contain; }

.screen { display: none; }
.screen.active { display: block; }

/* ---------- 顶栏 ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.brand-mark {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: var(--blue);
    display: inline-block;
}

.topbar-note {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted);
}

/* ---------- 落地页 ---------- */
.hero { padding: 24px 20px calc(40px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }

.eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--blue);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 12px;
    font-size: 27px;
    line-height: 1.22;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.lede {
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

.lede strong { color: var(--text); font-weight: 600; }

/* ---------- 上传框 ---------- */
.upload-box {
    border: 1.5px dashed #c9d3de;
    border-radius: var(--radius);
    padding: 26px 18px 20px;
    text-align: center;
    background: #fbfcfe;
    transition: border-color 0.2s, background 0.2s;
}

.upload-box.drag { border-color: var(--blue); background: #eff6fd; }

.cam-icon { width: 30px; height: 30px; color: #8a97a6; }

.upload-title { margin: 10px 0 4px; font-size: 15px; font-weight: 500; }

.upload-sub { margin: 0 0 16px; font-size: 12px; color: var(--muted); line-height: 1.5; }

.upload-actions { display: flex; gap: 10px; }

.btn {
    border: none;
    border-radius: 11px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    flex: 1;
    transition: opacity 0.15s;
}

.btn:active { opacity: 0.75; }

.btn-primary { background: var(--blue); color: #fff; }

.btn-ghost { background: #fff; color: var(--blue); border: 1px solid #c9d3de; }

.btn-wide { width: 100%; padding: 15px; font-size: 15px; }

/* ---------- 文档选择 ---------- */
.doc-label {
    margin: 28px 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.doc-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.doc-scroll::-webkit-scrollbar { display: none; }

.doc-chip {
    flex: 0 0 auto;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
}

.doc-chip.sel { border-color: var(--blue); background: #eaf2fb; color: var(--blue-dark); font-weight: 500; }

.link-more {
    display: block;
    width: 100%;
    margin: 8px 0 0;
    padding: 8px;
    background: none;
    border: none;
    font-size: 13px;
    color: var(--blue);
    font-family: inherit;
    cursor: pointer;
}

/* ---------- 卖点 ---------- */
.points { list-style: none; padding: 0; margin: 26px 0; display: flex; flex-direction: column; gap: 14px; }

.points li { display: flex; gap: 11px; align-items: flex-start; }

.dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
    margin-top: 7px;
}

.points strong { display: block; font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.points span { font-size: 13px; color: var(--muted); line-height: 1.45; }

.trust {
    background: var(--soft);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.trust strong { font-size: 14px; font-weight: 500; }
.trust span { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------- FAQ ---------- */
.faq { margin: 34px 0 26px; }

.faq h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }

.faq details { border-bottom: 1px solid var(--line); padding: 13px 0; }

.faq summary {
    font-size: 14px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); flex: 0 0 auto; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 9px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

.foot {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    color: #9aa3af;
}

/* ---------- 编辑器 ---------- */
#screen-editor { display: none; flex-direction: column; height: 100vh; height: 100dvh; }
#screen-editor.active { display: flex; }

.btn-back {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 19px;
    color: var(--text);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.editor-title { font-size: 15px; font-weight: 500; }
.editor-size { margin-left: auto; font-size: 12px; color: var(--muted); }

.stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f5;
    position: relative;
    overflow: hidden;
    touch-action: none;
}

.preview-canvas {
    background: #fff;
    box-shadow: 0 2px 14px rgba(20, 30, 45, 0.14);
    border-radius: 2px;
    cursor: grab;
}

.stage-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #7b8794;
    background: rgba(255, 255, 255, 0.86);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
}

.panel {
    padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #fff;
}

.panel-label { margin: 0 0 9px; font-size: 12px; color: var(--muted); }
.panel-label + .panel-label { margin-top: 16px; }

.swatches { display: flex; gap: 10px; }

.swatch {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    cursor: pointer;
    padding: 0;
    position: relative;
}

.swatch.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue); }

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

.zoom-ico { font-size: 15px; color: var(--muted); width: 12px; text-align: center; }

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    border-radius: 2px;
    background: #d8dee6;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--blue);
    cursor: pointer;
}

.doc-hint {
    margin: 13px 0 15px;
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.5;
}

.fineprint { margin: 9px 0 0; text-align: center; font-size: 11px; color: var(--muted); }

/* ---------- 遮罩 ---------- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.overlay.show { display: flex; }

.overlay-card { text-align: center; }

.spinner {
    width: 26px;
    height: 26px;
    margin: 0 auto 12px;
    border: 2.5px solid #d8dee6;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.overlay-card p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- 支付弹层 ---------- */
.sheet-wrap {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 32, 0.42);
    display: none;
    align-items: flex-end;
    z-index: 60;
}

.sheet-wrap.show { display: flex; }

.sheet {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 26px 22px calc(22px + env(safe-area-inset-bottom));
    animation: sheetUp 0.22s ease-out;
}

@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.sheet-price { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: var(--blue); }
.sheet-sub { margin: 4px 0 16px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.sheet-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }

.sheet-list span { font-size: 13px; color: var(--text); padding-left: 20px; position: relative; }

.sheet-list span::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 5px;
    width: 8px;
    height: 4px;
    border-left: 1.5px solid var(--blue);
    border-bottom: 1.5px solid var(--blue);
    transform: rotate(-45deg);
}

.link-cancel {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: none;
    border: none;
    font-size: 13px;
    color: var(--muted);
    font-family: inherit;
    cursor: pointer;
}

.dev-note { margin: 12px 0 0; text-align: center; font-size: 11px; color: #b4732a; line-height: 1.5; }

.fit-note { margin: 11px 0 0; font-size: 11.5px; color: #3B6D11; display: none; }
.fit-note.show { display: block; }
.fit-note.warn { color: #A32D2D; }

.pay-terms { margin: 10px 0 2px; font-size: 11.5px; line-height: 1.6; color: var(--muted); text-align: center; }
.pay-terms a { color: var(--blue); text-decoration: underline; }
.foot-links { display: block; margin-top: 6px; font-size: 12px; }
.foot-links a { color: var(--blue); text-decoration: none; }

/* ---------- 规格落地页 ---------- */
.brand { text-decoration: none; color: var(--text); }

.sp { max-width: 720px; margin: 0 auto; padding: 20px 20px 56px; }
.sp-crumbs { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.sp-crumbs a { color: var(--muted); text-decoration: none; }
.sp-crumbs span { margin: 0 2px; }
.sp h1 { font-size: 26px; line-height: 1.28; letter-spacing: -0.02em; margin: 0 0 12px; }
.sp-lead { font-size: 16px; line-height: 1.65; color: #3a3b42; margin: 0 0 22px; }
.sp h2 { font-size: 18px; line-height: 1.35; margin: 34px 0 10px; }
.sp p, .sp li { font-size: 15px; line-height: 1.7; color: #33343a; }
.sp p { margin: 0 0 14px; }
.sp-cta { display: block; text-align: center; text-decoration: none; }
.sp-price-note { text-align: center; font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

.sp-figure { display: flex; gap: 20px; align-items: center; margin: 26px 0 20px; }
.sp-figure svg { flex: none; border-radius: 6px; }
.sp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; flex: 1; }
.sp-fact { background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.sp-fact dt { font-size: 11.5px; color: var(--muted); margin: 0 0 2px; }
.sp-fact dd { margin: 0; font-size: 14px; font-weight: 500; color: var(--text); }

.sp-checks { list-style: none; padding: 0; margin: 12px 0 0; }
.sp-checks li { position: relative; padding-left: 26px; margin: 9px 0; }
.sp-checks li::before {
    content: ''; position: absolute; left: 6px; top: 6px;
    width: 7px; height: 12px;
    border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue);
    transform: rotate(40deg);
}

.sp-steps { padding-left: 22px; margin: 12px 0 0; }
.sp-steps li { margin: 9px 0; }

.sp-faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.sp-faq summary { font-size: 15px; font-weight: 500; cursor: pointer; list-style: none; position: relative; padding-right: 22px; }
.sp-faq summary::-webkit-details-marker { display: none; }
.sp-faq summary::after { content: '+'; position: absolute; right: 2px; top: -1px; color: var(--muted); font-weight: 400; }
.sp-faq details[open] summary::after { content: '−'; }
.sp-faq p { margin: 8px 0 0; font-size: 14.5px; color: #4b4c55; }

.sp-related { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sp-related a {
    font-size: 13px; padding: 8px 13px; border: 1px solid var(--line);
    border-radius: 999px; text-decoration: none; color: #33343a; background: #fff;
}

/* ---------- 首页底部文档索引（给爬虫的真实内链） ---------- */
.doc-index { margin: 34px 0 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.doc-index-title { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 10px; }
.doc-index-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.doc-index-cols a { font-size: 13px; color: #4b4c55; text-decoration: none; padding: 3px 0; }
.doc-index-cols a:hover { color: var(--blue); }

@media (max-width: 430px) {
    .sp h1 { font-size: 22px; }
    .sp-figure { align-items: flex-start; }
    .sp-figure svg { width: 96px; height: auto; }
    .sp-facts { grid-template-columns: 1fr; gap: 6px; }
    .sp-fact { padding: 8px 10px; }
}
