/* 字体改为本地托管，避免被 googleapis.com 访问限制 / 延迟拖慢首屏 */
@import url('../fonts/fonts.css');

/* ═══════════════════════════════════════════════════════════════
   CLAUDE · Paper Theme
   Warm cream paper (#f8f8f6) · Vermillion accent · Ink typography
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Surfaces (light paper) */
    --bg-0: #F8F8F6;         /* main paper bg */
    --bg-1: #F2F1EC;         /* subtle surface */
    --bg-2: #EBE9E2;         /* raised surface / hover */
    --bg-3: #E0DED5;         /* strong surface / border bg */

    /* Ink (dark text on paper) */
    --text-0: #1A1814;       /* primary — near-black ink */
    --text-1: #3D3A33;       /* secondary */
    --text-2: #6B6658;       /* muted */
    --text-3: #9A9485;       /* faint */

    /* Accent (vermillion) */
    --accent: #C96442;
    --accent-2: #AB5232;     /* deep hover */
    --accent-3: #D97757;     /* warm variant */
    --accent-soft: rgba(201, 100, 66, 0.12);
    --accent-faint: rgba(201, 100, 66, 0.05);

    /* Lines */
    --line: rgba(26, 24, 20, 0.08);
    --line-strong: rgba(26, 24, 20, 0.16);

    /* Shadows */
    --shadow-card: 0 2px 4px rgba(26, 24, 20, 0.04), 0 8px 24px -8px rgba(26, 24, 20, 0.08);
    --shadow-lifted: 0 8px 16px -4px rgba(26, 24, 20, 0.1), 0 20px 40px -12px rgba(26, 24, 20, 0.12);

    /* ─ Legacy aliases (kept so existing inline CSS keeps rendering) ─
       Old names had dark-theme intent; values now map to the light theme
       so `color: var(--paper)` → dark text, `background: var(--ink-0)` → paper. */
    --ink-0: var(--bg-0);
    --ink-1: var(--bg-1);
    --ink-2: var(--bg-2);
    --ink-3: var(--bg-3);
    --paper: var(--text-0);
    --paper-2: var(--text-1);
    --paper-3: var(--text-2);
    --paper-4: var(--text-3);
    --vermillion: var(--accent);
    --vermillion-2: var(--accent-2);
    --vermillion-3: var(--accent-3);
    --vermillion-soft: var(--accent-soft);
    --vermillion-faint: var(--accent-faint);

    /* Typography */
    --display: 'Fraunces', 'Songti SC', 'PingFang SC', serif;
    --body: 'Newsreader', Georgia, 'Songti SC', serif;
    --sans: 'Fraunces', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    /* html + body 双保险：单独给 body 在移动 Safari 下常常失效 */
    overflow-x: hidden;
}

body.cla-home {
    margin: 0;
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.65;
    background: var(--bg-0);
    color: var(--text-0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    position: relative;
    overflow-x: clip;
}

/* Subtle paper grain */
body.cla-home::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0.035 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    mix-blend-mode: multiply;
}

body.cla-home.is-nav-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

.cla-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cla-container {
    width: calc(100% - 48px);
    max-width: 1240px;
    margin: 0 auto;
}

main.cla-main { flex: 1; }

/* ─────────────────────────────────────────────
   KICKERS / OVERLINES
   ───────────────────────────────────────────── */
.cla-kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0;
}
.cla-kicker::before {
    content: '';
    width: 28px; height: 1px;
    background: currentColor;
    flex-shrink: 0;
}
.cla-kicker.is-center { justify-content: center; }
.cla-kicker.is-center::after {
    content: '';
    width: 28px; height: 1px;
    background: currentColor;
    flex-shrink: 0;
}

.cla-rule {
    display: flex; align-items: center; gap: 14px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
}
.cla-rule::before, .cla-rule::after {
    content: '';
    flex: 1; height: 1px;
    background: var(--line-strong);
}

