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

:root {
    --primary-color: #2e53f9;
    --secondary-color: #974be3;
    --accent-color: #f093fb;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --bg-primary: #fdf9f9;
    --bg-secondary: #fdfbfb;
    --bg-gray: #edf2f7;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container:not(.home-page) {
    height: 100vh;
    height: 100dvh;
}

/* 首页特殊样式 - 固定在一屏内 */
.container.home-page {
    height: 100vh;
    height: 100dvh; /* 动态视口高度，支持移动端浏览器 */
    overflow: hidden;
}

/* ==========================================
   顶部导航栏
   ========================================== */

.header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-img {
    height: 1.5rem;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    align-items: center;
}

/* 客服图标 */
.customer-service {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    text-decoration: none;
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #667eea, #764ba2) border-box;
}

.customer-service:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.customer-service-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    position: relative;
}

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

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* ==========================================
   英雄区域
   ========================================== */

.hero {
    background: linear-gradient(135deg, #2e53f9 0%, #974be3 100%);
    padding: 1.5rem 2rem 1.25rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="60" height="60" patternUnits="userSpaceOnUse"><path d="M 60 0 L 0 0 0 60" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: rgb(6, 6, 6);
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}


/* ==========================================
   教程分类区域
   ========================================== */

.tutorials-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    max-width: 1300px;
    margin: 0 auto;
}

/* ==========================================
   教程卡片
   ========================================== */

.tutorial-card {
    background: var(--bg-primary);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
}

.tutorial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.tutorial-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.tutorial-card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: auto;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}

.card-icon .icon-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* 回收图标单独放大 */
.tutorial-card[data-category="recycle"] .icon-img {
    width: 140px;
    height: 140px;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 回收卡片文字上移对齐 */
.tutorial-card[data-category="recycle"] .card-content {
    margin-top: -10px;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0;
    word-break: keep-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ==========================================
   教程详情页
   ========================================== */

/* 教程页面容器 - 固定在一屏内 */
/* 教程详情页 - 移动端：允许滚动 */
.tutorial-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: visible;
}

.tutorial-detail {
    padding: 0.75rem 1rem 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: visible;
}

.container:not(.home-page) {
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
}

/* 确保内容区域可滚动 */
.tutorial-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: 0;
}

.content-split {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: visible;
    min-height: 0;
}

.article-content,
.video-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 3rem; /* 为返回按钮留出空间 */
}

.tutorial-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 0.6rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    text-align: center;
    flex-shrink: 0;
    display:flex;
}

.tutorial-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
    flex:1;
    display:flex;
    justify-content:center;
    align-items:center;
}

/* 移动端标签切换器 - 默认隐藏 */
.mobile-tab-switcher {
    display: none;
}

.mobile-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.mobile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.mobile-tab:active {
    transform: scale(0.98);
}

