/* ===== 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

html {
    font-size: 14px;
}

body {
    background-color: #ffffff;
    color: #000000;
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ===== 文章布局 ===== */
.article-section {
    padding: 100px 0 60px; /* 顶部内边距 */
    min-height: 100vh;
}

/* 文章头部 */
.article-header {
    text-align: center;
    margin-bottom: 60px; /* 底部边距 */
}

.article-header h1 {
    font-size: 2rem; /* 标题字号 */
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.subtitle {
    font-size: 0.9rem; /* 副标题字号 */
    color: #666;
    font-weight: 300;
    letter-spacing: 1px;
}

/* 文章内容 */
.article-content {
    max-width: 700px;
    margin: 0 auto;
}

.chapter {
    margin-bottom: 60px; /* 章节间距 */
    scroll-margin-top: 80px;
}

.chapter h2 {
    font-size: 1.3rem; /* 章节标题字号 */
    font-weight: 300;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.sanskrit-subtitle {
    color: #666;
    font-size: 0.8rem; /* 梵语副标题字号 */
    margin-bottom: 20px;
    font-style: italic;
    letter-spacing: 0.5px;
}

.article-content p {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.6;
    letter-spacing: 0.2px;
    font-size: 0.85rem; /* 正文字号 */
}

/* 梵语文字样式 */
.sanskrit {
    font-size: 0.95rem; /* 梵语文字 */
    font-weight: 500;
    color: #000;
    letter-spacing: 0.5px;
}

.transliteration {
    font-size: 0.8rem; /* 转写文字字号 */
    color: #666;
    font-style: italic;
    margin-left: 0.3rem;
}

/* 网格布局 */
.sanskrit-grid,
.content-grid,
.vowel-grid,
.compound-grid,
.support-grid,
.consonant-grid {
    display: grid;
    gap: 15px; /* 网格间距 */
    margin: 20px 0;
}

.sanskrit-grid {
    grid-template-columns: repeat(2, 1fr);
}

.content-grid {
    grid-template-columns: repeat(2, 1fr);
}

.vowel-grid {
    grid-template-columns: repeat(3, 1fr);
}

.compound-grid {
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
}

.support-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.consonant-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* 网格项样式 */
.sanskrit-item,
.content-item,
.vowel-item,
.support-item,
.consonant-item {
    padding: 15px; /* 内边距 */
    border: 1px solid #e5e5e5;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 0.85rem; /* 网格内文字字号 */
}

.sanskrit-item:hover,
.content-item:hover,
.vowel-item:hover,
.support-item:hover,
.consonant-item:hover {
    border-color: #000;
}

.content-item h4,
.support-item h4,
.consonant-item h4 {
    font-size: 0.9rem; /* 小标题字号 */
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.compound-grid,
.vowel-examples,
.weight-grid,
.sandhi-grid {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.compound-grid {
    grid-template-columns: repeat(2, 1fr);
}

.vowel-examples {
    grid-template-columns: repeat(3, 1fr);
}

.weight-grid {
    grid-template-columns: repeat(2, 1fr);
}

.sandhi-grid {
    grid-template-columns: repeat(2, 1fr);
}

.compound-item,
.example-item,
.weight-item,
.sandhi-item {
    padding: 15px;
    border: 1px solid #e5e5e5;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.compound-item:hover,
.example-item:hover,
.weight-item:hover,
.sandhi-item:hover {
    border-color: #000;
}

.consonant-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.detail-item {
    padding: 15px;
    border: 1px solid #e5e5e5;
    text-align: center;
    transition: all 0.3s ease;
}

.detail-item:hover {
    border-color: #000;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.feature-item {
    padding: 20px;
    border: 1px solid #e5e5e5;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-item:hover {
    border-color: #000;
}

/* 左侧章节导航 */
.chapter-nav {
    position: fixed;
    top: 50%;
    left: 32px;
    transform: translateY(-50%);
    z-index: 1000;
}

.nav-trigger {
    width: 6px;
    height: 6px;
    background-color: #666;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1002;
}

.nav-trigger:hover,
.nav-trigger.active {
    background-color: #1a1a1a;
    transform: scale(1.2);
}

.nav-menu.left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%) translateX(-8px);
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 0.75rem;
    min-width: 100px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.chapter-nav:hover .nav-menu.left {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.nav-menu.left .nav-item {
    display: block;
    padding: 0.5rem 0.375rem;
    color: #666;
    text-decoration: none;
    font-size: 9px !important;
    line-height: 1.2;
    transition: all 0.2s ease;
    border-radius: 3px;
    cursor: pointer;
}

.nav-menu.left .nav-item:hover {
    color: #1a1a1a;
    background-color: #f8f9fa;
}

.nav-menu.left .nav-item.active {
    color: #1a1a1a;
    font-weight: 500;
    background-color: #f8f9fa;
}

.nav-menu.left .nav-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

/* 返回链接 */
.back-section {
    text-align: center;
    margin-top: 40px; /* 顶部边距 */
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 0.8rem; /* 返回链接字号 */
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 20px;
}

.back-link:hover {
    color: #000;
    background-color: #f8f8f8;
}

/* ===== 顶部导航栏样式 ===== */
.navbar {
    position: fixed;
    top: 15px; /* 靠近顶部 */
    right: 15px;
    width: auto;
    background: transparent;
    border: none;
    padding: 0;
    z-index: 1000;
}

.nav-container {
    position: relative;
}

.nav-menu.top {
    position: fixed;
    top: 0;
    right: -280px;
    width: 250px; /* 宽度 */
    height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 70px 25px 25px; /* 内边距 */
    box-shadow: -5px 0 12px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 999;
}

.nav-menu.active {
    right: 0;
}

.menu-overlay.active {
    display: block;
}

.nav-menu li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
}

.nav-menu a {
    display: block;
    padding: 12px 0; /* 内边距 */
    font-size: 13px; /* 导航文字字号 */
    width: 100%;
}

.nav-menu a.active {
    font-weight: 500;
}

.hamburger {
    display: block;
    position: fixed;
    top: 15px; /* 靠近顶部 */
    right: 15px;
    z-index: 1000;
    background: #ffffff;
    width: 35px; /* 汉堡菜单 */
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 0.9rem; /* 图标 */
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

/* ===== 页脚样式 ===== */
.footer {
    background: #000;
    color: #fff;
    padding: 25px 0; /* 内边距 */
    text-align: center;
}

.footer-content p {
    font-size: 0.75rem; /* 页脚文字字号 */
    letter-spacing: 0.3px;
    color: #999;
}

/* 咒语页面专用样式 */
.mantra-section {
    margin: 25px 0;
    padding: 20px;
    border: 1px solid #e5e5e5;
}

.mantra-section .sanskrit-text {
    margin-bottom: 15px;
    text-align: center;
}

.mantra-section .sanskrit-text p {
    font-size: 1rem;
    color: #000;
    margin-bottom: 8px;
    line-height: 1.8;
}

.mantra-section .transliteration-text {
    text-align: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

.mantra-section .transliteration-text p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.6;
    font-style: italic;
}

.mantra-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.mantra-item {
    padding: 15px;
    border: 1px solid #e5e5e5;
    text-align: center;
    transition: all 0.3s ease;
}

.mantra-item:hover {
    border-color: #000;
}

.mantra-item .sanskrit {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mantra-grid {
        grid-template-columns: 1fr;
    }
    
    .mantra-section {
        padding: 15px;
    }
    
    .mantra-section .sanskrit-text p {
        font-size: 0.9rem;
    }
}

/* 瑜伽经页面专用样式 */
.sutra-section {
    margin: 12px 0;
    padding: 10px 0;
    position: relative;
}

.sutra-section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e5e5, transparent);
}

.sutra-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.sutra-number {
    background: #333;
    color: #fff;
    width: 28px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 500;
    flex-shrink: 0;
}

.sutra-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #000;
}

.sutra-content {
    margin-left: 36px;
}

.sutra-content .sanskrit-text p {
    font-size: 0.9rem;
    color: #000;
    margin-bottom: 2px;
    line-height: 1.3;
    font-weight: 500;
}

.sutra-content .transliteration-text p {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 2px;
    line-height: 1.3;
    font-style: italic;
}

.sutra-content .translation-text p {
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 0;
    line-height: 1.4;
    padding-top: 4px;
}

/* 章节标题样式 */
.chapter h2 {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.sanskrit-subtitle {
    text-align: center;
    font-weight: 500;
}

/* 开篇颂内容居中 */
#invocation .mantra-section {
    text-align: center;
}

#invocation .translation-text p {
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sutra-section {
        margin: 10px 0;
        padding: 8px 0;
    }
    
    .sutra-content {
        margin-left: 0;
    }
    
    .sutra-header {
        margin-bottom: 4px;
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    html {
        font-size: 13px;
    }
    
    .container {
        padding: 0 20px;
        max-width: 100%;
    }
    
    .article-section {
        padding: 80px 0 30px;
    }
    
    .article-header h1 {
        font-size: 1.7rem;
        letter-spacing: 3px;
    }
    
    .sanskrit-grid,
    .content-grid,
    .vowel-grid,
    .support-grid,
    .consonant-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .compound-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chapter-nav {
        display: none;
    }
    
    .sanskrit-item,
    .content-item,
    .vowel-item,
    .support-item,
    .consonant-item {
        padding: 12px;
    }
}

/* 八支体系页面专用样式 */
.limbs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.limb-item {
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.limb-item:hover {
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.limb-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #000;
}

.limb-item .sanskrit {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
    font-style: italic;
}

.limb-item p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
    margin-bottom: 15px;
}

.sutra-reference {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #000;
}

.sutra-reference .sanskrit {
    font-size: 0.85rem;
    color: #000;
    margin-bottom: 5px;
    font-weight: 500;
}

.sutra-reference p {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .limbs-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .limb-item {
        padding: 15px;
    }
}

/* 亮色主题（默认） */
.light-theme {
    background-color: #ffffff;
    color: #000000;
}

.light-theme .sanskrit {
    color: #000000;
}

.light-theme .transliteration {
    color: #666666;
}

.light-theme .sanskrit-item,
.light-theme .content-item,
.light-theme .vowel-item,
.light-theme .support-item,
.light-theme .consonant-item,
.light-theme .compound-item,
.light-theme .example-item,
.light-theme .weight-item,
.light-theme .sandhi-item {
    border-color: #e5e5e5;
    background: white;
}

/* 暗色主题 */
.dark-theme {
    background-color: #1a1a1a;
    color: #ffffff;
}

.dark-theme .sanskrit {
    color: #ffffff;
}

.dark-theme .transliteration {
    color: #cccccc;
}

.dark-theme .sanskrit-item,
.dark-theme .content-item,
.dark-theme .vowel-item,
.dark-theme .support-item,
.dark-theme .consonant-item,
.dark-theme .compound-item,
.dark-theme .example-item,
.dark-theme .weight-item,
.dark-theme .sandhi-item {
    border-color: #444444;
    background: #2a2a2a;
    color: #ffffff;
}

.dark-theme .nav-menu.left {
    background: #2a2a2a;
    border-color: #444444;
}

.dark-theme .nav-item {
    color: #cccccc;
}

.dark-theme .nav-item:hover,
.dark-theme .nav-item.active {
    background-color: #3a3a3a;
    color: #ffffff;
}

.dark-theme .footer {
    background: #000000;
    color: #ffffff;
}

/* ===== 基础样式 - 使用CSS变量 ===== */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #e5e5e5;
    --card-bg: #ffffff;
    --muted-text: #666666;
    --hover-color: #000000;
}

.dark-theme {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --border-color: #444444;
    --card-bg: #2a2a2a;
    --muted-text: #cccccc;
    --hover-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

html {
    font-size: 14px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ===== 文章布局 ===== */
.article-section {
    padding: 100px 0 60px;
    min-height: 100vh;
    background-color: var(--bg-color);
}

/* 文章头部 */
.article-header {
    text-align: center;
    margin-bottom: 60px;
}

.article-header h1 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: var(--text-color);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--muted-text);
    font-weight: 300;
    letter-spacing: 1px;
}

/* 文章内容 */
.article-content {
    max-width: 700px;
    margin: 0 auto;
}

.chapter {
    margin-bottom: 60px;
    scroll-margin-top: 80px;
}

.chapter h2 {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 15px;
    letter-spacing: 1px;
    color: var(--text-color);
}

.sanskrit-subtitle {
    color: var(--muted-text);
    font-size: 0.8rem;
    margin-bottom: 20px;
    font-style: italic;
    letter-spacing: 0.5px;
}

.article-content p {
    margin-bottom: 15px;
    color: var(--muted-text);
    line-height: 1.6;
    letter-spacing: 0.2px;
    font-size: 0.85rem;
}

/* 梵语文字样式 */
.sanskrit {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

.transliteration {
    font-size: 0.8rem;
    color: var(--muted-text);
    font-style: italic;
    margin-left: 0.3rem;
}

/* 网格布局和项样式 */
.sanskrit-item,
.content-item,
.vowel-item,
.support-item,
.consonant-item,
.compound-item,
.example-item,
.weight-item,
.sandhi-item,
.feature-item,
.detail-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.sanskrit-item:hover,
.content-item:hover,
.vowel-item:hover,
.support-item:hover,
.consonant-item:hover,
.compound-item:hover,
.example-item:hover,
.weight-item:hover,
.sandhi-item:hover,
.feature-item:hover,
.detail-item:hover {
    border-color: var(--hover-color);
}

.content-item h4,
.support-item h4,
.consonant-item h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    color: var(--text-color);
}

/* 左侧章节导航 */
.chapter-nav .nav-menu.left {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.nav-menu.left .nav-item {
    color: var(--muted-text);
}

.nav-menu.left .nav-item:hover,
.nav-menu.left .nav-item.active {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* 顶部导航栏 */
.navbar .nav-menu.top {
    background: var(--card-bg);
}

.nav-menu a {
    color: var(--text-color);
}

.nav-menu a:hover {
    color: var(--muted-text);
}

.hamburger {
    background: var(--card-bg);
    color: var(--text-color);
}

/* 页脚 */
.footer {
    background: var(--text-color);
    color: var(--bg-color);
}

.footer-content p {
    color: var(--muted-text);
}

/* 按钮 */
.cta-button {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.cta-button:hover {
    background: transparent;
    color: var(--text-color);
}

.cta-button.outline {
    background: transparent;
    color: var(--text-color);
    border-color: var(--text-color);
}

.cta-button.outline:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

/* 返回链接 */
.back-link {
    color: var(--muted-text);
}

.back-link:hover {
    color: var(--text-color);
    background-color: var(--card-bg);
}

/* 图标 */
.method-icon,
.benefit-icon,
.feature-item i,
.private-card i,
.comparison-card i {
    color: var(--text-color);
}

/* 分隔线 */
.rest-section,
.back-section {
    border-top-color: var(--border-color);
}

.rest-section p {
    color: var(--muted-text);
}

/* 咒语页面专用样式 */
.mantra-section {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}

.mantra-section .sanskrit-text p {
    color: var(--text-color);
}

.mantra-section .transliteration-text p {
    color: var(--muted-text);
}

.mantra-item {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}

/* 瑜伽经页面专用样式 */
.sutra-section:not(:last-child)::after {
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.sutra-number {
    background: var(--text-color);
    color: var(--bg-color);
}

.sutra-title {
    color: var(--text-color);
}

.sutra-content .sanskrit-text p {
    color: var(--text-color);
}

.sutra-content .transliteration-text p {
    color: var(--muted-text);
}

.sutra-content .translation-text p {
    color: var(--muted-text);
}

/* 八支体系页面专用样式 */
.limb-item {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}

.limb-item h4 {
    color: var(--text-color);
}

.limb-item .sanskrit {
    color: var(--muted-text);
}

.limb-item p {
    color: var(--muted-text);
}

.sutra-reference {
    background: var(--card-bg);
    border-left: 3px solid var(--text-color);
}

.sutra-reference .sanskrit {
    color: var(--text-color);
}

.sutra-reference p {
    color: var(--muted-text);
}
