/* Cheese! OCR — Article shared stylesheet */

:root {
    --sky: #7EC8E3;
    --sky-light: #B8E2F2;
    --sky-pale: #E8F4FA;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.14);
    --border: rgba(0, 0, 0, 0.08);
    --link: #0071e3;
    --tldr-bg: #FFF7E0;
    --tldr-border: #F5C76A;
    --code-bg: #f5f5f7;
    --code-border: rgba(0, 0, 0, 0.08);
    --footer-bg: #f5f5f7;
    --footer-text: #6e6e73;
    --lang-bg: rgba(0, 0, 0, 0.04);
    --lang-bg-hover: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141416;
        --surface: #1e1e22;
        --surface-2: #18181b;
        --text: #f5f5f7;
        --text-secondary: #a1a1a6;
        --text-tertiary: #6e6e73;
        --shadow: rgba(0, 0, 0, 0.3);
        --shadow-hover: rgba(0, 0, 0, 0.45);
        --border: rgba(255, 255, 255, 0.08);
        --link: #64d2ff;
        --tldr-bg: #2a2410;
        --tldr-border: #6F5828;
        --code-bg: #18181b;
        --code-border: rgba(255, 255, 255, 0.08);
        --footer-bg: #18181b;
        --footer-text: #a1a1a6;
        --lang-bg: rgba(255, 255, 255, 0.06);
        --lang-bg-hover: rgba(255, 255, 255, 0.12);
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
                 "PingFang SC", "Hiragino Sans", "Hiragino Sans GB", "Apple SD Gothic Neo",
                 "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

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

/* ── Article header / nav ── */
.article-nav {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.back-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.back-link:hover { color: var(--text); text-decoration: none; }

.lang-switcher {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--lang-bg);
    border-radius: 999px;
    font-size: 0.8rem;
}

.lang-switcher a {
    color: var(--text);
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-weight: 500;
    opacity: 0.65;
    transition: opacity 0.15s, background 0.15s;
}

.lang-switcher a:hover { opacity: 1; background: var(--lang-bg-hover); text-decoration: none; }
.lang-switcher a[aria-current="page"] { opacity: 1; font-weight: 600; background: var(--lang-bg-hover); }

.article-header {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.5rem 1rem;
}

.article-header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.article-meta {
    color: var(--text-tertiary);
    font-size: 0.92rem;
    font-weight: 500;
}

.article-meta time { color: var(--text-secondary); }

/* ── TL;DR ── */
.tldr {
    max-width: 760px;
    margin: 1.5rem auto;
    padding: 1.25rem 1.5rem;
    background: var(--tldr-bg);
    border-left: 4px solid var(--tldr-border);
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.65;
}

.tldr strong {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

/* ── Article body ── */
.article-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    font-size: 1.05rem;
    line-height: 1.75;
}

.article-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 2.5rem 0 0.75rem;
    line-height: 1.3;
}

.article-body h3 {
    font-size: 1.2rem;
    font-weight: 650;
    margin: 1.75rem 0 0.5rem;
    line-height: 1.35;
}

.article-body p { margin: 0 0 1.1rem; }

.article-body ul,
.article-body ol {
    margin: 0 0 1.25rem 1.4rem;
    padding-left: 0.4rem;
}

.article-body li { margin-bottom: 0.4rem; }

.article-body strong { font-weight: 650; }

.article-body em { font-style: italic; }

.article-body code {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.92em;
}

.article-body pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
    font-size: 0.92em;
    line-height: 1.6;
}

.article-body pre code {
    background: none;
    border: none;
    padding: 0;
}

.article-body blockquote {
    border-left: 3px solid var(--sky);
    padding: 0.4rem 1.1rem;
    margin: 1rem 0 1.5rem;
    color: var(--text-secondary);
    font-style: italic;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.75rem;
    font-size: 0.95rem;
}

