:root {
    /* Dark Mode (Admin-inspired Editorial Night) */
    --bg-primary: #0a0a0a;
    --bg-secondary: #131313;
    --bg-tertiary: #1c1c1c;
    --bg-card: #141414;
    --bg-card-hover: #1d1d1d;

    --text-primary: #f5f5f5;
    --text-secondary: #d0d0d0;
    --text-muted: #a1a1a1;
    --text-subtle: #7a7a7a;

    --muted: #181818;
    --muted-foreground: #b3b3b3;
    --border: rgba(255, 255, 255, 0.12);
    --accent: #b8860b;
    --accent-foreground: #ffffff;
    --background: #0a0a0a;
    --foreground: #f5f5f5;

    --accent-primary: #b8860b;
    --accent-secondary: #d4a84b;
    --accent-hover: #dfa638;
    --accent-primary-rgb: 184, 134, 11;

    --bg-gradient: none;

    --gray-100: #fafafa;
    --gray-200: #e6e6e6;
    --gray-300: #cccccc;
    --gray-400: #b3b3b3;
    --gray-500: #8c8c8c;
    --gray-600: #737373;
    --gray-700: #595959;
    --gray-800: #404040;
    --gray-900: #262626;

    --border-color: rgba(255, 255, 255, 0.12);
    --border-hover: rgba(255, 255, 255, 0.25);
    --border-active: rgba(255, 255, 255, 0.4);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.55);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(184, 134, 11, 0.25);
    --shadow-accent: 0 6px 24px rgba(184, 134, 11, 0.25);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 4rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

:root.light-mode {
    --bg-primary: #fafaf8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f3f0;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f3f0;

    --text-primary: #1a1a1a;
    --text-secondary: #4c4c4c;
    --text-muted: #6b6b6b;
    --text-subtle: #8c8c8c;

    --muted: #f5f3f0;
    --muted-foreground: #6b6b6b;
    --border: #e8e4df;
    --accent: #b8860b;
    --accent-foreground: #ffffff;
    --background: #fafaf8;
    --foreground: #1a1a1a;

    --accent-primary: #b8860b;
    --accent-secondary: #d4a84b;
    --accent-hover: #a07008;
    --accent-primary-rgb: 184, 134, 11;

    --bg-gradient: none;

    --border-color: rgba(26, 26, 26, 0.12);
    --border-hover: rgba(26, 26, 26, 0.25);
    --border-active: rgba(26, 26, 26, 0.4);

    --shadow-sm: 0 2px 6px rgba(26, 26, 26, 0.05);
    --shadow-md: 0 10px 26px rgba(26, 26, 26, 0.12);
    --shadow-lg: 0 22px 50px rgba(26, 26, 26, 0.16);
    --shadow-glow: 0 0 30px rgba(184, 134, 11, 0.15);
    --shadow-accent: 0 8px 24px rgba(184, 134, 11, 0.18);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    padding: 0px;
}

/* ============================================
   SCROLLBAR STYLING - Minimalist Black & White
   ============================================ */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) rgba(0, 0, 0, 0.3);
}

html.light-mode * {
    scrollbar-color: rgba(15, 23, 42, 0.4) rgba(15, 23, 42, 0.1);
}

/* WebKit Browsers (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin: 2px;
}

html.light-mode *::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.08);
}

*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.05);
    transition: all var(--transition-fast);
}

html.light-mode *::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(15, 23, 42, 0.2);
    box-shadow: 0 0 4px rgba(15, 23, 42, 0.08);
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

html.light-mode *::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(15, 23, 42, 0.3);
    box-shadow: 0 0 8px rgba(15, 23, 42, 0.12);
}

*::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

html.light-mode *::-webkit-scrollbar-thumb:active {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(15, 23, 42, 0.35);
    box-shadow: 0 0 10px rgba(15, 23, 42, 0.15);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1rem;
}

/* Mobile Sticky Navigation */
.mobile-sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.2s ease;
    display: none;
}

html.light-mode .mobile-sticky-nav {
    background: rgba(250, 250, 248, 0.92);
    border-bottom-color: var(--border-color);
    box-shadow: none;
}

.mobile-sticky-nav.visible {
    transform: translateY(0);
}

.mobile-nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    max-width: 100vw;
    gap: 0.75rem;
}

.mobile-nav-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.mobile-nav-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
}

.mobile-nav-dates {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    min-width: 0;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 30px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 30px), transparent 100%);
}

.mobile-nav-dates::-webkit-scrollbar {
    display: none;
}

