/* Gas Preparation Visualization Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.gas-prep-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header .subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

main {
    padding: 30px;
}

.visualization-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.apparatus-display, .collection-display, .gas-selection {
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.apparatus-display h3, .collection-display h3, .gas-selection h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 3px solid #4facfe;
    padding-bottom: 8px;
}

#apparatusCanvas {
    width: 100%;
    height: 500px;
    background: linear-gradient(to bottom, #e0f7fa, #ffffff);
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.apparatus-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 0.95em;
}

.info-item span:first-child {
    font-weight: 600;
    color: #4a5568;
}

.info-item span:last-child {
    font-weight: 700;
    color: #2b6cb0;
}

.method-buttons, .gas-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    direction: ltr;  /* 确保从左到右显示 */
    margin-bottom: 15px;
}

.method-btn, .gas-btn {
    padding: 15px 10px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 600;
    color: #4a5568;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.method-btn:hover, .gas-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #4facfe;
}

.method-btn.active, .gas-btn.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-color: #00f2fe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.method-sub {
    display: block;
    font-size: 0.75em;
    font-weight: 400;
    margin-top: 5px;
    opacity: 0.85;
}

.method-info, .gas-info {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.method-info p {
    color: #4a5568;
    line-height: 1.6;
    font-size: 0.95em;
}

.gas-info {
    display: grid;
    gap: 10px;
}

.gas-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 0.9em;
}

.gas-detail span:first-child {
    font-weight: 600;
    color: #718096;
}

.gas-detail span:last-child {
    font-weight: 600;
    color: #2b6cb0;
}

.controls-panel {
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.controls-panel h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 3px solid #4facfe;
    padding-bottom: 10px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.control-group {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9em;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.control-button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.control-button.start {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.control-button.start:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.4);
}

.control-button.pause {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.control-button.pause:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(237, 137, 54, 0.4);
}

.control-button.reset {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: white;
}

.control-button.reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(252, 129, 129, 0.4);
}

.formulas-section, .options-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.formulas-section h3, .options-section h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.formula-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.formula-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #4facfe;
}

.formula-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9em;
}

.formula {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #2b6cb0;
    font-size: 1.1em;
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item:hover {
    background: #edf2f7;
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.option-item span {
    font-size: 0.95em;
    color: #4a5568;
    cursor: pointer;
}

.explanation {
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.explanation h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid #4facfe;
    padding-bottom: 10px;
}

.explanation h3 {
    color: #2d3748;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.explanation p {
    color: #4a5568;
    line-height: 1.8;
    font-size: 1.05em;
    margin-bottom: 15px;
}

.explanation strong {
    color: #2b6cb0;
    font-weight: 700;
}

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

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

    .method-buttons, .gas-buttons {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .gas-prep-container {
        border-radius: 10px;
    }

    main {
        padding: 15px;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .apparatus-info {
        grid-template-columns: 1fr;
    }

    #apparatusCanvas {
        height: 400px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    header .subtitle {
        font-size: 0.9em;
    }

    .explanation {
        padding: 15px;
    }

    .explanation h2 {
        font-size: 1.4em;
    }
}
