:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --text-color: #333333;
    --text-light: #666666;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* 主容器样å¼?*/
.demo-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 页头样式 */
.demo-header {
    background: var(--secondary-color);
    color: white;
    padding: 25px;
    text-align: center;
}

.demo-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.demo-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* 标签页导航样å¼?*/
.demo-tabs {
    display: flex;
    background: #f1f3f4;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: thin;
}

.demo-tabs::-webkit-scrollbar {
    height: 6px;
}

.demo-tabs::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.demo-tab {
    padding: 15px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    flex: 1;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 140px;
}

.demo-tab:hover {
    background: rgba(255, 255, 255, 0.7);
}

.demo-tab.active {
    background: white;
    border-bottom: 3px solid var(--primary-color);
    font-weight: 600;
    color: var(--primary-color);
}

/* 标签内容区域 */
.tab-content {
    display: none;
    padding: 0;
    height: calc(100vh - 180px);
}

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

.iframe-container {
    width: 100%;
    height: 100%;
    border: none;
}

/* 内容布局样式 */
.demo-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    padding: 20px;
    height: 100%;
}

.animation-area {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.controls-panel {
    background: var(--background-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

/* 控制组样å¼?*/
.control-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.control-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-color);
}

/* 表单元素样式 */
input[type="range"] {
    width: 100%;
    margin: 10px 0;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* 数值显示样å¼?*/
.value-display {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
    padding: 5px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    margin-top: 5px;
}

/* 说明文本样式 */
.explanation {
    background: #e8f4fd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 4px solid var(--primary-color);
}

.explanation h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 16px;
}

.explanation ul {
    padding-left: 20px;
}

.explanation li {
    margin-bottom: 5px;
}

/* 按钮样式 */
button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 10px;
    font-size: 14px;
}

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

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

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

.btn-secondary {
    background: #9b59b6;
    color: white;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active {
    transform: translateY(0);
}

/* 画布样式 */
canvas {
    display: block;
    background: white;
    width: 100%;
    height: 100%;
}

/* 状态信息样å¼?*/
.status-info {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 10px;
    border: 1px solid #e0e0e0;
}

/* 阶段标题样式 */
.stage {
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    color: var(--primary-color);
    border: 1px solid rgba(52, 152, 219, 0.2);
}

/* 视图切换样式 */
.pattern-views {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.pattern-view {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pattern-view.active {
    border-color: var(--primary-color);
    font-weight: bold;
    background: rgba(52, 152, 219, 0.1);
}

.pattern-view:hover {
    background: rgba(52, 152, 219, 0.05);
}

/* 响应式设è®?*/
@media (max-width: 1024px) {
    .demo-content {
        grid-template-columns: 1fr;
    }

    .demo-tabs {
        flex-wrap: wrap;
    }

    .demo-tab {
        min-width: 120px;
        flex: 1 0 50%;
    }

    .demo-header h1 {
        font-size: 1.8rem;
    }

    .demo-header p {
        font-size: 1rem;
    }

    .tab-content {
        height: auto;
        min-height: 600px;
    }
}

@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .demo-header {
        padding: 15px;
    }

    .demo-header h1 {
        font-size: 1.5rem;
    }

    .demo-tab {
        padding: 12px 10px;
        font-size: 14px;
        min-width: 100px;
    }

    .demo-content {
        padding: 10px;
    }

    .controls-panel {
        padding: 15px;
    }
}