/* gallery.css - 现代极简风格 (V3.0 Dark Mode Ready) */

/* --- [SECTION 1] 根变量与主题定义 --- */
:root {
    /* 字体系统 */
    --font-main: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Noto Sans SC', sans-serif;
    
    /* ====== 白昼模式 (默认) ====== */
    /* 背景与层级 */
    --color-bg: #f8fafc;              /* 页面大背景 */
    --color-surface: #ffffff;         /* 卡片、弹窗、侧边栏背景 */
    --color-surface-hover: #f8fafc;   /* 悬浮时的背景色 */
    --color-modal-overlay: rgba(15, 23, 42, 0.6); /* 弹窗遮罩 */
    
    /* 毛玻璃背景 (导航栏) */
    --color-glass-bg: rgba(255, 255, 255, 0.85);
    
    /* 输入框与标签 */
    --color-input-bg: #f1f5f9;        /* 输入框、未选标签背景 */
    --color-input-bg-hover: #e2e8f0;
    
    /* 边框 */
    --color-border: #e2e8f0;
    
    /* 品牌色 */
    --color-primary: #2563eb;         /* 主题蓝 */
    --color-primary-hover: #1d4ed8;
    --color-secondary: #7c3aed;       /* 辅助紫 */
    
    /* 文字颜色 */
    --color-text-primary: #0f172a;    /* 主标题 (深黑) */
    --color-text-secondary: #64748b;  /* 次要信息 (灰) */
    --color-text-sub: #94a3b8;        /* 更淡的信息 */
    --color-text-heading-dark: #1e293b; /* 卡片标题 */
    --color-text-inverse: #ffffff;    /* 反色文本 (按钮字) */

    /* 装饰与渐变 */
    --color-gradient-dark: linear-gradient(135deg, #2563eb, #4f46e5);
    --shadow-color: 0, 0, 0;          /* 阴影基础色 */
    
    /* 圆角 */
    --border-radius-main: 16px;
    --border-radius-small: 8px;

    /* 滚动条颜色 */
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-thumb-hover: #94a3b8;
}

/* ====== 黑夜模式 ====== */
[data-theme="dark"] {
    /* 背景变黑 */
    --color-bg: #050505;              /* 纯黑或极深灰 */
    --color-surface: #1c1c1e;         /* 类似于iOS深色模式的灰 */
    --color-surface-hover: #2c2c2e;
    --color-modal-overlay: rgba(0, 0, 0, 0.8);
    
    /* 毛玻璃变深 */
    --color-glass-bg: rgba(28, 28, 30, 0.85);
    
    /* 输入框变深灰 */
    --color-input-bg: #2c2c2e;
    --color-input-bg-hover: #3a3a3c;
    
    /* 边框变暗 */
    --color-border: #38383a;
    
    /* 品牌色微调 (深色模式下蓝色要稍微亮一点才护眼) */
    --color-primary: #0a84ff;
    --color-primary-hover: #409cff;
    
    /* 文字反白 */
    --color-text-primary: #f2f2f7;    /* 次白 */
    --color-text-secondary: #a1a1a6;  /* 浅灰 */
    --color-text-sub: #6e6e73;
    --color-text-heading-dark: #ffffff; 
    --color-text-inverse: #ffffff;

    /* 滚动条变暗 */
    --scrollbar-thumb: #48484a;
    --scrollbar-thumb-hover: #636366;
}

/* 阴影系统 (使用变量方便调整) */
:root {
    --shadow-glow-soft: 0 1px 2px 0 rgba(var(--shadow-color), 0.05);
    --shadow-glow-medium: 0 10px 15px -3px rgba(var(--shadow-color), 0.1), 0 4px 6px -2px rgba(var(--shadow-color), 0.05);
    --shadow-glow-strong: 0 20px 25px -5px rgba(var(--shadow-color), 0.1), 0 10px 10px -5px rgba(var(--shadow-color), 0.04);
}

/* 黑夜模式下阴影稍微深一点，否则看不见 */
[data-theme="dark"] {
     --shadow-glow-soft: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
     --shadow-glow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
     --shadow-glow-strong: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; 
    outline: none;
}

/* 全局禁止选中文本 */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  overflow-x: hidden;
  background-image: none;
  transition: background-color 0.3s ease, color 0.3s ease; /* 平滑过渡 */
} 