.article-body th,
.article-body td {
    text-align: left;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

.article-body th {
    font-weight: 650;
    background: var(--surface-2);
    border-bottom: 2px solid var(--border);
}

.article-body td:first-child { font-weight: 500; }

.article-body hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.article-body figure {
    margin: 1.5rem 0;
}

.article-body figcaption {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 0.5rem;
}

.callout {
    background: var(--sky-pale);
    border-left: 4px solid var(--sky);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0 1.75rem;
}

@media (prefers-color-scheme: dark) {
    .callout { background: rgba(126, 200, 227, 0.08); }
}

.callout strong {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.callout p { margin-bottom: 0; }

/* ── FAQ ── */
.article-faq {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border);
}

.article-faq h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 0.25rem;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: "+";
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1;
}

.faq-item[open] summary::after { content: "−"; }

.faq-item .answer {
    padding: 0 0.25rem 1.1rem;
    color: var(--text-secondary);
    font-size: 0.97rem;
    line-height: 1.7;
}

/* ── CTA card ── */
.article-cta {
    max-width: 760px;
    margin: 2rem auto;
    padding: 2rem 1.5rem;
}

.cta-card {
    background: linear-gradient(135deg, var(--sky), var(--sky-light));
    border-radius: 20px;
    padding: 2.25rem 2rem;
    text-align: center;
    color: var(--text);
}

@media (prefers-color-scheme: dark) {
    .cta-card { background: linear-gradient(135deg, #1a3a4a, #1e1e22); }
}

.cta-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.cta-card p {
    color: var(--text);
    opacity: 0.85;
    margin-bottom: 1.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--text);
    color: var(--bg);
    padding: 0.8rem 1.85rem 0.8rem 1.6rem;
    border-radius: 980px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button::before {
    content: "";
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    margin-bottom: 0.08em;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'><path d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/></svg>") no-repeat center / contain;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'><path d='M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z'/></svg>") no-repeat center / contain;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-hover);
    text-decoration: none;
}

/* ── Related articles ── */
.article-related {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--border);
}

.article-related h2 {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 960px;
    margin: 0 auto;
}

.related-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow);
    border-color: var(--sky);
    text-decoration: none;
}

.related-card h3 {
    font-size: 1rem;
    font-weight: 650;
    margin-bottom: 0.4rem;
    line-height: 1.35;
}

.related-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* ── Article footer ── */
.article-footer {
    background: var(--footer-bg);
    padding: 1.75rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--footer-text);
}

.article-footer a {
    color: var(--link);
    text-decoration: none;
    margin: 0 0.7rem;
}

.article-footer a:hover { text-decoration: underline; }

.article-footer p { margin-top: 0.5rem; }

/* ── Blog index ── */
.blog-hero {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.5rem 1.5rem;
    text-align: center;
}

.blog-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.blog-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 520px;
    margin: 0 auto;
}

.blog-list {
    max-width: 760px;
    margin: 1.5rem auto 3rem;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.blog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem 1.6rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
    border-color: var(--sky);
    text-decoration: none;
}

.blog-card h2 {
    font-size: 1.2rem;
    font-weight: 650;
    margin-bottom: 0.4rem;
    letter-spacing: -0.005em;
    line-height: 1.4;
}

.blog-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.blog-card .blog-card-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sky);
    margin-bottom: 0.5rem;
}

@media (prefers-color-scheme: dark) {
    .blog-card .blog-card-tag { color: var(--sky-light); }
}

/* ── Responsive ── */
@media (max-width: 720px) {
    .article-header { padding: 1.5rem 1.25rem 1rem; }
    .article-header h1 { font-size: 1.85rem; }
    .article-body { padding: 1.5rem 1.25rem 2.5rem; font-size: 1rem; }
    .article-body h2 { font-size: 1.4rem; margin: 2rem 0 0.5rem; }
    .article-body h3 { font-size: 1.1rem; }
    .article-faq { padding: 1.5rem 1.25rem; }
    .article-cta { padding: 1.5rem 1.25rem; }
    .cta-card { padding: 1.75rem 1.25rem; }
    .article-related { padding: 2rem 1.25rem; }
    .related-grid { grid-template-columns: 1fr; max-width: 420px; }
    .blog-hero { padding: 2rem 1.25rem 1rem; }
    .blog-hero h1 { font-size: 1.85rem; }
    .blog-list { padding: 0 1.25rem; }
    .blog-card { padding: 1.25rem; }
}

@media (min-width: 721px) and (max-width: 960px) {
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .related-card:hover, .blog-card:hover, .cta-button:hover { transform: none; }
}
