/* ==========================================================================
   blog.aibochinese.com - shared base stylesheet
   Loaded before each page's inline <style>, so page-level rules always win.
   Provides normalization, accessibility defaults and fallbacks for pages
   that ship without their own styles.
   ========================================================================== */

:root {
    --brand-start: #667eea;
    --brand-end: #764ba2;
    --text: #24292f;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #ffffff;
    --surface: #f8f9fb;
    --radius: 12px;
    --maxw: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial,
                 sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }
img { border-style: none; }

a {
    color: var(--brand-end);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
    margin: 1.6em 0 .8em;
    line-height: 1.3;
    font-weight: 700;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1em; }

ul, ol { padding-left: 1.4em; }

code, pre, kbd, samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .92em;
}
pre {
    overflow-x: auto;
    padding: 1em;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
}
code { background: var(--surface); padding: .12em .4em; border-radius: 4px; }
pre code { background: none; padding: 0; }

blockquote {
    margin: 1.2em 0;
    padding: .6em 1em;
    border-left: 4px solid var(--brand-start);
    background: var(--surface);
    color: var(--muted);
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2em 0;
    display: block;
    overflow-x: auto;
}
th, td { border: 1px solid var(--border); padding: .55em .8em; text-align: left; }
th { background: var(--surface); }

hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---- layout helpers used across the site ------------------------------- */
.container,
.wrap,
.main-content {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px 0;
}

.btn,
.button {
    display: inline-block;
    padding: .6em 1.4em;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
    color: #fff;
    font-weight: 600;
    transition: opacity .2s ease, transform .2s ease;
}
.btn:hover,
.button:hover { opacity: .9; text-decoration: none; }

/* ---- accessibility ----------------------------------------------------- */
:focus-visible {
    outline: 3px solid var(--brand-start);
    outline-offset: 2px;
}

a[target="_blank"] { /* external links are opened safely, no visual noise */ }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

@media print {
    body { color: #000; background: #fff; }
    a { color: #000; text-decoration: underline; }
    .no-print, nav, footer { display: none !important; }
}