/* 允许特定区域选中文本 */
pre, code, input, textarea, .work-description, .comment-content {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* --- [SECTION 1.5] 滚动条美化 --- */
html::-webkit-scrollbar,
.modal-scroll-content::-webkit-scrollbar,
.feed-view-content::-webkit-scrollbar,
textarea::-webkit-scrollbar {
    width: 8px;
    background-color: transparent;
}

html::-webkit-scrollbar-thumb,
.modal-scroll-content::-webkit-scrollbar-thumb,
.feed-view-content::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
    transition: all 0.2s;
}

html::-webkit-scrollbar-thumb:hover,
.modal-scroll-content::-webkit-scrollbar-thumb:hover,
.feed-view-content::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

/* GPU加速优化类 */
.inspiration-wall, .work-card {
    transform: translateZ(0);
    will-change: transform;
}

/* --- [SECTION 2] 导航栏 (顶部) --- */
.top-navbar {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 1000;
    
    /* 使用变量实现毛玻璃 */
    background: var(--color-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out, background-color 0.3s;
}

.navbar-hamburger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--border-radius-small);
    transition: background-color 0.2s ease;
    color: var(--color-text-primary);
}

.navbar-hamburger:hover { 
    background-color: var(--color-input-bg); 
}

.navbar-hamburger i { 
    color: var(--color-primary); 
    font-size: 1.2rem; 
}

.navbar-search {
    position: relative;
}

.navbar-search .search-input {
    background: var(--color-input-bg);
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 9px 45px 9px 20px;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    outline: none;
    width: 100%; 
    max-width: 400px;
    transition: all 0.3s ease;
}

.navbar-search .search-input::placeholder { color: var(--color-text-sub); }

.navbar-search .search-input:focus {
    background: var(--color-surface);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.navbar-search .search-btn {
    background: transparent; 
    border: none; 
    color: var(--color-primary);
    position: absolute; 
    right: 15px; 
    top: 50%; 
    transform: translateY(-50%);
    font-size: 1rem; 
    cursor: pointer;
}

.navbar-home-btn {
    width: 42px; 
    height: 42px;
    border-radius: var(--border-radius-small);
    display: flex; 
    justify-content: center; 
    align-items: center;
    background-color: transparent;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--color-border);
}

.navbar-home-btn:hover {
    background-color: var(--color-input-bg);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* --- [SECTION 3] 侧边栏 (Sidebar) --- */
.side-nav {
    position: fixed; 
    top: 0; 
    left: -280px;
    width: 280px; 
    height: 100vh;
    background: var(--color-surface);
    z-index: 1100;
    box-shadow: var(--shadow-glow-strong);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;
    display: flex; 
    flex-direction: column;
    border-right: 1px solid var(--color-border);
}

.side-nav.active { 
    left: 0;
}

.nav-header { 
    padding: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    border-bottom: 1px solid var(--color-border); 
}

.nav-header .nav-title { 
    font-family: var(--font-display); 
    color: var(--color-primary); 
    font-size: 1.5rem; 
    font-weight: 700; 
}

.close-nav { 
    background: transparent; 
    border: none; 
    color: var(--color-text-secondary); 
    font-size: 1.2rem; 
    cursor: pointer; 
    transition: color 0.3s ease; 
}

.close-nav:hover { color: var(--color-primary); }

.side-nav .nav-content {
    padding: 10px;
    flex: 1; 
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-group { padding: 15px; }

.side-nav .nav-section-title { 
    font-family: var(--font-display); 
    color: var(--color-text-secondary);
    font-size: 0.85rem; 
    font-weight: 600; 
    margin-bottom: 15px;
    letter-spacing: 1px; 
    text-transform: uppercase;
}

.gallery-categories, .quick-links { list-style: none; }
.gallery-categories { margin-bottom: 30px; }

.gallery-categories .nav-item, .quick-links a {
    display: flex; 
    align-items: center; 
    padding: 12px 15px;
    border-radius: var(--border-radius-small);
    cursor: pointer; 
    transition: all 0.2s ease; 
    margin-bottom: 5px;
    font-weight: 500; 
    color: var(--color-text-primary);
    text-decoration: none;
}

.gallery-categories .nav-item i, .quick-links i { 
    margin-right: 15px; 
    color: var(--color-text-secondary); 
    width: 20px; 
    text-align: center;
    transition: color 0.2s;
}

.gallery-categories .nav-item:hover, .quick-links a:hover { 
    background: var(--color-input-bg); 
    color: var(--color-primary);
}
.gallery-categories .nav-item:hover i, .quick-links a:hover i {
    color: var(--color-primary);
}

/* 通知红点 */
.custom-nav .nav-item { position: relative; }
.notification-badge, .notification-count-badge {
    position: absolute;
    top: 12px;
    right: 15px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}
.notification-count-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    top: 10px;
}
.notification-badge {
    width: 8px;
    height: 8px;
    top: 18px;
}


.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-modal-overlay);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- [SECTION 4] 主内容区域 --- */
.main-content { 
    flex: 1; 
    padding-top: 85px; 
    transition: margin-left 0.4s ease; 
    min-height: 100vh;
}

