/* ============================================================
   创意工坊（A 列表页 / B 详情页 / D 试玩入口）
   作用域：只写 #workshop-view 及其子元素 + 主菜单 6 按钮适配。
   风格：与 files/css/editor.css 一致的深色玻璃拟态。
   ============================================================ */

#workshop-view {
    --ws-bg: #0b1020;
    --ws-panel: rgba(15, 23, 42, 0.6);
    --ws-panel-2: rgba(24, 33, 59, 0.72);
    --ws-line: rgba(255, 255, 255, 0.1);
    --ws-text: #e5eefc;
    --ws-muted: #97a6c6;
    --ws-accent: #22c55e;
    --ws-accent-2: #3b82f6;
    --ws-danger: #ef4444;
    --ws-warn: #facc15;
    --ws-radius: 18px;
    --ws-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);

    position: fixed;
    inset: 0;
    z-index: 200; /* 与 #editor-view 同层：二者互斥，不同时显示 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--ws-text);
    font-size: 13px;
    font-family: 'SmileySans', 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background:
        radial-gradient(1200px 600px at 12% -12%, rgba(56, 189, 248, 0.10), transparent 60%),
        radial-gradient(900px 520px at 92% -4%, rgba(34, 197, 94, 0.08), transparent 55%),
        linear-gradient(180deg, #070d1a, #0b1020);
}

#workshop-view * {
    box-sizing: border-box;
}

#workshop-view input,
#workshop-view button {
    font-family: inherit;
}

/* 骨架/加载时的轻微淡出，避免闪烁 */
#workshop-view.ws-loading #ws-cards {
    opacity: 0.92;
}

.ws-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

/* ── 顶栏（文档 §3：56px）───────────────────────────────── */
#workshop-view .ws-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 14px;
    border-bottom: 1px solid var(--ws-line);
    background: rgba(8, 13, 26, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#workshop-view .ws-titlewrap {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

#workshop-view .ws-title-icon {
    font-size: 16px;
    line-height: 1;
}

#workshop-view .ws-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#workshop-view .ws-topright {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

#workshop-view .ws-back-arrow {
    font-size: 18px;
    line-height: 1;
    margin-right: 2px;
}

#workshop-view .ws-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--ws-line);
    background: rgba(148, 163, 184, 0.1);
    color: var(--ws-text);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease-out, border-color 0.18s ease-out, transform 0.12s ease-out;
}

#workshop-view .ws-icon-btn:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.35);
}

#workshop-view .ws-icon-btn:active {
    transform: scale(0.96);
}

#workshop-view .ws-icon-btn-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fecaca;
}

/* ── 离线条（文档 §9：顶部黄条）────────────────────────── */
#workshop-view .ws-offline {
    flex: 0 0 auto;
    padding: 7px 16px;
    font-size: 12px;
    color: #fde68a;
    background: rgba(250, 204, 21, 0.14);
    border-bottom: 1px solid rgba(250, 204, 21, 0.3);
}

/* ── 列表页（可滚动主体）───────────────────────────────── */
#workshop-view .ws-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 10px 16px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

#workshop-view .ws-body::-webkit-scrollbar,
#workshop-view .ws-detail::-webkit-scrollbar {
    width: 8px;
}

#workshop-view .ws-body::-webkit-scrollbar-thumb,
#workshop-view .ws-detail::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28);
    border-radius: 999px;
}

/* 工具条：搜索 + 只看已验证 + 随机 */
#workshop-view .ws-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 2px 0 8px;
}

#workshop-view .ws-search {
    flex: 1 1 240px;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 8px 0 10px;
    border-radius: 999px;
    border: 1px solid var(--ws-line);
    background: rgba(2, 6, 23, 0.55);
    transition: border-color 0.18s ease-out, box-shadow 0.18s ease-out;
}

#workshop-view .ws-search:focus-within {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

#workshop-view .ws-search-icon {
    flex: 0 0 auto;
    font-size: 13px;
    opacity: 0.75;
}

#workshop-view .ws-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ws-text);
    font-size: 13px;
}

#workshop-view .ws-search input::placeholder {
    color: rgba(151, 166, 198, 0.75);
}

#workshop-view .ws-search-clear {
    display: none; /* JS 控制：有搜索词时 flex */
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.22);
    color: #cbd5e1;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

#workshop-view .ws-search-clear:hover {
    background: rgba(148, 163, 184, 0.38);
}

