/* 意玩云数 · 实人认证 — 接口文档
   方向：type-only-statement。纸白与墨，靠字号、字距与色块组织版面。
   tokens 全部来自 auth.css，这里只写版式。 */

html {
    /* 滚动条占位在两侧均分，左右留白才真正相等 */
    scrollbar-gutter: stable both-edges;
}

.docs {
    --gutter: 24px;
}

@media (max-width: 600px) {
    .docs {
        --gutter: 16px;
    }
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9;
    padding: 12px 18px;
    background: var(--ink);
    color: var(--paper);
    font-size: 14px;
    text-decoration: none;
}

.skip:focus {
    left: 12px;
    top: 12px;
}

/* ---------- 顶部：无导航条 ---------- */

.docs-top {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px var(--gutter);
}

.docs-top .brand {
    text-decoration: none;
}

.docs-top .mark {
    background: var(--ink);
    color: var(--paper);
}

.docs-top .wordmark span {
    color: var(--muted);
}

.docs-links {
    display: flex;
    gap: 30px;
    font-size: 14px;
}

.docs-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.18s ease;
}

.docs-links a:hover,
.docs-links a:focus-visible {
    color: var(--text);
}

/* ---------- 首屏 ---------- */

.hero {
    display: flex;
    flex-direction: column;
    min-height: 92svh;
    padding: 152px var(--gutter) 34px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(56px, 12.5vw, 190px);
    line-height: 0.94;
    letter-spacing: -0.05em;
    font-weight: 500;
}

.hero h1 .line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.09em;
    margin-bottom: -0.09em;
}

.hero h1 .line:nth-child(2) {
    text-align: right;
}

.hero h1 [data-line] {
    display: block;
}

.hero-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
    margin-top: auto;
    padding-top: 10vh;
}

.hero-lede {
    margin: 0;
    max-width: 30em;
    font-size: clamp(17px, 1.5vw, 22px);
    line-height: 1.55;
    color: var(--text);
}

.btn-ink {
    display: inline-flex;
    align-items: center;
    height: 54px;
    padding: 0 28px;
    background: var(--ink);
    color: var(--paper);
    font-size: 15px;
    text-decoration: none;
    flex: none;
    transition: background 0.18s ease;
}

.btn-ink:hover {
    background: var(--jade-deep);
}

.btn-ink:focus-visible {
    outline: 2px solid var(--jade);
    outline-offset: 3px;
}

/* ---------- 陈述段：整屏墨色 ---------- */

.statement {
    display: flex;
    align-items: center;
    padding: 12vh var(--gutter);
    background: var(--ink);
    color: var(--on-dark);
}

.statement-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    align-items: center;
    gap: clamp(48px, 7vw, 120px);
    width: 100%;
}

.stairs {
    margin: 0;
    font-size: clamp(24px, 2.5vw, 36px);
    line-height: 1.34;
    letter-spacing: -0.02em;
    font-weight: 500;
}

.stairs span {
    display: block;
    padding-left: calc(var(--n) * 4vw);
}

.stairs span:last-child {
    color: var(--jade-light);
}

/* 接口真正的输出：一个布尔值 */
.answer {
    text-align: left;
}

