/* ============================================================
   ewbang · 多因素身份验证 MFA —— 站点样式
   设计方向：暖白底 + 白卡片 + 墨绿强调 + 极细边线
   ============================================================ */

/* ==========================================================
   01 设计令牌
   ========================================================== */
:root {
    /* 底色与表面 */
    --paper: #f7f5ef;
    --paper-2: #f1eee4;
    --surface: #ffffff;

    /* 墨色 */
    --ink: #1b1a16;
    --ink-2: #3c3931;
    --ink-3: #55514a;
    --ink-4: #757063;
    /* 仅装饰：编号、占位符 */
    --ink-5: #a7a193;

    /* 线 */
    --rule: #e8e4d8;
    --rule-soft: #f0ece1;
    --rule-strong: #d9d4c6;

    /* 强调 */
    --accent: #17664e;
    --accent-deep: #0f4f3b;
    --accent-soft: #e8f2ec;

    --danger: #b03a2e;
    --danger-soft: #fbeceb;
    --warn: #8a5709;

    /* 字体 */
    --sans: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC",
        "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Microsoft YaHei", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
        "Liberation Mono", monospace;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --shadow-card: 0 1px 2px rgba(27, 26, 22, .03);
    --shadow-pop: 0 18px 40px -24px rgba(27, 26, 22, .45),
        0 2px 6px rgba(27, 26, 22, .05);
}

/* ==========================================================
   02 基础
   ========================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink-2);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

input {
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    display: block;
}

::selection {
    background: var(--accent);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

[hidden],
.hidden {
    display: none !important;
}

.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;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--paper);
}

::-webkit-scrollbar-thumb {
    background: var(--rule-strong);
    border: 3px solid var(--paper);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ink-4);
}

/* ==========================================================
   03 布局
   ========================================================== */
.page {
    position: relative;
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 28px 28px;
}

/* ==========================================================
   04 顶栏
   ========================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    background: rgba(247, 245, 239, .92);
    -webkit-backdrop-filter: saturate(150%) blur(10px);
    backdrop-filter: saturate(150%) blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .005em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
}

.brand-mark svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

.brand-text {
    line-height: 1.35;
}

.brand-mfa {
    color: var(--accent);
    font-weight: 700;
}

.brand-tail {
    color: var(--ink-4);
    font-weight: 500;
    white-space: nowrap;
}

.top-nav {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    flex: none;
}

.top-nav a {
    position: relative;
    color: var(--ink-4);
    font-size: 12.5px;
    letter-spacing: .01em;
    transition: color .18s var(--ease);
}

.top-nav a:hover {
    color: var(--ink-2);
}

.top-nav a.is-active {
    color: var(--ink);
    font-weight: 600;
}

/* ==========================================================
   05 首屏
   ========================================================== */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 236px;
    gap: 56px;
    align-items: start;
    padding: 44px 0 40px;
}

.hero-copy {
    min-width: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-4);
}

.eyebrow-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.title {
    margin-top: 16px;
    text-wrap: balance;
    font-size: clamp(30px, 3.7vw, 44px);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -.022em;
    color: var(--ink);
}

.title-accent {
    color: var(--accent);
}

.lede {
    max-width: 56ch;
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.85;
    color: var(--ink-3);
}

/* 右侧要点清单 */
.hero-points {
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding-top: 8px;
}

.hero-points li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--ink-2);
}

.hero-points svg {
    width: 13px;
    height: 13px;
    flex: none;
    margin-top: 3px;
    stroke: var(--accent);
}

/* ==========================================================
   06 工作区
   ========================================================== */
.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 368px;
    gap: 18px;
    align-items: start;
}

.col-main,
.col-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/* ==========================================================
   07 卡片与区块头
   ========================================================== */
.card {
    padding: 20px 22px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.sec-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--rule-soft);
}

.step {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .1em;
    color: var(--ink-5);
}

.sec-title {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .005em;
    color: var(--ink);
}

.sec-hint {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--ink-4);
    letter-spacing: .02em;
    white-space: nowrap;
}

