/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - 淡橙色主题 */
    --primary-color: #fb923c;
    --primary-light: #fdba74;
    --primary-dark: #f97316;
    --primary-soft: #fff7ed;
    
    /* 强调色 */
    --accent-color: #f97316;
    --accent-hover: #ea580c;
    
    /* 中性色 - 更柔和 */
    --bg-primary: #ffffff;
    --bg-secondary: #fafaf9;
    --bg-tertiary: #f5f5f4;
    --text-primary: #44403c;
    --text-secondary: #78716c;
    --text-muted: #a8a29e;
    --border-color: #e7e5e4;
    --border-light: #f5f5f4;
    
    /* 标签颜色 */
    --tag-cloud-bg: #eff6ff;
    --tag-cloud-color: #3b82f6;
    --tag-local-bg: #f0fdf4;
    --tag-local-color: #22c55e;
    --tag-other-bg: #faf5ff;
    --tag-other-color: #a855f7;
    
    /* 阴影 - 更柔和 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    
    /* 尺寸 */
    --sidebar-width: 220px;
    --header-height: 64px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==================== 顶部导航 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.2;
}

.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    overflow: hidden;
    transition: all 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary-light);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.1);
}

.search-engine-select {
    padding: 10px 8px 10px 12px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    border-right: 1px solid var(--border-color);
    min-width: 60px;
}

.search-engine-select:hover {
    color: var(--primary-dark);
}

.search-icon {
    margin: 0 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.search-input {
    flex: 1;
    padding: 10px 10px 10px 0;
    border: none;
    font-size: 14px;
    background: transparent;
    color: var(--text-primary);
    outline: none;
}

.search-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent-hover) 100%);
}

