/* styles.css */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #8b4513;
    --accent-color: #d4af37;
    --text-color: #2c3e50;
    --text-light: #5a6c7d;
    --bg-color: #fefefe;
    --bg-secondary: #f8f9fa;
    --border-color: #e1e8ed;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.latex-logo {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.latex-logo sup {
    font-size: 0.7em;
    vertical-align: super;
}

.latex-logo sub {
    font-size: 0.7em;
    vertical-align: sub;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 400;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--secondary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* 英雄区域 */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.latex-logo-large {
    font-size: 4rem;
    font-weight: 600;
    color: var(--primary-color);
    display: block;
    margin-bottom: 20px;
}

.latex-logo-large sup {
    font-size: 0.6em;
    vertical-align: super;
}

.latex-logo-large sub {
    font-size: 0.6em;
    vertical-align: sub;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-style: italic;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #34495e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.latex-preview {
    background-color: var(--bg-color);
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    overflow: hidden;
}

.preview-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9rem;
}

.preview-content {
    padding: 20px;
}

.preview-content code {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-wrap;
}

/* 通用区域样式 */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    color: var(--primary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--accent-color);
}

/* 关于部分 */
.about {
    padding: 80px 0;
    background-color: var(--bg-color);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: start;
}

.lead {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
    line-height: 1.8;
}

.about-features {
    display: grid;
    gap: 30px;
}

.feature-item h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.feature-item p {
    color: var(--text-light);
    line-height: 1.6;
}

.timeline {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
}

.timeline h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.timeline-year {
    font-weight: 600;
    color: var(--secondary-color);
    min-width: 60px;
    margin-right: 20px;
}

.timeline-content {
    color: var(--text-light);
}

/* 特性部分 */
.features {
    padding: 80px 0;
    background-color: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--bg-color);
    padding: 40px 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* 示例部分 */
.examples {
    padding: 80px 0;
    background-color: var(--bg-color);
}

.examples-tabs {
    max-width: 1000px;
    margin: 0 auto;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 15px 30px;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-family: inherit;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn.active,
.tab-btn:hover {
    color: var(--primary-color);
    border-bottom-color: var(--accent-color);
}

.tab-panel {
    display: none;
}

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

.example-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.code-block,
.output-block {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.code-header,
.output-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
}

.code-block pre {
    padding: 20px;
    margin: 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color);
}

.output-block > div:last-child {
    padding: 20px;
}

.math-output .equation {
    font-size: 1.2rem;
    margin: 15px 0;
    text-align: center;
    font-style: italic;
}

.table-output table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.table-output th,
.table-output td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.table-output th {
    background-color: var(--bg-secondary);
    font-weight: 600;
}

.table-caption {
    font-style: italic;
    text-align: center;
    color: var(--text-light);
}

.bib-output h4 {
    color: var(--primary-color);
    margin: 20px 0 10px;
}