.cla-mark {
    color: var(--accent);
    font-family: var(--display);
    font-style: italic;
    font-weight: 500;
}

/* ─────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────── */
.cla-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* 固定 height 消除 icon/文字字号差异导致的高度不一致 */
    height: 40px;
    padding: 0 22px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: 2px;
    transition: all 0.24s cubic-bezier(.2,.7,.2,1);
    cursor: pointer;
    border: 1px solid transparent;
    background: none;
    color: var(--text-0);
    line-height: 1;
    white-space: nowrap;
}
.cla-btn i { font-size: 14px; line-height: 1; }
.cla-btn.is-primary {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.cla-btn.is-primary:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -8px rgba(201, 100, 66, 0.45);
}
.cla-btn.is-ghost {
    color: var(--text-1);
    border-color: var(--line-strong);
}
.cla-btn.is-ghost:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-faint);
}
.cla-btn.is-outline {
    border-color: var(--text-0);
    color: var(--text-0);
}
.cla-btn.is-outline:hover {
    background: var(--text-0);
    color: var(--bg-0);
}
.cla-btn.is-sm { height: 32px; padding: 0 16px; font-size: 10px; }
.cla-btn.is-sm i { font-size: 12px; }

/* ─────────────────────────────────────────────
   TOPBAR · HEADER
   ───────────────────────────────────────────── */
.cla-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(248, 248, 246, 0.82);
    backdrop-filter: saturate(1.2) blur(18px);
    -webkit-backdrop-filter: saturate(1.2) blur(18px);
}
.cla-topbar-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 20px 0;
}

.cla-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--text-0);
}
.cla-brand-logo {
    height: 36px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: inline-block;
    flex-shrink: 0;
}
.cla-brand-title {
    font-family: var(--display);
    font-optical-sizing: auto;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
}
.cla-brand-tag {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-top: 4px;
}

.cla-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 24px;
}
.cla-nav-item { position: relative; }
.cla-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-1);
    cursor: pointer;
    transition: color 0.18s;
    position: relative;
}
.cla-nav-link::before {
    content: '';
    position: absolute;
    left: 14px; right: 14px;
    bottom: 4px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s cubic-bezier(.2,.7,.2,1);
}
.cla-nav-link:hover { color: var(--accent); }
.cla-nav-link:hover::before { transform: scaleX(1); }
.cla-nav-link i { font-size: 13px; opacity: 0.65; }

.cla-nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: -4px;
    min-width: 230px;
    padding: 8px;
    background: var(--bg-0);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    box-shadow: var(--shadow-lifted);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.24s cubic-bezier(.2,.7,.2,1);
    z-index: 60;
}
.cla-nav-dropdown::before {
    content: '';
    position: absolute;
    top: -6px; left: 24px;
    width: 10px; height: 10px;
    background: var(--bg-0);
    border-left: 1px solid var(--line-strong);
    border-top: 1px solid var(--line-strong);
    transform: rotate(45deg);
}
.cla-nav-item.has-dropdown:hover .cla-nav-dropdown,
.cla-nav-item.has-dropdown:focus-within .cla-nav-dropdown {
    opacity: 1; visibility: visible; transform: none;
}
.cla-nav-dropdown-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    font-family: var(--body);
    font-size: 14px;
    color: var(--text-1);
    border-radius: 2px;
    transition: background 0.18s, color 0.18s, padding-left 0.18s;
}
.cla-nav-dropdown-link:hover {
    background: var(--accent-faint);
    color: var(--accent);
    padding-left: 16px;
}
.cla-nav-dropdown-link i { font-size: 14px; opacity: 0.7; }

.cla-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 20px;
    border-left: 1px solid var(--line);
    /* 自动占满剩余空间，把登录/注册推到最右 */
    margin-left: auto;
}
.cla-nav-user {
    padding: 6px 14px 6px 6px;
    border: 1px solid var(--line-strong);
    border-radius: 100px;
    color: var(--text-0);
}
.cla-nav-user:hover { border-color: var(--accent); }
.cla-nav-user::before { display: none; }
.cla-nav-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-2);
}

