/* ============ 手办社 - 全站样式 ============ */
/* 完全还原原站紫色主题风格 */

:root {
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #6d28d9;
    --primary-bg: #f5f3ff;
    --primary-border: #e9d5ff;
    --bg-color: #f8f9fa;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.1);
    --card-hover-shadow: 0 4px 12px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --header-height: 64px;
    --footer-bg: #1e1b4b;
    --max-width: 1400px;
    --sidebar-width: 320px;
    --content-gap: 24px;
}

* {
    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;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

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

/* ============ 头部导航 ============ */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 24px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.site-logo img {
    width: 36px;
    height: 36px;
}

.site-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #f59e0b);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

/* 搜索框 */
.header-search {
    flex: 0 0 240px;
    position: relative;
}

.header-search input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0 40px 0 16px;
    font-size: 14px;
    outline: none;
    background: var(--bg-color);
    transition: border-color 0.2s;
}

.header-search input:focus {
    border-color: var(--primary);
}

.header-search button {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* 导航菜单 */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.main-nav a {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-color);
    transition: all 0.2s;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    background: var(--primary-bg);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-color);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

/* ============ 面包屑 ============ */
.breadcrumb {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

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

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

.breadcrumb span {
    color: var(--text-light);
}

/* ============ 主布局 ============ */
.page-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 40px;
}

.main-layout {
    display: flex;
    gap: var(--content-gap);
    align-items: flex-start;
}

.sidebar {
    flex: 0 0 var(--sidebar-width);
    position: sticky;
    top: calc(var(--header-height) + 16px);
}

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

/* ============ 卡片通用 ============ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-body {
    padding: 20px;
}

/* ============ 首页 - Banner轮播图 ============ */
.hero-section {
    display: flex;
    gap: var(--content-gap);
    margin-top: 20px;
    margin-bottom: var(--content-gap);
}

.category-sidebar {
    flex: 0 0 var(--sidebar-width);
}

.category-sidebar .card-body {
    padding: 8px 0;
}

.category-list a {
    display: block;
    padding: 14px 24px;
    font-size: 15px;
    color: var(--text-color);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.category-list a:hover,
.category-list a.active {
    color: var(--primary);
    background: var(--primary-bg);
    border-left-color: var(--primary);
}

.banner-carousel {
    flex: 1;
    min-width: 0;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    max-height: 420px;
}

.banner-carousel .carousel-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-slide .slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 32px 32px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
}

.carousel-slide .slide-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.carousel-slide .slide-desc {
    font-size: 14px;
    opacity: 0.9;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-color);
    z-index: 5;
    transition: all 0.2s;
}

.carousel-nav:hover {
    background: white;
    box-shadow: var(--card-shadow);
}

.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

/* ============ 首页 - 热门推荐区域 ============ */
.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
}