.mobile-nav-dates .date-tab {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 响应式：移动端适配 */
@media (max-width: 768px) {
    .top-bar-logo h1 {
        font-size: 0.875rem;
    }

    .top-bar-logo svg {
        width: 16px;
        height: 16px;
    }

    .top-bar-nav {
        gap: 0.75rem;
    }

    .date-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .view-toggle button {
        padding: 3px 6px !important;
        font-size: 0.7rem !important;
    }

    .view-toggle svg {
        width: 12px !important;
        height: 12px !important;
    }
}

/* Filter Tool Link */
.filter-tool-link {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    color: var(--text-secondary) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
    border: 1px solid transparent !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.filter-tool-link:hover {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    transform: translateY(-1px) !important;
}

.filter-tool-link svg {
    transition: transform 0.2s ease !important;
}

.filter-tool-link:hover svg {
    transform: scale(1.1) !important;
}

/* Enhanced view toggle styles */
.view-toggle {
    display: flex !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 4px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.view-btn {
    border: none !important;
    background: transparent !important;
    padding: 6px 12px !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    color: var(--text-secondary) !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    position: relative !important;
}

.view-btn:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.view-btn.active {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #000000 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    font-weight: 600 !important;
}

.view-btn.active svg {
    filter: brightness(0) !important;
}

.view-btn svg {
    transition: transform 0.2s ease !important;
}

.view-btn:hover svg {
    transform: scale(1.05) !important;
}

/* Light mode adjustments */
html.light-mode .filter-tool-link {
    background: rgba(0, 0, 0, 0.04) !important;
}

html.light-mode .filter-tool-link:hover {
    background: rgba(0, 0, 0, 0.08) !important;
}

html.light-mode .view-toggle {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

html.light-mode .view-btn:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}

html.light-mode .view-btn.active {
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast), border var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.theme-toggle-btn:hover {
    background: var(--accent);
    color: var(--accent-foreground);
    border-color: transparent;
    transform: rotate(8deg);
    box-shadow: var(--shadow-md);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* Fixed Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    /* 固定高度防止加载前后抖动 */
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
}

html.light-mode .top-bar {
    background: rgba(250, 250, 248, 0.92);
    box-shadow: none;
}

.top-bar-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.top-bar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.top-bar-logo svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.top-bar-logo h1 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.top-bar-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-width: 0;
}

body {
    padding-top: 64px;
    /* 匹配 top-bar 高度 */
}

/* Header - 移除原来的header样式，因为现在在top bar中 */
.header {
    display: none;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card:hover {
    border-color: var(--border-hover);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-icon.likes {
    background: rgba(255, 255, 255, 0.12);
    color: var(--gray-100);
}

.stat-icon.views {
    background: rgba(255, 255, 255, 0.09);
    color: var(--gray-200);
}

.stat-icon.posts {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gray-300);
}

.stat-icon.time {
    background: rgba(255, 255, 255, 0.04);
    color: var(--gray-400);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-time {
    font-size: 1.25rem;
}

/* Hot Topic */
.hot-topic {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.hot-badge {
    background: var(--accent);
    color: var(--accent-foreground);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.35);
    box-shadow: var(--shadow-sm);
}

.topic-text {
    flex: 1;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    min-width: 200px;
}

.topic-author {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9375rem;
}

/* Content Section */
.content-section {
    margin-bottom: var(--spacing-xl);
}

/* Date Separator - full width between separate masonry grids */
.date-separator {
    width: 100%;
    /* Visually hidden to maintain seamless waterfall but keep anchor logic */
    display: block;
    /* Ensure it exists in layout tree */
    height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.date-separator-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.date-separator-text {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 0.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: none;
}

/* Mobile date separator adjustments */
@media (max-width: 768px) {
    .date-separator {
        margin: 2rem 0 1.5rem 0;
        gap: 1rem;
    }

    .date-separator-text {
        font-size: 0.95rem;
        padding: 0.4rem 1rem;
    }
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* Content List - Masonry Layout */
.content-list {
    width: 100%;
}

.masonry-grid {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
    margin-bottom: 1rem;
}

.masonry-grid:last-child {
    margin-bottom: 0;
}

.masonry-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.masonry-item {
    margin-bottom: 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    transform-origin: top;
}

/* Gallery View - Masonry layout with row-based loading */
.image-gallery-grid {
    display: flex;
    gap: 4px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.image-gallery-grid:last-child {
    margin-bottom: 0;
}

.image-gallery-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (max-width: 1100px) {
    .image-gallery-grid {
        /* 3 columns handled by JS */
    }
}

@media (max-width: 768px) {
    .image-gallery-grid {
        /* 2 columns handled by JS */
    }
}

@media (max-width: 540px) {
    .image-gallery-grid {
        /* 1 column handled by JS */
    }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 3px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.gallery-item:hover {
    border-color: var(--border-hover);
}

.gallery-author-info {
    position: absolute;
    top: 0px;
    left: 0;
    right: 0;
    padding: 6px 10px 30px 10px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.8rem;
    font-weight: 100;
    pointer-events: none;
    z-index: 5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-author-link {
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
    transition: color 0.2s;
}

.gallery-author-link:hover {
    color: #fff;
}

.gallery-item:hover .gallery-author-info {
    opacity: 1;
}


.gallery-thumb {
    width: 100%;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    display: block;
    position: relative;
    overflow: hidden;
}

.gallery-thumb:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.gallery-thumb-placeholder {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: stretch;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0px;
}

.gallery-thumb-placeholder .loading-spinner {
    align-self: center;
}

.gallery-thumb img {
    width: 100%;
    display: block;
    vertical-align: bottom;
}

/* 简单纵向图片显示 - 仅用于单张图片或 fallback */
.gallery-simple-img {
    width: 100%;
    display: block;
    object-fit: cover;
    margin-bottom: 0px;
}

.gallery-simple-img:last-child {
    margin-bottom: 0;
}

/* 移除复杂布局样式 */
.gallery-single-img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* 基础网格容器 */
.gallery-grid-container {
    width: 100%;
    display: grid;
    gap: 2px;
    background: transparent;
}

/* 2 张图：并排 */
.gallery-grid-2 {
    grid-template-columns: 1fr 1fr;
    aspect-ratio: 16/9;
    /* 限制整体比例 */
}

/* 3 张图：左大右小两张 */
.gallery-grid-3 {
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 16/9;
}

.gallery-grid-3 .gallery-img-item:first-child {
    grid-row: 1 / 3;
    grid-column: 1 / 2;
    height: 100%;
}

.gallery-grid-3 .gallery-img-item:nth-child(2) {
    grid-row: 1 / 2;
    grid-column: 2 / 3;
}

.gallery-grid-3 .gallery-img-item:nth-child(3) {
    grid-row: 2 / 3;
    grid-column: 2 / 3;
}

/* 4 张图：2x2 网格 */
.gallery-grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 16/9;
}

/* 图片项通用样式 */
.gallery-img-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 0;
    /* 防止 grid item 溢出 */
}

/* 视频容器 */
.gallery-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
}

.gallery-video-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.gallery-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    color: white;
}

.gallery-item:hover .gallery-thumb img {
    /* 移除放大效果 */
}

.gallery-empty {
    padding: 1.5rem 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.gallery-multi-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery-icon-group {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity var(--transition-fast);
}

.gallery-item:hover .gallery-icon-group {
    opacity: 1;
    pointer-events: auto;
}

.gallery-icon-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    text-decoration: none;
    cursor: pointer;
}

.gallery-icon-button:hover {
    transform: translateY(-1px);
    background: var(--accent);
    color: var(--accent-foreground);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.gallery-icon-button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.gallery-icon-button svg {
    display: block;
}

.gallery-icon-button.copied {
    background: var(--accent);
    color: var(--accent-foreground);
    border-color: transparent;
}

.gallery-icon-button.copy-failed {
    background: rgba(100, 100, 100, 0.8);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.gallery-copy-icon {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.loading-spinner.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

/* Image viewer overlay */
.image-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 3000;
}

.image-viewer.visible {
    display: flex;
}

.image-viewer-dialog {
    width: min(1400px, 100%);
    max-height: 90vh;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.viewer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.viewer-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.viewer-stage {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 横向滚动容器 */
.viewer-scroll-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    scroll-snap-type: none;
    /* 暂时禁用 snap，避免干扰初始定位 */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-primary-rgb, 255, 255, 255), 0.5) transparent;
    position: relative;
    border-radius: var(--radius-md);
    background: transparent;
    /* 移除背景色 */
    display: flex;
    /* 添加 flex 布局 */
    justify-content: flex-start;
    /* 从左开始显示 */
    align-items: center;
    /* 垂直居中 */
}

.viewer-scroll-container::-webkit-scrollbar {
    height: 6px;
    /* 更细的滚动条 */
}

.viewer-scroll-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.viewer-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-primary-rgb, 255, 255, 255), 0.5);
    border-radius: 3px;
}

.viewer-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-primary-rgb, 255, 255, 255), 0.7);
}