.gallery-content { 
    padding: 0 40px; 
}

.gallery-section { 
    display: none; 
}
.gallery-section.active { 
    display: block; 
}

/* --- [SECTION 5] 标签筛选栏 (Tags) --- */
.tags-filter-container { 
    padding: 0 40px 20px; 
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tag-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tag-row-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tag-row-label i { color: var(--color-primary); }

.tags-filter-scroll {
    display: flex; 
    gap: 10px;
    overflow-x: auto; 
    cursor: grab; 
    user-select: none;
    padding-bottom: 10px; 
    scrollbar-width: none; 
}
.tags-filter-scroll::-webkit-scrollbar { display: none; }

.filter-tag {
    padding: 6px 16px;
    background: var(--color-surface); 
    border: 1px solid var(--color-border);
    border-radius: 20px; 
    cursor: pointer; 
    transition: all 0.2s ease;
    white-space: nowrap; 
    font-size: 0.9rem; 
    font-weight: 500;
    color: var(--color-text-secondary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.filter-tag:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-input-bg-hover);
}

.filter-tag.active {
    background: var(--color-primary);
    color: var(--color-text-inverse); 
    border-color: var(--color-primary);
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}


/* --- [SECTION 6] 瀑布流卡片 (Work Card) --- */
.inspiration-wall { 
    position: relative; 
    width: 100%; 
    margin: 0 auto; 
}

.work-card {
    position: absolute;
    width: 280px;
    background-color: var(--color-surface);
    border-radius: var(--border-radius-main);
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, background-color 0.3s;
    
    opacity: 0;
    transform: translate3d(0, 20px, 0);
}

.work-card.visible { 
    opacity: 1; 
    transform: translate3d(0, 0, 0);
}

/* 桌面端悬浮效果 */
@media (hover: hover) {
    .work-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-glow-medium);
        z-index: 10;
    }
}

.card-image-container { 
    position: relative; 
    overflow: hidden; 
}

.card-image {
    width: 100%; 
    display: block; 
    aspect-ratio: 4 / 3;
    object-fit: cover; 
    background-color: var(--color-input-bg);
    transition: transform 0.5s ease;
}

.work-card:hover .card-image { 
    transform: scale(1.05); 
}

.card-content { 
    padding: 16px; 
}

.card-title {
    font-family: var(--font-display); 
    font-weight: 700;
    font-size: 1.05rem; 
    color: var(--color-text-heading-dark);
    margin-bottom: 6px; 
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-description {
    font-size: 0.85rem; 
    line-height: 1.5;
    margin-bottom: 12px; 
    color: var(--color-text-secondary);
    height: calc(1.5em * 3);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.stat-item {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--color-text-sub);
    font-weight: 500;
}

.stat-item i {
    margin-right: 4px;
    font-size: 0.8rem;
}

.card-footer { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.card-author { 
    display: flex; 
    align-items: center; 
}

.card-author-avatar {
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    object-fit: cover;
    margin-right: 8px; 
    border: 1px solid var(--color-border);
}

.card-author-name { 
    font-size: 0.8rem; 
    font-weight: 500; 
    color: var(--color-text-secondary);
}

.card-heat {
    display: flex; 
    align-items: center; 
    font-size: 0.85rem; 
    font-weight: 600;
    color: var(--color-primary);
}
.card-heat i { margin-right: 4px; }


/* --- [SECTION 7] 加载更多按钮 --- */
.load-more-container { 
    padding: 40px 0 60px; 
    text-align: center; 
}

.load-more-btn {
    font-family: var(--font-display); 
    font-size: 0.95rem; 
    font-weight: 600;
    padding: 12px 32px; 
    border-radius: 30px; 
    border: 1px solid var(--color-border);
    background: var(--color-surface); 
    color: var(--color-text-primary);
    cursor: pointer; 
    transition: all 0.2s ease;
    box-shadow: var(--shadow-glow-soft);
}

.load-more-btn:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: var(--shadow-glow-medium);
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.empty-message, .error-message {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-secondary);
    font-size: 1rem;
}

/* --- [SECTION 8] 作品详情弹窗 (Modal) --- */
.work-details-modal { 
    position: fixed; 
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%; 
    z-index: 2000;
    display: none; 
    align-items: center; 
    justify-content: center;
    padding: 20px;
}

.modal-overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: var(--color-modal-overlay);
    backdrop-filter: blur(4px); 
}

