/* 文章页面专用样式 */

/* 重置Typora默认样式 */
body.typora-export {
    padding: 0 !important;
    margin: 0 !important;
    background: #f5f7fa !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    min-height: 100vh;
}

/* 头部导航区域 */
.g-doc {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.g-head {
    padding: 0;
    background: transparent;
}

.g-head-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.m-logo a {
    color: #2c3e50 !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 28px !important;
}

.m-logo span {
    color: #7f8c8d !important;
    font-size: 14px !important;
    margin-left: 10px;
}

.m-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: auto !important;
}

.m-nav li {
    margin-left: 30px;
}

.m-nav a {
    color: #5a6c7d;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.m-nav a:hover,
.m-nav .active a {
    color: #4facfe !important;
    background: rgba(79, 172, 254, 0.1);
}

/* 文章容器 */
#write {
    max-width: 820px !important;
    margin: 100px auto 50px !important;
    padding: 50px 45px !important;
    background: white;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    line-height: 1.8 !important;
    position: relative;
}

/* 文章装饰元素 */
#write::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 16px 16px 0 0;
}

/* 文章标题样式 */
#write h1 {
    font-size: 2.6em !important;
    color: #1a202c !important;
    font-weight: 700 !important;
    margin: 0 0 35px 0 !important;
    line-height: 1.3 !important;
    border-bottom: none !important;
    position: relative;
    padding-bottom: 25px;
    text-align: center;
}

#write h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 2px;
}

/* 文章元信息标签 */
.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e8f4ff 100%);
    border-radius: 12px;
    border: 1px solid rgba(79, 172, 254, 0.1);
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #5a6c7d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.meta-tag.primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.meta-tag.category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.meta-tag.difficulty {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.meta-tag.time {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.meta-tag::before {
    margin-right: 6px;
    font-size: 14px;
}

.meta-tag.primary::before { content: '📚'; }
.meta-tag.category::before { content: '🏷️'; }
.meta-tag.difficulty::before { content: '⭐'; }
.meta-tag.time::before { content: '⏱️'; }

/* 文章内容摘要 */
.article-summary {
    background: linear-gradient(135deg, #f8fafc 0%, #e8f4ff 100%);
    border-left: 4px solid #4facfe;
    padding: 25px 30px;
    margin: 30px 0;
    border-radius: 0 12px 12px 0;
    position: relative;
    font-size: 16px;
    line-height: 1.7;
    color: #2d3748;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.1);
}

.article-summary::before {
    content: '💡 核心要点';
    position: absolute;
    top: -12px;
    left: 20px;
    background: white;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #4facfe;
    border-radius: 12px;
    border: 2px solid #4facfe;
}

/* 章节标签 */
.section-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    margin-right: 10px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.section-tag::before {
    content: '📖';
    margin-right: 4px;
    font-size: 12px;
}

/* 二级标题 */
#write h2 {
    font-size: 1.9em !important;
    color: #2d3748 !important;
    font-weight: 600 !important;
    margin: 50px 0 25px 0 !important;
    border-bottom: none !important;
    position: relative;
    padding-left: 0;
    padding-top: 20px;
}

#write h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 2px;
    opacity: 0.3;
}

#write h2::after {
    content: counter(section-counter);
    counter-increment: section-counter;
    position: absolute;
    left: -50px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

#write {
    counter-reset: section-counter;
}

/* 三级标题 */
#write h3 {
    font-size: 1.5em !important;
    color: #2d3748 !important;
    font-weight: 600 !important;
    margin: 35px 0 20px 0 !important;
    position: relative;
    padding-left: 25px;
}

#write h3::before {
    content: '▶';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #4facfe;
    font-size: 16px;
}

/* 重点内容标签 */
.highlight-box {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7e2 100%);
    border: 2px solid #fc8181;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    position: relative;
}

.highlight-box::before {
    content: '🎯 重点提醒';
    position: absolute;
    top: -12px;
    left: 20px;
    background: white;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #e53e3e;
    border-radius: 12px;
    border: 2px solid #fc8181;
}

/* 技巧提示框 */
.tip-box {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border: 2px solid #68d391;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    position: relative;
}

.tip-box::before {
    content: '💡 实用技巧';
    position: absolute;
    top: -12px;
    left: 20px;
    background: white;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #38a169;
    border-radius: 12px;
    border: 2px solid #68d391;
}