#workshop-view .ws-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 8px;
    border-radius: 10px;
    color: var(--ws-muted);
    font-size: 12.5px;
    cursor: pointer;
    user-select: none;
}

#workshop-view .ws-check:hover {
    color: var(--ws-text);
}

#workshop-view .ws-check input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--ws-accent);
    cursor: pointer;
}

/* 排序 tab 行（最新 / 热门 / 最多通关 + 共 N 题） */
/* 2026-11-25（用户需求）：筛选按钮（沙漏图标）+ 下拉面板：类型 / 难度 / 格子数 */
#workshop-view .ws-filterbar {
    position: relative;
    padding: 10px 0 0;
}

#workshop-view .ws-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.55);
    color: var(--ws-muted);
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.18s ease-out, color 0.18s ease-out, border-color 0.18s ease-out;
}

#workshop-view .ws-filter-btn:hover {
    color: var(--ws-text);
    border-color: rgba(148, 163, 184, 0.4);
}

#workshop-view .ws-filter-btn.has-filter {
    color: #34d399;
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.14);
}

#workshop-view .ws-filter-ico {
    display: block;
    flex: 0 0 auto;
}

#workshop-view .ws-filter-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    width: min(330px, calc(100vw - 40px));
    max-height: min(62vh, 430px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(10, 16, 30, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#workshop-view .ws-filter-panel[hidden] {
    display: none;
}

#workshop-view .ws-filter-title {
    font-size: 11.5px;
    color: var(--ws-muted);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}

#workshop-view .ws-filter-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#workshop-view .ws-filter-opts button {
    height: 26px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.6);
    color: var(--ws-text);
    font-size: 12px;
    cursor: pointer;
}

#workshop-view .ws-filter-opts button.active {
    color: #0b1220;
    background: #34d399;
    border-color: #34d399;
    font-weight: 600;
}

#workshop-view .ws-filter-foot {
    display: flex;
    justify-content: flex-end;
}

#workshop-view .ws-filter-reset {
    height: 26px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: transparent;
    color: var(--ws-muted);
    font-size: 12px;
    cursor: pointer;
}

#workshop-view .ws-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 2px 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#workshop-view .ws-tab {
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ws-muted);
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.18s ease-out, color 0.18s ease-out, border-color 0.18s ease-out;
}

#workshop-view .ws-tab:hover {
    background: rgba(148, 163, 184, 0.12);
    color: var(--ws-text);
}

#workshop-view .ws-tab.active {
    color: #34d399;
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.14);
}

#workshop-view .ws-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--ws-muted);
}

/* ── 卡片墙（任务书：≥768px 3 列 / 480–767px 2 列 / <480px 1 列）── */
#workshop-view .ws-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 14px 0 6px;
}

#workshop-view .ws-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: var(--ws-radius);
    border: 1px solid var(--ws-line);
    background: linear-gradient(180deg, var(--ws-panel-2), rgba(15, 23, 42, 0.72));
    cursor: pointer;
    outline: none;
    transition: transform 0.18s ease-out, border-color 0.18s ease-out, box-shadow 0.18s ease-out;
}

#workshop-view .ws-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
}

#workshop-view .ws-card:active {
    transform: translateY(0);
}

#workshop-view .ws-card:focus-visible {
    border-color: var(--ws-accent-2);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

#workshop-view .ws-thumb-wrap {
    position: relative;
    flex: 0 0 88px;
    width: 88px;
    height: 88px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(2, 6, 23, 0.55);
}

#workshop-view .ws-thumb {
    display: block;
    width: 100%;
    height: 100%;
}

#workshop-view .ws-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

/* 被举报隐藏的作品：作者在「我的作品」里仍能看到，但整体压暗并打标记 */
#workshop-view .ws-card-hidden { opacity: 0.68; }
#workshop-view .ws-card-hidden .ws-thumb { filter: grayscale(0.55); }
#workshop-view .ws-flag {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.35);
}
#workshop-view .ws-hidden-note {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: rgba(127, 29, 29, 0.28);
}

/* 徽标 pill（文档 §7.2：20px / 详情 24px，必须带文字） */
#workshop-view .ws-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    background: rgba(2, 6, 23, 0.74);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#workshop-view .ws-badge-lg {
    height: 24px;
    padding: 0 10px;
    font-size: 12px;
}