.modal-content {
    position: relative; 
    z-index: 1;
    width: 100%; 
    max-width: 650px;
    max-height: 90vh;
    background: var(--color-surface); 
    border-radius: var(--border-radius-main);
    box-shadow: var(--shadow-glow-strong);
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    border: none;
}

.close-modal {
    position: absolute; 
    top: 15px; 
    right: 15px;
    width: 32px; 
    height: 32px; 
    border-radius: 50%;
    background: rgba(0,0,0,0.3); 
    border: none;
    color: white;
    font-size: 1.5rem; 
    line-height: 32px;
    text-align: center;
    cursor: pointer; 
    z-index: 10;
    transition: all 0.2s ease;
}
.close-modal:hover { background: rgba(0,0,0,0.5); }

.modal-scroll-content { 
    flex: 1 1 auto; 
    overflow-y: auto; 
    min-height: 0; 
}

/* 弹窗头部 (封面图) */
.modal-header { 
    position: relative; 
    width: 100%; 
    height: 220px; 
    flex-shrink: 0;
}
.modal-work-cover { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}
.modal-header .creator-avatar { 
    width: 40px; height: 40px; border-radius: 50%; margin-right: 12px; 
    border: 2px solid white; 
}
.modal-header .creator-name { 
    color: white; 
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-body { padding: 25px; }

/* 选项卡 */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 25px;
}
.modal-tab-btn {
    padding: 0 5px 12px 5px;
    margin-right: 25px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--color-text-sub);
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transition: transform 0.2s;
}
.modal-tab-btn:hover { color: var(--color-text-primary); }
.modal-tab-btn.active { color: var(--color-primary); font-weight: 600; }
.modal-tab-btn.active::after { transform: scaleX(1); }

.comment-count-badge {
    background-color: var(--color-input-bg);
    color: var(--color-primary);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 详情内容 */
.work-tags-container { 
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 25px; 
}
.work-tags-container .tag, .work-tags-container .tag-default {
    background-color: var(--color-input-bg);
    color: var(--color-text-secondary);
    border: none;
    padding: 6px 12px; 
    border-radius: 6px;
    font-size: 0.85rem; 
}

.modal-section { margin-bottom: 25px; }
.modal-section h4 { 
    font-size: 1.1rem; font-weight: 700; color: var(--color-text-primary); 
    margin-bottom: 12px; display: flex; align-items: center; 
}
.modal-section h4 i { margin-right: 10px; color: var(--color-primary); }
.modal-section .work-description { 
    font-size: 0.95rem; line-height: 1.7; color: var(--color-text-primary); 
}

/* 详细设定 Iframe */
.work-detailed-iframe-container { 
    border: 1px solid var(--color-border); 
    border-radius: var(--border-radius-small);
    background-color: var(--color-bg);
}
#galleryWorkDetailedDescriptionIframe {
    width: 100%; display: block; border: none; background: transparent;
}
.iframe-loader .spinner {
    width: 30px; height: 30px; border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%; animation: spin 1s linear infinite; margin: 20px auto;
}

/* 评论列表 */
.comment-item {
    display: flex; gap: 15px; padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--color-border);}
.comment-body {flex: 1;min-width: 0;width: 100%;}
.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.comment-author { font-weight: 600; color: var(--color-text-primary); }
.comment-time { font-size: 0.8rem; color: var(--color-text-sub); }
.comment-content { font-size: 0.95rem; line-height: 1.6; color: var(--color-text-secondary); }

