/* ============================================
   Pg_www.8zg6x.cn 模板 - 主样式文件
   ============================================ */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a73e8;
    --primary-dark: #1557b0;
    --secondary-color: #34a853;
    --danger-color: #ea4335;
    --warning-color: #fbbc04;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #80868b;
    --border-color: #dadce0;
    --bg-white: #ffffff;
    --bg-gray: #f8f9fa;
    --bg-hover: #f1f3f4;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", 
                 "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-gray);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   顶部公告栏
   ============================================ */
.top-bar {
    background: var(--text-primary);
    color: #fff;
    font-size: 14px;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-left, .top-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar .date {
    opacity: 0.8;
}

/* 用户登录注册区域 - 必需功能样式 */
.user-section {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-nickname {
    font-size: 14px;
    color: #fff;
}

.btn-logout {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #fff;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.user-login {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-login, .btn-register {
    font-size: 14px;
    color: #fff;
    transition: opacity 0.2s;
}

.btn-login:hover, .btn-register:hover {
    opacity: 0.8;
    color: #fff;
}

.divider {
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   网站头部
   ============================================ */
.site-header {
    background: var(--bg-white);
    padding: 20px 0;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo-area {
    flex-shrink: 0;
}

.logo img {
    height: 50px;
    width: auto;
}

.search-area {
    flex: 1;
    max-width: 500px;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.search-form:focus-within {
    border-color: var(--primary-color);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

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

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* ============================================
   主导航
   ============================================ */
.main-nav {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    overflow-x: auto;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ============================================
   主内容区
   ============================================ */
.site-main {
    padding: 30px 0;
}

.main-content {
    display: flex;
    gap: 30px;
}

.content-left {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* ============================================
   面包屑导航
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumb-link {
    color: var(--text-secondary);
}

.breadcrumb-link:hover {
    color: var(--primary-color);
}

.breadcrumb-sep {
    color: var(--text-tertiary);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   区块标题
   ============================================ */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.title-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.title-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.more-link {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: auto;
}

.more-link:hover {
    color: var(--primary-color);
}

/* ============================================
   首页 - 头条新闻
   ============================================ */
.top-news {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.featured-news {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}

.featured-link {
    display: block;
}

.featured-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
}

.featured-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.featured-desc {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 10px;
    line-height: 1.5;
}

.featured-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    opacity: 0.8;
}

.top-news-list {
    list-style: none;
}

.news-item {
    border-bottom: 1px solid var(--border-color);
}

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

.news-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
}

.news-tag {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.news-tag.hot {
    background: #fee;
    color: var(--danger-color);
}

.news-title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.news-time {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   最新资讯网格
   ============================================ */
.latest-news {
    margin-bottom: 30px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.news-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-link {
    display: block;
}

.card-img-wrap {
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-card:hover .card-img {
    transform: scale(1.05);
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ============================================
   市场动态网格
   ============================================ */
.market-section {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.market-item {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.market-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.market-link {
    display: block;
    text-align: center;
}

.market-icon {
    margin: 0 auto 15px;
    width: 40px;
}

.market-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
}

.market-time {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   侧边栏组件
   ============================================ */
.widget {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

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

.hot-item {
    border-bottom: 1px dashed var(--border-color);
}

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

.hot-link {
    display: block;
    padding: 10px 0;
}

.hot-num {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    margin-right: 8px;
}

.hot-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommend-item {
    display: block;
    margin-bottom: 15px;
}

.recommend-item:last-child {
    margin-bottom: 0;
}

.recommend-link {
    display: flex;
    gap: 10px;
}

.recommend-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.recommend-content {
    flex: 1;
}

.recommend-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommend-views, .recommend-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============================================
   列表页 - 栏目标题
   ============================================ */
.category-header {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    text-align: center;
}

.category-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}

.category-desc {
    font-size: 15px;
    color: var(--text-secondary);
}

/* ============================================
   列表页 - 置顶文章
   ============================================ */
.featured-article {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.featured-article-link {
    display: flex;
    gap: 20px;
}

.featured-article-img {
    position: relative;
    width: 300px;
    flex-shrink: 0;
}

.featured-article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 12px;
    background: var(--danger-color);
    color: #fff;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.featured-article-content {
    flex: 1;
    padding: 20px 20px 20px 0;
}

.featured-article-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.featured-article-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-article-meta {
    display: flex;
    gap: 10px;
    font-size: 14px;
    color: var(--text-tertiary);
}

.meta-divider {
    color: var(--border-color);
}

/* ============================================
   列表页 - 文章列表
   ============================================ */
.article-list {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.article-item {
    border-bottom: 1px solid var(--border-color);
}

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

.article-item-link {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.article-item-content {
    flex: 1;
}

.article-item-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-item-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-item-meta {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.article-item-thumb {
    width: 160px;
    height: 120px;
    flex-shrink: 0;
}

.article-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* ============================================
   分页
   ============================================ */
.pagination-wrap {
    margin-top: 30px;
}

.pagination {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.pagination-list {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
}

.pagination-link {
    display: block;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s;
}

.pagination-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pagination-ellipsis {
    padding: 8px 14px;
    color: var(--text-tertiary);
}

/* ============================================
   详情页 - 文章详情
   ============================================ */
.article-detail {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.article-header {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.article-title {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 15px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.meta-left, .meta-right {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: var(--text-secondary);
}

.meta-item svg {
    flex-shrink: 0;
}

/* 作者链接样式 - 必需功能 */
.author-link {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.author-link:hover {
    opacity: 0.8;
}

/* 文章正文 */
.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 15px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: var(--radius-sm);
}

.article-content h2,
.article-content h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* 分享按钮 */
.article-share {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
}

.share-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================
   详情页 - 相关推荐
   ============================================ */
.related-articles {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s;
}

.related-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.related-link {
    display: block;
}

.related-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.related-content {
    padding: 15px;
}

.related-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-meta {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ============================================
   作者主页
   ============================================ */
.author-profile {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.author-header {
    display: flex;
    gap: 20px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.author-avatar-wrap {
    flex-shrink: 0;
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.author-email {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: var(--text-secondary);
}

.author-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-top: 25px;
}

.stat-box {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

/* 作者文章列表 */
.author-articles {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.author-article-list {
    margin-top: 20px;
}

.author-article-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.author-article-item:first-child {
    padding-top: 0;
}

.author-article-item:last-child {
    border-bottom: none;
}

.author-article-link {
    display: flex;
    gap: 20px;
}

.author-article-content {
    flex: 1;
}

.author-article-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.author-article-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-article-meta {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.author-article-thumb {
    width: 140px;
    height: 105px;
    flex-shrink: 0;
}

.author-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 20px;
}

/* 作者主页分页 */
.author-pagination {
    margin-top: 30px;
}

/* ============================================
   网站底部
   ============================================ */
.site-footer {
    background: var(--text-primary);
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    font-size: 14px;
    transition: opacity 0.2s;
}

.footer-col a:hover {
    opacity: 0.7;
    color: rgba(255, 255, 255, 0.8);
}

.footer-col p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.footer-logo {
    margin-top: 15px;
}

.footer-bottom {
    padding-top: 20px;
    text-align: center;
}

.copyright {
    font-size: 14px;
    opacity: 0.7;
}

/* ============================================
   返回顶部按钮
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}
