* {
    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 {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

h1 {
    color: #2c3e50;
    font-size: 2.2em;
    font-weight: 600;
    margin-bottom: 10px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.status {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    background: #e0e0e0;
    color: #666;
    font-size: 14px;
}

.status.connected {
    background: #4CAF50;
    color: white;
}

.status.connecting {
    background: #FF9800;
    color: white;
}

main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.info-item label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.channels-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.channel-group {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.channel-group h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    text-align: center;
}

.channels-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.channel {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.channel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.channel-header {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    text-align: center;
    font-size: 14px;
}

.channel-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.channel-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.channel-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.channel-range {
    font-size: 11px;
    color: #6c757d;
    text-align: center;
}

.flags-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.flags-panel h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    text-align: center;
}

.flags {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.flag {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flag-label {
    font-weight: 600;
    color: #495057;
}

.flag-value {
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
}

.flag.active {
    border-color: #dc3545;
    background: #fff5f5;
}

.flag.active .flag-value {
    color: #dc3545;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .controls {
        justify-content: center;
    }
    
    .info-panel {
        flex-direction: column;
        align-items: center;
    }
    
    .channels-row {
        grid-template-columns: 1fr;
    }
    
    .flags {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.8em;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.channel.updated {
    animation: pulse 0.3s ease;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}