/* public/assets/css/audio/radio-generator.css */

.rad-wrapper { padding: 32px; border-radius: var(--radius-lg); }
.rad-header { text-align: center; margin-bottom: 40px; }
.rad-title { font-size: 2rem; font-weight: 800; color: var(--text-main); margin-bottom: 12px; letter-spacing: -0.5px; }
.rad-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 700px; margin: 0 auto; line-height: 1.6; }

.rad-workspace { display: flex; flex-direction: column; gap: 40px; max-width: 900px; margin: 0 auto; }

/* ================= 上部：Tab 表单面板 ================= */
.rad-panel { background: var(--bg-surface); padding: 24px; border: 1px solid var(--border-color); border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }

.rad-tabs { display: flex; flex-wrap: wrap; gap: 8px; background: var(--bg-body); padding: 6px; border-radius: 12px; margin-bottom: 24px; border: 1px solid var(--border-color); }
.rad-tab { flex: 1; min-width: 120px; padding: 12px 10px; text-align: center; border-radius: 8px; border: none; background: transparent; cursor: pointer; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); transition: all 0.2s ease; }
.rad-tab:hover { color: var(--text-main); }
.rad-tab.active { background: var(--bg-surface); color: var(--primary-color); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.rad-tab-content { display: none; animation: radFadeIn 0.3s ease; }
.rad-tab-content.active { display: block; }
@keyframes radFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.rad-form-group { margin-bottom: 20px; }
.rad-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rad-label { display: block; font-weight: 600; color: var(--text-main); font-size: 0.9rem; margin-bottom: 8px; }

.rad-input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border-color); border-radius: 10px; font-size: 0.95rem; background: var(--bg-body); color: var(--text-main); outline: none; transition: all 0.2s; box-sizing: border-box; }
.rad-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15); }
.rad-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.9rem; color: var(--text-muted); }

