/* OSS Community 样式 - 已对齐官网视觉规范 */ :root { --bg: #030712; --bg-card: rgba(255, 255, 255, 0.02); --border: rgba(255, 255, 255, 0.05); --border-hover: rgba(6, 182, 212, 0.3); --cyan: #06b6d4; --cyan-light: #22d3ee; --text: #fff; --text-secondary: #9ca3af; --text-muted: #6b7280; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; } /* 全局背景网格 */ body::before { content: ''; position: fixed; inset: 0; background-image: linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px); background-size: 60px 60px; pointer-events: none; z-index: -1; } /* 头部导航 */ .comm-header { position: sticky; top: 0; z-index: 100; background: rgba(3, 7, 18, 0.8); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); transition: border-color 0.3s; } .header-container { max-width: 1400px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; } .header-left { display: flex; align-items: center; gap: 24px; } .back-link { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: all 0.3s ease; display: flex; align-items: center; gap: 4px; } .back-link:hover { color: var(--cyan-light); transform: translateX(-4px); } .site-title { font-size: 18px; font-weight: 700; background: linear-gradient(135deg, var(--cyan), #3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 0.02em; } .btn { padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all 0.3s ease; display: flex; align-items: center; gap: 6px; } .btn-primary { background: linear-gradient(135deg, var(--cyan), #3b82f6); color: #fff; box-shadow: 0 4px 12px rgba(6, 182, 212, 0.1); } .btn-primary:hover { box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4); transform: translateY(-2px); } /* 主布局 */ .comm-main { max-width: 1200px; margin: 0 auto; padding: 24px 100px 24px 24px; /* 右侧为 Dock 留空间 */ min-height: calc(100vh - 64px); } .comm-container { display: grid; grid-template-columns: 260px 1fr; gap: 32px; animation: fadeInUp 0.6s ease forwards; opacity: 0; transform: translateY(20px); } @keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } } /* 侧边栏 */ .comm-sidebar { position: sticky; top: 88px; height: fit-content; } .sidebar-section { background: rgba(10, 15, 30, 0.6); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 20px; backdrop-filter: blur(8px); transition: all 0.3s ease; } .sidebar-section:hover { border-color: rgba(255, 255, 255, 0.1); } .sidebar-section h3 { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.1em; } .category-list { list-style: none; } .category-list li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; cursor: pointer; transition: all 0.25s ease; margin-bottom: 4px; color: var(--text-secondary); font-size: 14px; font-weight: 500; } .category-list li:hover { background: rgba(255, 255, 255, 0.04); color: #fff; transform: translateX(4px); } .category-list li.active { background: rgba(6, 182, 212, 0.1); border-left: 3px solid var(--cyan); color: var(--cyan-light); } .cat-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; opacity: 0.7; } .cat-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; } .category-list li.active .cat-icon { opacity: 1; color: var(--cyan); } .cat-count { font-size: 11px; color: var(--text-muted); background: rgba(255, 255, 255, 0.03); padding: 2px 8px; border-radius: 6px; font-weight: 600; } .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; } .stat-item { padding: 10px 4px; background: rgba(255, 255, 255, 0.02); border-radius: 8px; } .stat-num { display: block; font-size: 20px; font-weight: 800; color: var(--cyan-light); margin-bottom: 4px; } .stat-label { font-size: 10px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; } /* 内容区 */ .comm-content { min-width: 0; } .content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); } .content-header h2 { font-size: 22px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px; } .content-header h2::before { content: ''; display: block; width: 4px; height: 20px; background: var(--cyan); border-radius: 2px; } .sort-options { display: flex; gap: 8px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: 10px; padding: 4px; } .sort-btn { padding: 6px 14px; border-radius: 8px; background: transparent; border: none; color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; } .sort-btn:hover { color: #fff; } .sort-btn.active { background: rgba(6, 182, 212, 0.15); color: var(--cyan-light); box-shadow: 0 2px 6px rgba(6, 182, 212, 0.1); } /* 帖子列表 - 卡片动效 */ .posts-list { display: flex; flex-direction: column; gap: 16px; } .post-card { background: rgba(10, 15, 30, 0.6); border: 1px solid var(--border); border-radius: 16px; padding: 24px; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer; position: relative; overflow: hidden; animation: cardEnter 0.5s ease forwards; opacity: 0; transform: translateY(20px); } @keyframes cardEnter { to { opacity: 1; transform: translateY(0); } } .post-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), transparent); opacity: 0; transition: opacity 0.4s; } .post-card:hover { border-color: var(--border-hover); transform: translateY(-4px) scale(1.005); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 12px rgba(6, 182, 212, 0.1); } .post-card:hover::before { opacity: 1; } .post-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; position: relative; z-index: 1; } .post-avatar { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--cyan), #3b82f6); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #fff; box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3); flex-shrink: 0; } .post-meta { flex: 1; min-width: 0; } .post-author { font-weight: 600; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .post-time { font-size: 12px; color: var(--text-muted); } .post-tags { display: flex; gap: 6px; flex-shrink: 0; } .tag { padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; background: rgba(6, 182, 212, 0.08); border: 1px solid rgba(6, 182, 212, 0.15); color: var(--cyan-light); text-transform: uppercase; } .pinned-badge { padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #fbbf24; display: flex; align-items: center; gap: 4px; } .post-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: flex-start; gap: 8px; position: relative; z-index: 1; color: #fff; transition: color 0.2s; } .post-card:hover .post-title { color: var(--cyan-light); } .post-excerpt { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; position: relative; z-index: 1; } .post-stats { display: flex; gap: 20px; font-size: 12px; color: var(--text-muted); font-weight: 500; position: relative; z-index: 1; } .post-stats span { display: flex; align-items: center; gap: 6px; transition: color 0.2s; } .post-stats svg { width: 14px; height: 14px; opacity: 0.6; } .post-card:hover .post-stats span { color: var(--text-secondary); } /* 空状态 / 加载动画 */ .empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); animation: fadeIn 0.5s ease; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .loading-spinner { width: 32px; height: 32px; border: 3px solid rgba(6, 182, 212, 0.1); border-top-color: var(--cyan); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; } @keyframes spin { to { transform: rotate(360deg); } } .empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; } /* 分页 */ .pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; padding-bottom: 32px; } .page-btn { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; } .page-btn:hover { background: rgba(6, 182, 212, 0.1); border-color: var(--border-hover); color: var(--cyan); transform: translateY(-2px); } .page-btn.active { background: var(--cyan); border-color: var(--cyan); color: #fff; box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4); } /* 响应式 */ @media (max-width: 900px) { .comm-container { grid-template-columns: 1fr; } .comm-sidebar { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; } .stats-grid { margin-top: 0; } } @media (max-width: 600px) { .header-container { padding: 0 16px; } .comm-main { padding: 16px; } .content-header h2 { font-size: 18px; } .sort-options { display: none; } .post-card { padding: 16px; } .post-title { font-size: 15px; } } /* 创建帖子按钮样式 - 区别于普通导航链接 */ button.dock-item { background: transparent; border: none; cursor: pointer; } .dock-action-btn { color: #10b981; /* 翡翠绿 - 代表创建/动作 */ background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.2); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); } .dock-action-btn:hover { background: rgba(16, 185, 129, 0.2); border-color: #10b981; color: #34d399; box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); transform: scale(1.1); }