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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: #333;
}

.status-container {
    margin-bottom: 30px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 8px;
}

#status, #connection-status {
    margin: 5px 0;
    font-size: 0.9rem;
}

.file-info {
    margin-bottom: 20px;
    padding: 12px;
    background-color: #e3f2fd;
    border-radius: 8px;
    text-align: left;
    font-size: 0.9rem;
    display: none;
}

.file-info p {
    margin-bottom: 8px;
    font-weight: 500;
}

.file-info ul {
    margin-left: 20px;
}

.file-info a {
    color: #1976D2;
    text-decoration: none;
}

.file-info a:hover {
    text-decoration: underline;
}

.switch-mode {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
}

.switch-mode label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.switch-mode input {
    margin-right: 8px;
}

/* WebSocket参数表单样式 */
.ws-params-container {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 8px;
    text-align: left;
    display: none;
}

.ws-params-container h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: #0d47a1;
}

.ws-params-container p {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 15px;
}

.headers-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-key,
.header-value {
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    flex: 1;
}

.header-key {
    width: 40%;
}

.header-value {
    width: 60%;
}

.delete-param-btn {
    padding: 6px 10px;
    background-color: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.delete-param-btn:hover {
    background-color: #ffcdd2;
}

.header-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.add-param-btn,
.save-params-btn {
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.add-param-btn {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.add-param-btn:hover {
    background-color: #bbdefb;
}

.save-params-btn {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.save-params-btn:hover {
    background-color: #c8e6c9;
}

.test-btn {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.test-btn:hover {
    background-color: #1976D2;
}

.test-btn:active {
    background-color: #0D47A1;
}

.record-button {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.record-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    background-color: #f0f0f0;
}

.record-button.recording {
    background-color: #ffebee;
}

.record-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #f44336;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.record-button.recording .record-icon {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        background-color: #f44336;
    }
    50% {
        transform: scale(1.1);
        background-color: #e53935;
    }
    100% {
        transform: scale(1);
        background-color: #f44336;
    }
}

.button-text {
    font-size: 1rem;
    font-weight: 500;
    color: #666;
}

.debug-container {
    margin-top: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 5px;
}

.debug-header h3 {
    font-size: 1rem;
    font-weight: 500;
    color: #555;
}

.clear-btn {
    padding: 4px 8px;
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn:hover {
    background-color: #e0e0e0;
    color: #333;
}

.debug-info {
    text-align: left;
    background-color: #f8f8f8;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    flex: 1;
    min-height: 150px;
    border: 1px solid #eee;
}

.debug-info div {
    border-bottom: 1px solid #eee;
    padding: 3px 0;
}

/* 重连选项样式 */
.reconnect-option {
    margin: 10px 0;
    padding: 5px;
    background-color: #fff3e0;
    border-radius: 4px;
    display: flex;
    justify-content: center;
}

.reconnect-btn {
    padding: 6px 12px;
    background-color: #ff9800;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.reconnect-btn:hover {
    background-color: #f57c00;
}

.reconnect-btn:active {
    background-color: #e65100;
}

/* 播放容器样式 */
.playback-container {
    margin-top: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.playback-container h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 12px;
}

.playback-container audio {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 24px;
    outline: none;
}

.playback-container hr {
    width: 80%;
    border: none;
    height: 1px;
    background-color: #ddd;
    margin: 10px 0;
}

.control-button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 5px;
}

.control-button:hover {
    background-color: #43A047;
}

.control-button:active {
    background-color: #388E3C;
}

/* 服务器音频播放器样式 */
.server-audio-container {
    margin-top: 25px;
    padding: 15px;
    background-color: #f3e5f5;
    border-radius: 8px;
    text-align: center;
}

.server-audio-container h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #6a1b9a;
}

.server-audio-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    background-color: #e1f5fe;
    color: #0277bd;
    margin-bottom: 12px;
}

.server-audio-status.playing {
    background-color: #e8f5e9;
    color: #2e7d32;
    animation: pulse 1.5s infinite;
}

.server-audio-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.autoplay-control {
    display: flex;
    align-items: center;
    background-color: #e8eaf6;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.85rem;
    width: 100%;
    justify-content: center;
    margin-bottom: 5px;
}

.autoplay-control input {
    margin-right: 8px;
}

.server-audio-info {
    font-size: 0.8rem;
    color: #555;
    padding: 8px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-top: 10px;
}

/* 控制按钮样式 */
.server-audio-controls .control-button {
    min-width: auto;
    padding: 8px 15px;
}

.server-audio-controls .control-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 媒体查询适配移动设备 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
        border-radius: 10px;
    }
    
    .record-button {
        width: 120px;
        height: 120px;
    }
    
    .record-icon {
        width: 50px;
        height: 50px;
    }
    
    .server-audio-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .autoplay-control {
        font-size: 0.8rem;
    }
} 