/* 🌟 核心修改 1：测试流按钮区域自动折行 (彻底解决遮盖和滚动不便的问题) */
.rad-test-streams-box { background: rgba(var(--primary-rgb), 0.05); padding: 12px 16px; border-radius: 12px; border: 1px dashed rgba(var(--primary-rgb), 0.3); margin-bottom: 24px; }
.rad-ts-label { font-size: 0.85rem; color: var(--primary-color); font-weight: 600; margin-bottom: 8px; }
.rad-ts-scroll { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 4px; }
.rad-test-btn { white-space: nowrap; padding: 6px 14px; font-size: 0.85rem; background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 20px; cursor: pointer; transition: 0.2s; font-weight: 500; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.rad-test-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* 滑块控制组 */
.rad-range-group { background: var(--bg-body); padding: 12px; border-radius: 12px; border: 1px solid var(--border-color); }
.rad-range-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rad-range-header .rad-label { margin: 0; }
.rad-range-inputs { display: flex; align-items: center; gap: 6px; }
.rad-input-num { width: 64px; padding: 4px 6px; border: 1px solid var(--border-color); border-radius: 6px; font-family: monospace; font-size: 0.9rem; text-align: center; background: var(--bg-surface); color: var(--text-main); outline: none; }
.rad-input-num:focus { border-color: var(--primary-color); }
.rad-unit { font-size: 0.85rem; color: var(--text-muted); }
.rad-range-slider { -webkit-appearance: none; width: 100%; height: 6px; background: #e2e8f0; border-radius: 3px; outline: none; margin: 0; }
.rad-range-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--primary-color); cursor: pointer; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.rad-btn-outline { background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; transition: 0.2s; font-weight: 500; }
.rad-btn-outline:hover { color: var(--primary-color); border-color: var(--primary-color); background: rgba(var(--primary-rgb), 0.05); }

/* 拾色器 */
.rad-color-picker-wrapper { display: flex; align-items: center; gap: 12px; background: var(--bg-body); border: 1.5px solid var(--border-color); padding: 8px 12px; border-radius: 10px; transition: 0.2s; }
.rad-color-picker-wrapper:hover { border-color: #cbd5e1; }
.rad-color-picker { -webkit-appearance: none; border: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; padding: 0; background: none; }
.rad-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.rad-color-picker::-webkit-color-swatch { border: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); }

/* 开关组件 */
.rad-switches-container { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rad-switch-group { display: flex; align-items: center; justify-content: space-between; background: var(--bg-body); padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border-color); transition: 0.2s; }
.rad-switch-group:hover { border-color: #cbd5e1; }
.rad-switch-info strong { display: block; font-size: 0.95rem; color: var(--text-main); margin-bottom: 4px; }
.rad-switch-info span { display: block; font-size: 0.8rem; color: var(--text-muted); }
.rad-switch-ui { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.rad-switch-ui input { opacity: 0; width: 0; height: 0; }
.rad-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .3s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 24px; }
.rad-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.rad-switch-ui input:checked + .rad-slider { background-color: var(--primary-color); }
.rad-switch-ui input:checked + .rad-slider:before { transform: translateX(20px); }


/* ================= 下部：展示台与代码生成 ================= */
.rad-showcase { display: flex; flex-direction: column; gap: 20px; }

.rad-panel-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin: 0; display: flex; align-items: center; justify-content: space-between; }
.rad-status-badge { font-size: 0.75rem; background: #10b981; color: white; padding: 4px 10px; border-radius: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }

/* 画布 */
.rad-canvas { position: relative; background-color: #f8fafc; background-image: radial-gradient(#cbd5e1 1px, transparent 1px); background-size: 20px 20px; border: 1px solid var(--border-color); border-radius: 16px; padding: 60px 40px; display: flex; align-items: center; justify-content: center; min-height: 240px; overflow-x: auto; box-shadow: inset 0 2px 10px rgba(0,0,0,0.02); }
.rad-canvas::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(var(--primary-rgb), 0.1) 0%, transparent 60%); pointer-events: none; }

/* 🌟 核心修改 2：加入 max-width: 100% 防止在移动端固定像素溢出 */
.rad-player-widget {
    --rad-bg: #1e293b; --rad-theme: #3b82f6; background-color: var(--rad-bg);
    border-radius: 16px; padding: 16px 20px; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-sizing: border-box; position: relative; z-index: 2; margin: 0 auto;
    width: 100%; max-width: 100%;
}
.rad-widget-inner { display: flex; align-items: center; gap: 16px; height: 100%; }

.rad-cover { position: relative; width: 72px; height: 72px; border-radius: 14px; overflow: hidden; background: rgba(0,0,0,0.2); flex-shrink: 0; box-shadow: 0 8px 16px rgba(0,0,0,0.2); transition: 0.3s; border: 1px solid rgba(255,255,255,0.1); }
.rad-cover img { width: 100%; height: 100%; object-fit: cover; }
.rad-eq-animation { position: absolute; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; gap: 3px; opacity: 0; transition: opacity 0.3s; backdrop-filter: blur(2px); }
.rad-eq-animation span { display: block; width: 4px; height: 12px; background: var(--rad-theme); border-radius: 2px; }

.rad-player-widget.is-playing .rad-eq-animation { opacity: 1; }
.rad-player-widget.is-playing .rad-eq-animation span { animation: rad-eq 1s ease-in-out infinite alternate; }
.rad-player-widget.is-playing .rad-eq-animation span:nth-child(1) { animation-delay: 0.1s; }
.rad-player-widget.is-playing .rad-eq-animation span:nth-child(2) { animation-delay: 0.3s; }
.rad-player-widget.is-playing .rad-eq-animation span:nth-child(3) { animation-delay: 0.0s; }
.rad-player-widget.is-playing .rad-eq-animation span:nth-child(4) { animation-delay: 0.2s; }
@keyframes rad-eq { 0% { height: 6px; } 100% { height: 26px; } }

.rad-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.rad-info h2 { margin: 0 0 6px 0; font-size: 1.25rem; font-weight: 700; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 4px rgba(0,0,0,0.3); letter-spacing: -0.3px; }
.rad-status { margin: 0; font-size: 0.85rem; color: rgba(255,255,255,0.6); display: flex; align-items: center; gap: 6px; }
.rad-status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; transition: 0.3s; }
.rad-player-widget.is-playing .rad-status::before { background: var(--rad-theme); box-shadow: 0 0 8px var(--rad-theme); }
.rad-player-widget.is-error .rad-status::before { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.rad-controls { flex-shrink: 0; display: flex; align-items: center; gap: 16px; }
.rad-vol-box { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.7); }
.rad-vol-slider { -webkit-appearance: none; width: 64px; height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; outline: none; }
.rad-vol-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--rad-theme); cursor: pointer; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.rad-vol-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--rad-theme); cursor: pointer; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.rad-btn-play { width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--rad-theme); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 8px 20px -5px var(--rad-theme); outline: none; }
.rad-btn-play:hover { transform: scale(1.08); filter: brightness(1.1); }
.rad-btn-play:active { transform: scale(0.95); }

