/* 海角社区在线 - 全局样式表 */

/* 基础重置和变量 */
:root {
    --primary-color: #1a73e8;
    --secondary-color: #34a853;
    --accent-color: #fbbc04;
    --danger-color: #ea4335;
    --dark-bg: #202124;
    --light-bg: #f8f9fa;
    --border-color: #dadce0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
}

/* 头部样式 */
.hjsq-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.hjsq-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hjsq-logo-section h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.hjsq-logo-section h1 a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.hjsq-logo-section h1 a:hover {
    opacity: 0.9;
}

.hjsq-logo-section p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.hjsq-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.hjsq-nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.hjsq-nav-link:hover,
.hjsq-nav-link.active {
    background: rgba(255,255,255,0.2);
}

/* 搜索栏 */
.hjsq-search-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.hjsq-search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hjsq-search-box {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    background: var(--light-bg);
    padding: 0.75rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.hjsq-search-input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
    background: white;
}

.hjsq-search-btn {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.hjsq-search-btn:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 主容器 */
.hjsq-main-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

/* 论坛版块 */
.hjsq-forum-section {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.hjsq-section-title {
    padding: 1.5rem 2rem;
    background: linear-gradient(to right, #f8f9fa, white);
    border-bottom: 2px solid var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hjsq-category-tabs {
    display: flex;
    padding: 1rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.hjsq-category-tab {
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    background: var(--light-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-weight: 500;
}

.hjsq-category-tab:hover,
.hjsq-category-tab.active {
    background: var(--primary-color);
    color: white;
}

/* 帖子列表 */
.hjsq-post-list {
    padding: 1rem 0;
}

.hjsq-post-item {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s;
}

.hjsq-post-item:hover {
    background: var(--light-bg);
}

.hjsq-post-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hjsq-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.hjsq-post-meta {
    flex: 1;
}

.hjsq-post-author {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.hjsq-post-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.hjsq-post-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.3s;
}

.hjsq-post-title:hover {
    color: var(--primary-color);
}

.hjsq-post-content {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.hjsq-post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.hjsq-post-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.hjsq-tag {
    padding: 0.25rem 0.75rem;
    background: #e8f0fe;
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.hjsq-tag:hover {
    background: var(--primary-color);
    color: white;
}

.hjsq-post-actions {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hjsq-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.hjsq-action-btn:hover {
    color: var(--primary-color);
}

.hjsq-like-btn.liked {
    color: var(--danger-color);
}

/* 侧边栏 */
.hjsq-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.hjsq-sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.hjsq-widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.hjsq-hot-list {
    list-style: none;
}

.hjsq-hot-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
}

.hjsq-hot-item:last-child {
    border-bottom: none;
}

.hjsq-hot-item:hover {
    padding-left: 0.5rem;
    color: var(--primary-color);
}

.hjsq-hot-rank {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: var(--light-bg);
    border-radius: 4px;
    font-weight: 700;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.hjsq-hot-item:nth-child(1) .hjsq-hot-rank {
    background: #ea4335;
    color: white;
}

.hjsq-hot-item:nth-child(2) .hjsq-hot-rank {
    background: #fbbc04;
    color: white;
}

.hjsq-hot-item:nth-child(3) .hjsq-hot-rank {
    background: #34a853;
    color: white;
}

.hjsq-user-card {
    text-align: center;
}

.hjsq-user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    object-fit: cover;
}

.hjsq-user-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.hjsq-user-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.hjsq-stat-item {
    text-align: center;
}

.hjsq-stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.hjsq-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 标签云 */
.hjsq-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hjsq-tag-cloud .hjsq-tag {
    font-size: 0.9rem;
}

/* 页脚 */
.hjsq-footer {
    background: var(--dark-bg);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.hjsq-footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hjsq-footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.hjsq-footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.hjsq-footer-links {
    list-style: none;
}

.hjsq-footer-links li {
    margin-bottom: 0.5rem;
}

.hjsq-footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.hjsq-footer-links a:hover {
    color: white;
}

.hjsq-footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* 返回顶部按钮 */
.hjsq-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    z-index: 999;
}

.hjsq-back-to-top:hover {
    background: #1557b0;
    transform: translateY(-5px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .hjsq-main-container {
        grid-template-columns: 1fr;
    }

    .hjsq-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .hjsq-header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .hjsq-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .hjsq-main-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .hjsq-search-box {
        flex-direction: column;
    }

    .hjsq-post-item {
        padding: 1rem;
    }

    .hjsq-sidebar {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hjsq-post-item {
    animation: fadeIn 0.5s ease-out;
}

/* 评论区 */
.hjsq-comments-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.hjsq-comments-section.show {
    max-height: 1000px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.hjsq-comment-item {
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.hjsq-comment-author {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.hjsq-comment-text {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
