/* ═══════════════════════════════════════════
   橘猫网 - 公众号风格样式 (双版本)
   移动端优先，全面模仿微信公众号阅读体验
   ═══════════════════════════════════════════ */

:root {
    --bg: #fdf6f0;
    --card-bg: #ffffff;
    --text: #2d2016;
    --text-secondary: #8a7a6a;
    --title: #2d2016;
    --accent: #ff6b35;
    --accent-light: #fff0e6;
    --accent-bg: rgba(255,107,53,0.08);
    --link: #607fa6;
    --border: #f0e0d0;
    --border-light: #f5ebe0;
    --tag-bg: #fff0e6;
    --sidebar-bg: #fffbf7;
    --sidebar-width: 190px;
    --max-width: 680px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
                 "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ─── Top Bar ─── */
.top-bar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 16px;
}
.top-bar-inner {
    max-width: calc(var(--max-width) + var(--sidebar-width) + 40px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.site-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.site-name .cat-icon {
    font-size: 22px;
}

/* ─── Search Bar ─── */
.search-wrap {
    flex: 1;
    max-width: 360px;
    min-width: 0;
}
.search-form {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}
.search-form:focus-within {
    border-color: var(--accent);
}
.search-icon {
    padding: 6px 8px 6px 14px;
    font-size: 15px;
    user-select: none;
}
.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 7px 2px 7px 0;
    font-size: 14px;
    color: var(--text);
    outline: none;
    min-width: 40px;
    width: 100%;
}
.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}
.search-clear {
    display: none;
    padding: 6px 12px 6px 4px;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-secondary);
    background: none;
    border: none;
    user-select: none;
}
.search-clear.show {
    display: block;
}

/* ─── Layout: sidebar + main ─── */
.layout-wrap {
    max-width: calc(var(--max-width) + var(--sidebar-width) + 40px);
    margin: 0 auto;
    display: flex;
    gap: 0;
    min-height: calc(100vh - 120px);
}

/* ─── Sidebar ─── */
.sidebar {
    display: block;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    flex-shrink: 0;
    flex-grow: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 56px;
    align-self: flex-start;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
}
.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0 20px 12px;
}
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
    background: var(--accent-light);
    color: var(--accent);
}
.sidebar-nav a.active {
    background: var(--accent-light);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}
.sidebar-nav a .cat-emoji {
    font-size: 16px;
    opacity: 0.7;
}

/* Mobile category bar (hidden on desktop) */
.mobile-cats {
    display: none;
    padding: 10px 16px;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}
.mobile-cats::-webkit-scrollbar { display: none; }
.mobile-cats a {
    flex-shrink: 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    padding: 4px 12px;
    border-radius: 14px;
    background: var(--bg);
    transition: all 0.15s;
}
.mobile-cats a.active {
    color: #fff;
    background: var(--accent);
}

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 12px 16px 60px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ─── Article Card (列表页) ─── */
.article-card {
    background: var(--card-bg);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 18px 20px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-light);
}
.article-card:hover {
    box-shadow: 0 2px 12px rgba(255,107,53,0.06);
}
.article-card:active {
    transform: scale(0.98);
}
.article-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.category-tag {
    font-size: 12px;
    color: var(--accent);
    background: var(--accent-light);
    padding: 2px 10px;
    border-radius: 3px;
    font-weight: 500;
    flex-shrink: 0;
}

/* ─── Small sub-tags ─── */
.article-tags {
    display: flex;
    gap: 5px;
    margin: 6px 0 4px;
    flex-wrap: wrap;
}
.article-tag {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 400;
    letter-spacing: 0.5px;
    border: 1px solid;
}
.article-date {
    font-size: 12px;
    color: var(--text-secondary);
}
.article-card h2 {
    font-size: 17px;
    font-weight: 600;
    color: var(--title);
    line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card .summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card .source {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}
.search-highlight {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

/* ─── Search result header ─── */
.search-result-header {
    padding: 8px 0 12px;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-result-header .clear-search {
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
    background: none;
    border: none;
}

/* ═══════════════════════════════════════════
   文章详情页 - 公众号专业排版
   参考：wechat-typeset-pro terracotta 主题
   ═══════════════════════════════════════════ */

.article-detail {
    background: var(--card-bg);
    min-height: 100vh;
}
.article-top-bar {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── 文章标题区 ─── */
.article-header {
    padding: 28px 24px 0;
}
.article-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--title);
    line-height: 1.5;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}

/* ─── 文章元信息 ─── */
.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0;
}

/* ─── 公众号风格正文排版 ─── */
.article-body {
    padding: 20px 24px 32px;
    font-size: 16px;
    line-height: 1.8;
    color: #2d2016;
    letter-spacing: 0.5px;
}
.article-body p {
    margin-bottom: 1.2em;
    text-align: justify;
    word-break: break-word;
}

/* ─── 正文标题（H2/H3）—— 左橙色边框 ─── */
.article-body h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--title);
    line-height: 1.4;
    border-left: 4px solid var(--accent);
    border-bottom: 1px dashed var(--accent);
    padding: 0 0 8px 14px;
    margin: 32px 0 14px;
}
.article-body h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--title);
    line-height: 1.4;
    border-left: 3px solid var(--accent);
    padding: 0 0 6px 12px;
    margin: 28px 0 12px;
}