/* 图片轨道 - 横向排列 */
.viewer-images-track {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    /* 减少 padding */
    min-height: 400px;
    justify-content: flex-start;
    /* 从左开始排列 */
    align-items: center;
    /* 垂直居中 */
    flex-shrink: 0;
    /* 防止收缩 */
}

/* 单个图片项 */
.viewer-image-item {
    flex-shrink: 0;
    width: auto;
    max-width: 85vw;
    /* 减小最大宽度，避免图片过宽 */
    min-height: 400px;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
    border-radius: var(--radius-md);
    background: transparent;
    /* 移除背景 */
}

.viewer-image-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    /* 更淡的加载背景 */
}

.viewer-image {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    display: none;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.viewer-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.65rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    min-height: 400px;
}

.viewer-placeholder.error {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.viewer-nav {
    position: relative;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.viewer-nav:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.75);
}

.viewer-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

.viewer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.viewer-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity var(--transition-fast);
}

.viewer-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

body.viewer-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .image-viewer {
        padding: 1rem;
    }

    .image-viewer-dialog {
        padding: 1rem;
    }

    .viewer-images-track {
        min-height: 300px;
    }

    .viewer-image-item {
        min-height: 300px;
        max-height: 60vh;
    }

    .viewer-image {
        max-height: 60vh;
    }

    .viewer-placeholder {
        min-height: 300px;
    }

    .viewer-nav {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* Tweet Embed Container */
.tweet-embed-container {
    margin: 0;
    /* padding: var(--spacing-md); */
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: none;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.tweet-embed-container.loaded {
    min-height: auto;
}

/* Date Navigation Tabs */
.date-tabs-container {
    position: relative;
    margin-top: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 40px), transparent 100%);
}

