/* 变量定义 - 暖色系 */
:root {
    --primary-color: #D84315; /* 红棕色 */
    --secondary-color: #FF8F00; /* 琥珀色 */
    --accent-color: #FF6F00; /* 橙黄色 */
    --bg-color: #FFFAF0; /* 暖白/浅米色 */
    --text-color: #4E342E; /* 深咖啡色 */
    --highlight-bg: #FFF3E0;
    --border-color: #FFE0B2;
    --header-bg: #FFF3E0;
}

body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.5;
    font-size: 16px;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

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

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.header h1 {
    color: var(--primary-color);
    margin-bottom: 8px;
    margin-top: 0;
    font-size: 2.2em;
}

.header .subtitle {
    color: #8d6e63;
    font-size: 1.1em;
    margin: 0;
}

/* 返回按钮 */
.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ffb300, #ff8f00);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.3);
}

/* 导航栏 */
.navigation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.nav-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s ease;
}

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

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

.nav-btn:hover:not(.active):not(:disabled) {
    background-color: var(--highlight-bg);
}

.nav-btn:disabled {
    border-color: #BCAAA4;
    color: #BCAAA4;
    cursor: not-allowed;
}

/* 章节样式 */
.section {
    background: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border-left: 5px solid var(--secondary-color);
}

.section h2 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid var(--highlight-bg);
    padding-bottom: 10px;
}

/* 引用块 */
blockquote {
    margin: 0;
    padding: 20px;
    background-color: var(--highlight-bg);
    border-radius: 10px;
    font-style: italic;
    color: var(--text-color);
    border-left: 4px solid var(--accent-color);
}

/* 数学块 */
.math-block {
    overflow-x: auto;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

/* 高亮框 */
.highlight {
    background-color: var(--highlight-bg);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px dashed var(--secondary-color);
}

/* 布局：文字 + 绘图 */
.layout-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

@media (max-width: 768px) {
    .layout-split {
        grid-template-columns: 1fr;
    }
}

.viz-container {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
}

#lp-viz {
    width: 100%;
    height: 300px;
}

.viz-caption {
    font-size: 0.9em;
    color: #6D4C41;
    margin-top: 10px;
}

/* 列表 */
ul, ol {
    padding-left: 20px;
}

li {
    margin-bottom: 10px;
}

.section ul li {
    list-style: none;
    background: var(--highlight-bg);
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.section ul li:hover {
    transform: scale(1.02);
    border-color: var(--secondary-color);
}

strong {
    color: var(--primary-color);
}

/* 交互演示相关样式 (来自原 observation.css) */
.obs-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.obs-visual {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#observation-viz {
    width: 100%;
    height: 400px;
}

.viz-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.obs-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.info-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #bf360c;
    font-size: 1.1rem;
    border-bottom: 2px solid #ffcc80;
    padding-bottom: 5px;
}

.variables-table {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

.variables-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.variables-table th, .variables-table td {
    border: 1px solid var(--border-color);
    padding: 6px;
    text-align: center;
}

.variables-table th {
    background: #fff3e0;
    color: var(--text-color);
}

.non-basic {
    color: #9e9e9e;
    background: #f5f5f5;
}

.is-basic {
    color: #e65100;
    font-weight: bold;
}

.btn-group {
    display: flex;
    gap: 10px;
}

.action-btn, .ctrl-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--primary-color);
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.action-btn:hover, .ctrl-btn:hover {
    background: #fbe9e7;
}

.action-btn:disabled, .ctrl-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.highlight-btn {
    background: var(--primary-color);
    color: #fff;
}

.highlight-btn:hover {
    background: #bf360c;
}

.algebraic-box {
    background: #fff8e1;
    border-left: 4px solid #ffa000;
    min-height: 120px;
}

#algebraic-steps {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #4e342e;
    white-space: pre-line;
}

@media (max-width: 900px) {
    .obs-layout {
        grid-template-columns: 1fr;
    }
}

footer {
    text-align: center;
    padding: 40px 20px;
    color: #a1887f;
    font-size: 14px;
}