.sec-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ==========================================================
   08 输入区
   ========================================================== */
.input-shell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--rule-strong);
    border-radius: 8px;
    background: var(--surface);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.input-shell:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-icon {
    width: 15px;
    height: 15px;
    flex: none;
    stroke: var(--ink-4);
}

.secret-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: none;
    font-family: var(--mono);
    font-size: 13.5px;
    letter-spacing: .04em;
    color: var(--ink);
}

.secret-input::placeholder {
    font-family: var(--sans);
    font-size: 13px;
    letter-spacing: 0;
    color: var(--ink-4);
}

.secret-input.invalid {
    color: var(--danger);
}

.input-clear {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 5px;
    color: var(--ink-4);
    transition: background .15s, color .15s;
}

.input-clear:hover {
    background: var(--paper-2);
    color: var(--ink);
}

.input-clear svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

.field-error {
    display: none;
    align-items: flex-start;
    gap: 6px;
    margin-top: 9px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--danger);
}

.field-error.show {
    display: flex;
}

.field-error svg {
    width: 14px;
    height: 14px;
    flex: none;
    margin-top: 3px;
    stroke: currentColor;
}

.tool-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-top: 14px;
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--rule-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 12.5px;
    transition: border-color .18s, background .18s, color .18s;
}

.ghost-btn:hover {
    border-color: var(--ink-4);
    background: var(--paper);
    color: var(--ink);
}

.ghost-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    opacity: .7;
}

.tool-hint {
    font-size: 11.5px;
    color: var(--ink-4);
}

.tool-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    margin: 0 2px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--paper);
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-3);
}

/* 开关 */
.switch-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 12px;
    color: var(--ink-2);
    cursor: pointer;
    user-select: none;
}

.switch-wrap input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.switch-track {
    position: relative;
    width: 32px;
    height: 18px;
    flex: none;
    border-radius: 999px;
    background: var(--rule-strong);
    transition: background .2s var(--ease);
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(27, 26, 22, .18);
    transition: transform .2s var(--ease);
}

.switch-wrap input:checked + .switch-track {
    background: var(--accent);
}

.switch-wrap input:checked + .switch-track::after {
    transform: translateX(14px);
}

.switch-wrap input:focus-visible + .switch-track {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.switch-label {
    white-space: nowrap;
}

/* ==========================================================
   09 验证码面板
   ========================================================== */
.code-panel {
    padding: 16px 18px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: #faf8f2;
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.code-caption {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    color: var(--ink-3);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2.4s ease-out infinite;
}

.code-panel.empty .live-dot {
    background: var(--ink-4);
    animation: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(23, 102, 78, .35);
    }

    70%,
    100% {
        box-shadow: 0 0 0 6px rgba(23, 102, 78, 0);
    }
}

.code-owner {
    max-width: 62%;
    padding-left: 9px;
    border-left: 1px solid var(--rule);
    font-size: 11px;
    color: var(--ink-4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 数字 + 圆环 */
.code-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.code-value {
    display: flex;
    align-items: baseline;
    gap: 22px;
    min-width: 0;
}

.digit-group {
    display: flex;
    gap: 4px;
}

.digit {
    font-family: var(--mono);
    font-size: clamp(38px, 4.8vw, 54px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.01em;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    animation: digitIn .26s var(--ease) both;
}

.digit.is-empty {
    color: var(--ink-5);
    animation: none;
}

/* 只做位移：即使动画被暂停或跳过，数字也不会消失 */
@keyframes digitIn {
    from {
        transform: translateY(4px);
    }

    to {
        transform: translateY(0);
    }
}

.code-ring {
    position: relative;
    width: 50px;
    height: 50px;
    flex: none;
}

.code-ring svg {
    width: 50px;
    height: 50px;
    transform: rotate(-90deg);
}

.ring-track {
    fill: none;
    stroke: var(--rule);
    stroke-width: 3;
}

.ring-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset .35s linear, stroke .2s;
}

.ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-family: var(--mono);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.ring-label i {
    font-style: normal;
    font-size: 8.5px;
    color: var(--ink-4);
}

.code-panel.empty .ring-fill {
    stroke: var(--rule-strong);
}

.code-panel.empty .ring-label {
    color: var(--ink-4);
}

.code-panel.is-soon .ring-fill {
    stroke: var(--danger);
}

.code-panel.is-soon .ring-label {
    color: var(--danger);
}

.code-panel.is-soon .code-progress span {
    background: var(--danger);
}

.code-progress {
    height: 2px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--rule);
}

.code-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width .3s linear;
}

.code-panel.empty .code-progress span {
    background: var(--ink-5);
}

.code-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 14px;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .01em;
    transition: background .18s var(--ease), transform .12s var(--ease);
}