.search-input:focus {
    border-color: var(--primary-light);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ==================== 主体布局 ==================== */
.main-layout {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* ==================== 左侧导航 ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 100;
}

.nav-menu {
    padding: 12px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 500;
    border-right: 3px solid var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.nav-section {
    padding: 16px 12px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== 主内容区 ==================== */
	.main-content {
	    flex: 1;
	    margin-left: var(--sidebar-width);
	    max-width: calc(100% - var(--sidebar-width));
	    box-sizing: border-box;
	    /* 
	       核心调整：
	       原来的 padding: 24px; 改为非对称设置。
	       左侧：12px（紧贴侧边栏，因为侧边栏本身有宽度，无需太宽内边距）
	       右侧：70px（为工具栏预留通道）
	       上下：保持 24px
	    */
	    padding: 24px 65px 24px 12px; 
	}
/* ==================== 广告位 ==================== */
.ad-banner-top,
.ad-banner-mid,
.ad-banner-bottom {
    width: 100%;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 24px;
    position: relative;
    transition: all 0.3s;
}

.ad-banner-top:hover,
.ad-banner-mid:hover,
.ad-banner-bottom:hover {
    border-color: var(--primary-light);
}

.ad-banner-top {
    height: 90px;
}

.ad-banner-mid {
    height: 90px;
}

.ad-banner-bottom {
    height: 120px;
    margin-top: 24px;
}

.ad-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.ad-banner-small {
    height: 100px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    position: relative;
    transition: all 0.3s;
}

.ad-banner-small:hover {
    border-color: var(--primary-light);
}

.ad-label {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 13px;
    gap: 6px;
}

.ad-placeholder i {
    font-size: 20px;
}

/* ==================== 区块样式 ==================== */
.section {
    margin-bottom: 32px;
    scroll-margin-top: 80px;
}

/* 欢迎区 */
.welcome-section {
    margin-bottom: 32px;
}

.welcome-card {
    background: linear-gradient(135deg, var(--primary-soft) 0%, #fff 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.welcome-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-card .highlight {
    color: var(--primary-dark);
}

.welcome-card p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 16px;
}

.welcome-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

/* 区块标题 */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

.section-title i {
    color: var(--primary-dark);
    font-size: 18px;
}

.section-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 20px;
}

/* 子分类 */
.subsection {
    margin-bottom: 24px;
}

.subsection-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.tag-cloud,
.tag-local,
.tag-other {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.tag-cloud {
    background: var(--tag-cloud-bg);
    color: var(--tag-cloud-color);
}

.tag-local {
    background: var(--tag-local-bg);
    color: var(--tag-local-color);
}

.tag-other {
    background: var(--tag-other-bg);
    color: var(--tag-other-color);
}

/* ==================== 卡片网格 ==================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.tutorials-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.models-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* 卡片样式 */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: block;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.card-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 横向卡片 */
.card-horizontal {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.card-icon-large {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.card-body {
    flex: 1;
    min-width: 0;
}

.card-body .card-name {
    margin-bottom: 4px;
}

.card-body .card-desc {
    -webkit-line-clamp: 1;
}

/* 紧凑型卡片 */
.card-compact {
    text-align: center;
    padding: 16px 12px;
}

.card-compact .card-icon {
    margin: 0 auto 10px;
    width: 44px;
    height: 44px;
    font-size: 16px;
}

.card-compact .card-name {
    margin-bottom: 4px;
}

.card-compact .card-desc {
    font-size: 11px;
    -webkit-line-clamp: 1;
}

/* ==================== 页脚 ==================== */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.footer-section p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--text-secondary);
    font-size: 13px;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: var(--primary-dark);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-muted);
}

.footer-disclaimer {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .tutorials-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 16px;
    }
    
    .header-center {
        display: none;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .tutorials-grid {
        grid-template-columns: 1fr;
    }
    
    .models-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ad-row {
        grid-template-columns: 1fr;
    }
    
    .welcome-card {
        padding: 20px;
    }
    
    .welcome-card h1 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .card {
        padding: 12px;
    }
    
    .card-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .card-name {
        font-size: 13px;
    }
    
    .card-desc {
        font-size: 11px;
    }
    
    .section-title {
        font-size: 16px;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.5s ease forwards;
}

.card {
    animation: fadeIn 0.4s ease forwards;
}

	/* === 页脚二维码样式 === */
	.footer-qrcodes {
	    display: flex;
	    gap: 20px;
	    margin-top: 15px;
	}
	.qr-item {
	    text-align: center;
	    font-size: 12px;
	    color: #666;
	}
	.qr-item img {
	    width: 80px;
	    height: 80px;
	    border: 1px solid #eee;
	    padding: 2px;
	    background: #fff;
	}
	/* === 右侧悬浮栏样式 === */
	.side-toolbar {
    position: fixed;
    right: 15px; /* 距离边缘稍近一点 */
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95); /* 稍微透明一点，更轻盈 */
    backdrop-filter: blur(5px); /* 毛玻璃效果 */
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* 阴影减轻 */
    
    /* 核心修改：宽度缩小 */
    width: 46px; 
    /* 字体缩小 */
    font-size: 10px; 
}
	.toolbar-item {
    padding: 6px 0; /* 上下间距缩小 */
    cursor: pointer;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}
	.toolbar-item:last-child {
	    border-bottom: none;
	}
	.toolbar-icon {
    font-weight: normal; /* 字体不加粗，更精致 */
    color: #666;
    line-height: 1.2;
}
	.toolbar-qrcode {
	    display: none;
	    position: absolute;
	    right: 100%; /* 位于左侧 */
	    top: 50%;
	    transform: translateY(-50%);
	    margin-right: 10px;
	    background: #fff;
	    padding: 5px;
	    border-radius: 4px;
	    box-shadow: 0 0 10px rgba(0,0,0,0.15);
	    white-space: nowrap;
	}
	.toolbar-qrcode img {
	    width: 120px;
	    height: 120px;
	    display: block;
	}
	.toolbar-qrcode span {
	    display: block;
	    margin-top: 5px;
	    color: #333;
	}
	/* 鼠标悬停显示二维码 */
	.toolbar-item:hover .toolbar-qrcode {
	    display: block;
	}
	/* 回到顶端按钮样式 */
	#backToTopBtn {
	    background: #f5f5f5;
	}
	#backToTopBtn:hover {
	    background: #e9e9e9;
	}