/* ===== 所有原有样式完整保留，未作任何改动 ===== */
        :root {
            --bg: #10141a;
            --panel: #171c23;
            --panel-2: #1c222b;
            --line: #272f39;
            --line-soft: #1f252e;
            --text: #eef1f4;
            --text-dim: #8993a1;
            --text-faint: #565f6b;
            --accent: #6c8cff;
            --accent-soft: #6c8cff26;
            --accent-2: #b06cff;
            --success: #3ddc97;
            --warn: #f5a524;
            --danger: #ff6b6b;
            --display: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            --mono: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
        }
        * { box-sizing: border-box; }
        html, body { margin: 0; padding: 0; }
        body {
            background:
                radial-gradient(circle at 14% -10%, #1a2231 0%, transparent 45%),
                var(--bg);
            color: var(--text);
            font-family: var(--display);
            -webkit-font-smoothing: antialiased;
            min-height: 100vh;
            padding: 40px 20px 60px;
        }
        .app { max-width: 640px; margin: 0 auto; }
        .site-footer {
            max-width: 640px;
            margin: 0 auto;
            font-family: var(--mono);
            font-size: 12px;
            color: var(--text-faint);
        }
        .site-footer a {
            color: var(--text-dim);
            text-decoration: none;
            transition: color .15s;
        }
        .site-footer a:hover { color: var(--accent); }
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }
        .site-footer {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            gap: 14px 22px;
            border-top: 1px solid var(--line);
            padding-top: 20px;
            margin-top: 42px;
            line-height: 1.7;
        }
        .site-footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

        /* ---------- header / signature ---------- */
        .eyebrow {
            font-family: var(--mono);
            font-size: 11px;
            letter-spacing: .12em;
            color: var(--accent);
            text-transform: uppercase;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .eyebrow::before {
            content: "";
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-soft);
        }
        h1 {
            font-size: 30px;
            font-weight: 700;
            letter-spacing: -.01em;
            margin: 14px 0 6px;
        }
        .tagline {
            color: var(--text-dim);
            font-size: 14.5px;
            line-height: 1.6;
            margin: 0 0 16px;
            max-width: 54ch;
        }
        .callout {
            display: flex;
            gap: 10px;
            align-items: flex-start;
            background: var(--panel);
            border: 1px solid var(--line);
            border-left: 3px solid var(--warn);
            border-radius: 8px;
            padding: 12px 14px;
            font-size: 12.5px;
            color: var(--text-dim);
            line-height: 1.6;
            margin: 0 0 20px;
        }
        .callout.error {
            border-left-color: var(--danger);
            display: none;
        }
        .callout.error.show { display: flex; }
        .callout-icon { flex-shrink: 0; }
        .entropy-strip {
            font-family: var(--mono);
            font-size: 13px;
            letter-spacing: .06em;
            color: var(--text-faint);
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: 10px;
            padding: 14px 16px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: clip;
            user-select: none;
        }
        .entropy-strip.is-live { color: var(--accent-2); }

        /* ---------- panel ---------- */
        .panel {
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: 14px;
            padding: 26px;
            margin-top: 22px;
        }
        .field-group {
            display: flex;
            flex-direction: column;
            padding: 14px 0;
            border-bottom: 1px solid var(--line-soft);
        }
        .field-group:first-child { padding-top: 0; }
        .field-group-last { border-bottom: none; }
        .control-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
        }
        .control-row label, .control-label {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-dim);
            letter-spacing: .02em;
            flex-shrink: 0;
        }
        .hint-group {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .field-msg {
            font-family: var(--mono);
            font-size: 11.5px;
            color: var(--danger);
            padding: 6px 0 0;
        }
        .field-msg:empty { display: none; }

        .stepper {
            display: flex;
            align-items: center;
            background: var(--panel-2);
            border: 1px solid var(--line);
            border-radius: 9px;
            overflow: hidden;
        }
        .stepper button {
            width: 34px;
            height: 36px;
            border: none;
            background: transparent;
            color: var(--text-dim);
            font-family: var(--display);
            font-size: 17px;
            cursor: pointer;
            transition: background .15s, color .15s;
        }
        .stepper button:hover { background: var(--accent-soft); color: var(--accent); }
        .stepper input {
            width: 64px;
            height: 36px;
            border: none;
            background: transparent;
            color: var(--text);
            font-family: var(--mono);
            font-size: 14px;
            text-align: center;
            -moz-appearance: textfield;
        }
        .stepper input::-webkit-outer-spin-button,
        .stepper input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .bit-hint, .strength-badge {
            font-family: var(--mono);
            font-size: 11px;
            font-weight: 600;
            padding: 5px 9px;
            border-radius: 6px;
            white-space: nowrap;
        }
        .bit-hint { color: var(--accent); background: var(--accent-soft); }
        .strength-badge.tier-low { color: var(--danger); background: #ff6b6b1f; }
        .strength-badge.tier-mid { color: var(--warn); background: #f5a5241f; }
        .strength-badge.tier-high { color: var(--accent); background: var(--accent-soft); }
        .strength-badge.tier-vhigh { color: var(--success); background: #3ddc971f; }

        .presets {
            display: flex;
            gap: 8px;
            padding: 0 0 14px;
            flex-wrap: wrap;
        }
        .chip {
            font-family: var(--mono);
            font-size: 12px;
            color: var(--text-dim);
            background: var(--panel-2);
            border: 1px solid var(--line);
            border-radius: 999px;
            padding: 6px 12px;
            cursor: pointer;
            transition: .15s;
        }
        .chip:hover { border-color: var(--accent); color: var(--text); }
        .chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

        .segmented {
            display: flex;
            background: var(--panel-2);
            border: 1px solid var(--line);
            border-radius: 9px;
            padding: 3px;
            gap: 2px;
            flex-wrap: wrap;
        }
        .segmented button {
            font-family: var(--mono);
            font-size: 12px;
            padding: 8px 12px;
            border: none;
            border-radius: 7px;
            background: transparent;
            color: var(--text-dim);
            cursor: pointer;
            transition: .15s;
        }
        .segmented button:hover { color: var(--text); }
        .segmented button.active { background: var(--accent); color: #0b0e13; font-weight: 600; }

        .auto-note {
            font-size: 11.5px;
            color: var(--text-faint);
            margin: 14px 0 0;
        }

        .generate-btn {
            width: 100%;
            margin-top: 14px;
            padding: 15px;
            border: none;
            border-radius: 10px;
            background: var(--accent);
            color: #0b0e13;
            font-family: var(--display);
            font-size: 15px;
            font-weight: 700;
            letter-spacing: .02em;
            cursor: pointer;
            transition: transform .12s, box-shadow .12s, background .15s, opacity .15s;
        }
        .generate-btn:hover { box-shadow: 0 8px 24px -8px var(--accent-soft); transform: translateY(-1px); }
        .generate-btn:active { transform: translateY(0); }
        .generate-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

        /* ---------- output ---------- */
        .output { margin-top: 24px; }
        .output-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12px;
            color: var(--text-faint);
            letter-spacing: .1em;
            text-transform: uppercase;
            margin-bottom: 10px;
        }
        .ghost-btn {
            font-family: var(--mono);
            font-size: 11.5px;
            color: var(--text-dim);
            background: var(--panel-2);
            border: 1px solid var(--line);
            border-radius: 7px;
            padding: 7px 11px;
            cursor: pointer;
            transition: .15s;
        }
        .ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
        .ghost-btn:disabled { opacity: .4; cursor: not-allowed; }

        .key-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .key-row {
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--panel-2);
            border: 1px solid var(--line);
            border-radius: 9px;
            padding: 11px 12px;
        }
        .key-idx {
            font-family: var(--mono);
            font-size: 11px;
            color: var(--text-faint);
            flex-shrink: 0;
            width: 20px;
        }
        .key-value {
            font-family: var(--mono);
            font-size: 13px;
            color: var(--text);
            word-break: break-all;
            flex: 1;
        }
        .copy-btn {
            flex-shrink: 0;
            font-family: var(--mono);
            font-size: 11px;
            color: var(--text-dim);
            background: transparent;
            border: 1px solid var(--line);
            border-radius: 6px;
            padding: 6px 9px;
            cursor: pointer;
            transition: .15s;
        }
        .copy-btn:hover { border-color: var(--accent); color: var(--accent); }
        .copy-btn.copied { border-color: var(--success); color: var(--success); }

        .empty-state {
            font-family: var(--mono);
            font-size: 12.5px;
            color: var(--text-faint);
            text-align: center;
            padding: 22px 10px;
            border: 1px dashed var(--line);
            border-radius: 9px;
        }

        .download-row {
            display: flex;
            gap: 8px;
            margin-top: 12px;
        }

        .footnote {
            margin-top: 26px;
            font-size: 12.5px;
            line-height: 1.7;
            color: var(--text-faint);
        }
        .footnote code {
            font-family: var(--mono);
            color: var(--text-dim);
            background: var(--panel-2);
            padding: 1px 6px;
            border-radius: 4px;
            border: 1px solid var(--line);
        }

        /* ---------- docs / faq sections ---------- */
        .section-title {
            font-size: 12px;
            letter-spacing: .1em;
            text-transform: uppercase;
            color: var(--text-faint);
            margin: 34px 0 14px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .section-title::after {
            content: "";
            flex: 1;
            height: 1px;
            background: var(--line);
        }
        .section-desc {
            font-size: 13px;
            color: var(--text-dim);
            line-height: 1.7;
            margin: -6px 0 16px;
        }

        .docs-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }
        @media (max-width:560px) { .docs-grid { grid-template-columns: 1fr; } }
        .doc-card {
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: 10px;
            padding: 16px;
            transition: border-color .2s, background .2s;
        }
        .doc-card.active { border-color: var(--accent); background: var(--panel-2); }
        .doc-card-head {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 9px;
        }
        .doc-card-title { font-weight: 700; font-size: 14px; }
        .doc-card-tag {
            font-family: var(--mono);
            font-size: 10px;
            color: var(--text-faint);
            white-space: nowrap;
        }
        .doc-charset {
            font-family: var(--mono);
            font-size: 11px;
            color: var(--accent-2);
            margin: 0 0 9px;
            word-break: break-all;
            line-height: 1.6;
        }
        .doc-desc {
            font-size: 12.5px;
            color: var(--text-dim);
            line-height: 1.65;
            margin: 0 0 9px;
        }
        .doc-use {
            font-size: 11.5px;
            color: var(--text-faint);
            line-height: 1.6;
            margin: 0;
        }
        .doc-use b { color: var(--text-dim); font-weight: 600; }

        .faq-item {
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: 10px;
            padding: 2px 16px;
            margin-bottom: 8px;
        }
        .faq-item summary {
            cursor: pointer;
            padding: 14px 0;
            font-size: 13.5px;
            font-weight: 600;
            list-style: none;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
        }
        .faq-item summary::-webkit-details-marker { display: none; }
        .faq-item summary::after {
            content: "+";
            font-family: var(--mono);
            color: var(--text-faint);
            font-size: 17px;
            flex-shrink: 0;
            transition: transform .2s;
        }
        .faq-item[open] summary::after { transform: rotate(45deg); }
        .faq-item p {
            font-size: 13px;
            color: var(--text-dim);
            line-height: 1.75;
            margin: 0 0 16px;
            padding-top: 2px;
        }

        button:focus-visible, input:focus-visible, summary:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        @media (max-width:520px) {
            .control-row { flex-direction: column; align-items: flex-start; gap: 10px; }
            .hint-group { align-self: flex-start; }
        }
        @media (prefers-reduced-motion: reduce) {
            .generate-btn, .chip, .copy-btn, .ghost-btn, .doc-card { transition: none; }
        }

/* Right-to-left locale support */
html[dir="rtl"] .callout {
    border-left-width: 1px;
    border-right: 3px solid var(--warn);
}
html[dir="rtl"] .callout.error { border-right-color: var(--danger); }
html[dir="rtl"] .key-value,
html[dir="rtl"] .doc-charset,
html[dir="rtl"] .entropy-strip,
html[dir="rtl"] code {
    direction: ltr;
    text-align: left;
}
