/* 专栏文章页 — 掘金风 */
@import url('../assets/css/site-cta.css');

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

:root {
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --text: #252933;
    --text-muted: #8a919f;
    --border: #e4e6eb;
    --link: #1e80ff;
    --link-hover: #1171ee;
    --bg: #f4f5f5;
    --surface: #fff;
    --radius: 4px;
    --toc-w: 196px;
    --layout-max: 1080px;
    --topbar-h: 52px;
    --accent: #1e80ff;
    --toc-active-bg: rgba(30, 128, 255, 0.08);
}

body {
    font-family: var(--font);
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

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

.article-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.article-topbar__inner {
    max-width: var(--layout-max);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.article-topbar__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
}

.article-topbar__brand img { width: 24px; height: 24px; border-radius: 6px; }

.article-topbar__back {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.article-topbar__back:hover { color: var(--link); }

.article-layout {
    max-width: var(--layout-max);
    margin: 0 auto;
    padding: 20px 20px 48px;
    display: grid;
    grid-template-columns: var(--toc-w) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.article-toc {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    align-self: start;
    max-height: calc(100vh - var(--topbar-h) - 32px);
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.article-toc__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 14px 16px 8px;
    letter-spacing: 0.02em;
}

.article-toc__nav { padding: 0 8px 12px; }

.article-toc__nav a {
    display: block;
    padding: 7px 10px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
    border-radius: 4px;
    border-left: 3px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.article-toc__nav a:hover {
    color: var(--link);
    background: var(--toc-active-bg);
}

.article-toc__nav a.is-active {
    color: var(--link);
    font-weight: 600;
    background: var(--toc-active-bg);
    border-left-color: var(--accent);
}

.article-main { min-width: 0; }

.article-body {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.article-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid var(--border);
}

.article-back {
    display: inline-block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.article-back:hover { color: var(--link); }

.article-title {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.article-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.article-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.article-meta__author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-meta__avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.article-content { padding: 28px 32px 36px; }

.article-content h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 36px 0 14px;
    padding-left: 10px;
    border-left: 3px solid var(--accent);
    scroll-margin-top: calc(var(--topbar-h) + 16px);
}

.article-content h2:first-child { margin-top: 0; }

.article-content h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 12px;
}

.article-content p {
    margin-bottom: 16px;
    color: #4a5568;
    font-size: 15px;
    line-height: 1.85;
}

.article-content .lead {
    font-size: 17px;
    color: #2d3748;
    line-height: 1.9;
    margin-bottom: 24px;
}

.article-content strong { color: var(--text); font-weight: 600; }

.article-content ul,
.article-content ol {
    margin: 0 0 16px 22px;
    color: #4a5568;
    font-size: 15px;
}

.article-content li { margin-bottom: 8px; }

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

.article-content .img-caption {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: -8px 0 20px;
}

.quote-box,
.highlight-box {
    background: var(--toc-active-bg);
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
    margin: 24px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 15px;
    color: #334155;
}

.note-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 14px;
    color: #92400e;
    margin-bottom: 24px;
}

.store-summary {
    display: grid;
    gap: 12px;
    margin: 20px 0 28px;
}

.store-summary a {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.store-summary a:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(30, 128, 255, 0.1);
    color: var(--text);
}

.store-summary .store-name { font-weight: 700; }
.store-summary .store-meta { color: var(--text-muted); font-size: 14px; }
.store-summary .store-stars { color: #f59e0b; }

.review-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 14px;
}

.review-card blockquote {
    margin: 0;
    color: #334155;
    font-size: 15px;
    line-height: 1.8;
}

.review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.review-meta .stars { color: #f59e0b; }

.theme-list {
    margin: 0 0 16px 22px;
    color: #4a5568;
    font-size: 15px;
}

.theme-list li { margin-bottom: 8px; }

.ref-list {
    font-size: 14px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 24px;
    margin-top: 32px;
}

.ref-list h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text);
}

.ref-list ul { margin-left: 20px; }
.ref-list a { word-break: break-all; }

.related {
    margin-top: 32px;
    padding: 20px 22px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.related h3 { font-size: 16px; margin-bottom: 10px; color: var(--text); }
.related ul { list-style: none; line-height: 2; }
.related a { font-size: 14px; }

.article-foot {
    text-align: center;
    padding: 28px 0 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.compare-table-wrap {
    overflow-x: auto;
    margin: 20px 0 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 560px;
}

.compare-table th,
.compare-table td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.compare-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.compare-table tr:last-child td { border-bottom: none; }

.compare-table td ul {
    margin: 0;
    padding-left: 18px;
}

.compare-table td li { margin-bottom: 4px; }

.model-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--toc-active-bg);
    color: var(--accent);
    margin-bottom: 6px;
}

.toc-toggle {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 40;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    font-family: inherit;
}

.toc-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 44;
}

@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .article-toc {
        display: none;
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 72px;
        top: auto;
        max-height: 50vh;
        z-index: 45;
        box-shadow: 0 8px 32px rgba(15, 23, 42, 0.16);
    }

    .article-toc.is-open { display: block; }

    .toc-toggle { display: block; }

    .toc-drawer-backdrop.is-open { display: block; }

    .article-header,
    .article-content {
        padding-left: 20px;
        padding-right: 20px;
    }
}