/* 段落样式 */
#write p {
    color: #5a6c7d !important;
    font-size: 16px !important;
    line-height: 1.8 !important;
    margin: 16px 0 !important;
    text-align: justify;
}

/* 强调文本 */
#write strong {
    color: #2c3e50 !important;
    font-weight: 600 !important;
}

/* 列表样式 */
#write ol, #write ul {
    margin: 20px 0 !important;
    padding-left: 0 !important;
}

#write ol li, #write ul li {
    margin: 12px 0 !important;
    padding: 12px 20px !important;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #4facfe;
    color: #5a6c7d !important;
    position: relative;
    transition: all 0.3s ease;
}

#write ol li:hover, #write ul li:hover {
    background: #e8f4ff;
    transform: translateX(4px);
}

#write ol {
    counter-reset: custom-counter;
}

#write ol li {
    counter-increment: custom-counter;
    list-style: none;
}

#write ol li::before {
    content: counter(custom-counter);
    position: absolute;
    left: -35px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* 引用块样式 */
#write blockquote {
    background: linear-gradient(135deg, #f8fafc 0%, #e8f4ff 100%) !important;
    border-left: 4px solid #4facfe !important;
    padding: 20px 24px !important;
    margin: 24px 0 !important;
    border-radius: 0 8px 8px 0 !important;
    color: #5a6c7d !important;
    font-style: italic;
    position: relative;
}

#write blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 48px;
    color: #4facfe;
    font-family: Georgia, serif;
    opacity: 0.3;
}

/* 代码样式 */
#write code {
    background: #f1f3f4 !important;
    color: #e91e63 !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    border: none !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
}

#write pre {
    background: #f8fafc !important;
    border: 1px solid #e1e8ed !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin: 24px 0 !important;
    overflow-x: auto;
}

/* 表格样式 */
#write table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 24px 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

#write table th {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 16px !important;
    text-align: left !important;
    border: none !important;
}

#write table td {
    padding: 16px !important;
    border-bottom: 1px solid #f1f3f4 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

#write table tr:nth-child(even) {
    background: #f8fafc !important;
}

#write table tr:hover {
    background: #e8f4ff !important;
}

/* 分割线 */
#write hr {
    border: none !important;
    height: 2px !important;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    margin: 40px 0 !important;
    border-radius: 1px !important;
}

/* 图片样式 */
#write img {
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    margin: 24px 0 !important;
    transition: transform 0.3s ease !important;
}

#write img:hover {
    transform: translateY(-4px) !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .g-head-wrap {
        padding: 0 15px;
        flex-direction: column;
        height: auto;
        padding-top: 15px;
        padding-bottom: 15px;
    }
    
    .m-nav {
        margin-top: 10px;
    }
    
    .m-nav li {
        margin-left: 15px;
    }
    
    #write {
        margin: 120px 15px 30px !important;
        padding: 25px 20px !important;
    }
    
    #write h1 {
        font-size: 2.2em !important;
    }
    
    #write h2 {
        font-size: 1.6em !important;
        margin-left: 20px;
    }
    
    #write h2::after {
        left: -30px;
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    #write ol li::before {
        left: -30px;
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .article-nav {
        max-width: calc(100% - 30px);
        flex-direction: column;
    }
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

/* 文章底部导航 */
.article-nav {
    max-width: 820px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.article-nav a {
    flex: 1;
    padding: 25px;
    background: white;
    border-radius: 16px;
    text-decoration: none;
    color: #5a6c7d;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    text-align: center;
}

.article-nav a:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    color: #4facfe;
}

.article-nav .nav-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.article-nav .nav-title {
    font-weight: 600;
    font-size: 14px;
}

/* 阅读进度条 */
.reading-progress {
    position: fixed;
    top: 70px;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    z-index: 999;
    transition: width 0.3s ease;
}

/* 目录导航 */
.article-toc {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    max-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.article-toc h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.article-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-toc li {
    margin: 8px 0;
}

.article-toc a {
    color: #5a6c7d;
    text-decoration: none;
    font-size: 13px;
    display: block;
    padding: 4px 0;
    border-left: 2px solid transparent;
    padding-left: 10px;
    transition: all 0.3s ease;
}

.article-toc a:hover,
.article-toc a.active {
    color: #4facfe;
    border-left-color: #4facfe;
}

@media (max-width: 1200px) {
    .article-toc {
        display: none !important;
    }
}