#workshop-view .ws-badge-author {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.42);
    background: rgba(120, 53, 15, 0.42);
}

#workshop-view .ws-badge-community {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.42);
    background: rgba(6, 78, 59, 0.42);
}

#workshop-view .ws-badge-none {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.36);
    background: rgba(120, 53, 15, 0.28);
}

/* 难度角标 */
#workshop-view .ws-diff {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(2, 6, 23, 0.74);
    color: #cbd5e1;
    font-size: 10.5px;
    line-height: 1;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#workshop-view .ws-diff-lg {
    height: 24px;
    padding: 0 9px;
    font-size: 11.5px;
}

#workshop-view .ws-diff-easy,
#workshop-view .ws-diff-tutorial {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.4);
}

#workshop-view .ws-diff-normal,
#workshop-view .ws-diff-fraction {
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 0.4);
}

#workshop-view .ws-diff-hard {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
}

#workshop-view .ws-diff-expert {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.42);
}

#workshop-view .ws-diff-unsolvable {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.32);
}

/* 2026-11-20：关卡组（一整个难度合成一个作品） */
/* 2026-11-20：关卡组卡片与单关卡明显区分（左侧紫色竖条 + 紫色描边） */
#workshop-view .ws-card.ws-card-pack {
    border-color: rgba(167, 139, 250, 0.34);
}

#workshop-view .ws-card.ws-card-pack::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #a78bfa, #7c3aed);
    pointer-events: none;
}

#workshop-view .ws-card.ws-card-pack:hover {
    border-color: rgba(167, 139, 250, 0.6);
}

#workshop-view .ws-pack-flag {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.42);
    background: rgba(76, 29, 149, 0.24);
}

#workshop-view .ws-pack {
    margin: 10px 0 4px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.06);
    overflow: hidden;
}

#workshop-view .ws-pack-head {
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #c4b5fd;
    background: rgba(76, 29, 149, 0.18);
}

#workshop-view .ws-pack-list {
    margin: 0;
    padding: 4px 6px 6px;
    list-style: none;
    max-height: 168px;
    overflow: auto;
}

#workshop-view .ws-pack-lv {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 6px;
}

#workshop-view .ws-pack-lv:nth-child(odd) {
    background: rgba(148, 163, 184, 0.06);
}

#workshop-view .ws-pack-lv .idx {
    flex: 0 0 auto;
    min-width: 18px;
    text-align: right;
    opacity: 0.55;
    font-variant-numeric: tabular-nums;
}

#workshop-view .ws-pack-lv .nm {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#workshop-view .ws-pack-lv .df {
    flex: 0 0 auto;
    font-size: 11px;
    opacity: 0.65;
}

/* 卡片文字区 */
#workshop-view .ws-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 0 2px 2px;
}

#workshop-view .ws-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ws-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#workshop-view .ws-card-author {
    font-size: 11.5px;
    color: var(--ws-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#workshop-view .ws-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--ws-muted);
}

#workshop-view .ws-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

#workshop-view .ws-stat-big {
    font-size: 15px;
    color: #cbd5e1;
    gap: 5px;
}

#workshop-view .ws-card-tags,
#workshop-view .ws-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#workshop-view .ws-tag {
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    font-size: 10.5px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 加载更多 */
#workshop-view .ws-more-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0 24px;
}

#workshop-view .ws-more-wrap.ws-busy {
    opacity: 0.6;
}

/* ── 骨架屏（文档 §7.5：8 张灰卡，shimmer 1.2s）───────── */
#workshop-view .ws-skel {
    pointer-events: none;
}

#workshop-view .ws-skel-thumb {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

#workshop-view .ws-skel-line {
    height: 10px;
    margin-top: 8px;
    border-radius: 6px;
}

#workshop-view .ws-skel-thumb,
#workshop-view .ws-skel-line {
    background: linear-gradient(
        90deg,
        rgba(148, 163, 184, 0.1) 0%,
        rgba(148, 163, 184, 0.24) 50%,
        rgba(148, 163, 184, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: ws-shimmer 1.2s linear infinite;
}

@keyframes ws-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── 空态 / 错误态（文档 §9）────────────────────────────── */
#workshop-view .ws-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 56px 20px;
    text-align: center;
}

#workshop-view .ws-state-icon {
    font-size: 40px;
    line-height: 1;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
}