.comment-footer { display: flex; align-items: center; gap: 15px; margin-top: 8px; }
.comment-action-btn { 
    background: none; border: none; color: var(--color-text-sub); cursor: pointer; 
    display: flex; align-items: center; gap: 5px; font-size: 0.85rem; 
    padding: 4px 8px; transition: all 0.2s;
}
.comment-action-btn:hover { color: var(--color-primary); background: var(--color-input-bg); border-radius: 4px; }
.comment-action-btn.liked { color: #ef4444; }

.replies-container { 
    margin-left: 10px; padding-left: 15px; border-left: 2px solid var(--color-input-bg); 
    margin-top: 10px;
}

/* 评论输入框 */
#comment-form {
    display: none;
    gap: 12px; padding: 15px 20px;
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    align-items: flex-end;
}
.modal-content.comments-active #comment-form { display: flex; }

#comment-textarea {
    width: 100%; height: auto; max-height: 80px;
    background: var(--color-input-bg); 
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem; color: var(--color-text-primary);
    outline: none; resize: vertical;
    transition: all 0.2s;
}
#comment-textarea:focus {
    background: var(--color-surface); border-color: var(--color-primary);
}

.submit-comment-btn { 
    flex-shrink: 0; padding: 10px 18px; 
    background: var(--color-primary); color: white; 
    border: none; border-radius: 8px; cursor: pointer; font-weight: 600; 
    transition: background 0.2s;
}
.submit-comment-btn:hover { background: var(--color-primary-hover); }
.submit-comment-btn:disabled { background: var(--color-text-sub); cursor: not-allowed; }

/* 底部按钮 */
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg); /* 使用背景色，稍微区别于内容 */
    text-align: center;
}
.modal-footer .start-play-btn {
    font-family: var(--font-display);
    font-size: 1rem; font-weight: 600;
    padding: 12px 40px;
    border-radius: 30px;
    border: none;
    background: var(--color-gradient-dark);
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    cursor: pointer; transition: all 0.3s ease;
    display: inline-flex; align-items: center; gap: 10px;
}
.modal-footer .start-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(37, 99, 235, 0.3);
}

/* ========================================= */
/* === 作品详情页 - 头部新布局 === */
/* ========================================= */

/* 头部遮罩层容器 */
.modal-header-overlay { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    color: white; 
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 5;
}

/* 创作者信息 */
.modal-header .creator-info { 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    width: 100%; 
    margin-bottom: 0;
}
.author-left-group {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    margin-right: 10px;
}

