/* Space Type Generator - 独立样式 */

/* ============ 总览页 ============ */
.sti-page {
    min-height: 100vh;
    background: #f7f8fc;
}

.sti-hero {
    max-width: 1080px;
    margin: 24px auto 0;
    padding: 18px 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 12px;
    box-sizing: border-box;
}

.sti-hero-inner {
    text-align: center;
}

.sti-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    letter-spacing: -0.3px;
    display: inline;
}

.sti-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    display: inline;
    margin-left: 16px;
}

.sti-body {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 48px 60px;
}

/* --- 分类区 --- */
.sti-section {
    margin-bottom: 48px;
}

.sti-section:last-child {
    margin-bottom: 0;
}

.sti-section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.sti-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.sti-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

.sti-section-count {
    font-size: 12px;
    color: #999;
}

/* --- 卡片网格 --- */
.sti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

/* --- 卡片 --- */
.sti-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #eaedf3;
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.sti-card:hover {
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.sti-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.25s;
}

.sti-card:hover .sti-card-icon {
    transform: scale(1.08);
}

.sti-card-body {
    flex: 1;
    min-width: 0;
}

.sti-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 3px;
    line-height: 1.3;
}

.sti-card-desc {
    font-size: 12px;
    color: #8c8fa3;
    line-height: 1.5;
}

.sti-card-arrow {
    color: #c5c8d4;
    font-size: 12px;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.sti-card:hover .sti-card-arrow {
    color: #667eea;
    transform: translateX(3px);
}

/* --- 响应式 --- */
@media (max-width: 768px) {
    .sti-hero {
        margin: 16px 16px 0;
        padding: 14px 16px;
        border-radius: 10px;
    }
    .sti-body {
        padding: 24px 16px 40px;
    }
    .sti-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sti-body {
        padding: 32px 32px 48px;
    }
    .sti-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* legacy class compat */
.st-mode-grid { display: none; }
.st-index-container { display: none; }

/* ============ 模式独立页（三栏布局，复用词云样式） ============ */
.st-main-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    min-height: 90vh;
    box-sizing: border-box;
}

.st-content-container {
    display: flex;
    width: 100%;
    gap: 10px;
    margin-top: 20px;
    min-height: 80vh;
}

/* 左侧 tab 导航栏 */
.st-sidebar-nav {
    width: 70px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: fit-content;
    min-height: 80vh;
}

.st-sidebar-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.st-sidebar-nav .nav-item:hover {
    background-color: #e9ecef;
}

.st-sidebar-nav .nav-item.active {
    background-color: #007bff;
    color: white;
}

.st-sidebar-nav .nav-item i {
    font-size: 18px;
    margin-bottom: 4px;
}

.st-sidebar-nav .nav-item span {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
}

.st-sidebar-nav .nav-item--footer {
    margin-top: auto;
}

/* 中间设置区域 */
.st-edit-area {
    flex: 1;
    min-height: 0;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: calc(80vh + 5px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* 右侧预览区域 */
.st-canvas-area {
    flex: 3;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 80vh;
    position: relative;
    overflow: hidden;
}

/* Tab 内容 */
.st-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.st-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* flex 子项默认 min-width/min-height:auto 会限制内部滚动区；音乐 Tab 需纵向铺满 */
.st-edit-area > .st-tab-content.active {
    width: 100%;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
}

/* ============ 帮助面板 ============ */
.st-help-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: 8px;
}

.st-help-lead {
    font-size: 13px;
    line-height: 1.55;
    color: #555;
    margin: 0 0 16px;
}

.st-help-section {
    margin-bottom: 18px;
}

.st-help-section:last-child {
    margin-bottom: 0;
}

.st-help-heading {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-help-heading i {
    color: #007bff;
    font-size: 14px;
    width: 1.1em;
    text-align: center;
}

.st-help-section p {
    font-size: 13px;
    line-height: 1.55;
    color: #555;
    margin: 0;
}

/* ============ 文本面板 ============ */
.st-text-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.st-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.st-textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.st-textarea:focus {
    border-color: #007bff;
}

/* 颜色设置 */
.st-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.st-color-label {
    font-size: 12px;
    color: #555;
    min-width: 72px;
}

.st-color-picker {
    width: 32px;
    height: 24px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    -webkit-appearance: none;
}

.st-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.st-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.st-color-row--top-gap {
    margin-top: 10px;
}

.st-swatches-hint {
    font-size: 12px;
    color: #888;
    margin: 6px 0 8px;
}

.st-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}

button.st-swatch {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

button.st-swatch:hover {
    transform: scale(1.08);
    border-color: #999;
}

button.st-swatch.st-swatch-active {
    border-color: #007bff;
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.35);
}

.st-bg-upload-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.st-bg-upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.st-bg-upload-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #333;
}

.st-bg-upload-btn span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0f2f7;
    border: 1px solid #d8dce6;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.st-bg-upload-btn:hover span {
    background: #e4e8f0;
}