.date-tabs-container::-webkit-scrollbar {
    display: none;
}

.date-tabs {
    display: flex;
    position: relative;
    padding: 0.25rem 0;
    min-width: 100%;
}

.date-tab {
    padding: 0.35rem 1rem;
    margin: 0 0.25rem;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.date-tab:first-child {
    margin-left: 0;
}

.date-tab:last-child {
    margin-right: 0;
}

.date-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.date-tab.active {
    background: var(--accent);
    color: var(--accent-foreground);
    border-color: var(--accent);
    font-weight: 600;
}

.date-nav-card {
    padding: 1rem;
}

.loading-dates {
    display: flex;
    justify-content: center;
    padding: 1rem;
    color: var(--text-secondary);
}

.no-dates {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Loading states for better UX */
.content-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.content-loading .loading-spinner {
    margin-bottom: 1rem;
}

.date-tab.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer p {
    margin-bottom: var(--spacing-xs);
    font-size: 0.9375rem;
}

.footer-note {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Responsive Design */

/* Tablet and below */
@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    body {
        padding: 4rem 0.5rem 0.5rem 0.5rem;
    }

    .container {
        padding: 0;
    }

    /* Header adjustments */
    .header {
        padding: 1.5rem 0;
        margin-bottom: 1rem;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .logo-icon {
        width: 24px;
        height: 24px;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    /* Single column masonry for mobile */
    .masonry-grid {
        column-count: 1;
        column-gap: 0;
    }

    .masonry-item {
        margin-bottom: 1rem;
    }

    /* Stats grid - single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    /* Date navigation */
    .date-nav-card {
        padding: 0.75rem;
    }

    .date-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.8125rem;
    }

    .date-tabs-container {
        margin-top: 0.25rem;
    }

    /* Hot topic */
    .hot-topic {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    /* Tweet containers */
    .tweet-embed-container {
        padding: 0.75rem;
    }

    /* Footer */
    .footer {
        padding: 1rem 0;
        font-size: 0.875rem;
    }

    .footer p {
        font-size: 0.875rem;
    }

    .footer-note {
        font-size: 0.8125rem;
    }

    /* Remove hover effects on mobile */
    .content-item:hover {
        transform: none;
    }

    .stat-card:hover {
        border-color: var(--border-color);
    }

    /* Deleted item state */
    .deleted-item {
        pointer-events: none;
        user-select: none;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .date-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.8125rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
    }

    .stat-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.loading {
    background: linear-gradient(90deg,
            var(--bg-card) 0%,
            var(--bg-card-hover) 50%,
            var(--bg-card) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Tweet Embed Container */
.tweet-embed-container {
    margin: 0;
    /* padding: var(--spacing-md); */
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: none;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.tweet-embed-container.loaded {
    background: transparent;
    border: none;
    padding: 0;
    display: block;
    min-height: auto;
}

/* Tweet Loading State */
.tweet-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    color: var(--text-secondary);
    width: 100%;
    min-height: 160px;
}

/* Hide loading state when tweet is loaded */
.tweet-embed-container.loaded .tweet-loading {
    display: none !important;
}

/* Hide loading state when container has loaded class but tweet still showing */
.tweet-embed-container.loaded .loading-spinner {
    display: none !important;
}

/* Ensure loaded tweets are displayed properly */
.tweet-embed-container.loaded {
    min-height: auto;
}

/* Ensure any remaining loading elements are hidden */
.twitter-tweet {
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tweet Error State */
.tweet-error {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-md);
    font-size: 0.9375rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Twitter Embed Styling Override */
.tweet-embed-container .twitter-tweet {
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

.tweet-embed-container .twitter-tweet iframe {
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    min-height: 200px !important;
}


/* Copy Day Button */
.copy-day-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
    margin-left: 0.5rem;
}

.copy-day-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.copy-day-btn:active {
    transform: translateY(0);
}

.copy-day-btn svg {
    width: 18px;
    height: 18px;
}

.copy-day-btn.generating {
    cursor: wait;
    opacity: 0.7;
    animation: pulse 1.5s infinite;
}

.copy-day-btn.success {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.copy-day-btn.error {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Sticky Date Indicator */
.sticky-date-indicator {
    position: fixed;
    top: 60%;
    left: 40px;
    transform: translateY(-50%);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.05em;
}

.sticky-date-indicator.visible {
    opacity: 1;
}

@media (max-width: 1300px) {
    .sticky-date-indicator {
        left: 10px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* =========================================
   UPDATED Sticky Date Indicator (White Pill) 
   ========================================= */

/* Ensure content is above the line */
.gallery-item {
    z-index: 5;
    position: relative;
    background: var(--bg-card);
    /* Ensure no transparency so line is hidden behind */
}

/* The Label (Top Layer) */
.sticky-date-indicator {
    position: fixed;
    top: 60%;
    left: 40px;
    transform: translateY(-50%);

    /* White Pill Style */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;

    padding: 6px 16px;
    border-radius: 999px;
    /* Full Rounded */
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.05em;

    z-index: 1002;
    /* Above everything */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.sticky-date-indicator.visible {
    opacity: 1;
}

/* The Line (Background Layer) */
.sticky-date-line {
    position: fixed;
    top: 60%;
    /* Same vertical pos as label */
    left: 0;
    right: 0;
    height: 1px;

    background: rgba(255, 255, 255, 0.15);

    z-index: 1;
    /* Low Z-index: Behind images (z-5) */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.sticky-date-line.visible {
    opacity: 1;
}

@media (max-width: 1000px) {
    .sticky-date-indicator {
        left: 10px;
        font-size: 0.75rem;
        padding: 5px 12px;
    }

    .date-separator-text {
        font-size: 0.95rem;
        padding: 0.4rem 1rem;
    }
}

/* Desktop: Center Sticky Date Indicator in Left Sidebar (260px width) */
@media (min-width: 1301px) {
    .sticky-date-indicator {
        left: 130px;
        transform: translate(-50%, -50%);
    }
}

/* Scroll To Top Interaction */
.top-bar-logo,
.mobile-nav-title {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.top-bar-logo:hover,
.mobile-nav-title:hover {
    opacity: 0.8;
}

/* ============================
   Right Sidebar (Authors)
   ============================ */
.sidebar-right {
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 0;
    width: 260px;
    background: transparent;
    padding: 20px;
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ============================
   Left Sidebar (Taxonomy)
   ============================ */
.sidebar-left {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 260px;
    /* Force width constraint */
    right: auto;
    /* Prevent stretching */
    background: transparent;
    padding: 20px;
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-right::-webkit-scrollbar,
.sidebar-left::-webkit-scrollbar {
    display: none;
}

/* Hide sidebars on smaller screens */
@media (max-width: 1300px) {

    .sidebar-right,
    .sidebar-left {
        display: none;
    }
}

.sidebar-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.author-list,
.category-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.author-item,
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.author-item:hover,
.category-item:hover {
    background: var(--bg-card-hover);
}

.category-item.active {
    background: rgba(184, 134, 11, 0.15);
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.category-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 10px;
}



.author-name {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.author-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
}


/* Sidebar layout adjustments removed to keep waterfall centered */