/* documentation, legal and error pages */

.doc-head { padding: 54px 0 36px; border-bottom: 1px solid var(--line); }
.doc-head .wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 46px; align-items: end; }
.doc-head h1 { font-family: var(--serif); font-size: clamp(32px, 4.3vw, 52px); line-height: 1.15; letter-spacing: -.035em; font-weight: 600; margin: 14px 0 16px; }
.doc-head .lead { color: var(--muted); font-size: 14px; line-height: 1.85; max-width: 650px; margin: 0; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.doc-meta span { border: 1px solid var(--line); background: rgba(255,253,249,.7); border-radius: 999px; padding: 4px 10px; font-size: 10px; color: var(--muted); }
.doc-side { border-left: 1px solid var(--line); padding-left: 26px; }
.doc-side b { display: block; font-size: 11px; letter-spacing: .06em; margin-bottom: 8px; }
.doc-side p { margin: 0 0 12px; color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.doc-side a { display: block; font-size: 11.5px; color: var(--amber-deep); padding: 4px 0; }
.doc-side a:hover { text-decoration: underline; text-underline-offset: 3px; }

.ai-strip { background: #fdf4e3; border-bottom: 1px solid #ecd7ae; }
.ai-strip .wrap { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; }
.ai-strip svg { width: 20px; height: 20px; flex: none; margin-top: 2px; fill: none; stroke: var(--amber-deep); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ai-strip b { color: #76520f; font-size: 12px; display: block; margin-bottom: 2px; }
.ai-strip p { margin: 0; color: #85683a; font-size: 11px; line-height: 1.7; }
.ai-strip .ai-tag { margin-left: auto; flex: none; border: 1px solid #dfc18b; color: #85601d; border-radius: 999px; font-size: 9px; padding: 3px 9px; align-self: center; }

.doc-layout { display: grid; grid-template-columns: 246px minmax(0, 1fr); gap: 58px; padding: 42px 0 84px; align-items: start; }
.doc-toc { position: sticky; top: 94px; border: 1px solid var(--line); background: rgba(255,253,249,.72); border-radius: 16px; padding: 16px 14px; max-height: calc(100vh - 116px); overflow-y: auto; }
.doc-toc > b { display: block; font-size: 10px; letter-spacing: .14em; color: var(--faint); text-transform: uppercase; padding: 0 8px 10px; }
.doc-toc a { display: block; font-size: 11.5px; color: var(--muted); padding: 5px 8px; border-radius: 7px; line-height: 1.5; }
.doc-toc a:hover { color: var(--ink); background: var(--paper-2); }
.doc-toc .sub { font-size: 10.5px; padding-left: 20px; color: var(--faint); }
.doc-toc .toc-ai { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 9px; color: var(--amber-deep); }

.doc-body { min-width: 0; max-width: 820px; }
.doc-body section { scroll-margin-top: 88px; margin: 0 0 52px; }
.doc-body section:last-child { margin-bottom: 0; }
.doc-body h2 { font-family: var(--serif); font-size: 27px; line-height: 1.3; letter-spacing: -.025em; font-weight: 600; margin: 0 0 7px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.doc-body h2 .no { font-size: 12px; font-family: var(--mono); color: var(--amber-deep); margin-right: 9px; letter-spacing: 0; vertical-align: 3px; }
.doc-body h3 { font-size: 15px; margin: 28px 0 9px; letter-spacing: -.01em; }
.doc-body h4 { font-size: 13px; margin: 20px 0 6px; }
.doc-body p, .doc-body li { font-size: 13px; line-height: 1.9; color: var(--ink-2); }
.doc-body p { margin: 0 0 13px; }
.doc-body a { color: var(--amber-deep); border-bottom: 1px solid rgba(169,111,12,.35); }
.doc-body a:hover { border-color: var(--amber-deep); }
.doc-body strong { color: var(--ink); }
.doc-body ul, .doc-body ol { margin: 8px 0 16px; padding-left: 21px; }
.doc-body li { margin: 5px 0; }
.doc-body li::marker { color: var(--amber-deep); }
.doc-body code { font-family: var(--mono); font-size: .88em; background: var(--paper-2); border-radius: 4px; padding: 2px 5px; color: #574a35; }
.doc-body pre { background: #211e4d; color: #e9e4d7; border-radius: 12px; padding: 15px 16px; overflow-x: auto; font-family: var(--mono); font-size: 11px; line-height: 1.7; margin: 12px 0 18px; }
.doc-body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.doc-body kbd { font-family: var(--mono); font-size: 10px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--white); }
.doc-body hr { border: 0; border-top: 1px dashed var(--line); margin: 30px 0; }

.note { border: 1px solid var(--line); background: rgba(255,253,249,.8); border-left: 3px solid var(--blue); border-radius: 0 11px 11px 0; padding: 13px 15px; margin: 15px 0 18px; }
.note b { display: block; font-size: 12px; margin-bottom: 3px; }
.note p, .note ul { margin: 0; font-size: 11.5px; line-height: 1.8; color: var(--muted); }
.note ul { padding-left: 18px; }
.note.warn { border-left-color: var(--amber-deep); background: #fdf7eb; }
.note.danger { border-left-color: var(--red, #b4533d); background: #fcf0ed; }
.note.ok { border-left-color: var(--green); background: var(--green-soft); }
.note.ai { border-left-color: var(--amber-deep); background: #fdf4e3; }
.note code { background: rgba(28,26,64,.06); }

.steps { list-style: none; padding: 0; margin: 16px 0 20px; counter-reset: st; }
.steps > li { position: relative; padding: 0 0 18px 44px; margin: 0; border-left: 1px solid var(--line); margin-left: 15px; }
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before { counter-increment: st; content: counter(st); position: absolute; left: -15px; top: -2px; width: 29px; height: 29px; border-radius: 50%; background: var(--paper); border: 1px solid rgba(28,26,64,.2); display: grid; place-items: center; font-family: var(--serif); font-size: 12px; color: var(--ink); }
.steps > li b { display: block; font-size: 12.5px; margin-bottom: 3px; color: var(--ink); }
.steps > li p { margin: 0; font-size: 11.5px; line-height: 1.8; color: var(--muted); }

.checklist { list-style: none; padding: 0; margin: 12px 0 18px; display: grid; gap: 7px; }
.checklist li { position: relative; padding-left: 25px; margin: 0; font-size: 12px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 16px; height: 16px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 9px; font-weight: 700; }
.checklist.no li::before { content: "×"; background: #f9ece8; color: #b4533d; }

.dtable { width: 100%; border-collapse: collapse; margin: 13px 0 20px; font-size: 11.5px; background: rgba(255,253,249,.65); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dtable th, .dtable td { border-bottom: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; line-height: 1.65; }
.dtable th { background: var(--paper-2); font-size: 10.5px; color: var(--ink); font-weight: 600; letter-spacing: .02em; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable td code { font-size: 10px; white-space: nowrap; }
.dtable .nowrap { white-space: nowrap; }

.provider-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 20px; }
.pcard { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,249,.72); padding: 13px 14px; }
.pcard b { display: flex; align-items: center; gap: 7px; font-size: 12px; margin-bottom: 5px; }
.pcard b i { width: 20px; height: 20px; border-radius: 6px; color: #fff; font-style: normal; display: grid; place-items: center; font-size: 7px; font-weight: 700; }
.pcard p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.pcard code { font-size: 9px; }

.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { list-style: none; cursor: pointer; position: relative; padding: 15px 30px 15px 0; font-size: 12.5px; font-weight: 600; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 4px; top: 13px; font-size: 17px; font-weight: 300; color: var(--faint); }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { margin: 0; padding: 0 26px 16px 0; font-size: 11.5px; line-height: 1.85; color: var(--muted); }

.doc-end { border-top: 1px solid var(--line); padding: 26px 0 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.doc-end p { margin: 0; color: var(--faint); font-size: 10.5px; line-height: 1.7; max-width: 500px; }
.doc-end .ai-note { color: var(--amber-deep); }
.doc-end a { font-size: 11px; color: var(--amber-deep); }

.legal .doc-layout { grid-template-columns: 220px minmax(0,1fr); }
.legal .doc-body { max-width: 760px; }
.legal .doc-body h3 { margin-top: 24px; }

.err-page { min-height: calc(100vh - 74px); display: grid; place-items: center; padding: 60px 20px; }
.err-box { text-align: center; max-width: 540px; }
.err-box img { width: 66px; height: 66px; border-radius: 20px; margin: 0 auto 22px; box-shadow: 0 14px 34px rgba(28,26,64,.18); }
.err-code { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--amber-deep); }
.err-box h1 { font-family: var(--serif); font-size: clamp(28px, 5vw, 42px); letter-spacing: -.03em; margin: 12px 0 12px; font-weight: 600; }
.err-box p { color: var(--muted); font-size: 13px; line-height: 1.85; margin: 0 0 24px; }
.err-box .row { justify-content: center; display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1000px) {
  .doc-head .wrap { grid-template-columns: 1fr; gap: 24px; }
  .doc-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
  .doc-layout, .legal .doc-layout { grid-template-columns: 1fr; gap: 22px; padding-top: 26px; }
  .doc-toc { position: static; max-height: 0; overflow: hidden; padding: 0; border: 0; margin: 0; }
  .doc-toc > * { display: none; }
  .doc-toc::before { content: "本页目录"; display: block; font-size: 10px; letter-spacing: .14em; color: var(--faint); padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,249,.7); }
  .doc-body { max-width: none; }
}
@media (max-width: 760px) {
  .doc-head { padding: 36px 0 26px; }
  .doc-head h1 { font-size: 34px; }
  .ai-strip .wrap { align-items: flex-start; }
  .ai-strip .ai-tag { display: none; }
  .doc-layout { padding-bottom: 58px; }
  .doc-body h2 { font-size: 23px; }
  .doc-body p, .doc-body li { font-size: 12.5px; }
  .provider-cards { grid-template-columns: 1fr; }
  .dtable { display: block; overflow-x: auto; white-space: nowrap; }
  .dtable td, .dtable th { white-space: normal; min-width: 110px; }
  .doc-end { flex-direction: column; }
}