.copy-btn:hover:not(:disabled) {
    background: var(--accent-deep);
}

.copy-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.copy-btn:disabled {
    background: var(--paper-2);
    color: var(--ink-5);
    cursor: not-allowed;
}

.copy-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.copy-btn.copied {
    background: var(--accent-deep);
}

.code-note {
    font-size: 11px;
    color: var(--ink-4);
}

/* 参数标签 */
.parsed-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--rule-soft);
}

.parsed-label {
    margin-right: 2px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-5);
}

.param-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.param-tag {
    padding: 2px 8px;
    border: 1px solid var(--rule-soft);
    border-radius: 5px;
    background: var(--paper);
    font-family: var(--mono);
    font-size: 10.5px;
    line-height: 1.7;
    color: var(--ink-3);
}

/* ==========================================================
   10 已保存账号
   ========================================================== */
.saved-count {
    min-width: 22px;
    padding: 0 7px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--paper);
    font-family: var(--mono);
    font-size: 10.5px;
    line-height: 18px;
    text-align: center;
    color: var(--ink-3);
}

.export-wrap {
    position: relative;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    background: var(--surface);
    font-size: 11.5px;
    color: var(--ink-2);
    transition: border-color .18s, color .18s;
}

.export-btn:hover {
    border-color: var(--ink-4);
    color: var(--ink);
}

.export-btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    opacity: .78;
}

.export-btn .chev {
    width: 10px;
    height: 10px;
    opacity: .5;
    transition: transform .2s var(--ease);
}

.export-btn[aria-expanded="true"] .chev {
    transform: rotate(180deg);
}

.export-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    width: 272px;
    padding: 6px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-pop);
    animation: menuIn .18s var(--ease);
}

@keyframes menuIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.export-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 6px;
    text-align: left;
    transition: background .15s;
}

.export-item:hover:not(:disabled) {
    background: var(--paper);
}

.export-item:disabled {
    opacity: .42;
    cursor: not-allowed;
}

.export-item .ico {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 6px;
    background: var(--paper);
    color: var(--ink-3);
}

.export-item .ico.import {
    background: var(--accent-soft);
    color: var(--accent);
}

.export-item .ico svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.export-item .txt {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.export-item strong {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
}

.export-item .txt span {
    font-size: 11px;
    line-height: 1.55;
    color: var(--ink-4);
}

.export-warn {
    margin: 6px 10px 4px;
    font-size: 10.5px;
    line-height: 1.65;
    color: var(--warn);
}

.export-sep {
    height: 1px;
    margin: 6px 4px;
    background: var(--rule-soft);
}

.saved-list {
    display: flex;
    flex-direction: column;
}

.saved-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--rule-soft);
}

.saved-item:last-child {
    border-bottom: 0;
}

.saved-avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 8px;
    background: var(--paper-2);
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-2);
}

.saved-meta {
    min-width: 0;
}

