/* ============================================================
 * 样式工作室（style-studio.html）：深色高级感 + 玻璃态卡片 + 极光渐变按钮
 * 设计语言对齐 Figma/Adobe 创意套件：暗底、大圆角、半透明磨砂、细腻描边
 * ============================================================ */

body.ss-body {
    background: #0b0b12;
    color: #d8dae8;
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
}

/* ---- 顶栏 ---- */
.ss-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(15, 14, 26, .72);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    flex-wrap: wrap;
}
.ss-topbar .ss-back {
    color: #9aa0c8;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}
.ss-topbar .ss-back:hover { color: #e6e6f5; }
.ss-topbar h1 { font-size: 16px; font-weight: 700; margin: 0; white-space: nowrap; }
.ss-topbar .spacer { flex: 1; }
.ss-name-input, .ss-price-input {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    color: #e8e9f5;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
}
.ss-name-input { width: 180px; }
.ss-price-input { width: 90px; }
.ss-name-input:focus, .ss-price-input:focus { border-color: #7c8cff; }

/* 极光渐变按钮（主操作） */
.ss-btn {
    border: none;
    border-radius: 12px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(120deg, #5c54ec, #a855f7 55%, #38bdf8);
    background-size: 180% 180%;
    transition: background-position .4s ease, transform .15s ease, box-shadow .3s ease;
    box-shadow: 0 4px 18px rgba(92, 84, 236, .35);
    white-space: nowrap;
}
.ss-btn:hover { background-position: 90% 50%; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(168, 85, 247, .4); }
.ss-btn:active { transform: translateY(0); }
.ss-btn.ghost {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: none;
    color: #c9cbe0;
}
.ss-btn.ghost:hover { background: rgba(255, 255, 255, .12); transform: none; }

/* ---- 布局：左控制台 + 右预览 ---- */
.ss-layout {
    display: flex;
    gap: 18px;
    padding: 18px;
    align-items: flex-start;
}
.ss-panel {
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ss-stage { flex: 1; min-width: 0; position: sticky; top: 76px; }

/* 玻璃态模块卡片 */
.ss-module {
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 18px;
    padding: 16px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.ss-module > h3 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #eef0ff;
}
.ss-module .ss-mod-desc { font-size: 12px; color: #8b8fb0; margin: 0 0 12px; line-height: 1.6; }

/* 分段选择器（材质/背景模式） */
.ss-seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ss-seg button {
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    color: #b9bcd6;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.ss-seg button:hover { border-color: #7c8cff; color: #e6e6f5; }
.ss-seg button.on {
    background: linear-gradient(120deg, #5c54ec, #a855f7);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 12px rgba(92, 84, 236, .4);
}

/* 控件行 */
.ss-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ss-row label { flex: 0 0 84px; font-size: 12px; color: #9aa0c8; }
.ss-row input[type="range"] {
    flex: 1;
    accent-color: #8c9bff;
    height: 4px;
}
.ss-row .ss-val { flex: 0 0 44px; text-align: right; font-size: 11px; color: #7f83a8; font-variant-numeric: tabular-nums; }
.ss-row input[type="color"] {
    width: 42px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 8px;
    background: transparent;
    padding: 2px;
    cursor: pointer;
}
.ss-row select {
    flex: 1;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    color: #e8e9f5;
    padding: 7px 10px;
    font-size: 12px;
    outline: none;
}
.ss-row select option { background: #191926; }
.ss-row textarea {
    width: 100%;
    min-height: 84px;
    background: rgba(0, 0, 0, .35);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    color: #cde3ff;
    font-family: "Courier New", monospace;
    font-size: 12px;
    padding: 10px;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}
.ss-row textarea:focus { border-color: #7c8cff; }

.ss-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px dashed rgba(140, 155, 255, .5);
    background: rgba(92, 84, 236, .08);
    color: #a9b4ff;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.ss-upload-btn:hover { background: rgba(92, 84, 236, .18); border-color: #8c9bff; }
.ss-file-state { font-size: 11px; color: #7f83a8; margin-left: 8px; word-break: break-all; }

.ss-note {
    font-size: 12px;
    color: #8b8fb0;
    line-height: 1.7;
    background: rgba(168, 85, 247, .07);
    border: 1px solid rgba(168, 85, 247, .18);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 8px;
}
.ss-note strong { color: #c9a5f5; }

/* ---- 预览舞台 ---- */
.ss-preview {
    position: relative;
    height: calc(100vh - 140px);
    min-height: 480px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .09);
    background: linear-gradient(160deg, #0A0A0F, #1A0B2E);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.ss-bg-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#ssParticles, #ssLottie { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ss-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* 预览里的示意节点（结构对齐真实 .node-box：title + meta，buildSceneCss 的规则直接生效） */
.ss-preview .node-box {
    position: absolute;
    min-width: 132px;
    border-radius: 12px;
    border: 2px solid #5a67d8;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
    overflow: visible;
}
.ss-preview .node-box .node-title {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 1px solid #eef1f6;
    border-radius: 10px 10px 0 0;
    white-space: nowrap;
}
.ss-preview .node-box .node-meta { padding: 4px 14px; font-size: 11px; color: #718096; }

.ss-stage-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #6f7396;
    text-align: center;
}

/* 手机端：控制台在上、预览在下 */
@media (max-width: 900px) {
    .ss-layout { flex-direction: column; }
    .ss-panel { flex: none; width: 100%; box-sizing: border-box; }
    .ss-stage { position: static; width: 100%; }
    .ss-preview { height: 420px; }
    .ss-name-input { width: 130px; }
}
