:root {
    --primary: #007AFF; /* 音频工具主色：蓝色 */
    --primary-light: #5D9CFF;
    --bg: #0a0a0f;
    --card-bg: #1a1a24;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0B0;
    --gradient-freq: linear-gradient(90deg, #3a0ca3 0%, #4361ee 25%, #4cc9f0 50%, #f72585 75%, #ff006e 100%);
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, sans-serif;
    padding: 0; margin: 0;
    line-height: 1.6;
}

.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    max-width: 1000px;
    margin: 20px auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

h1 {
    text-align: center; font-weight: 700; font-size: 2rem;
    display: flex; align-items: center; justify-content: center; gap: 15px;
    margin-bottom: 1.5rem;
}

h1 i { color: var(--primary); }

/* 快速导航 */
.quick-nav {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 2rem;
}

.quick-links-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.quick-link {
    background: rgba(0,122,255,0.15);
    color: var(--primary-light);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,122,255,0.3);
}

.quick-link:hover {
    background: rgba(0,122,255,0.25);
    color: white;
    transform: translateY(-2px);
}

/* SEO内容区 */
.seo-content {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.seo-content h2 {
    color: var(--primary-light);
    margin-bottom: 20px;
    text-align: center;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.seo-item {
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.seo-item h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.seo-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.keyword-tags {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag {
    background: rgba(0,122,255,0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--primary-light);
    border: 1px solid rgba(0,122,255,0.2);
}

/* 可视化区域 */
.visualizer-container {
    background: #000;
    border-radius: 14px;
    height: 150px;
    position: relative;
    margin: 25px 0;
    border: 1px solid #333;
    overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: 150px;
}

#visualizer { width: 100%; height: 100%; }

.visualizer-label {
    position: absolute; top: 10px; left: 15px;
    background: rgba(0,0,0,0.6); padding: 4px 12px;
    border-radius: 20px; font-size: 0.8rem; color: var(--primary-light);
}

/* 控制控件 */
.section {
    background: rgba(255,255,255,0.03);
    padding: 20px; border-radius: 15px; margin-bottom: 20px;
}

.slider-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}

.slider-value {
    background: var(--primary); color: white;
    padding: 6px 20px; border-radius: 30px; font-weight: bold; font-size: 1.2rem;
}

.freq-slider {
    width: 100%; height: 10px; -webkit-appearance: none;
    background: var(--gradient-freq); border-radius: 5px; outline: none;
    touch-action: manipulation;
}

.freq-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 24px; height: 24px;
    background: #fff; border: 4px solid var(--primary); border-radius: 50%; cursor: pointer;
}

.freq-slider::-moz-range-thumb {
    width: 24px; height: 24px;
    background: #fff; border: 4px solid var(--primary); border-radius: 50%; cursor: pointer;
}

.volume-control {
    display: flex; align-items: center; gap: 15px; margin-top: 25px;
}

.volume-slider { 
    flex: 1; 
    touch-action: manipulation;
}

/* 预设按钮 */
.preset-freq {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 20px;
}

.freq-btn {
    background: rgba(255,255,255,0.05); border: 1px solid #444; color: #ccc;
    padding: 12px; border-radius: 10px; cursor: pointer; transition: 0.3s;
    display: flex; flex-direction: column; align-items: center;
    user-select: none;
    min-height: 70px;
    justify-content: center;
}

.freq-btn:hover {
    background: rgba(255,255,255,0.1); color: white; border-color: #666;
}

.freq-btn.active {
    background: var(--primary); color: white; border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
}

.freq-btn small { font-size: 0.7rem; opacity: 0.7; margin-top: 4px; }

/* 按钮组 */
.controls { display: flex; gap: 10px; flex-wrap: wrap; }
.controls button {
    flex: 1; padding: 15px; border-radius: 10px; border: none; font-weight: bold;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: 0.2s; min-width: 120px;
    user-select: none;
    touch-action: manipulation;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #0066d6; }
.btn-primary.active { 
    background: #0056cc; 
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 122, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); }
}

.btn-secondary { background: #333; color: #eee; }
.btn-secondary:hover { background: #444; }
.btn-secondary.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
}

.btn-danger { background: #ff3b30; color: white; }
.btn-danger:hover { background: #e0352b; }

.btn-toggle { background: #34c759; color: white; }
.btn-toggle:hover { background: #2db54e; }
.btn-toggle.playing { background: #ff3b30; }

/* 状态栏适配键盘工具 */
.status-bar {
    display: grid; grid-template-columns: repeat(3, 1fr);
    background: #111; padding: 15px; border-radius: 12px; margin-top: 20px; gap: 10px;
}

.status-item { display: flex; flex-direction: column; align-items: center; }
.status-label { font-size: 0.7rem; color: #666; margin-bottom: 5px; }
.status-value { color: var(--primary-light); font-weight: bold; font-size: 1.1rem; }

/* 专业文档主题色 */
.instructions-section .feature-item { border-left-color: var(--primary); }
.instructions-section .feature-item h3, .faq-section h2, .faq-item h3 { color: var(--primary-light); }
.instructions-section .feature-item .tip a, .faq-item .faq-link {
    background: rgba(0, 122, 255, 0.1); border-color: rgba(0, 122, 255, 0.3); color: var(--primary-light);
}

/* 扫频动画 */
.sweep-indicator {
    position: absolute; top: 0; left: 0; height: 100%; width: 4px;
    background: white; box-shadow: 0 0 10px #fff; display: none;
}
.sweeping .sweep-indicator { display: block; animation: sweepAnim 10s linear; }
@keyframes sweepAnim { from { left: 0; } to { left: 100%; } }

/* 声道按钮激活状态 */
.channel-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-light);
}

/* 噪音按钮激活状态 */
.noise-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-light);
}

/* 扫频按钮激活状态 */
#sweepBtn.active {
    background: #0056cc;
    color: white;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
}

/* 预设频率按钮激活状态 */
.freq-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-light);
}

/* 在播放状态下的正弦波播放按钮 */
.btn-toggle.playing {
    background: #ff3b30;
    color: white;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .card {
        padding: 1.5rem;
        margin: 10px;
        border-radius: 15px;
    }
    
    .quick-nav {
        padding: 0 1rem;
    }
    
    .quick-links-container {
        padding: 10px;
    }
    
    .quick-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .preset-freq { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .freq-btn {
        min-height: 60px;
        padding: 10px 8px;
    }
    
    .status-bar { 
        grid-template-columns: 1fr; 
    }
    
    .controls button { 
        min-width: 100px; 
        padding: 12px 8px;
    }
    
    .slider-value {
        font-size: 1rem;
        padding: 4px 12px;
    }
    
    .seo-grid {
        grid-template-columns: 1fr;
    }
    
    .seo-item {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }
}

/* 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .card {
        max-width: 95%;
    }
    
    .seo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 防止输入框缩放干扰 */
input[type="range"] {
    -webkit-tap-highlight-color: transparent;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .btn-primary, .btn-secondary.active, .btn-toggle {
        border: 2px solid white;
    }
}

/* 减少动画效果（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}