.st-bg-upload-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.st-bg-upload-clear {
    font-size: 12px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    cursor: pointer;
}

.st-bg-upload-clear:hover {
    border-color: #ccc;
    background: #fafafa;
}

.st-bg-upload-note {
    font-size: 11px;
    color: #999;
    margin: 8px 0 0;
    line-height: 1.4;
}

.st-bg-upload-note.st-bg-upload-suggest {
    margin-top: 4px;
}

.st-bg-upload-error {
    font-size: 11px;
    color: #c62828;
    margin: 6px 0 0;
}

/* ============ 参数面板 ============ */
.st-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.st-setting-group {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
}

.st-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f0f2f5;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: 600;
    color: #444;
}

.st-group-header i {
    font-size: 12px;
    width: 14px;
    text-align: center;
}

.st-group-header .toggle-icon {
    margin-left: auto;
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.st-group-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.st-group-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.st-group-body.collapsed {
    display: none;
}

/* 单个参数项 */
.st-setting-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.st-setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #666;
}

.st-setting-value {
    font-weight: 600;
    color: #333;
    min-width: 35px;
    text-align: right;
}

.st-setting-item input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

.st-setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
}

.st-setting-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #007bff;
}

.st-setting-item select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

/* ============ 预设面板 ============ */
.st-presets-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

@media (min-width: 400px) {
    .st-presets-panel {
        grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
    }
}

.st-preset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    text-align: center;
    line-height: 1.35;
    transition: all 0.2s;
}

.st-preset-btn:hover {
    border-color: #007bff;
    background: #f0f7ff;
    color: #007bff;
}

.st-preset-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: #fff;
}

/* ============ 导出面板 ============ */
.st-export-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.st-export-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.st-export-section-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 格式选择网格 */
.st-export-format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.st-format-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px 8px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: #fff;
}

.st-format-option input[type="radio"] {
    display: none;
}

.st-format-option i {
    font-size: 16px;
    color: #aaa;
    margin-bottom: 2px;
    transition: color 0.2s;
}

.st-format-option span {
    font-size: 12px;
    font-weight: 600;
    color: #444;
    line-height: 1.2;
}

.st-format-option small {
    font-size: 10px;
    color: #aaa;
}

.st-format-option:hover {
    border-color: #bcc;
    background: #f8faff;
}

.st-format-option.active {
    border-color: #007bff;
    background: #f0f7ff;
}

.st-format-option.active i {
    color: #007bff;
}

/* 尺寸选择网格 */
.st-export-size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.st-size-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.st-size-option input[type="radio"] {
    display: none;
}

.st-size-icon {
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    background: #f0f2f5;
    border-radius: 4px;
    padding: 2px 6px;
    margin-bottom: 2px;
    transition: all 0.2s;
}

.st-size-option span:last-child {
    font-size: 10px;
    color: #666;
}

.st-size-option:hover {
    border-color: #bcc;
}

.st-size-option.active {
    border-color: #007bff;
    background: #f0f7ff;
}

.st-size-option.active .st-size-icon {
    background: #007bff;
    color: #fff;
}

/* 自定义尺寸 */
.st-export-custom-size {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
}

.st-size-input {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.st-size-input:focus {
    border-color: #007bff;
}

.st-size-x {
    font-size: 12px;
    color: #999;
}

.st-size-unit {
    font-size: 11px;
    color: #999;
}

/* 动画参数行 */
.st-export-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-export-label {
    font-size: 12px;
    color: #555;
    min-width: 40px;
}

.st-export-select {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    background: #fff;
    transition: border-color 0.2s;
}

.st-export-select:focus {
    border-color: #007bff;
}

/* 进度条 */
.st-export-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-progress-bar {
    flex: 1;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}

.st-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #007bff, #00c6ff);
    border-radius: 3px;
    transition: width 0.3s;
}