.saved-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-issuer {
    font-size: 10.5px;
    color: var(--ink-4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-name-input {
    width: 100%;
    height: 24px;
    padding: 0 6px;
    border: 1px solid var(--accent);
    border-radius: 5px;
    outline: none;
    background: var(--surface);
    font-size: 12.5px;
    color: var(--ink);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.saved-code-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.saved-code {
    font-family: var(--mono);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: .04em;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.saved-code.is-fresh {
    animation: fresh .8s var(--ease);
}

@keyframes fresh {
    0% {
        color: var(--accent-deep);
    }

    100% {
        color: var(--accent);
    }
}

.saved-timer {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-family: var(--mono);
    font-size: 9px;
    color: var(--ink-4);
}

.saved-timer svg {
    display: none;
}

.saved-timer .st-track {
    fill: none;
    stroke: var(--rule-strong);
    stroke-width: 1.4;
}

.saved-timer .st-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.4;
    stroke-linecap: round;
    transition: stroke-dashoffset .3s linear;
}

.saved-timer .st-num {
    font-weight: 600;
}

.saved-timer .st-unit {
    font-style: normal;
    opacity: .7;
}

.saved-timer.is-soon {
    color: var(--danger);
}

.saved-timer.is-soon .st-fill {
    stroke: var(--danger);
}

.saved-actions {
    display: flex;
    align-items: center;
    gap: 0;
    opacity: 0;
    transition: opacity .18s var(--ease);
}

.saved-item:hover .saved-actions,
.saved-item:focus-within .saved-actions,
.saved-item.editing .saved-actions {
    opacity: 1;
}

@media (hover: none) {
    .saved-actions {
        opacity: 1;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
    }
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 22px;
    height: 24px;
    border-radius: 5px;
    color: var(--ink-5);
    transition: background .15s, color .15s;
}

.icon-btn:hover {
    background: var(--paper);
    color: var(--ink-2);
}

.icon-btn.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* 复制成功的短暂反馈：只作用于被点击的这个小图标 */
.icon-btn.is-done,
.icon-btn.is-done:hover {
    background: var(--accent-soft);
    color: var(--accent);
    cursor: default;
}

.icon-btn svg {
    width: 12.5px;
    height: 12.5px;
    stroke: currentColor;
}

.saved-empty {
    padding: 24px 14px;
    border: 1px dashed var(--rule-strong);
    border-radius: 10px;
    background: var(--paper);
    text-align: center;
}

.saved-empty svg {
    width: 24px;
    height: 24px;
    margin: 0 auto 9px;
    stroke: var(--ink-5);
}

.saved-empty strong {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
}

.saved-empty span {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--ink-4);
}

.empty-import {
    margin-top: 10px;
    padding-bottom: 1px;
    border-bottom: 1px solid currentColor;
    font-size: 12px;
    color: var(--accent);
}

.empty-import:hover {
    color: var(--accent-deep);
}

.clear-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px 0;
    border-radius: 7px;
    font-size: 12px;
    color: var(--danger);
    transition: background .18s, color .18s, opacity .18s;
}

.clear-btn:hover:not(:disabled) {
    background: var(--danger-soft);
}

.clear-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.side-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--accent-soft);
    font-size: 11.5px;
    line-height: 1.75;
    color: var(--ink-3);
}

.side-note svg {
    width: 13px;
    height: 13px;
    flex: none;
    margin-top: 3px;
    stroke: var(--accent);
}

/* ==========================================================
   11 正文与常见问题
   ========================================================== */
.card.doc {
    margin-top: 56px;
    padding: 0;
    /* 吸顶栏高约 54px，跳转后标题不被遮住 */
    scroll-margin-top: 74px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.doc-head {
    margin-bottom: 18px;
}

.doc-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.01em;
    color: var(--ink);
    text-wrap: balance;
}

.doc-lede {
    max-width: 68ch;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--ink-3);
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.doc-card {
    padding: 18px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.doc-num {
    display: block;
    margin-bottom: 8px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    color: var(--accent);
}

.doc-card h3 {
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--ink);
}

.doc-card p,
.doc-card li {
    font-size: 12.5px;
    line-height: 1.85;
    color: var(--ink-3);
}

.doc-card ol {
    counter-reset: doclist;
}

.doc-card ol li {
    position: relative;
    padding-left: 16px;
    counter-increment: doclist;
}

.doc-card ol li + li {
    margin-top: 3px;
}

.doc-card ol li::before {
    content: counter(doclist, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: .4em;
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--ink-5);
}