.tutorial-intro {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.tutorial-info {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.info-item svg {
    color: var(--primary-color);
}

/* ==========================================
   内容切换标签
   ========================================== */

.content-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* ==========================================
   内容区域布局
   ========================================== */

.tutorial-content-wrapper {
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-split {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

/* ==========================================
   侧边栏
   ========================================== */

.sidebar {
    background: var(--bg-primary);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.sidebar-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chapter-count {
    font-size: 0.875rem;
    color: var(--text-light);
    background: var(--bg-gray);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

/* 章节列表 */
.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chapter-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.chapter-item:hover {
    background: var(--bg-gray);
}

.chapter-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: var(--primary-color);
}

.chapter-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
}

.chapter-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.chapter-duration {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* 视频列表 */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.video-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.video-item:hover {
    background: var(--bg-gray);
}

.video-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: var(--primary-color);
}

.video-thumbnail {
    width: 80px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.video-info {
    flex: 1;
}

.video-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.video-duration {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ==========================================
   图文内容区域
   ========================================== */

.article-content {
    background: var(--bg-primary);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.article {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.article-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.article-header {
    margin-bottom: 2rem;
}

.article-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.article-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.article-body {
    color: var(--text-primary);
}

.article-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.article-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    position: relative;
    padding-left: 1rem;
    flex-shrink: 0;
}

.article-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.article-section p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 4px solid var(--primary-color);
    padding: 0.85rem 1.1rem;
    border-radius: 0.5rem;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.code-block {
    background: #2d3748;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    color: #e2e8f0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.tag-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.tag-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-gray);
    border-radius: 0.5rem;
}

.tag-item code {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.tag-item span {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.example-box {
    background: var(--bg-gray);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.example-box h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.preview {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.summary-list {
    list-style: none;
    padding: 0;
}

.summary-list li {
    padding: 0.75rem 0 0.75rem 2rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.summary-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* 步骤列表样式 */
.article-section ol {
    list-style: none;
    padding: 0;
    counter-reset: step-counter;
}

.article-section ol li {
    padding: 0.75rem 0 0.75rem 2.5rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
    counter-increment: step-counter;
}

.article-section ol li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 1.8rem;
    height: 1.8rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   视频内容区域
   ========================================== */

.video-content {
    background: var(--bg-primary);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    gap: 1rem;
}

.video-player {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 0;
}

.player-wrapper {
    position: relative;
    width: 100%;
    height: 580px;
    background: #000;
    border-radius: 0.75rem;
    overflow: hidden;
}

.player-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* 注意事项在右侧视频下方 */
.notice-section-right {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

.notice-section-right h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    position: relative;
    padding-left: 1rem;
    flex-shrink: 0;
}

.notice-section-right h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* 视频控制器样式优化 */
video::-webkit-media-controls-panel {
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

video::-webkit-media-controls-play-button,
video::-webkit-media-controls-timeline,
video::-webkit-media-controls-current-time-display,
video::-webkit-media-controls-time-remaining-display,
video::-webkit-media-controls-mute-button,
video::-webkit-media-controls-volume-slider,
video::-webkit-media-controls-fullscreen-button {
    filter: brightness(1.2);
}

.video-details h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.video-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.video-description {
    margin-bottom: 2rem;
}

.video-description h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.video-description h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.video-description p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.video-description ul {
    list-style: none;
    padding: 0;
}

.video-description ul li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.video-description ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
    line-height: 1;
}

.video-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

.action-btn.primary:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   页脚
   ========================================== */

.footer {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: 0.8rem 2rem;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.tutorial-footer {
    padding: 0.5rem 2rem;
    font-size: 0.75rem;
}

/* ==========================================
   轮播图样式
   ========================================== */

.carousel-container {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.step-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
    border-radius: 0.75rem;
    overflow: hidden;
    min-height: 0;
}

.step-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.step-description {
    flex-shrink: 0;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 0.5rem;
    text-align: center;
}

.step-number {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.35rem;
}

.step-description p {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 600;
}

/* 轮播图按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    color: var(--primary-color);
}

.carousel-btn:hover {
    background: white;
    box-shadow: var(--shadow-lg);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn.prev {
    left: 1rem;
}

.carousel-btn.next {
    right: 1rem;
}

/* 步骤指示器 - 现代简约风格 */
.carousel-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0 0.5rem;
    flex-shrink: 0;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.25);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
}

.indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.indicator:hover {
    background: rgba(102, 126, 234, 0.4);
    transform: scale(1.2);
}

.indicator.active {
    width: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-color: rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.indicator.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    animation: indicatorSlide 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.indicator.active::after {
    display: none;
}

@keyframes indicatorSlide {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

/* ==========================================
   响应式设计
   ========================================== */

@media (max-width: 1400px) {
    .tutorials-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 769px) {
    /* 桌面端视频内容区域保持固定高度和隐藏溢出 */
    .video-content {
        overflow: hidden;
    }

    /* 桌面端注意事项保持竖向布局 */
    .notice-section-right {
        flex-direction: column;
    }

    .notice-section-right h3 {
        margin-bottom: 0.6rem;
    }
}

@media (max-width: 1024px) {
    .tutorials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .content-split {
        grid-template-columns: 350px 1fr;
        gap: 1rem;
    }

    .article-content,
    .video-content {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .container.home-page {
        height: 100vh;
        height: 100svh; /* 小视口高度，适合移动端 */
    }

    .header-content {
        padding: 0.5rem 1rem;
    }

    .logo-img {
        height: 1.25rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .customer-service-icon {
        width: 32px;
        height: 32px;
    }

    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.875rem;
    }

    .hero {
        padding: 1.25rem 1rem 1rem;
    }

    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 0.35rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .tutorials-section {
        padding: 1rem 1rem 0.5rem;
    }

    .tutorials-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .tutorial-card {
        padding: 1.25rem 1rem;
        gap: 0.5rem;
        min-height: auto;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    }

    .tutorial-card:active {
        transform: scale(0.98);
    }

    .card-icon {
        width: auto;
        min-height: 85px;
    }

    .card-icon svg {
        width: 30px;
        height: 30px;
    }

    .card-icon .icon-img {
        width: 75px;
        height: 75px;
    }
    
    /* 移动端回收图标调整 */
    .tutorial-card[data-category="recycle"] .icon-img {
        width: 85px;
        height: 85px;
    }

    .card-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .card-description {
        font-size: 0.8rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .footer {
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
    }

    /* 移动端隐藏教程详情页的页脚 */
    .tutorial-footer {
        display: none;
    }

    /* 教程详情页 - 移动端 */
    .tutorial-page {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        height: 100%;
    }

    .tutorial-detail {
        padding: 0.75rem 1rem 0;
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100svh;
    }

    .tutorial-header {
        padding: 0.6rem 1rem;
        margin-bottom: 0.6rem;
        flex-shrink: 0;
    }

    .tutorial-title {
        font-size: 1.15rem;
    }

    /* 移动端显示标签切换器 */
    .mobile-tab-switcher {
        display: flex;
        background: var(--bg-primary);
        border-radius: 0.75rem;
        margin: 0 1rem 0.75rem;
        padding: 0.25rem;
        box-shadow: var(--shadow-sm);
        border-bottom: 2px solid var(--border-color);
        flex-shrink: 0;
    }

    .mobile-tab {
        padding: 0.65rem 0.85rem;
        font-size: 0.95rem;
        border-radius: 0.5rem;
    }

    .mobile-tab.active {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
        border-bottom: none;
    }

    /* 内容区域在移动端默认全屏显示 */
    .tutorial-content-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
    }

    .content-split {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: hidden;
        min-height: 0;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .article-content,
    .video-content {
        padding: 1rem;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        min-height: 0;
        width: 100%;
    }

    /* 移动端标签切换逻辑 */
    .mobile-tab-switcher ~ .tutorial-content-wrapper .article-content {
        display: flex;
    }

    .mobile-tab-switcher ~ .tutorial-content-wrapper .video-content {
        display: none;
    }

    /* 当视频标签激活时 */
    .mobile-tab-switcher.show-video ~ .tutorial-content-wrapper .article-content {
        display: none;
    }

    .mobile-tab-switcher.show-video ~ .tutorial-content-wrapper .video-content {
        display: flex;
    }

    .video-content {
        gap: 0.75rem;
    }

    /* 图文内容充满屏幕 */
    .article-content .article {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .article-content .article-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .article-content .article-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    /* 移动端视频播放器充满屏幕 */
    .video-player {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin-bottom: 0;
        min-height: 0;
    }

    .player-wrapper {
        height: auto !important;
        width: 100%;
        max-height: 65vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .player-wrapper video {
        width: 100%;
        height: auto;
        max-height: 65vh;
    }

    .notice-section-right {
        flex: 0 0 auto;
        margin-top: 0;
        display: block;
    }

    .notice-section-right h3 {
        display: none;
    }

    .notice-section-right ul {
        font-size: 0.85rem;
    }

    .notice-section-right .highlight-box {
        padding: 0.65rem 0.85rem;
        font-size: 0.85rem;
        margin: 0;
        line-height: 1.5;
    }

    /* 轮播图移动端优化 - 充满剩余空间 */
    .carousel-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        margin: 0;
    }

    .carousel-wrapper {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 0;
    }

    .carousel-slide {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.95);
    }

    .carousel-btn.prev {
        left: 0.5rem;
    }

    .carousel-btn.next {
        right: 0.5rem;
    }

    .step-image-wrapper {
        max-height: 60vh;
        flex: 0 0 auto;
    }

    .step-image {
        max-height: 60vh;
        width: auto;
        object-fit: contain;
    }

    .step-description {
        padding: 0.85rem;
        flex-shrink: 0;
    }

    .step-number {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }

    .step-description p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .carousel-indicators {
        flex-shrink: 0;
    }

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

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container.home-page {
        height: 100vh;
        height: 100svh; /* 小视口高度，适合移动端 */
    }

    .header-content {
        padding: 0.5rem 0.75rem;
    }

    .logo {
        gap: 0.4rem;
    }

    .logo-img {
        height: 1rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .customer-service {
        padding: 0.4rem;
    }

    .customer-service-icon {
        width: 28px;
        height: 28px;
    }

    .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .hero {
        padding: 0.9rem 0.75rem 0.65rem;
    }

    .hero-title {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }

    .hero-subtitle {
        font-size: 0.75rem;
    }

    .tutorials-section {
        padding: 0.65rem 0.75rem 0.4rem;
    }

    .tutorials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }

    .tutorial-card {
        padding: 1rem 0.85rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        min-height: auto;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    }

    .tutorial-card:active {
        transform: scale(0.98);
    }

    .card-icon {
        width: auto;
        min-height: 75px;
    }

    .card-icon svg {
        width: 26px;
        height: 26px;
    }

    .card-icon .icon-img {
        width: 65px;
        height: 65px;
    }
    
    /* 小屏幕回收图标调整 */
    .tutorial-card[data-category="recycle"] .icon-img {
        width: 75px;
        height: 75px;
    }

    .card-title {
        font-size: 0.95rem;
        line-height: 1.3;
    }

    .card-description {
        font-size: 0.75rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .footer {
        padding: 0.5rem;
        font-size: 0.65rem;
    }

    /* 小屏幕隐藏教程详情页的页脚 */
    .tutorial-footer {
        display: none;
    }

    /* 教程详情页 - 小屏幕 */
    .tutorial-page {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        height: 100%;
    }

    .tutorial-detail {
        padding: 0.5rem 0.75rem 0;
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100svh;
    }

    .tutorial-header {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
        flex-shrink: 0;
        display:flex;
    }

    .tutorial-title {
        font-size: 1.05rem;
    }

    /* 小屏幕标签切换器优化 */
    .mobile-tab-switcher {
        margin: 0 0.75rem 0.65rem;
        padding: 0.2rem;
        flex-shrink: 0;
    }

    .mobile-tab {
        padding: 0.55rem 0.75rem;
        font-size: 0.9rem;
    }

    .tutorial-content-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
    }

    .content-split {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: hidden;
        min-height: 0;
    }

    .article-content,
    .video-content {
        padding: 0.75rem;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        min-height: 0;
    }

    .video-content {
        gap: 0.65rem;
    }

    /* 小屏幕视频播放器优化 */
    .video-player {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin-bottom: 0;
        min-height: 0;
    }

    .player-wrapper {
        height: auto !important;
        width: 100%;
        max-height: 60vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .player-wrapper video {
        width: 100%;
        height: auto;
        max-height: 60vh;
    }

    .notice-section-right {
        flex: 0 0 auto;
        margin-top: 0;
        display: block;
    }

    .notice-section-right h3 {
        display: none;
    }

    .notice-section-right ul {
        font-size: 0.8rem;
    }

    .notice-section-right li {
        padding: 0.4rem 0;
    }

    .notice-section-right .highlight-box {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
        margin: 0;
        line-height: 1.5;
    }

    .article-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    /* 小屏幕轮播图优化 */
    .carousel-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        margin: 0;
    }

    .carousel-wrapper {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 0;
    }

    .carousel-slide {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.95);
    }

    .carousel-btn svg {
        width: 20px;
        height: 20px;
    }

    .carousel-btn.prev {
        left: 0.35rem;
    }

    .carousel-btn.next {
        right: 0.35rem;
    }

    .step-image-wrapper {
        max-height: 55vh;
        flex: 0 0 auto;
    }

    .step-image {
        max-height: 55vh;
        width: auto;
        object-fit: contain;
    }

    .step-description {
        padding: 0.65rem;
        flex-shrink: 0;
    }

    .step-number {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .step-description p {
        font-size: 0.88rem;
        line-height: 1.5;
    }

    .carousel-indicators {
        flex-shrink: 0;
    }

    .highlight-box {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .carousel-indicators {
        padding: 0.85rem 0 0.4rem;
        gap: 0.4rem;
    }

    .indicator {
        width: 7px;
        height: 7px;
    }

    .indicator.active {
        width: 28px;
        height: 7px;
    }
    
    /* 移动端回收图标调整 */
    .tutorial-card[data-category="recycle"] .icon-img {
        width: 85px;
        height: 85px;
    }

    .content-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tab-button {
        justify-content: center;
    }
}

/* 极小视口高度回退 */
@media (max-height: 600px) {
    .container.home-page {
        min-height: 600px;
        height: auto;
        overflow-y: auto;
    }

    .hero {
        padding: 0.75rem 1rem 0.5rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.8rem;
    }

    .tutorials-section {
        padding: 0.75rem 1rem;
    }

    .tutorials-grid {
        gap: 0.75rem;
    }

    .tutorial-card {
        padding: 0.75rem;
    }
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-gray);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

a.back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    /* background: linear-gradient(135deg, #2e53f9, #974be3); */
    color: var(--primary-color) !important;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none !important;
    border-radius: 0.75rem;
    /* width: 100%; */
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
}

a.back:hover,
a.back:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(151, 75, 227, 0.3);
    color: #ffffff !important;
    text-decoration: none !important;
    background:var(--primary-color) !important;
}

a.back svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

/* 移动端优化 */
@media (max-width: 768px) {
    a.back {
        font-size: 0.95rem;
        padding: 0.7rem 1rem;
    }
}