.st-progress-text {
    font-size: 11px;
    color: #666;
    min-width: 36px;
    text-align: right;
}

/* 导出按钮 */
.st-export-btn {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.st-export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.st-export-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.st-export-btn.exporting {
    background: linear-gradient(135deg, #6c757d, #495057);
    pointer-events: none;
}

/* ============ 模式切换面板 ============ */
.st-mode-switch-panel {
    overflow-y: auto;
}

.stm-group {
    margin-bottom: 14px;
}

.stm-group:last-child {
    margin-bottom: 0;
}

.stm-group-label {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    letter-spacing: 0.5px;
    padding: 0 4px 6px;
    border-bottom: 1px solid #eee;
    margin-bottom: 6px;
}

.stm-group-label i {
    margin-right: 4px;
    font-size: 12px;
}

.stm-group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.stm-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #444;
    font-size: 14px;
    line-height: 1;
    background: #fff;
    border: 1px solid #e8e8e8;
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.stm-item i {
    font-size: 12px;
    color: var(--stm-accent, #667eea);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.stm-item span {
    flex-shrink: 0;
}

.stm-item:hover {
    background: #f0f0f0;
    border-color: #ccc;
    color: #222;
}

.stm-item.stm-active {
    background: var(--stm-accent, #667eea);
    border-color: var(--stm-accent, #667eea);
    color: #fff;
}

.stm-item.stm-active i {
    color: #fff;
}

/* ============ 预览 iframe 容器 ============ */
.st-preview-container {
    flex: 1;
    position: relative;
    background: #fff;
    min-height: 0; /* flex 子项占满剩余高度；父级 .st-canvas-area 已有 min-height */
}

.st-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
}

.st-preview-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f0f2f5;
    border-bottom: 1px solid #e5e5e5;
    gap: 10px;
}

.st-preview-toolbar .mode-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.st-preview-toolbar .back-link {
    font-size: 12px;
    color: #007bff;
    text-decoration: none;
}

.st-preview-toolbar .back-link:hover {
    text-decoration: underline;
}

/* ============ 音乐面板 ============ */
/* 音乐 Tab：中间栏纵向铺满，曲目列表占满标题与音量区之间的剩余高度并向下滚动 */
#music-tab.st-tab-content.active {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.st-music-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1;
    overflow: hidden;
    box-sizing: border-box;
}

.st-music-panel > .st-panel-title,
.st-music-panel > .st-music-categories {
    flex-shrink: 0;
}

.st-music-panel > .st-music-controls {
    flex-shrink: 0;
}

.st-music-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.st-music-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    white-space: nowrap;
    --st-cat-accent: #6b7280;
    --st-cat-bg: #f3f4f6;
}

/* 分类图标与选中态主题色（与 data-cat 对应） */
.st-music-cat-btn[data-cat="upbeat"] { --st-cat-accent: #d97706; --st-cat-bg: #fff7ed; }
.st-music-cat-btn[data-cat="healing"] { --st-cat-accent: #db2777; --st-cat-bg: #fdf2f8; }
.st-music-cat-btn[data-cat="light"] { --st-cat-accent: #0d9488; --st-cat-bg: #f0fdfa; }
.st-music-cat-btn[data-cat="jazz"] { --st-cat-accent: #7c3aed; --st-cat-bg: #f5f3ff; }
.st-music-cat-btn[data-cat="lofi"] { --st-cat-accent: #475569; --st-cat-bg: #f1f5f9; }
.st-music-cat-btn[data-cat="romantic"] { --st-cat-accent: #e11d48; --st-cat-bg: #fff1f2; }
.st-music-cat-btn[data-cat="guofeng"] { --st-cat-accent: #dc2626; --st-cat-bg: #fef2f2; }
.st-music-cat-btn[data-cat="natural"] { --st-cat-accent: #16a34a; --st-cat-bg: #f0fdf4; }
.st-music-cat-btn[data-cat="epic"] { --st-cat-accent: #2563eb; --st-cat-bg: #eff6ff; }
.st-music-cat-btn[data-cat="cute"] { --st-cat-accent: #c026d3; --st-cat-bg: #fdf4ff; }
.st-music-cat-btn[data-cat="daily"] { --st-cat-accent: #b45309; --st-cat-bg: #fffbeb; }
.st-music-cat-btn[data-cat="neutral"] { --st-cat-accent: #64748b; --st-cat-bg: #f8fafc; }

.st-music-cat-btn i {
    font-size: 11px;
    color: var(--st-cat-accent);
}

.st-music-cat-btn:hover:not(.active) {
    border-color: #c5ccd6;
    background: #fafbfc;
}

.st-music-cat-btn.active {
    border-color: var(--st-cat-accent);
    background: var(--st-cat-bg);
    color: var(--st-cat-accent);
}

.st-music-cat-btn.active i {
    color: var(--st-cat-accent);
}

.st-music-tracks {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    min-width: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* 清单未返回时：每类 20 条占位，与真实列表行高一致 */
.st-music-track--skeleton {
    pointer-events: none;
    cursor: default;
    border-color: #ececec;
    background: #fafbfc;
}

.st-music-skel-play {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e8eaed;
    animation: st-music-skel-pulse 1.1s ease-in-out infinite;
}

.st-music-skel-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.st-music-skel-line {
    border-radius: 4px;
    background: linear-gradient(90deg, #e8eaed 0%, #f0f2f5 45%, #e8eaed 90%);
    background-size: 200% 100%;
    animation: st-music-skel-shimmer 1.4s ease-in-out infinite;
}

.st-music-skel-line--title {
    height: 12px;
    width: 72%;
    max-width: 220px;
}

.st-music-skel-line--meta {
    height: 9px;
    width: 36px;
}

.st-music-skel-check {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #ececec;
    animation: st-music-skel-pulse 1.1s ease-in-out infinite;
}

@keyframes st-music-skel-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@keyframes st-music-skel-pulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

.st-music-tracks > .st-music-empty {
    width: 100%;
    box-sizing: border-box;
}

.st-music-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px;
    color: #bbb;
    font-size: 13px;
}

.st-music-empty i {
    font-size: 28px;
}

.st-music-track {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1.5px solid #eee;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    align-self: stretch;
    flex-shrink: 0;
}

.st-music-track:hover {
    border-color: #ccd;
    background: #fafbff;
}

.st-music-track.selected {
    border-color: #007bff;
    background: #f0f7ff;
}

.st-music-track.playing .st-music-track-play i {
    color: #007bff;
}

.st-music-track-play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.st-music-track-play:hover {
    background: #e0e0e0;
}

.st-music-track-play i {
    font-size: 12px;
    color: #666;
    transition: color 0.2s;
}

.st-music-track-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.st-music-track-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.st-music-track-duration {
    font-size: 11px;
    color: #999;
}

.st-music-track-select {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid #ddd;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.st-music-track-select:hover {
    border-color: #007bff;
}

.st-music-track-select i {
    font-size: 11px;
    color: transparent;
    transition: color 0.2s;
}

.st-music-track.selected .st-music-track-select {
    border-color: #007bff;
    background: #007bff;
}

.st-music-track.selected .st-music-track-select i {
    color: #fff;
}

.st-music-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1.5px solid #e8ecf2;
    border-radius: 8px;
    background: #f8faff;
}

.st-music-now-playing {
    display: flex;
    align-items: center;
    gap: 6px;
}

.st-music-now-label {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

.st-music-now-name {
    font-size: 13px;
    font-weight: 600;
    color: #007bff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.st-music-volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-music-volume-icon {
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
    cursor: pointer;
}

.st-music-volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

.st-music-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.st-music-volume-val {
    font-size: 12px;
    color: #666;
    min-width: 32px;
    text-align: right;
}

.st-music-deselect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.st-music-deselect-btn:hover {
    border-color: #e53e6b;
    color: #e53e6b;
    background: #fff5f7;
}

/* ============ 响应式 ============ */
@media (max-width: 992px) {
    .st-content-container {
        flex-direction: column;
        min-height: auto;
    }

    .st-sidebar-nav {
        flex-direction: row;
        width: 100%;
        min-height: auto;
        overflow-x: auto;
        padding: 5px;
    }

    .st-sidebar-nav .nav-item {
        flex-direction: row;
        gap: 4px;
        padding: 8px 12px;
        white-space: nowrap;
    }

    .st-sidebar-nav .nav-item i {
        margin-bottom: 0;
    }

    .st-sidebar-nav .nav-item--footer {
        margin-top: 0;
        margin-left: auto;
    }

    .st-edit-area {
        max-height: none;
        overflow: visible;
    }

    .st-canvas-area {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .st-index-container {
        padding: 10px;
    }

    .st-mode-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .st-mode-thumb {
        height: 100px;
    }
}