/* ─── 引用块 ─── */
.article-body blockquote {
    border-left: 4px solid var(--accent);
    background: var(--accent-bg);
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 0 6px 6px 0;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.75;
    font-style: italic;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

/* ─── 加粗 ─── */
.article-body strong, .article-body b {
    color: var(--accent);
    font-weight: 700;
}

/* ─── 链接 ─── */
.article-body a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,107,53,0.3);
}
.article-body a:hover {
    border-bottom-color: var(--accent);
}

/* ─── 列表 ─── */
.article-body ul, .article-body ol {
    padding-left: 24px;
    margin-bottom: 1.2em;
}
.article-body li {
    margin-bottom: 0.5em;
    line-height: 1.75;
}

/* ─── 正文图片（从原文提取） ─── */
.article-inline-image {
    margin: 24px 0;
    text-align: center;
}
.article-inline-image img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

/* ─── 分割线 ─── */
.article-body hr {
    margin: 32px auto;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    border: none;
    width: 60%;
    opacity: 0.4;
}

/* ─── 代码 ─── */
.article-body code {
    background: var(--accent-bg);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.article-body pre {
    background: var(--accent-bg);
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
    border-top: 3px solid var(--accent);
}
.article-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ─── 文章底部 ─── */
.article-footer {
    padding: 0 24px 24px;
    border-bottom: 8px solid var(--bg);
}
.article-source {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--accent-bg);
    padding: 10px 16px;
    border-radius: 6px;
    margin-top: 20px;
    border-left: 3px solid var(--accent);
}
.article-source a {
    color: var(--link);
    text-decoration: none;
}

/* ─── Comment Section ─── */
.comment-section {
    padding: 24px;
    border-top: 1px solid var(--border);
}

/* ─── Reaction Bar ─── */
.reaction-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 24px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 0;
}
.reaction-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 28px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.15s;
    user-select: none;
}
.reaction-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}
.reaction-btn.active {
    border-color: var(--accent);
    background: var(--accent-light);
    font-weight: 600;
}
.reaction-btn.active#likeBtn {
    color: #c0392b;
    border-color: #c0392b;
    background: #fef0ef;
}
.reaction-btn.active#dislikeBtn {
    color: #6b4faa;
    border-color: #6b4faa;
    background: #f0eaf8;
}
.reaction-icon { font-size: 20px; }
.reaction-count { font-weight: 700; font-size: 16px; min-width: 12px; }
.reaction-label { font-size: 13px; color: var(--text-secondary); }

/* ─── Comments ─── */
.comment-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--title);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.comment-form-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.comment-name {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    background: var(--bg);
    width: 120px;
    flex-shrink: 0;
    transition: border-color 0.2s;
}
.comment-name:focus {
    border-color: var(--accent);
}
.comment-textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    background: var(--bg);
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.comment-textarea:focus {
    border-color: var(--accent);
}
.comment-submit {
    align-self: flex-end;
    padding: 8px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.comment-submit:hover {
    opacity: 0.85;
}
.comment-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.comment-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}
.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--title);
}
.comment-time {
    font-size: 11px;
    color: var(--text-secondary);
}
.comment-content {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    padding-left: 36px;
}
.comment-empty {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 14px;
}
.comment-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ─── Footer ─── */
.site-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--card-bg);
    border-top: 1px solid var(--border);
}

/* ─── Loading / Empty / Error ─── */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.loading::after {
    content: "加载中...";
}
.error-msg {
    text-align: center;
    padding: 60px 20px;
    color: var(--accent);
}

