: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;
}

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

.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);
}

.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;
    margin-bottom: 20px;
}

.section h3 {
    color: var(--accent-color);
    margin-top: 25px;
}

.section p {
    line-height: 1.6;
    margin-bottom: 12px;
}

.highlight {
    background-color: var(--highlight-bg);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
    margin: 20px 0;
    color: var(--text-color);
}

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

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);
}

.visualization-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    gap: 15px;
}

.canvas-container {
    width: 100%;
    max-width: 600px;
    height: 400px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    position: relative;
}

#kernel-viz {
    display: flex;
    width: 100%;
    gap: 20px;
    justify-content: center;
}

.viz-box {
    flex: 1;
    min-width: 300px;
    height: 350px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* WebGL 不支持时的隐藏类 */
.viz-box.webgl-unavailable {
    display: none;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    width: 100%;
    max-width: 600px;
}

.controls label {
    min-width: 120px;
    white-space: nowrap;
}

.controls input[type="range"] {
    flex: 1;
}

#btn-confirm-c {
    min-width: 90px;
    padding: 10px 15px;
}

#c-value {
    min-width: 30px;
    display: inline-block;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}

.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);
}

@media (max-width: 768px) {
    #kernel-viz {
        flex-direction: column;
    }

    .viz-box {
        min-width: 100%;
        width: 100%;
        height: 300px;
    }

    /* 当 3D 隐藏时，2D 视图全宽 */
    #kernel-viz:has(.viz-box.webgl-unavailable) #kernel-2d {
        width: 100%;
        min-width: 100%;
    }
}

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

/* 滑块样式 */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #ead9c7;
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    accent-color: var(--primary-color);
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--primary-color);
    box-shadow: 0 2px 7px rgba(216, 67, 21, 0.3);
    cursor: pointer;
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: #ead9c7;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--primary-color);
    box-shadow: 0 2px 7px rgba(216, 67, 21, 0.3);
    cursor: pointer;
}