/* 常见问题 */
#faq .doc-head {
    margin-bottom: 14px;
}

.faq-list {
    padding: 2px 20px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.faq-item {
    border-bottom: 1px solid var(--rule-soft);
}

.faq-item:last-child {
    border-bottom: 0;
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    transition: color .18s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "";
    width: 7px;
    height: 7px;
    flex: none;
    margin-right: 4px;
    border-right: 1.5px solid var(--ink-4);
    border-bottom: 1.5px solid var(--ink-4);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s var(--ease), border-color .18s;
}

.faq-item summary:hover {
    color: var(--accent);
}

.faq-item summary:hover::after {
    border-color: var(--accent);
}

.faq-item[open] summary::after {
    transform: rotate(-135deg) translateY(-2px);
}

.faq-body {
    max-width: 78ch;
    padding: 0 0 16px;
}

.faq-body p {
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--ink-3);
}

/* ==========================================================
   12 页脚
   ========================================================== */
.page-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 56px;
    padding: 18px 0 26px;
    border-top: 1px solid var(--rule);
}

.foot-copy {
    font-size: 11.5px;
    color: var(--ink-4);
}

.foot-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.foot-nav a {
    font-size: 11.5px;
    color: var(--ink-4);
    transition: color .18s;
}

.foot-nav a:hover {
    color: var(--accent);
}

/* 返回顶部 */
.to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 60;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-3);
    box-shadow: 0 10px 24px -16px rgba(27, 26, 22, .5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .22s var(--ease), transform .22s var(--ease),
        visibility .22s, border-color .18s, color .18s;
}

.to-top.is-on {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.to-top svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

/* ==========================================================
   13 模态框
   ========================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(27, 26, 22, .42);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: fadeIn .18s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid var(--rule);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 40px 80px -40px rgba(27, 26, 22, .55);
    animation: modalIn .22s var(--ease);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.99);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.modal-ico {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    background: var(--paper);
    color: var(--ink-3);
}

.modal-ico.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.modal-ico svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.modal-copy {
    flex: 1;
    min-width: 0;
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ink);
}

.modal-desc,
.modal-file {
    margin-top: 3px;
    font-size: 12px;
    color: var(--ink-4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-close {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 6px;
    color: var(--ink-4);
    transition: background .15s, color .15s;
}

.modal-close:hover {
    background: var(--paper);
    color: var(--ink);
}

.modal-close svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.btn-ghost,
.btn-primary,
.btn-danger {
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    transition: background .18s, border-color .18s, color .18s;
}

.btn-ghost {
    border: 1px solid var(--rule-strong);
    background: var(--surface);
    color: var(--ink-2);
}

.btn-ghost:hover {
    background: var(--paper);
    color: var(--ink);
}

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

.btn-primary:hover {
    background: var(--accent-deep);
}

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

.btn-danger:hover {
    background: #932e24;
}

/* 导入 */
.import-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 18px 0;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 10px;
}

.import-stat {
    padding: 12px 8px;
    border-left: 1px solid var(--rule);
    text-align: center;
}

.import-stat:first-child {
    border-left: 0;
}

.import-stat strong {
    display: block;
    font-family: var(--mono);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.import-stat span {
    font-size: 10.5px;
    letter-spacing: .04em;
    color: var(--ink-4);
}

.import-stat.is-new strong {
    color: var(--accent);
}

.import-stat.is-dup strong {
    color: var(--ink-4);
}

.import-note {
    margin-bottom: 12px;
    padding: 9px 11px;
    border-radius: 6px;
    background: var(--danger-soft);
    font-size: 11.5px;
    line-height: 1.65;
    color: var(--danger);
}

.import-modes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.import-mode {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--rule);
    border-radius: 9px;
    cursor: pointer;
    transition: border-color .18s, background .18s;
}

.import-mode input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.import-mode b {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
}

.import-mode em {
    display: block;
    margin-top: 2px;
    font-style: normal;
    font-size: 11px;
    line-height: 1.6;
    color: var(--ink-4);
}