/* 标题 + 按钮容器 */
.work-title-row {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* 标题样式 */
.modal-work-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin: 0;
    line-height: 1.2;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 添加到桌面按钮样式 */
.add-to-desktop-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.add-to-desktop-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.add-to-desktop-btn:active {
    transform: scale(0.95);
}

.add-to-desktop-btn.added {
    background: #f59e0b; 
    border-color: #f59e0b;
    color: white;
    cursor: default; 
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.add-to-desktop-btn.added:hover {
    transform: none;
}

/* --- [SECTION 9] 关注按钮 --- */
.follow-btn, .profile-follow-btn {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem; font-weight: 600;
    cursor: pointer; border: none; outline: none;
    transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
/* 未关注 */
.follow-btn:not(.is-following), .profile-follow-btn:not(.is-following) {
    background: var(--color-primary); color: white;
}
.follow-btn:not(.is-following):hover:not(:disabled) {
    background: var(--color-primary-hover);
}
/* 已关注 */
.follow-btn.is-following, .profile-follow-btn.is-following {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}
.follow-btn.is-following:hover {
    border-color: #ef4444; color: #ef4444; background: rgba(254, 242, 242, 0.1);
}
.follow-btn.is-following:hover span:first-child, .profile-follow-btn.is-following:hover span:first-child { display: none; }
.follow-btn.is-following:hover::after, .profile-follow-btn.is-following:hover::after { content: "取消关注"; }

/* --- [SECTION 10] 个人主页弹窗 (现代卡片版) --- */

.user-profile-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 6000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.user-profile-modal.active { opacity: 1; visibility: visible; }

.profile-modal-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--color-modal-overlay);
    backdrop-filter: blur(4px);
}

/* 卡片容器 */
.profile-card {
    position: relative;
    width: 90%; max-width: 400px;
    background-color: var(--color-surface);
    border-radius: 24px;
    box-shadow: var(--shadow-glow-strong);
    overflow: hidden;
    transform: translateY(20px) scale(0.95); 
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex; flex-direction: column;
}

.user-profile-modal.active .profile-card { 
    transform: translateY(0) scale(1); 
    opacity: 1;
}

/* 1. 关闭按钮 */
.close-profile-modal {
    position: absolute; top: 15px; right: 15px; 
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(4px);
    color: white; border: none; font-size: 1.5rem; line-height: 32px;
    cursor: pointer; z-index: 20;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.close-profile-modal:hover { background: rgba(0,0,0,0.6); }

/* 2. 顶部封面图 */
.profile-banner {
    width: 100%; 
    height: 140px;
    background-color: var(--color-border);
    background-size: cover; background-position: center;
    background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
}

/* 3. 内容区域 */
.profile-content-wrapper {
    padding: 0 25px 30px 25px;
    margin-top: -50px; 
    display: flex; flex-direction: column; align-items: center;
    position: relative; z-index: 2;
}

/* 头像容器 */
.profile-avatar-container {
    width: 100px; height: 100px;
    border-radius: 50%;
    padding: 4px;
    background: var(--color-surface);
    box-shadow: var(--shadow-glow-soft);
    margin-bottom: 15px;
}

.profile-avatar {
    width: 100%; height: 100%;
    border-radius: 50%; object-fit: cover;
    background-color: var(--color-input-bg);
}

/* 文本信息 */
.profile-info-center {
    text-align: center; width: 100%; margin-bottom: 25px;
}

.profile-username {
    font-size: 1.4rem; font-weight: 800; color: var(--color-text-primary);
    margin-bottom: 8px;
}

.profile-stats {
    display: inline-block;
    background: var(--color-input-bg); padding: 6px 16px; border-radius: 20px;
    font-size: 0.85rem; color: var(--color-text-secondary); font-weight: 600;
    margin-bottom: 15px;
}
/* 强制让统计数字也是跟随主题的颜色，虽然内联样式容易覆盖 */
.profile-stats span { color: var(--color-text-primary) !important; }

.profile-bio {
    font-size: 0.95rem; color: var(--color-text-secondary); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
    padding: 0 10px;
}

/* 4. 底部按钮区 */
.profile-footer-actions {
    width: 100%;
    display: flex; gap: 12px;
    margin-top: auto;
}

.profile-action-btn {
    flex: 1;
    padding: 12px 0;
    border-radius: 12px;
    font-size: 0.95rem; font-weight: 600;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.profile-action-btn:active { transform: scale(0.98); }

/* 查看作品按钮 */
.view-works-btn {
    background-color: var(--color-input-bg);
    color: var(--color-text-secondary);
}
.view-works-btn:hover {
    background-color: var(--color-input-bg-hover); color: var(--color-text-primary);
}

/* 关注按钮 */
.profile-follow-btn {
    background: var(--color-gradient-dark);
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}
.profile-follow-btn:hover:not(.is-following) {
    box-shadow: 0 8px 15px rgba(37, 99, 235, 0.3);
}

.profile-follow-btn.is-following {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    box-shadow: none;
}
.profile-follow-btn.is-following:hover {
    background: rgba(254, 242, 242, 0.1); border-color: #ef4444; color: #ef4444;
}

/* --- [SECTION 11] 信息流视图 (Following Feed) --- */
body.feed-view-is-active .top-navbar { transform: translateY(-100%); opacity: 0; }
body.feed-view-is-active { overflow: hidden; }

.following-feed-view {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--color-bg);
    display: flex; flex-direction: column;
    opacity: 0; pointer-events: none; transform: translateX(50px);
    transition: all 0.4s ease; z-index: 10;
}
.main-content.feed-active .following-feed-view {
    opacity: 1; pointer-events: auto; transform: translateX(0);
}
.main-content.feed-active .gallery-content, 
.main-content.feed-active .tags-filter-container {
    opacity: 0; pointer-events: none; transform: translateX(-50px);
}

.feed-view-header {
    padding: 15px 25px; background: var(--color-surface); border-bottom: 1px solid var(--color-border);
    display: flex; justify-content: space-between; align-items: center;
}
.back-to-gallery-btn {
    background: var(--color-input-bg); border: none; padding: 8px 16px; border-radius: 20px;
    font-weight: 600; color: var(--color-text-secondary); cursor: pointer; transition: all 0.2s;
}
.back-to-gallery-btn:hover { background: var(--color-input-bg-hover); }
.feed-view-header h3 { color: var(--color-text-primary); font-size: 1.1rem; }

.feed-view-content { flex: 1; overflow-y: auto; padding: 20px; }

.feed-item {
    background: var(--color-surface); border-radius: 16px; padding: 20px; margin-bottom: 20px;
    box-shadow: var(--shadow-glow-soft); border: 1px solid var(--color-border);
    transition: all 0.2s ease; cursor: pointer; max-width: 800px; margin-left: auto; margin-right: auto;
}
.feed-item:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-glow-medium);
    border-color: var(--color-primary);
}
.feed-item-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.feed-author-avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-border);}
.feed-author-name { font-weight: 600; color: var(--color-text-primary); font-size: 1rem; }
.feed-action-text, .feed-timestamp { font-size: 0.85rem; color: var(--color-text-sub); }