#workshop-view .ws-state-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ws-text);
}

#workshop-view .ws-state-desc {
    max-width: 460px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ws-muted);
}

#workshop-view .ws-state-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

#workshop-view .ws-state-detail {
    min-height: 260px;
}

#workshop-view .ws-pane-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 260px;
    color: var(--ws-muted);
    font-size: 13px;
}

/* ── 详情页（文档 §4.2）─────────────────────────────────── */
#workshop-view .ws-detail {
    /* JS 会把 display 设为 flex */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 16px 28px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

#workshop-view .ws-detail-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 26px;
    max-width: 1080px;
    margin: 0 auto;
}

#workshop-view .ws-detail-thumbwrap {
    min-width: 0;
}

#workshop-view .ws-detail-thumb {
    position: relative;
    width: 100%;
    max-width: 240px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--ws-line);
    background: rgba(2, 6, 23, 0.55);
    box-shadow: var(--ws-shadow);
}

#workshop-view .ws-detail-thumb-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

#workshop-view .ws-detail-thumb .ws-diff {
    position: absolute;
    left: 10px;
    top: 10px;
}

#workshop-view .ws-detail-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

#workshop-view .ws-detail-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

#workshop-view .ws-detail-meta {
    font-size: 12px;
    color: var(--ws-muted);
}

#workshop-view .ws-detail-badge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

#workshop-view .ws-detail-summary {
    margin: 0;
    font-size: 13px;
    line-height: 1.75;
    color: #cbd5e1;
    white-space: pre-wrap;
    word-break: break-word;
}

#workshop-view .ws-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#workshop-view .ws-detail-levelinfo {
    font-size: 12.5px;
    color: var(--ws-muted);
    line-height: 1.7;
}

#workshop-view .ws-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}

/* 2026-11-20（用户需求）：详情页三个按钮按可用宽度均分，窄屏才换行 */
#workshop-view .ws-detail-actions .ws-btn {
    flex: 1 1 auto;
    min-width: 0;
}

#workshop-view .ws-detail-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── 按钮层级（文档 §7.3：主 / 次 / 文字 / 危险，高 36px）── */
#workshop-view .ws-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(148, 163, 184, 0.12);
    color: var(--ws-text);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s ease-out, border-color 0.18s ease-out, transform 0.12s ease-out, opacity 0.18s ease-out;
}

#workshop-view .ws-btn:hover {
    background: rgba(148, 163, 184, 0.2);
}

#workshop-view .ws-btn:active {
    transform: scale(0.98);
}

#workshop-view .ws-btn:focus-visible {
    outline: 2px solid var(--ws-accent-2);
    outline-offset: 2px;
}

#workshop-view .ws-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

#workshop-view .ws-btn-primary {
    background: linear-gradient(180deg, #22c55e, #16a34a);
    border-color: rgba(255, 255, 255, 0.18);
    color: #04140a;
    font-weight: 700;
}

#workshop-view .ws-btn-primary:hover {
    background: linear-gradient(180deg, #34d399, #22c55e);
}

#workshop-view .ws-btn-ghost {
    border-color: var(--ws-line);
    background: rgba(148, 163, 184, 0.12);
}

#workshop-view .ws-btn-on {
    border-color: rgba(244, 114, 182, 0.45);
    background: rgba(244, 114, 182, 0.14);
    color: #f9a8d4;
}

#workshop-view .ws-btn-on:hover {
    background: rgba(244, 114, 182, 0.22);
}

#workshop-view .ws-btn-text {
    height: 32px;
    padding: 0 8px;
    border-color: transparent;
    background: transparent;
    color: var(--ws-muted);
}

#workshop-view .ws-btn-text:hover {
    background: rgba(148, 163, 184, 0.12);
    color: var(--ws-text);
}

#workshop-view .ws-btn-text-danger {
    color: #fca5a5;
}

#workshop-view .ws-btn-text-danger:hover {
    background: rgba(239, 68, 68, 0.16);
    color: #fecaca;
}

#workshop-view .ws-btn-danger {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

#workshop-view .ws-btn-danger:hover {
    background: rgba(239, 68, 68, 0.26);
}

#workshop-view .ws-btn-lg {
    height: 42px;
    padding: 0 20px;
    font-size: 14px;
    border-radius: 14px;
}

#workshop-view .ws-btn-sm {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 10px;
}

