/* ao3链接入口 - 全站样式 */
:root {
  --primary: #ff385c;
  --primary-dark: #e00b41;
  --bg: #ffffff;
  --surface: #f2f2f2;
  --surface-soft: #f7f7f7;
  --text: #222222;
  --muted: #6a6a6a;
  --border: #dddddd;
  --border-muted: #b0b0b0;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 32px;
  --r-full: 9999px;
  --sh-card: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.16) 0 2px 4px 0;
  --sh-bar: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.04) 0 2px 6px 0, rgba(0, 0, 0, 0.1) 0 4px 8px 0;
  --sh-pop: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 8px 24px 0;
  --max: 1280px;
  --header-h: 73px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 12px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: calc(var(--header-h) - 1px); }
.anchor-target, [id] { scroll-margin-top: calc(var(--header-h) + 24px); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: var(--primary); }
.logo svg { width: 32px; height: 32px; flex: none; }
.main-nav { display: none; }
.nav-link { position: relative; padding: 10px 0; margin: 0 14px; font-size: 15px; color: var(--muted); transition: color .2s ease-out; }
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active { font-weight: 500; }
.nav-link.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--text); }
.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
  width: 44px; height: 44px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--r-full); background: var(--bg); cursor: pointer; transition: box-shadow .2s;
}
.nav-toggle:hover { box-shadow: var(--sh-bar); }
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
.main-nav.open {
  display: flex; flex-direction: column; position: absolute; top: 72px; left: 12px; right: 12px;
  padding: 8px; background: var(--bg); border-radius: var(--r-md); box-shadow: var(--sh-pop); z-index: 99;
}
.main-nav.open .nav-link { margin: 0; padding: 12px 16px; border-radius: var(--r-sm); }
.main-nav.open .nav-link:hover { background: var(--surface); }
.main-nav.open .nav-link.active::after { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color .2s ease-out, transform .1s ease-out, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--bg); color: var(--text); border-color: var(--text); }
.btn-outline:hover { background: var(--surface-soft); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { padding: 16px 0 0; font-size: 13px; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; list-style: none; gap: 6px; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--border-muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 24px; text-align: center; }
.hero h1 { font-size: 30px; letter-spacing: -.01em; margin-bottom: 12px; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero-lead { max-width: 720px; margin: 0 auto; font-size: 16px; color: var(--muted); }



/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-soft { background: var(--surface-soft); }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: 24px; margin-bottom: 8px; }
.section-head p { max-width: 760px; margin: 0; color: var(--muted); }
.section-kicker { display: inline-block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--primary); }

.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }

/* ---------- Notice ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); font-size: 14px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--primary); }
.notice p { margin: 0; }

/* ---------- Mirror cards ---------- */
.no-copy { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mirror-list { list-style: none; }
.mirror-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  padding: 20px; background: var(--bg); border-radius: var(--r-md); box-shadow: var(--sh-card);
  transition: box-shadow .2s ease-out, transform .2s ease-out;
}
.mirror-card:hover { box-shadow: var(--sh-pop); transform: translateY(-2px); }
.mirror-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mirror-no { font-size: 13px; font-weight: 600; color: var(--muted); }
.badge { display: inline-block; padding: 5px 10px; font-size: 12px; font-weight: 600; line-height: 1; border-radius: 20px; background: var(--bg); box-shadow: 0 2px 4px rgba(0, 0, 0, .1); }
.badge-red { color: var(--primary); }
.mirror-card h3 { font-size: 18px; margin-bottom: 4px; word-break: break-all; }
.mirror-url { margin: 0 0 12px; font-size: 13px; color: var(--muted); word-break: break-all; font-family: "SFMono-Regular", Consolas, Menlo, monospace; }
.mirror-desc { flex: 1; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.mirror-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; list-style: none; }
.mirror-meta li { padding: 3px 10px; font-size: 12px; border-radius: var(--r-full); background: var(--surface); }
.mirror-card .btn { width: 100%; }