/* Mobile toggle */
.cla-mobile-toggle {
    display: none;
    width: 42px; height: 42px;
    background: var(--bg-0);
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.cla-mobile-toggle .bar {
    width: 18px; height: 1.5px;
    background: var(--text-0);
}

.cla-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 24, 20, 0.35);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}
body.is-nav-open .cla-mobile-overlay { display: block; opacity: 1; }

.cla-mobile-drawer {
    position: fixed;
    top: 0; right: 0;
    width: min(360px, 88vw);
    height: 100dvh;
    background: var(--bg-0);
    border-left: 1px solid var(--line-strong);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(.2,.7,.2,1);
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    /* 默认无阴影：关闭状态下 box-shadow 会向左漏到视口内形成"鬼影" */
    box-shadow: none;
}
body.is-nav-open .cla-mobile-drawer {
    transform: none;
    box-shadow: -20px 0 40px -20px rgba(26, 24, 20, 0.2);
}
.cla-mobile-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}
.cla-mobile-drawer-kicker {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.24em;
    color: var(--accent);
    text-transform: uppercase;
}
.cla-mobile-close {
    width: 36px; height: 36px;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    color: var(--text-0);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}
.cla-mobile-close:hover { border-color: var(--accent); color: var(--accent); }
.cla-mobile-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cla-mobile-nav-row { display: flex; align-items: center; }
.cla-mobile-nav-link {
    flex: 1;
    padding: 12px 14px;
    color: var(--text-0);
    font-family: var(--body);
    font-size: 16px;
    border-radius: 2px;
    transition: background 0.18s, color 0.18s;
}
.cla-mobile-nav-link:hover { background: var(--accent-faint); color: var(--accent); }
.cla-mobile-nav-link.level-2 {
    padding-left: 26px;
    font-size: 14px;
    color: var(--text-1);
    display: flex; align-items: center; gap: 8px;
}
.cla-mobile-nav-link.level-2 i { color: var(--accent); opacity: 0.7; }
.cla-mobile-nav-toggle {
    background: none;
    border: none;
    color: var(--text-2);
    width: 40px; height: 40px;
    cursor: pointer;
    transition: transform 0.24s, color 0.2s;
    font-size: 16px;
}
.cla-mobile-nav-group.is-open > .cla-mobile-nav-row .cla-mobile-nav-toggle {
    transform: rotate(180deg);
    color: var(--accent);
}
.cla-mobile-subnav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s ease;
}
.cla-mobile-nav-group.is-open > .cla-mobile-subnav { max-height: 600px; }
.cla-mobile-drawer-actions {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cla-mobile-drawer-actions .cla-btn { justify-content: center; width: 100%; }

@media (max-width: 960px) {
    .cla-nav { display: none; }
    .cla-nav-actions { display: none; }
    .cla-topbar-inner { justify-content: space-between; }
    .cla-mobile-toggle { display: inline-flex; }
    .cla-brand-tag { display: none; }
}

/* ─────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────── */
/* Footer · "Colophon" — like the back page of a book */
.cla-footer {
    margin-top: 140px;
    padding: 88px 0 36px;
    position: relative;
    background: transparent;
    isolation: isolate;
}
/* 顶部朱红 tick + 下方柔光底，无硬分割线 */
.cla-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 120px; height: 2px;
    background: var(--accent);
    transform: translateX(-50%);
}
.cla-footer::after {
    content: '';
    position: absolute;
    inset: 0 -5% auto -5%;
    height: 100%;
    background:
        radial-gradient(ellipse 60% 80% at 20% 100%, var(--accent-faint) 0%, transparent 65%),
        radial-gradient(ellipse 50% 70% at 80% 80%, var(--accent-faint) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    filter: blur(24px);
}

/* ── Social strip (centered, sits between links and colophon) ── */
.cla-footer-socials {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 28px 0 4px;
}
.cla-footer-socials a {
    width: 40px; height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-1);
    font-size: 16px;
    background: var(--bg-0);
    transition: all 0.28s cubic-bezier(.2,.7,.2,1);
}
.cla-footer-socials a:hover {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px) rotate(-6deg);
    box-shadow: 0 8px 20px -6px rgba(201, 100, 66, 0.4);
}

