/* md2word.com - Main Stylesheet for Guide Pages */
/* 与主页面保持一致的设计语言 */

:root {
    /* 品牌色彩系统 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --accent-blue: #3182ce;
    --accent-green: #38a169;
    --accent-red: #e53e3e;

    /* 中性色彩 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* 布局 */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* 基础样式重置 */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
}

/* Guide页面特定样式 */
.guide-page {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
}

.guide-main {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* 大屏幕布局优化 */
@media (min-width: 1280px) {
    .guide-main .container {
        max-width: 100%;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1536px) {
    .guide-main .container {
        max-width: 100%;
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

@media (min-width: 1920px) {
    .guide-main .container {
        max-width: 100%;
        padding-left: 6rem;
        padding-right: 6rem;
    }
}

@media (min-width: 2560px) {
    .guide-main .container {
        max-width: 100%;
        padding-left: 8rem;
        padding-right: 8rem;
    }
}

@media (min-width: 3840px) {
    .guide-main .container {
        max-width: 100%;
        padding-left: 12rem;
        padding-right: 12rem;
    }
}

/* 桌面端指南布局优化 */
@media (min-width: 1025px) {
    .guide-layout {
        display: flex;
        gap: 2.5rem;
        align-items: flex-start;
    }

    .guide-layout > .guide-content {
        flex: 1;
        min-width: 0;
    }

    .guide-layout > .guide-sidebar {
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 6rem;
        height: fit-content;
    }
}

@media (min-width: 1536px) {
    .guide-layout {
        gap: 3rem;
    }

    .guide-layout > .guide-sidebar {
        width: 320px;
    }
}

/* 导航栏样式 */
.nav-container {
    background: var(--primary-gradient);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand:hover {
    color: rgba(255, 255, 255, 0.9);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: white;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: var(--primary-dark);
}

.breadcrumb-separator {
    color: var(--gray-400);
}

.breadcrumb-current {
    color: var(--gray-600);
    font-weight: 500;
}

/* 页面头部 */
.guide-header {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.guide-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.guide-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.guide-header h1::after {
    display: none;  /* 完全隐藏这个装饰下划线 */
}

.guide-header p {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 统计数据 */
.quick-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-item:hover::before {
    transform: scaleX(1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stat-number::after {
    content: "";
    position: absolute;
    bottom: -0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 1px;
    opacity: 0.6;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* 主布局 */
.guide-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.guide-sidebar {
    width: 256px;
    flex-shrink: 0;
    position: sticky;
    top: 6rem;
}

.guide-content {
    flex: 1;
    min-width: 0;
}

/* 侧边栏目录 */
.toc {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.toc h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc h3::before {
    content: "📋";
    font-size: 1.25rem;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 0.25rem;
    position: relative;
}

.toc a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border-left: 3px solid transparent;
}

.toc a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.toc a:hover {
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(102, 126, 234, 0.05) 100%);
    color: var(--primary-color);
    transform: translateX(4px);
    border-left-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.toc a:hover::before {
    left: 100%;
}

.toc a[data-level="2"] {
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.toc a[data-level="3"] {
    font-weight: 400;
    font-size: 0.85rem;
    opacity: 0.9;
}

.toc a[data-level="4"] {
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.8;
}

.toc a.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-left-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateX(2px);
}

.toc-text {
    transition: all 0.2s ease;
}

.toc a:hover .toc-text {
    font-weight: 600;
}

/* 移动端TOC样式 */
.mobile-toc-toggle {
    margin-bottom: 1.5rem;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .guide-layout {
        flex-direction: column;
    }

    .guide-sidebar {
        width: 100%;
        position: static;
    }

    .quick-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .stat-item {
        min-width: 100px;
        padding: 1rem 0.75rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .mobile-toc-toggle {
        display: block;
    }
}

@media (min-width: 1025px) {
    .mobile-toc-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .guide-main {
        padding-top: 1rem;
        padding-bottom: 2rem;
    }

    .nav-content {
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.875rem;
    }

    .guide-header {
        padding: 1.5rem;
    }

    .guide-header h1 {
        font-size: 2rem;
    }

    .guide-header p {
        font-size: 1rem;
    }

    .quick-stats {
        gap: 1.5rem;
    }

    .breadcrumb {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* 选择文本样式 */
::selection {
    background-color: var(--primary-color);
    color: white;
}

/* 焦点样式 */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 为md2word.com链接添加特殊样式 */
.prose a[href*="md2word.com"] {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    border-bottom: 2px solid var(--primary-color);
    transition: all 0.2s ease;
}

.prose a[href*="md2word.com"]:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
    transform: translateY(-1px);
}

.prose a[href*="md2word.com"]::after {
    content: "↗";
    font-size: 0.8em;
    margin-left: 0.2em;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.prose a[href*="md2word.com"]:hover::after {
    transform: translateX(2px);
}

/* 修复prose类中h1元素的底部边框问题 */
article.prose h1,
.prose h1 {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

article.prose h1:first-child,
.prose h1:first-child {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* 移除prose中h1的所有伪元素装饰 */
article.prose h1::before,
article.prose h1::after,
.prose h1::before,
.prose h1::after {
    display: none !important;
    content: none !important;
}