/* ─── Back Button ─── */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    border: none;
    background: none;
    cursor: pointer;
}
.back-btn:hover {
    color: var(--accent);
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px 0;
}
.pagination button {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pagination button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
.page-info {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

/* ─── Article Prev/Next Navigation ─── */
.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 0;
}
.article-nav a {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.15s;
    max-width: 48%;
}
.article-nav a:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}
.nav-prev { justify-content: flex-start; }
.nav-next { justify-content: flex-end; }
.nav-arrow { font-size: 28px; color: var(--accent); flex-shrink: 0; }
.nav-text { min-width: 0; }
.nav-label { font-size: 11px; color: var(--text-secondary); display: block; margin-bottom: 2px; }
.nav-title { font-size: 14px; font-weight: 500; color: var(--title); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* ─── Language Toggle ─── */
.lang-toggle {
    padding: 4px 12px;
    border: 1px solid var(--accent);
    border-radius: 14px;
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}
.lang-toggle:hover {
    background: var(--accent);
    color: #fff;
}

/* ─── Responsive ─── */
@media (min-width: 768px) {
    .article-card {
        padding: 20px 24px;
    }
    .article-header {
        padding: 40px 48px 0;
    }
    .article-body {
        padding: 28px 48px 40px;
    }
    .article-body {
        font-size: 17px;
    }
    .article-body h2 {
        font-size: 22px;
    }
    .article-body h3 {
        font-size: 19px;
    }
    .article-card h2 {
        font-size: 19px;
    }
    .article-header h1 {
        font-size: 26px;
    }
    .article-footer {
        padding: 0 48px 28px;
    }
    .reaction-bar {
        padding: 28px 48px;
    }
    .article-nav {
        padding: 24px 48px;
    }
    .comment-section {
        padding: 28px 48px;
    }
}

/* Mobile: sidebar as horizontal scroll bar */
@media (max-width: 767px) {
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        position: static;
        max-height: none;
        padding: 8px 12px;
        display: flex;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sidebar::-webkit-scrollbar { display: none; }
    .sidebar-title {
        display: none;
    }
    .sidebar-nav {
        display: flex;
        gap: 6px;
        white-space: nowrap;
    }
    .sidebar-nav a {
        padding: 5px 12px;
        border-left: none;
        border-radius: 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
        background: var(--bg);
        border: 1px solid var(--border-light);
    }
    .sidebar-nav a:hover,
    .sidebar-nav a.active {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
    }
    .sidebar-nav a .cat-emoji {
        font-size: 13px;
    }
    .mobile-cats {
        display: none;
    }
    .layout-wrap {
        flex-direction: column;
    }
    .main-content {
        padding: 0 0 60px;
    }
    .search-wrap {
        max-width: none;
    }
    .top-bar-left .site-name .sub-en {
        display: none;
    }
    .article-body {
        padding: 16px 18px 28px;
    }
    .article-header {
        padding: 20px 18px 0;
    }
    .article-header h1 {
        font-size: 20px;
    }
    .article-body {
        font-size: 16px;
    }
    .article-footer {
        padding: 0 18px 20px;
    }
    .reaction-bar {
        gap: 16px;
        padding: 20px 18px;
    }
    .article-nav {
        padding: 16px 18px;
    }
    .comment-section {
        padding: 18px;
    }
}
/* ═══════════════════════════════════════════
   橘猫网增强样式 v2
   暗色模式 / 毛玻璃导航 / 卡片动效 / 骨架屏 / 返回顶部
   ═══════════════════════════════════════════ */

/* ─── Dark Mode ─── */
[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --title: #f1f5f9;
    --accent: #fb923c;
    --accent-light: rgba(251, 146, 60, 0.12);
    --accent-bg: rgba(251, 146, 60, 0.08);
    --link: #60a5fa;
    --border: #334155;
    --border-light: #1e293b;
    --tag-bg: rgba(251, 146, 60, 0.12);
    --sidebar-bg: #1e293b;
}

/* ─── Smooth theme transition ─── */
body, .top-bar, .sidebar, .article-card, .site-footer,
.reaction-btn, .search-form, .comment-textarea, .comment-name {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ─── Glass Navbar (scroll effect) ─── */
.top-bar.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
[data-theme="dark"] .top-bar.glass {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ─── Theme Toggle Button ─── */
.theme-toggle {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.theme-toggle:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

/* ─── Back to Top ─── */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
    transition: all 0.25s;
    opacity: 0;
    transform: translateY(10px);
}
.back-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255,107,53,0.4);
}

/* ─── Skeleton Loading ─── */
.skeleton {
    background: linear-gradient(90deg,
        var(--card-bg) 25%,
        var(--bg) 50%,
        var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
    margin-bottom: 8px;
}
.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 10px;
}
.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
    background: linear-gradient(90deg,
        var(--border) 25%,
        var(--bg) 50%,
        var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}
.skeleton-line:first-child {
    width: 30%;
    height: 16px;
}
.skeleton-line:nth-child(2) {
    width: 90%;
    height: 18px;
}
.skeleton-line:nth-child(3) {
    width: 75%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ─── Article Card v2 (enhanced) ─── */
.article-card {
    position: relative;
    overflow: hidden;
}
.article-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.article-card:hover::after {
    transform: scaleX(1);
}
.article-card:active {
    transform: scale(0.98);
}

/* ─── Card hover lift ─── */
.article-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255,107,53,0.08);
}

/* ─── Card likes badge ─── */
.card-likes {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
    font-size: 0.85em;
    color: #e74c3c;
}
[data-theme="dark"] .card-likes {
    color: #fb7185;
}

/* ─── Smooth scrollbar for dark mode ─── */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1e293b;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

/* ─── Loading spinner v2 ─── */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 40px 0;
}
.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: dot-bounce 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ─── Fade-in animation ─── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.article-card {
    animation: fadeInUp 0.4s ease-out both;
}
.article-card:nth-child(1) { animation-delay: 0s; }
.article-card:nth-child(2) { animation-delay: 0.05s; }
.article-card:nth-child(3) { animation-delay: 0.1s; }
.article-card:nth-child(4) { animation-delay: 0.15s; }
.article-card:nth-child(5) { animation-delay: 0.2s; }
.article-card:nth-child(6) { animation-delay: 0.25s; }

/* ─── Reaction pulse on click ─── */
.reaction-btn.pop {
    animation: pop 0.3s ease;
}
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