/* ── LINK GRID ── */
.cla-footer-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 48px;
    padding: 52px 0 44px;
    border-top: 1px dashed var(--line-strong);
    border-bottom: 1px dashed var(--line-strong);
}
.cla-footer-col-title {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cla-footer-col-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}
.cla-footer-links {
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.cla-footer-links a {
    font-family: var(--body);
    font-size: 15px;
    color: var(--text-1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: color 0.22s, gap 0.22s;
    width: fit-content;
}
.cla-footer-links a::before {
    content: '→';
    color: var(--accent);
    font-size: 13px;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.24s, transform 0.24s;
}
.cla-footer-links a:hover { color: var(--accent); gap: 14px; }
.cla-footer-links a:hover::before { opacity: 1; transform: none; }

/* ── COLOPHON bottom row ── */
.cla-footer-colophon {
    margin-top: 32px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-2);
}
.cla-footer-colophon .left { justify-self: start; }
.cla-footer-colophon .right { justify-self: end; }
.cla-footer-colophon .signoff {
    font-family: var(--display);
    font-style: italic;
    font-size: 15px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.cla-footer-colophon .signoff::before,
.cla-footer-colophon .signoff::after {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--accent);
    opacity: 0.5;
}

@media (max-width: 900px) {
    .cla-footer-links-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 28px; }
}
@media (max-width: 600px) {
    .cla-footer { margin-top: 96px; padding: 56px 0 28px; }
    .cla-footer-links-grid { grid-template-columns: 1fr; gap: 32px; padding: 40px 0; }
    .cla-footer-colophon {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 14px;
    }
    .cla-footer-colophon .left,
    .cla-footer-colophon .right,
    .cla-footer-colophon .signoff { justify-self: start; }
    .cla-footer-colophon .signoff::before,
    .cla-footer-colophon .signoff::after { display: none; }
}

/* ─────────────────────────────────────────────
   Method / Status badges (shared)
   ───────────────────────────────────────────── */
.cla-method {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    border-radius: 2px;
    line-height: 1.6;
    border: 1px solid;
}
.cla-method.get    { color: #2E6FDB; border-color: rgba(46, 111, 219, 0.3); background: rgba(46, 111, 219, 0.08); }
.cla-method.post   { color: #1A9A52; border-color: rgba(26, 154, 82, 0.3); background: rgba(26, 154, 82, 0.08); }
.cla-method.put    { color: #D48A0A; border-color: rgba(212, 138, 10, 0.3); background: rgba(212, 138, 10, 0.08); }
.cla-method.patch  { color: #7C5CC4; border-color: rgba(124, 92, 196, 0.3); background: rgba(124, 92, 196, 0.08); }
.cla-method.delete { color: #DC3D3D; border-color: rgba(220, 61, 61, 0.3); background: rgba(220, 61, 61, 0.08); }

.cla-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-1);
}
.cla-status-dot::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #1A9A52;
    box-shadow: 0 0 0 3px rgba(26, 154, 82, 0.18);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(26, 154, 82, 0.18); }
    50% { box-shadow: 0 0 0 5px rgba(26, 154, 82, 0.3); }
}

/* ─────────────────────────────────────────────
   SCROLLBAR · SELECTION
   ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
    background: var(--bg-3);
    border: 2px solid var(--bg-0);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

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

/* ─────────────────────────────────────────────
   Reveal on scroll
   ───────────────────────────────────────────── */
[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal-delay="3"] { transition-delay: 0.24s; }
[data-reveal-delay="4"] { transition-delay: 0.32s; }
