/* ══════════════════════════════════
   GCat Sites · Shared Styles
   my.g-cat.cn / papers.g-cat.cn
   v2.0 — mobile-first enhanced
   ══════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
    --bg: #fdf8f2;
    --bg-card: #fff;
    --text: #4a3a2a;
    --text-heading: #3a2a1a;
    --text-muted: #b8957a;
    --text-subtle: #c0b0a0;
    --text-link: #7eb3cc;
    --border-light: #ede4d8;
    --border-card: #f0e6da;
    --border-accent: #e8d5c0;
    --accent: #e88d3b;
    --accent-dark: #5d4037;
    --brand: #5d4037;
    --topnav-bg: rgba(253,248,242,0.92);
    --font-sans: 'Noto Sans SC', sans-serif;
    --font-serif: 'Noto Serif SC', serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ── Reset ── */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

/* ── Body ── */
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}
body.article {
    font-family: var(--font-serif);
    font-size: clamp(15px, 2vw, 16px);
    line-height: 2;
}

/* ── Typography ── */
h1,h2,h3,h4{font-family:var(--font-sans);font-weight:700;color:var(--text-heading)}
a{color:var(--text-link);text-decoration:none}
a:hover{color:var(--accent)}

/* ── Top Navigation ── */
.topnav {
    position: sticky; top: 0; z-index: 100;
    background: var(--topnav-bg);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 0 32px;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px;
    font-family: var(--font-sans);
}
.topnav .brand {
    font-size: 15px; font-weight: 600;
    color: var(--brand); text-decoration: none;
    display: flex; align-items: center; gap: 8px;
    white-space: nowrap;
}
.topnav .brand .emoji { font-size: 18px; }
.topnav .links { display: flex; gap: 24px; align-items: center; }
.topnav .links a {
    font-size: 13px; color: var(--text-muted);
    text-decoration: none; transition: color .2s;
    letter-spacing: .5px; white-space: nowrap;
}
.topnav .links a:hover { color: var(--accent); }
.topnav .links a.active { color: var(--accent); font-weight: 600; }

/* ── Hamburger Menu (Zero JS) ── */
.menu-toggle { display: none; }
.menu-btn {
    display: none;
    font-size: 24px; color: var(--accent-dark);
    cursor: pointer; user-select: none;
    line-height: 56px; padding: 0 4px;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 680px) {
    .topnav { padding: 0 20px; }
    .menu-btn { display: block; }
    .topnav .links {
        display: none;
        position: absolute; top: 56px; left: 0; right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 12px 20px 20px;
        gap: 0;
        border-bottom: 1px solid var(--border-light);
        box-shadow: 0 8px 24px rgba(93,64,55,0.06);
    }
    .topnav .links a {
        display: block; padding: 12px 0;
        font-size: 15px;
        border-bottom: 1px solid var(--border-light);
    }
    .topnav .links a:last-child { border-bottom: none; }
    .menu-toggle:checked ~ .links { display: flex; }
}

/* ── Container ── */
.container {
    max-width: 960px; margin: 0 auto;
    padding: clamp(24px, 5vw, 40px) clamp(16px, 4vw, 24px) 80px;
}
.container-narrow {
    max-width: 760px; margin: 0 auto;
    padding: clamp(24px, 5vw, 40px) clamp(16px, 4vw, 24px) 80px;
}
.article-container {
    max-width: 720px; margin: 0 auto;
    padding: clamp(20px, 4vw, 32px) clamp(16px, 4vw, 24px) 80px;
}

/* ── Page Header ── */
.page-header {
    margin-bottom: 32px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}
.page-header h1 {
    font-size: clamp(20px, 4vw, 22px);
    font-weight: 700; color: var(--text-heading);
    margin-bottom: 4px;
}
.page-header p { font-size: 13px; color: var(--text-muted); }

/* ── Back Link ── */
.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-muted);
    text-decoration: none; margin-bottom: 24px;
    font-family: var(--font-sans); transition: color .2s;
    padding: 8px 0; /* touch target */
}
.back-link:hover { color: var(--accent); }

/* ── Footer ── */
.footer {
    text-align: center; padding: 32px 16px 24px;
    border-top: 1px solid var(--border-light);
    font-size: 11px; color: var(--text-subtle);
    letter-spacing: 1px; font-family: var(--font-sans);
}
.footer a { color: var(--text-subtle); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer img { vertical-align: middle; }

/* ── Responsive Images ── */
img { max-width: 100%; height: auto; }

/* ── Code blocks ── */
pre {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    background: #f4efe8; padding: 16px; border-radius: 8px;
    margin: 1em 0; font-size: clamp(12px, 2.5vw, 14px);
    line-height: 1.5;
}
code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: #f0ece8; padding: 2px 6px; border-radius: 4px;
}
pre code { background: none; padding: 0; }

/* ── Section Title ── */
.section-title {
    font-size: 14px; font-weight: 500;
    color: var(--text-muted); letter-spacing: 3px;
    text-transform: uppercase; margin-bottom: 16px;
}

/* ── Base Mobile Adjustments ── */
@media (max-width: 600px) {
    .footer { font-size: 10px; }
    .back-link { margin-bottom: 20px; }
}
