/* 书签导航样式表 */

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #ff4d4f;
    --text-color: #333;
    --text-secondary: #666;
    --text-light: #999;
    --border-color: #e8e8e8;
    --bg-color: #f5f7fa;
    --card-bg: #fff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ==================== 头部样式 ==================== */
.site-header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
}

.logo-icon {
    font-size: 24px;
}

.main-nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 15px;
    transition: color 0.2s;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-favorite {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

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

.btn-login {
    padding: 8px 20px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    transition: background 0.2s;
}

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

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

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

/* ==================== 容器布局 ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ==================== 搜索区域 ==================== */
.search-section {
    margin-bottom: 32px;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    background: var(--card-bg);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.search-box input {
    flex: 1;
    padding: 14px 24px;
    border: none;
    outline: none;
    font-size: 16px;
}

.search-box button {
    padding: 14px 24px;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

/* ==================== 主内容区 ==================== */
.main-content {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    position: sticky;
    top: 88px;
    height: fit-content;
}

.category-list {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.category-item:hover {
    background: var(--bg-color);
}

.category-item.active {
    background: var(--primary-color);
    color: #fff;
}

.category-icon {
    font-size: 18px;
    margin-right: 12px;
}

.category-name {
    flex: 1;
    font-size: 14px;
}

.category-count {
    font-size: 12px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.2);
}

/* 标签区域 */
.tag-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
}

.tag-section h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s;
}

.tag-item:hover {
    transform: scale(1.05);
}

/* ==================== 书签内容区 ==================== */
.bookmark-content {
    min-height: 500px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

.section-title .icon {
    font-size: 20px;
}

/* 书签网格 */
.bookmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* 书签卡片 */
.bookmark-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

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

.card-header {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.logo-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrapper .logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.card-info .title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: #fff;
}

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

.card-footer {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    text-align: center;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

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

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
}

#loadMoreBtn {
    padding: 12px 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
}

#loadMoreBtn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

/* ==================== 详情页样式 ==================== */
.breadcrumb {
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

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

.breadcrumb .separator {
    margin: 0 8px;
}

.detail-page {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

@media (max-width: 992px) {
    .detail-page {
        grid-template-columns: 1fr;
    }
}

.detail-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}

.detail-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo-large {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-color);
    flex-shrink: 0;
}

.logo-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info h1 {
    font-size: 24px;
    margin-bottom: 12px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-description {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 24px;
}

.detail-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.detail-content {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.detail-content h2, .detail-content h3 {
    margin: 20px 0 12px;
}

.detail-content p {
    margin-bottom: 16px;
    line-height: 1.8;
}

/* 详情页侧边栏 */
.detail-sidebar {
    position: sticky;
    top: 88px;
    height: fit-content;
}

.sidebar-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.sidebar-title {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.related-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
}

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

.related-item:hover {
    opacity: 0.8;
}

.related-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-color);
    flex-shrink: 0;
}

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

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

.related-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-desc {
    font-size: 12px;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== 页脚样式 ==================== */
.site-footer {
    background: var(--card-bg);
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-brand .logo-icon {
    font-size: 28px;
}

.footer-brand .logo-text {
    font-size: 20px;
    font-weight: 600;
    margin-left: 8px;
}

.footer-desc {
    margin-top: 12px;
    color: var(--text-light);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 80px;
}

.link-group h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.link-group a {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 10px;
    transition: color 0.2s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 14px;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }

    .main-nav {
        display: none;
    }

    .container {
        padding: 16px;
    }

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

    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-actions {
        flex-direction: column;
    }

    .footer-content {
        flex-direction: column;
        gap: 32px;
    }

    .footer-links {
        gap: 40px;
    }
}