.answer-code {
    margin: 0;
    font-size: clamp(24px, 3.4vw, 44px);
    line-height: 1.3;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.answer-brace {
    color: rgba(233, 236, 230, 0.34);
}

.answer-key {
    color: var(--on-dark-muted);
}

.answer-true {
    color: var(--jade-light);
}

.answer-note {
    margin: 26px 0 0;
    max-width: 22em;
    font-size: 15px;
    line-height: 1.7;
    color: var(--on-dark-muted);
}

/* ---------- 链路 ---------- */

.chain {
    padding: 170px var(--gutter) 0;
}

.chain h2 {
    margin: 0 0 56px;
    font-size: clamp(34px, 4.4vw, 64px);
    line-height: 1.02;
    letter-spacing: -0.045em;
    font-weight: 500;
}

.chain-map {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chain-map > li {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.seg {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 22vh;
    min-height: 172px;
    padding: 18px 16px 20px;
    background: var(--ink);
    color: var(--on-dark);
    text-decoration: none;
    transition: background 0.2s ease;
}

.seg:hover {
    background: var(--ink-soft);
}

.seg:focus-visible {
    outline: 2px solid var(--jade);
    outline-offset: -4px;
}

.seg.is-human {
    background: var(--jade);
}

.seg.is-human:hover {
    background: var(--jade-deep);
}

.seg-time {
    font-size: 13px;
    letter-spacing: 0.01em;
    color: var(--on-dark-muted);
    font-variant-numeric: tabular-nums;
}

.seg-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.seg-path {
    font-size: 13px;
    line-height: 1.5;
    color: var(--on-dark-muted);
    word-break: break-all;
}

.seg.is-human .seg-path {
    color: rgba(233, 236, 230, 0.78);
}

.seg.is-human .seg-time {
    color: rgba(233, 236, 230, 0.78);
}

.seg-name {
    font-size: clamp(19px, 2.1vw, 32px);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.seg-note {
    margin: 18px 0 0;
    padding-right: 18px;
    font-size: 15px;
    line-height: 1.6;
}

/* ---------- 步骤 ---------- */

.step {
    padding: 0 var(--gutter);
    margin: 152px auto 0;
}

.step-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(40px, 5vw, 88px);
    align-items: start;
}

.step h2 {
    margin: 0 0 20px;
    font-size: clamp(32px, 3.4vw, 52px);
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-weight: 500;
}

.step-lead {
    margin: 0 0 22px;
    max-width: 23em;
    font-size: clamp(18px, 1.45vw, 21px);
    line-height: 1.55;
}

.step-body {
    margin: 0 0 22px;
    max-width: 32em;
    font-size: 16px;
    line-height: 1.72;
}

.step-text code,
.step-body code {
    font-size: 1em;
}

.params {
    width: 100%;
    margin: 4px 0 0;
    border-collapse: collapse;
    font-size: 14.5px;
}

.params th {
    padding: 0 12px 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
    text-align: left;
    white-space: nowrap;
}

.params td {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    line-height: 1.6;
}

.params td:first-child {
    width: 28%;
    white-space: nowrap;
}

.params td:last-child,
.params th:last-child {
    padding-right: 0;
}

.params .req {
    color: var(--muted);
    font-size: 13px;
}

.algo {
    margin: 0 0 28px;
    padding-left: 1.5em;
    font-size: 16px;
    line-height: 1.72;
}

.algo li {
    margin-bottom: 6px;
}

.algo li::marker {
    color: var(--jade);
    font-variant-numeric: tabular-nums;
}

.step-note {
    margin: 18px 0 0;
    max-width: 34em;
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
}

/* ---------- 代码面板 ---------- */

.panel {
    margin-bottom: 14px;
    background: var(--ink);
    color: var(--on-dark);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 16px 10px;
    background: rgba(233, 236, 230, 0.055);
}

.panel-label {
    font-size: 13px;
    color: var(--on-dark-muted);
}

.copy {
    padding: 3px 0;
    border: 0;
    background: none;
    color: var(--on-dark-muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.18s ease;
}

.copy:hover {
    color: var(--on-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.copy:focus-visible {
    outline: 2px solid var(--jade-light);
    outline-offset: 3px;
}

.panel pre {
    margin: 0;
    padding: 14px 16px 18px;
    overflow-x: auto;
}

.panel code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.78;
    color: #dde5df;
    tab-size: 4;
}

.panel .cmt {
    color: #8fa096;
}

/* ---------- 时钟 ---------- */

.clock {
    margin-top: 22px;
    padding: 18px 20px 16px;
    background: var(--panel);
}

.clock-label {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.clock-time {
    margin: 6px 0 8px;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.clock-drift {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

.clock-drift.is-bad {
    color: var(--danger);
}

/* ---------- 玉色警示块 ---------- */

.jade-field {
    padding: clamp(28px, 3.6vw, 46px);
    background: var(--jade);
    color: var(--on-dark);
}

.jade-field .jade-say {
    margin: 0 0 18px;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.32;
    letter-spacing: -0.025em;
}

.jade-field p:last-child {
    margin: 0;
    font-size: 15px;
    line-height: 1.72;
    color: rgba(233, 236, 230, 0.82);
}

/* ---------- 状态表 ---------- */

.status-table {
    width: 100%;
    margin-top: 30px;
    border-collapse: collapse;
    font-size: 14.5px;
}

.status-table th {
    padding: 0 12px 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
    text-align: left;
}

.status-table td {
    padding: 11px 12px 11px 0;
    border-bottom: 1px solid var(--line);
    line-height: 1.55;
}

.status-table td:first-child {
    width: 26%;
}

.status-table code {
    font-size: 13px;
}

.status-table .is-pass {
    color: var(--jade-deep);
}

/* ---------- 错误码 ---------- */

.errors {
    margin-top: 176px;
    padding: 92px var(--gutter) 96px;
    background: var(--ink);
    color: var(--on-dark);
}

.errors h2 {
    margin: 0 0 14px;
    font-size: clamp(34px, 4.4vw, 64px);
    line-height: 1.02;
    letter-spacing: -0.045em;
    font-weight: 500;
}

.errors-lead {
    margin: 0 0 46px;
    max-width: 34em;
    font-size: 17px;
    line-height: 1.6;
    color: var(--on-dark-muted);
}

.errors-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 56px;
    align-items: start;
}

.err-group {
    margin-bottom: 38px;
}

.err-group-name {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--on-dark-muted);
}

.err-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.err-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-height: 42px;
    padding: 8px 0;
    font-size: 16px;
    line-height: 1.5;
}

.err-code {
    flex: none;
    width: 62px;
    font-variant-numeric: tabular-nums;
}

.err-http {
    flex: none;
    width: 42px;
    font-size: 14px;
    color: rgba(233, 236, 230, 0.5);
    font-variant-numeric: tabular-nums;
}

.err-text {
    flex: 1;
    min-width: 0;
}

/* ---------- 常见问题 ---------- */

.faq {
    padding: 140px var(--gutter) 0;
}

.faq-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    margin-bottom: 64px;
}

.faq-q {
    grid-column: 1 / span 6;
    margin: 0;
    font-size: clamp(22px, 2.2vw, 32px);
    line-height: 1.18;
    letter-spacing: -0.03em;
    font-weight: 500;
}

.faq-a {
    grid-column: 7 / span 6;
    margin: 0;
    padding-top: 10px;
    font-size: 17px;
    line-height: 1.62;
}

.faq-title {
    grid-column: 1 / span 6;
    margin: 0;
    font-size: clamp(22px, 2.2vw, 32px);
    line-height: 1.18;
    letter-spacing: -0.03em;
    font-weight: 500;
    color: var(--muted);
}

/* ---------- 附录 ---------- */

/* ---------- 页脚 ---------- */

.docs-foot {
    padding: 100px var(--gutter) 34px;
    background: var(--ink);
    color: var(--on-dark);
}

.foot-name {
    margin: 0 0 72px;
    font-size: clamp(44px, 8.6vw, 132px);
    line-height: 0.94;
    letter-spacing: -0.05em;
    font-weight: 500;
}

.foot-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 32px;
    font-size: 14px;
    color: var(--on-dark-muted);
}

.foot-links {
    display: flex;
    gap: 26px;
}

.foot-links a {
    text-decoration: none;
    transition: color 0.18s ease;
}

.foot-links a:hover {
    color: var(--on-dark);
}

/* ---------- 动效 ---------- */

@media (prefers-reduced-motion: no-preference) {
    .js .hero h1 [data-line] {
        transform: translateY(105%);
        animation: line-up 850ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
        animation-delay: calc(var(--i) * 90ms + 100ms);
    }

    .js .hero-lede,
    .js .btn-ink {
        animation: fade-up 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
        animation-delay: 480ms;
    }

    .js .btn-ink {
        animation-delay: 580ms;
    }

    /* 只位移、不改透明度：文档内容任何时候都不会是「看不见」的状态，
       脚本失败或被快速滚过时也只是少一次上浮。 */
    .js [data-reveal] {
        transform: translateY(18px);
        transition: transform 0.52s cubic-bezier(0.16, 1, 0.3, 1);
        transition-delay: var(--d, 0ms);
    }

    .js [data-reveal].is-in {
        transform: none;
    }

    .js [data-grow] {
        transform: scaleX(0);
        transform-origin: left center;
        transition: transform 0.62s cubic-bezier(0.16, 1, 0.3, 1);
        transition-delay: var(--d, 0ms);
    }

    .js [data-grow].is-in {
        transform: none;
    }
}

@keyframes line-up {
    to {
        transform: none;
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- 窄屏 ---------- */

@media (max-width: 980px) {
    .step-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }

    .errors-groups {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

}

@media (max-width: 860px) {
    .docs-links {
        gap: 18px;
        font-size: 13px;
    }

    .docs-links a:first-child {
        display: none;
    }

    .hero {
        min-height: 88svh;
        padding-top: 112px;
    }

    .hero h1 {
        margin-block: auto;
        font-size: 17vw;
        line-height: 0.98;
    }

    .hero-foot {
        flex-direction: column;
        align-items: flex-start;
        gap: 26px;
        padding-top: 8vh;
    }

    .hero-lede {
        max-width: none;
        font-size: 18px;
    }

    .btn-ink {
        width: 100%;
        justify-content: center;
    }

    .statement {
        padding: 10vh var(--gutter);
    }

    .statement-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 44px;
    }

    .stairs {
        font-size: clamp(23px, 6vw, 30px);
        line-height: 1.42;
    }

    .stairs span {
        padding-left: calc(var(--n) * 2.2vw);
    }

    .answer,
    .answer-note {
        text-align: left;
        margin-left: 0;
    }

    .answer-code {
        font-size: 28px;
    }

    .chain {
        padding-top: 104px;
    }

    .chain h2 {
        margin-bottom: 34px;
    }

    .chain-map {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .seg {
        height: auto;
        min-height: 92px;
        padding: 14px 16px 16px;
    }

    .seg-name {
        font-size: 21px;
    }

    .seg-note {
        margin-top: 10px;
        padding-right: 0;
        font-size: 15px;
    }

    .step {
        margin-top: 104px;
    }

    .step h2 {
        font-size: 32px;
    }

    .params td:first-child {
        white-space: normal;
    }

    .errors {
        margin-top: 104px;
        padding: 64px var(--gutter) 68px;
    }

    .faq {
        padding-top: 96px;
    }

    .faq-row {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 14px;
        margin-bottom: 52px;
    }

    .faq-q,
    .faq-a,
    .faq-title {
        grid-column: 1 / -1;
    }

    .faq-q,
    .faq-title {
        font-size: 24px;
    }

    .faq-a {
        font-size: 16px;
    }

    .docs-foot {
        padding-top: 72px;
    }

    .foot-name {
        margin-bottom: 44px;
    }

    .foot-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .panel pre {
        white-space: pre-wrap;
        word-break: break-word;
    }

    .panel code {
        font-size: 12px;
        line-height: 1.7;
    }
}

@media (max-width: 420px) {

    .err-list li {
        min-height: 38px;
        gap: 16px;
        font-size: 15px;
    }

    .err-code {
        width: 64px;
    }
}

/* ---------- 收尾：控制台概览 ---------- */

.console-close {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 96px);
    align-items: center;
    padding: 140px var(--gutter) 150px;
}

.console-close h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.12;
    letter-spacing: -0.035em;
    font-weight: 500;
}

.console-close-text {
    margin: 18px 0 28px;
    max-width: 24em;
    font-size: 16px;
    line-height: 1.72;
}

.console-stats {
    max-width: 100%;
    padding: 18px 20px 16px;
}


@media (max-width: 860px) {
    .console-close {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
        padding: 96px var(--gutter) 96px;
    }
}