/* 开关效果 */
.rad-player-widget.hide-title .rad-info h2 { display: none; }
.rad-player-widget.hide-title .rad-info { justify-content: center; }
.rad-player-widget.is-compact { padding: 12px 16px; border-radius: 12px; }
.rad-player-widget.is-compact .rad-cover { width: 50px; height: 50px; border-radius: 10px; }
.rad-player-widget.is-compact .rad-info h2 { font-size: 1.05rem; margin-bottom: 2px; }
.rad-player-widget.is-compact .rad-btn-play { width: 44px; height: 44px; }
.rad-player-widget.is-compact .rad-vol-slider { width: 48px; }

/* IDE 代码区 */
.rad-code-section { background: #1e293b; border-radius: 12px; overflow: hidden; border: 1px solid #334155; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.rad-code-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #0f172a; border-bottom: 1px solid #334155; }
.rad-code-header span { color: #94a3b8; font-size: 0.85rem; font-family: ui-monospace, monospace; }
.rad-btn-copy { background: rgba(255,255,255,0.1); color: #e2e8f0; border: none; padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: 0.2s; }
.rad-btn-copy:hover { background: rgba(255,255,255,0.2); color: #fff; }
.rad-embed-code { width: 100%; height: 80px; padding: 16px; background: transparent; border: none; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.85rem; color: #a5b4fc; outline: none; resize: none; word-break: break-all; line-height: 1.5; }

/* SEO Blocks */
.rad-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 900px; margin: 0 auto; }
.rad-info-card { background: var(--bg-surface); padding: 24px; border-radius: 16px; border: 1px solid var(--border-color); }
.rad-info-card h3 { color: var(--text-main); font-size: 1.15rem; margin-bottom: 16px; }
.rad-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.rad-list li { font-size: 0.95rem; color: var(--text-muted); line-height: 1.5; }
.rad-ordered { counter-reset: rad-counter; }
.rad-ordered li { position: relative; padding-left: 28px; }
.rad-ordered li::before { counter-increment: rad-counter; content: counter(rad-counter); position: absolute; left: 0; top: 0; width: 20px; height: 20px; background: rgba(var(--primary-rgb), 0.1); color: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: bold; }

@media (max-width: 768px) {
    .rad-grid-2, .rad-switches-container, .rad-info-grid { grid-template-columns: 1fr; }
    .rad-canvas { padding: 40px 20px; }
}

/* 深色模式适配 */
[data-theme="dark"] .rad-panel, [data-theme="dark"] .rad-info-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .rad-tabs { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .rad-tab.active { background: #1e293b; }
[data-theme="dark"] .rad-input, [data-theme="dark"] .rad-color-picker-wrapper, [data-theme="dark"] .rad-range-group { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .rad-input-num { background: #1e293b; border-color: #475569; color: #f8fafc; }
[data-theme="dark"] .rad-range-slider { background: #334155; }
[data-theme="dark"] .rad-switch-group { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .rad-canvas { background-color: #0f172a; background-image: radial-gradient(#334155 1px, transparent 1px); border-color: #334155; }
[data-theme="dark"] .rad-canvas::before { background: radial-gradient(circle at center, rgba(var(--primary-rgb), 0.1) 0%, transparent 60%); }
[data-theme="dark"] .rad-slider { background-color: #475569; }

/* Embed 模式重置 */
body.is-embed-mode .pudiu-header, body.is-embed-mode .left-sidebar, body.is-embed-mode .right-sidebar, body.is-embed-mode footer, body.is-embed-mode .mobile-tabbar, body.is-embed-mode .rad-header, body.is-embed-mode .rad-settings, body.is-embed-mode .rad-panel-title, body.is-embed-mode .rad-code-section, body.is-embed-mode .tool-seo-article, body.is-embed-mode .breadcrumb { display: none !important; }
body.is-embed-mode { background: transparent !important; margin: 0; padding: 0; overflow: hidden; }
body.is-embed-mode .app-layout { display: block !important; margin: 0 !important; padding: 0 !important; max-width: none !important; }
body.is-embed-mode .rad-wrapper { padding: 0 !important; }
body.is-embed-mode .rad-workspace { display: block; margin: 0; max-width: none; }
body.is-embed-mode .rad-showcase { gap: 0; }
body.is-embed-mode .rad-canvas { padding: 0; background: transparent; border: none; box-shadow: none; display: block; min-height: auto; }
body.is-embed-mode .rad-canvas::before { display: none; }
body.is-embed-mode .rad-player-widget { border-radius: 0; box-shadow: none; height: 100vh; display: flex; align-items: center; justify-content: center; border: none; }