* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 2.5em;
}

.level-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
    font-weight: 600;
}

.level-info span {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

.circuit-diagram,
.controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.circuit-diagram h3,
.controls h3 {
    color: #4a5568;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

.circuit {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    position: relative;
}

/* 电路连接线样式 */
.wire {
    background: #2d3748;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wire1 {
    width: 40px;
    height: 4px;
    margin: 0 10px;
}

.wire2 {
    width: 40px;
    height: 4px;
    margin: 0 10px;
}

/* 移除wire3和::before，改为更简洁的设计 */
.wire3 {
    display: none;
}

/* 移除十字架形状 */
.circuit::before {
    display: none;
}

.power-supply {
    text-align: center;
}

.battery {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.2em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.resistor-container {
    text-align: center;
}

.resistor {
    display: flex;
    align-items: center;
    background: #e2e8f0;
    padding: 8px 15px;
    border-radius: 25px;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.band {
    width: 12px;
    height: 25px;
    margin: 0 2px;
    border-radius: 2px;
    border: 1px solid #cbd5e0;
}

/* 色环颜色定义 */
.band.black {
    background-color: #000;
}

.band.brown {
    background-color: #8B4513;
}

.band.red {
    background-color: #FF0000;
}

.band.orange {
    background-color: #FFA500;
}

.band.yellow {
    background-color: #FFFF00;
}

.band.green {
    background-color: #008000;
}

.band.blue {
    background-color: #0000FF;
}

.band.violet {
    background-color: #800080;
}

.band.gray {
    background-color: #808080;
}

.band.white {
    background-color: #FFFFFF;
    border: 1px solid #cbd5e0;
}

.band.gold {
    background-color: #FFD700;
}

.band.silver {
    background-color: #C0C0C0;
}

.resistor-value {
    font-weight: bold;
    color: #4a5568;
    font-size: 0.9em;
}

.speaker {
    text-align: center;
}

.speaker-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.speaker-info {
    font-size: 0.9em;
    color: #4a5568;
}

.speaker-info div:first-child {
    font-weight: bold;
    margin-bottom: 5px;
}

.color-selector {
    margin-bottom: 30px;
}

.band-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.band-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.band-control label {
    font-weight: 600;
    color: #4a5568;
}

.band-control select {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9em;
    transition: border-color 0.3s ease;
}

.band-control select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.volume-display {
    margin-bottom: 30px;
}

.volume-bar {
    width: 100%;
    height: 30px;
    background: #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.volume-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.volume-text {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #4a5568;
}

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #a0aec0, #718096);
    color: white;
}

.feedback {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback.success {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
}

.feedback.error {
    background: linear-gradient(45deg, #f56565, #e53e3e);
    color: white;
}

.feedback.info {
    background: linear-gradient(45deg, #4299e1, #3182ce);
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
    }

    .band-controls {
        grid-template-columns: 1fr;
    }

    .level-info {
        flex-direction: column;
        gap: 15px;
    }

    .game-controls {
        flex-direction: column;
    }

    .circuit {
        flex-direction: column;
        gap: 20px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.resistor:hover {
    animation: pulse 1s infinite;
}

/* 音量条动画 */
.volume-fill {
    position: relative;
    overflow: hidden;
}

.volume-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* 玩法说明样式 */
.game-instructions {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.game-instructions h3 {
    color: #4a5568;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

.instructions-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.instruction-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.instruction-section h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

/* 色环编码表格样式 */
.color-code-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: bold;
    padding: 12px;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

.table-row:nth-child(even) {
    background: #f7fafc;
}

.table-row:last-child {
    border-bottom: none;
}

.color-sample {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    min-width: 60px;
    text-align: center;
}

.color-sample.black {
    background-color: #000;
}

.color-sample.brown {
    background-color: #8B4513;
}

.color-sample.red {
    background-color: #FF0000;
}

.color-sample.orange {
    background-color: #FFA500;
}

.color-sample.yellow {
    background-color: #FFFF00;
    color: #333;
    text-shadow: none;
}

.color-sample.green {
    background-color: #008000;
}

.color-sample.blue {
    background-color: #0000FF;
}

.color-sample.violet {
    background-color: #800080;
}

.color-sample.gray {
    background-color: #808080;
}

.color-sample.white {
    background-color: #FFFFFF;
    color: #333;
    text-shadow: none;
    border: 1px solid #cbd5e0;
}

.color-sample.gold {
    background-color: #FFD700;
    color: #333;
    text-shadow: none;
}

.color-sample.silver {
    background-color: #C0C0C0;
    color: #333;
    text-shadow: none;
}

/* 公式框样式 */
.formula-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.formula {
    background: linear-gradient(45deg, #f7fafc, #edf2f7);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
    font-family: 'Courier New', monospace;
    border: 1px solid #e2e8f0;
}

.example {
    background: #f0fff4;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #9ae6b4;
}

.example h5 {
    color: #22543d;
    margin-bottom: 10px;
    font-size: 1em;
}

.example p {
    margin-bottom: 10px;
    color: #2d3748;
}

.example ul {
    margin-left: 20px;
    color: #4a5568;
}

.example li {
    margin-bottom: 5px;
}

/* 游戏技巧样式 */
.tips {
    background: #fffaf0;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f6ad55;
}

.tips ul {
    margin-left: 20px;
    color: #744210;
}

.tips li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .instructions-content {
        grid-template-columns: 1fr;
    }

    .table-header,
    .table-row {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
        font-size: 0.9em;
    }

    .color-sample {
        min-width: 50px;
        font-size: 0.8em;
    }
}

/* 动画效果 */
.instruction-section {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.instruction-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.formula {
    transition: background 0.3s ease;
}

.formula:hover {
    background: linear-gradient(45deg, #edf2f7, #e2e8f0);
}

/* 控制面板样式 */
.controls-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.controls-panel h3 {
    color: #4a5568;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

.color-selector {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.volume-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.volume-display {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .controls-panel {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .game-controls {
        flex-direction: column;
        align-items: center;
    }
}