/* ---------- Generic card ---------- */
.card { padding: 24px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--muted); }
.card p:last-child { margin-bottom: 0; }
.card-link { display: block; transition: box-shadow .2s ease-out, transform .2s ease-out; }
.card-link:hover { box-shadow: var(--sh-pop); transform: translateY(-2px); }
.icon-circle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: var(--r-full); background: var(--surface); }
.icon-circle svg { width: 22px; height: 22px; stroke: var(--text); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Steps ---------- */
.steps { list-style: none; counter-reset: step; display: grid; gap: 20px; grid-template-columns: 1fr; }
.steps li { counter-increment: step; position: relative; padding: 24px 24px 24px 76px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.steps li::before { content: counter(step); position: absolute; left: 24px; top: 24px; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-full); background: var(--primary); color: #fff; font-weight: 600; }
.steps h3 { font-size: 16px; margin-bottom: 6px; }
.steps p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; background: var(--surface-soft); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code, .mono { font-family: "SFMono-Regular", Consolas, Menlo, monospace; font-size: 13px; }

/* ---------- Split / about ---------- */
.split { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: start; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; }
.prose h3:first-child { margin-top: 0; }
.prose p, .prose li { color: #3f3f3f; }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 12px; }
.prose li { margin-bottom: 6px; }
.fact-list { list-style: none; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.fact-list li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; font-size: 14px; border-bottom: 1px solid var(--border); }
.fact-list li:last-child { border-bottom: 0; }
.fact-list span:first-child { color: var(--muted); flex: none; }
.fact-list span:last-child { text-align: right; font-weight: 500; }

/* ---------- Glossary ---------- */
.glossary { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 0; }
.glossary div { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.glossary dt { font-weight: 600; margin-bottom: 4px; }
.glossary dd { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { max-width: 880px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { position: relative; padding: 20px 40px 20px 0; font-size: 16px; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px; margin-top: -7px; border-right: 2px solid var(--text); border-bottom: 2px solid var(--text); transform: rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq .answer { padding: 0 0 20px; color: var(--muted); font-size: 14px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li { position: relative; padding: 0 0 20px 24px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: var(--r-full); background: var(--primary); border: 2px solid var(--bg); }
.timeline time { display: block; font-size: 13px; font-weight: 600; }
.timeline p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta { padding: 32px 24px; text-align: center; border-radius: var(--r-md); background: var(--text); color: #fff; }
.cta h2 { font-size: 22px; margin-bottom: 8px; }
.cta p { color: #d6d6d6; margin-bottom: 20px; }

/* ---------- Article (inner pages) ---------- */
.page-head { padding: 24px 0 8px; }
.page-head h1 { font-size: 28px; margin-bottom: 8px; }
.page-head p { color: var(--muted); max-width: 760px; }
.page-meta { font-size: 13px; color: var(--muted); }
.article-layout { max-width: 860px; padding: 24px 0 56px; }
.article h2 { font-size: 22px; margin: 40px 0 12px; padding-top: 8px; }
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 17px; margin: 24px 0 8px; }
.article p, .article li { color: #3f3f3f; }
.article ul, .article ol { padding-left: 22px; margin-bottom: 14px; }
.article li { margin-bottom: 6px; }
.article .table-wrap { margin: 12px 0 20px; }
.tip-box { padding: 16px 20px; margin: 16px 0; border-radius: var(--r-md); background: var(--surface-soft); border-left: 4px solid var(--primary); font-size: 14px; }
.tip-box p:last-child { margin-bottom: 0; }

/* ---------- Go page ---------- */
.go-wrap { max-width: 640px; margin: 0 auto; padding: 24px 0 64px; }
.go-card { padding: 32px 24px; text-align: center; border-radius: var(--r-md); box-shadow: var(--sh-pop); background: var(--bg); }
.go-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 16px; border-radius: var(--r-full); background: #fff0f3; color: var(--primary); }
.go-icon svg { width: 30px; height: 30px; }
.go-card h1 { font-size: 24px; margin-bottom: 8px; }
.go-target { margin: 20px 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-soft); }
.go-target strong { display: block; font-size: 20px; word-break: break-all; }
.go-target span { font-size: 13px; color: var(--muted); word-break: break-all; font-family: "SFMono-Regular", Consolas, Menlo, monospace; }
.go-actions { display: grid; gap: 12px; grid-template-columns: 1fr; }
.go-tips { list-style: none; margin-top: 24px; text-align: left; font-size: 14px; color: var(--muted); }
.go-tips li { position: relative; padding-left: 18px; margin-bottom: 8px; }
.go-tips li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: var(--r-full); background: var(--primary); }

/* ---------- Ad slot ---------- */
.ad-slot { margin: 24px auto; text-align: center; }
.ad-slot:empty { display: none; }

/* ---------- Floating buttons ---------- */
.fab { position: fixed; right: 16px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.fab-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 48px; height: 48px; padding: 0; border: 1px solid var(--border); border-radius: var(--r-full);
  background: var(--bg); color: var(--text); font-size: 10px; line-height: 1; cursor: pointer;
  box-shadow: var(--sh-bar); transition: box-shadow .2s, transform .1s, opacity .2s, visibility .2s, background-color .2s;
}
.fab-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fab-btn:hover { box-shadow: var(--sh-pop); }
.fab-btn:active { transform: scale(.95); }
.fab-mirrors { background: var(--primary); border-color: var(--primary); color: #fff; }
.fab-mirrors:hover { background: var(--primary-dark); }
.fab-top { opacity: 0; visibility: hidden; }
.fab-top.show { opacity: 1; visibility: visible; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-soft); border-top: 1px solid var(--border); padding: 40px 0 24px; font-size: 14px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.footer-brand p { margin-top: 12px; color: var(--muted); max-width: 420px; }
.footer-title { font-weight: 600; margin-bottom: 12px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-bottom { padding-top: 20px; font-size: 13px; color: var(--muted); }
.footer-bottom p { margin-bottom: 6px; }

/* ---------- 404 ---------- */
.error-page { padding: 64px 0; text-align: center; }
.error-page .code { font-size: 72px; font-weight: 600; color: var(--primary); line-height: 1; margin-bottom: 12px; }

/* ---------- Responsive ---------- */
@media (min-width: 560px) {
  .grid-2, .grid-3, .grid-4, .mirror-list { grid-template-columns: repeat(2, 1fr); }
  .glossary { grid-template-columns: repeat(2, 1fr); }
  .go-actions { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 744px) {
  .container { padding: 0 40px; }
  .fab { right: 24px; bottom: 32px; }
  .nav-toggle { display: none; }
  .main-nav { display: flex; align-items: center; }
  .hero { padding: 64px 0 32px; }
  .hero h1 { font-size: 40px; }
  .section { padding: 64px 0; }
  .section-head h2 { font-size: 28px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .page-head h1 { font-size: 34px; }
  .page-head, .article-layout { max-width: 860px; }
  .cta { padding: 48px; }
}
@media (min-width: 950px) {
  .grid-3, .mirror-list { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .glossary { grid-template-columns: repeat(3, 1fr); }
  .split { grid-template-columns: 3fr 2fr; gap: 48px; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .steps li { padding: 76px 20px 24px; }
  .steps li::before { left: 20px; }
}
@media (min-width: 1128px) {
  .mirror-list { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