.featured-section {
    margin-bottom: var(--content-gap);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.featured-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

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

.featured-card .card-image {
    aspect-ratio: 1;
    overflow: hidden;
}

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

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

.featured-card .card-info {
    padding: 12px;
}

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

.featured-card .card-likes {
    font-size: 12px;
    color: var(--text-light);
}

/* ============ 最新内容区域（主内容+侧边栏） ============ */
.latest-section {
    display: flex;
    gap: var(--content-gap);
}

.latest-main {
    flex: 1;
    min-width: 0;
}

.latest-sidebar {
    flex: 0 0 var(--sidebar-width);
}

/* 文章3列网格 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.article-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

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

.article-card .card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
}

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

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

.article-card .card-body {
    padding: 16px;
}

.article-card .card-category {
    display: inline-block;
    padding: 2px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 8px;
}

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

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

.article-card .card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
}

.article-card .card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============ 侧边栏组件 ============ */
.sidebar-widget {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: var(--content-gap);
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title .icon {
    color: var(--primary);
    font-size: 20px;
}

/* 热门内容列表 */
.hot-list .hot-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

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

.hot-item .hot-rank {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    background: var(--bg-color);
}

.hot-item:nth-child(1) .hot-rank,
.hot-item:nth-child(2) .hot-rank,
.hot-item:nth-child(3) .hot-rank {
    background: var(--primary);
    color: white;
}

.hot-item .hot-info {
    flex: 1;
    min-width: 0;
}

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

.hot-item .hot-views {
    font-size: 12px;
    color: var(--text-light);
}

/* 热门标签 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    display: inline-block;
    padding: 4px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tag-cloud a:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-bg);
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    background: var(--card-bg);
    transition: all 0.2s;
}

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

.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ============ 文章详情页 ============ */
.article-detail {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 32px;
}

.article-detail .article-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
}

.article-detail .article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.article-detail .article-meta .category-tag {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 13px;
}

.article-detail .article-cover {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.article-detail .article-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
}

.article-content h2 {
    font-size: 22px;
    margin: 32px 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}

.article-content h3 {
    font-size: 18px;
    margin: 24px 0 12px;
}

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

.article-content img {
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-light);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--primary-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 文章底部操作栏 */
.article-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
}

.article-actions .action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.article-actions .action-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.article-actions .action-btn.liked {
    color: #ef4444;
    border-color: #ef4444;
}

/* 上一篇/下一篇 */
.prev-next {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.prev-next a {
    flex: 1;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s;
}

.prev-next a:hover {
    background: var(--primary-bg);
}

.prev-next .label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

/* 相关推荐 */
.related-section {
    margin-top: 32px;
}

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

/* ============ 分类/标签页头部 ============ */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

/* ============ 搜索页 ============ */
.search-box {
    margin-bottom: 24px;
}

.search-box form {
    display: flex;
    gap: 12px;
}

.search-box input {
    flex: 1;
    height: 48px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box button {
    padding: 0 32px;
    height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* ============ 页脚 ============ */
.site-footer {
    background: var(--footer-bg);
    color: rgba(255,255,255,0.8);
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 24px 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 32px;
}

.footer-section h3 {
    color: white;
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-section p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.6);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    transition: color 0.2s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

.footer-bottom p {
    margin-bottom: 4px;
}

/* ============ 登录/注册 ============ */
.auth-container {
    max-width: 420px;
    margin: 40px auto;
    padding: 0 24px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 32px;
}

.auth-card h2 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.auth-link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary);
}

/* ============ 404页面 ============ */
.error-page {
    text-align: center;
    padding: 80px 24px;
}

.error-page h1 {
    font-size: 72px;
    color: var(--primary);
    margin-bottom: 16px;
}

.error-page p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.error-page .btn-back {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: background 0.2s;
}

.error-page .btn-back:hover {
    background: var(--primary-dark);
    color: white;
}

/* ============ 消息提示 ============ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ============ 响应式设计 ============ */
@media (max-width: 1200px) {
    .featured-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
    }

    .main-nav {
        display: none;
    }

    .header-search {
        flex: 1;
    }

    .hero-section {
        flex-direction: column;
    }

    .category-sidebar {
        flex: none;
        width: 100%;
    }

    .category-list {
        display: flex;
        overflow-x: auto;
        padding: 0 12px;
    }

    .category-list a {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 16px;
    }

    .category-list a:hover,
    .category-list a.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary);
    }

    .banner-carousel {
        max-height: 280px;
    }

    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .latest-section {
        flex-direction: column;
    }

    .latest-sidebar {
        flex: none;
        width: 100%;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .prev-next {
        flex-direction: column;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-detail {
        padding: 20px;
    }

    .article-detail .article-title {
        font-size: 22px;
    }
}

/* ============ 移动端菜单 ============ */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
}

/* ============ 标签页 ============ */
.tags-article-list .article-card {
    margin-bottom: 16px;
}

/* ============ 加载占位 ============ */
.placeholder-image {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 14px;
}