#workshop-view .ws-btn-count {
    font-size: 12px;
    opacity: 0.8;
}

/* ── 工坊内弹窗（举报原因 / 二次确认 / 帮助）───────────── */
#workshop-view .ws-modal {
    /* 复用全局 .modal 的居中与遮罩，这里只补容器 */
    align-items: center;
    justify-content: center;
}

#workshop-view .ws-modal-content {
    width: min(440px, 92vw);
    max-height: 86vh;
    overflow-y: auto;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--ws-line);
    background: linear-gradient(180deg, #111a2e, #0b1220);
    box-shadow: var(--ws-shadow);
}

#workshop-view .ws-modal-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
}

#workshop-view .ws-modal-body {
    font-size: 13px;
    line-height: 1.75;
    color: #cbd5e1;
    word-break: break-word;
}

#workshop-view .ws-modal-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

#workshop-view .ws-help-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── 响应式 ─────────────────────────────────────────────── */
@media (max-width: 767px) {
    #workshop-view .ws-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #workshop-view .ws-body {
        padding: 8px 12px 16px;
    }

    #workshop-view .ws-header {
        height: 52px;
        padding: 0 10px;
        gap: 8px;
    }

    #workshop-view .ws-title {
        font-size: 15px;
    }

    #workshop-view .ws-detail {
        padding: 14px 12px 22px;
    }

    #workshop-view .ws-detail-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    #workshop-view .ws-detail-thumb {
        max-width: 240px;
        margin: 0 auto;
    }

    #workshop-view .ws-detail-title {
        font-size: 18px;
    }
}

@media (max-width: 479px) {
    #workshop-view .ws-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    #workshop-view .ws-search {
        flex: 1 1 100%;
        max-width: none;
    }

    #workshop-view .ws-count {
        display: none;
    }
}

/* 极窄屏顶栏：隐藏"我的作品"的文字长度问题由紧凑按钮解决 */
@media (max-width: 420px) {
    #workshop-view .ws-topright .ws-btn-sm {
        padding: 0 8px;
        font-size: 11.5px;
    }
}

/* ── 动效偏好 ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #workshop-view *,
    #workshop-view *::before,
    #workshop-view *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
    }
}

/* ============================================================
   主菜单 6 个模式按钮适配（第 5/6 个为 关卡编辑器 / 创意工坊）
   说明：不修改 style.css；#start-modal 包着 #main-page，所以
   #start-modal .mode-btn 的 30px/34px 大号样式会作用到主菜单，
   这里用同特异性（#id .class）覆盖，再叠加 data-mode 配色。
   ============================================================ */
#main-mode-toggle {
    gap: 12px;
}

#main-mode-toggle .mode-btn {
    padding: 16px 12px;
    font-size: 24px;
    line-height: 1.25;
    border-radius: 22px;
    min-height: 44px;
}

#main-mode-toggle .mode-btn[data-mode="editor"] {
    border-color: rgba(168, 85, 247, 0.45);
    color: #d8b4fe;
    background: rgba(88, 28, 135, 0.24);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

#main-mode-toggle .mode-btn[data-mode="editor"]:hover {
    background: rgba(168, 85, 247, 0.22);
    border-color: rgba(168, 85, 247, 0.75);
}

#main-mode-toggle .mode-btn[data-mode="workshop"] {
    border-color: rgba(244, 114, 182, 0.45);
    color: #f9a8d4;
    background: rgba(131, 24, 67, 0.24);
    box-shadow: 0 0 10px rgba(244, 114, 182, 0.2);
}

#main-mode-toggle .mode-btn[data-mode="workshop"]:hover {
    background: rgba(244, 114, 182, 0.22);
    border-color: rgba(244, 114, 182, 0.75);
}

/* 矮屏（笔记本/横屏手机）：进一步收紧，保证 3 行按钮 + 说明都能放下 */
@media (max-height: 760px) {
    #main-mode-toggle {
        gap: 10px;
    }

    #main-mode-toggle .mode-btn {
        padding: 10px 10px;
        font-size: 19px;
        border-radius: 18px;
    }
}

/* 竖屏手机：6 个按钮单列会过高，改成 2 列 */
@media (orientation: portrait) and (max-width: 767px) {
    #main-mode-toggle {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    #main-mode-toggle .mode-btn {
        padding: 12px 8px;
        font-size: 17px;
        border-radius: 16px;
    }
}