.feed-work-preview {
    display: flex; gap: 15px; padding-top: 15px; border-top: 1px solid var(--color-border);
}
.feed-work-cover { 
    width: 100px; height: 100px; object-fit: cover; border-radius: 8px; background: var(--color-input-bg); 
}
.feed-work-title { font-size: 1.1rem; font-weight: 700; color: var(--color-text-heading-dark); margin-bottom: 6px; }
.feed-work-description { color: var(--color-text-secondary); }

.empty-feed-message { text-align: center; color: var(--color-text-sub); margin-top: 50px; }

/* --- [SECTION 12] 通知面板 (Notification) --- */
.notification-panel {
    position: fixed; top: 0; right: -380px; width: 360px; height: 100vh;
    background: var(--color-surface); 
    z-index: 1200; box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    display: flex; flex-direction: column; transition: right 0.3s ease;
}
.notification-panel.active { right: 0; }

.notification-panel-header {
    padding: 20px; border-bottom: 1px solid var(--color-border);
    display: flex; justify-content: space-between; align-items: center;
}
.notification-panel-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--color-text-primary); }


.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clear-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background-color: rgba(254, 242, 242, 0.1);
}

.close-panel-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-sub);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.close-panel-btn:hover {
    background-color: var(--color-input-bg);
    color: var(--color-text-primary);
}
.notification-list { flex: 1; overflow-y: auto; }
.notification-item {
    padding: 15px 20px; display: flex; gap: 15px; 
    border-bottom: 1px solid var(--color-border); cursor: pointer; transition: background 0.2s;
}
.notification-item:hover { background: var(--color-surface-hover); }
.notification-item.unread { background: var(--color-input-bg); }
.notification-item .actor-avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--color-border); }
.notification-content p { font-size: 0.9rem; margin-bottom: 4px; color: var(--color-text-secondary); }
.notification-content b { font-weight: 600; color: var(--color-text-primary); }
.notification-time { font-size: 0.75rem; color: var(--color-text-sub); }

.notification-panel-footer {
    padding: 15px; text-align: center; border-top: 1px solid var(--color-border);
    font-size: 0.8rem; color: var(--color-text-sub);
}

/* 高亮评论 */
.comment-item.highlight { background-color: var(--color-input-bg); transition: background 0.5s; }

/* 全局动画定义 */
@keyframes spin { 100% { transform: rotate(360deg); } }

/* --- [SECTION 14] 现代作品集网格视图 --- */

.author-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
    gap: 20px;
    padding-bottom: 40px;
}

.portfolio-card {
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-glow-soft);
}

.portfolio-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-medium);
    border-color: var(--color-primary);
}

.p-card-cover-wrapper {
    width: 100%;
    aspect-ratio: 16 / 10;
    position: relative;
    overflow: hidden;
    background-color: var(--color-input-bg);
}

.p-card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-card:hover .p-card-cover {
    transform: scale(1.05);
}

.p-card-heat-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}
.p-card-heat-badge i { color: #fbbf24; }

.p-card-info {
    padding: 12px 15px;
}

.p-card-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.p-card-stats {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.p-card-stats span { display: flex; align-items: center; gap: 4px; }

.portfolio-header-area {
    text-align: center;
    padding: 10px 0 30px;
}
.portfolio-header-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text-primary);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.portfolio-header-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 5px;
}