.import-mode.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.import-mode.is-danger.is-active {
    border-color: var(--danger);
    background: var(--danger-soft);
}

/* 清空 */
.clear-body {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--ink-3);
}

.clear-actions {
    margin-top: 12px;
}

.clear-backup {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 1px;
    border-bottom: 1px dashed var(--rule-strong);
    font-size: 12px;
    color: var(--ink-3);
    transition: color .18s, border-color .18s;
}

.clear-backup:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.clear-backup svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
}

body.modal-open {
    overflow: hidden;
}

/* ==========================================================
   14 提示条
   ========================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100% - 32px);
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    padding: 9px 16px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 18px 36px -22px rgba(27, 26, 22, .65);
    animation: toastIn .26s var(--ease) forwards;
    pointer-events: auto;
}

.toast.toast-out {
    animation: toastOut .22s ease forwards;
}

.toast.toast-warn {
    background: var(--warn);
}

.toast.toast-error {
    background: var(--danger);
}

.toast.toast-success {
    background: var(--accent);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ==========================================================
   15 无脚本提示
   ========================================================== */
.noscript-note {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid var(--rule-strong);
    border-left: 2px solid var(--warn);
    border-radius: 6px;
    background: var(--paper-2);
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--ink-3);
}

/* ==========================================================
   16 响应式
   ========================================================== */
@media (max-width: 980px) {
    .page {
        max-width: 740px;
    }

    .hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
        padding: 38px 0 28px;
    }

    .hero-points {
        gap: 8px;
        padding-top: 0;
    }

    .workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .doc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 660px) {
    .page {
        padding: 0 16px 20px;
    }

    .topbar {
        padding: 12px 0;
        gap: 12px;
    }

    .brand {
        gap: 8px;
        font-size: 12.5px;
    }

    .brand-mark {
        width: 24px;
        height: 24px;
        border-radius: 7px;
    }

    .brand-mark svg {
        width: 14px;
        height: 14px;
    }

    .top-nav {
        gap: 14px;
    }

    .top-nav a {
        font-size: 12px;
    }

    .hero {
        padding: 30px 0 24px;
        gap: 18px;
    }

    .title {
        margin-top: 14px;
    }

    .lede {
        font-size: 13.5px;
        line-height: 1.8;
    }

    .card {
        padding: 16px;
        border-radius: 11px;
    }

    .col-main,
    .col-side {
        gap: 16px;
    }

    /* 手机上没有 Ctrl+V，快捷键提示省掉，开关回到同一行 */
    .tool-hint {
        display: none;
    }

    .code-panel {
        padding: 14px;
    }

    .digit {
        font-size: 34px;
    }

    .code-value {
        gap: 12px;
    }

    .code-ring,
    .code-ring svg {
        width: 42px;
        height: 42px;
    }

    .ring-label {
        font-size: 12px;
    }

    .copy-btn {
        height: 36px;
        padding: 0 14px;
    }

    .card.doc {
        margin-top: 40px;
    }

    .doc-title {
        font-size: 18px;
    }

    .doc-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .faq-list {
        padding: 2px 16px;
    }

    .faq-item summary {
        padding: 14px 0;
        font-size: 12.5px;
    }

    .page-foot {
        margin-top: 40px;
        padding: 16px 0 22px;
    }

    .foot-nav {
        gap: 16px;
    }

    .to-top {
        right: 14px;
        bottom: 14px;
    }

    .toast-container {
        bottom: 14px;
    }
}

@media (max-width: 420px) {
    .brand {
        font-size: 12px;
    }

    .top-nav a {
        font-size: 11.5px;
    }

    .digit {
        font-size: 30px;
    }

    .code-value {
        gap: 10px;
    }

    .code-ring,
    .code-ring svg {
        width: 36px;
        height: 36px;
    }

    .sec-hint {
        display: none;
    }
}

/* 触屏与窄屏下让操作按钮常驻 */
@media (max-width: 560px) {
    .saved-actions {
        opacity: 1;
    }
}

/* ==========================================================
   17 降低动效
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .live-dot {
        animation: none;
    }
}