.add-to-desktop-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

/* --- [SECTION 13] 响应式适配 (Mobile) --- */
@media (max-width: 780px) {
    .main-content { padding-top: 75px; }
    .gallery-content { padding: 0 15px; }
    .tags-filter-container { padding: 0 20px 15px 20px; }
    
    .navbar-search { max-width: 140px; }
    .navbar-search .search-input { padding-left: 15px; }
    
    /* 移动端卡片特殊样式 */
    .work-card {
        position: absolute !important;
        margin-bottom: 0 !important;
        background-color: #2c2c2e; /* 移动端底色深一点防止闪烁 */
    }
    .work-card.mobile-style {
        background-size: cover; background-position: center; 
    }
    .work-card .card-image-container, .work-card .card-content { display: none; }
    
    /* 移动端覆盖层 - 保持白字 */
    .mobile-card-overlay {
        position: relative; width: 100%; padding-top: 133.33%;
        display: flex; flex-direction: column; justify-content: flex-end;
        border-radius: var(--border-radius-main); overflow: hidden;
    }
    .mobile-card-overlay::after {
        content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 60%;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%); 
        z-index: 1;
    }
    
    .mobile-card-content { position: relative; z-index: 2; padding: 0 12px 4px; color: white; }
    .mobile-style .card-title {
        color: white; font-size: 0.95rem; margin-bottom: 2px;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }
    .mobile-style .card-description {
        color: rgba(255,255,255,0.8); font-size: 0.8rem;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }
    
    .mobile-card-footer-new {
        position: relative; z-index: 2; padding: 0 12px 12px;
        display: flex; flex-direction: column; gap: 6px; 
    }
    .author-info-row { display: flex; align-items: center; gap: 6px; }
    .author-avatar { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.5); }
    .author-name { color: white; font-size: 0.8rem; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
    
    .card-stats-row { display: flex; gap: 10px; }
    .stat-badge { color: rgba(255,255,255,0.8); font-size: 0.7rem; display: flex; align-items: center; gap: 4px; }
    .stat-badge i { font-size: 0.7rem; }
    .heat-corner {
        position: absolute; top: 8px; left: 8px; z-index: 2;
        background: rgba(0,0,0,0.6); color: white; 
        padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 700;
        display: flex; align-items: center; gap: 4px;
    }
    .heat-corner i { color: #fbbf24; }

    .profile-card {
        width: 85%;
        max-height: 80vh;
    }
    .profile-banner {
        height: 120px;
    }
    .profile-content-wrapper {
        margin-top: -40px;
        padding: 0 20px 25px 20px;
    }
    .profile-avatar-container {
        width: 80px; height: 80px;
    }
    .profile-username { font-size: 1.25rem; }
    .profile-action-btn { padding: 10px 0; font-size: 0.9rem; }
    
    .modal-content { max-height: 95vh; border-radius: 16px 16px 0 0; }
    .modal-body { padding: 20px 15px; }
    
    .notification-panel { width: 100%; right: -100%; }
    .author-portfolio-grid {
        grid-template-columns: 1fr 1fr; 
        gap: 10px;
    }
    
    .p-card-cover-wrapper {
        aspect-ratio: 1 / 1; 
    }
    
    .p-card-info { padding: 10px; }
    .p-card-title { font-size: 0.85rem; }
    .p-card-stats { font-size: 0.7rem; }
    .p-card-heat-badge { font-size: 0.6rem; padding: 2px 6px; }

    .modal-footer {
        padding-bottom: 15px !important; 
        background: var(--color-surface);
    }

    #comment-form {
        padding-bottom: 15px !important;
    }

    .modal-content {
        max-height: 90vh; 
    }

    .close-modal { display: none !important; }
    .side-nav .nav-group:nth-of-type(2) { display: none !important; }
    .navbar-home-btn { display: none !important; }
    .navbar-hamburger span { display: none !important; }
    .navbar-hamburger { gap: 0; padding-right: 0; }

    .navbar-search {
        flex: 1 !important;
        max-width: none !important;
        margin-left: 15px;
        margin-right: 0;
    }

    .navbar-search .search-input {
        width: 100%;
        text-align: center;
    }
    .top-navbar {
        padding-left: 15px;
        padding-right: 15px;
        justify-content: flex-start;
    }
}
