

:root {
    --line: #eeeeea;
    --text: #22201c;
    --muted: #8e8b84;
    --ink: #22201c;
    --subtle: #b3aea3;
    --green: #18b365;
    --blue: #f6b800;
    --amber: #f6b800;
    --red: #e05252;
    --purple: #9b7a14;
    --shadow: 0 8px 22px rgba(33, 28, 16, 0.08);
}

.thsc-admin-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.thsc-admin-subhead h3 { margin: 0; font-size: 16px; }
.cloud-delivery-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
}
.cloud-delivery-item img {
    width: 34px;
    height: 26px;
    object-fit: contain;
}
.cloud-delivery-wear {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    white-space: nowrap;
}

#cloud-deliveries-subpanel .thsc-admin-table-wrap {
    width: calc(100% + 56px);
    margin-left: -28px;
    border-radius: 0;
}

/* 出货管理状态筛选：紧贴在 subtabs 右侧，高度和「云开任务状态」按钮一致（≈24px），
   保持 panel header 40px 总高不被拉高。hidden 时通过 [hidden] 全局规则彻底不占位。 */
.thsc-cloud-delivery-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    padding: 0;
    line-height: 1;
}
.thsc-cloud-delivery-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}
.thsc-cloud-delivery-toolbar .cloud-filter-select {
    min-width: 96px;
    height: 24px;
    padding: 0 24px 0 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    color: #111827;
    font-size: 12px;
    line-height: 22px;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.thsc-cloud-delivery-toolbar .cloud-filter-select:hover {
    border-color: #9ca3af;
}
.thsc-cloud-delivery-toolbar .cloud-filter-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .15);
}
.thsc-cloud-delivery-count {
    font-size: 12px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#panel-history .source-case-comp-view {
    flex: none;
    min-height: 0;
    height: auto;
    padding: 6px 10px;
    border: 1px solid #e8e6e0;
    border-radius: 6px;
    background: #fafafa;
    color: #000;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
#panel-history .source-case-comp-view:hover {
    border-color: #d9d4c8;
    background: #f3f3f3;
    color: #000;
}
#panel-history .source-case-comp-view:focus-visible {
    outline: 2px solid #c8c4bc;
    outline-offset: 2px;
}

* {
    box-sizing: border-box;

    -webkit-tap-highlight-color: transparent;
}

button,
[role="button"],
.recipe-card {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

[hidden] {
    display: none !important;
}

button,
input,
select {
    font: inherit;
}

.quality-consumer { color: #b0c3d9; }
.quality-industrial { color: #5e98d9; }
.quality-milspec { color: #4b69ff; }
.quality-restricted { color: #8847ff; }
.quality-classified { color: #d32ce6; }
.quality-covert { color: #eb4b4b; }
.quality-contraband { color: #e4ae39; }
.quality-default { color: var(--text); }

.quality-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: auto;
    padding: 2px 8px;
    border-radius: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.quality-badge.quality-consumer { background: #b0c3d9; }
.quality-badge.quality-industrial { background: #5e98d9; }
.quality-badge.quality-milspec { background: #4b69ff; }
.quality-badge.quality-restricted { background: #8847ff; }
.quality-badge.quality-classified { background: #d32ce6; }
.quality-badge.quality-covert { background: #eb4b4b; }
.quality-badge.quality-contraband { background: #e4ae39; }
.quality-badge.quality-default { background: #64748b; }

.thsc-benefit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.thsc-benefit-head h2 { margin: 0 0 4px; color: #0f172a; font-size: 22px; }
.thsc-benefit-head p { margin: 0; color: #64748b; font-size: 13px; }
.thsc-benefit-state {
    padding: 28px 12px;
    color: #64748b;
    text-align: center;
}
.thsc-benefit-card { cursor: pointer; }
.thsc-benefit-card.is-settled {
    border-color: #d7dce3;
    background: #eceff3;
    box-shadow: none;
    filter: grayscale(1);
    opacity: .68;
}
.thsc-benefit-card.is-settled .recipe-card-media,
.thsc-benefit-card.is-settled .recipe-card-body {
    background: #eceff3;
}
.thsc-benefit-card.is-settled:hover {
    border-color: #c5cbd4;
    box-shadow: none;
    transform: none;
}
.thsc-benefit-card.is-participated {
    border-color: #818cf8;
}
.thsc-benefit-card.is-settled.is-participated {
    filter: none;
    opacity: .84;
}
.thsc-benefit-my-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    display: inline-flex;
    width: 25px;
    height: 25px;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(79, 70, 229, .92);
    color: #fff;
    box-shadow: 0 3px 10px rgba(79, 70, 229, .3);
}
.thsc-benefit-my-badge svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.thsc-benefit-status { background: rgba(15, 23, 42, .82); }
#thsc-modal-participate.thsc-benefit-detail .thsc-buy-btns { display: none; }
#thsc-modal-participate.thsc-benefit-detail .thsc-participate-balance {
    display: flex;
    max-width: 720px;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    white-space: normal;
}
.thsc-benefit-rule {
    color: #dc2626;
    font-weight: 800;
    line-height: 1.5;
}
#thsc-modal-participate.thsc-benefit-detail .thsc-participate-balance small {
    color: #64748b;
    font-weight: 600;
}
@media (min-width: 769px) {
    /* 活动详情第二行是说明性信息，保持左对齐并压缩桌面端垂直占用。 */
    #thsc-modal-participate.thsc-benefit-detail .thsc-buy-hero {
        gap: 4px;
        padding-top: 11px;
        padding-bottom: 8px;
    }
    #thsc-modal-participate.thsc-benefit-detail #thsc-buy-hero-row2 {
        justify-content: flex-start;
        align-items: flex-start;
        gap: 3px 12px;
        text-align: left;
    }
    #thsc-modal-participate.thsc-benefit-detail #thsc-buy-hero-row2 .detail-subtitle {
        font-size: 12px;
        line-height: 1.35;
    }
    #thsc-modal-participate.thsc-benefit-detail .thsc-benefit-rule {
        font-size: 13px;
        line-height: 1.35;
    }
    #thsc-modal-participate.thsc-benefit-detail .thsc-participate-balance small {
        font-size: 11px;
        line-height: 1.35;
    }
    #thsc-modal-participate.thsc-benefit-detail #thsc-modal-participate-hint {
        margin-top: 0;
        font-size: 11px;
        line-height: 1.35;
    }
}

.ghost-btn,
.primary-btn {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 900;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.ghost-btn {
    color: var(--text);
    border-color: #ebe5d4;
    background: #fffaf0;
}

.primary-btn {
    color: #5f4100;
    border-color: #f0c31d;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
}

.primary-btn:hover,
.ghost-btn:hover {
    border-color: rgba(251, 146, 60, 0.55);
    box-shadow: 0 12px 28px rgba(249, 115, 22, 0.18);
}

.ghost-btn.danger {
    color: #ef4444;
}

.mall-publish-card {
    width: min(480px, 96vw);
}

.mall-publish-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mall-publish-asm {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.mall-publish-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mall-publish-field > span {
    font-size: 13px;
    color: var(--muted);
}

.mall-publish-field input {
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 0 10px;
    background: #fff;
    color: var(--ink);
}

.mall-publish-hint {
    min-height: 18px;
    margin: 0;
    font-size: 12px;
    color: #b91c1c;
}

.mall-publish-foot {
    display: flex;
    justify-content: flex-end;
    padding: 0 24px 20px;
}

#mall-publish-submit {
    min-height: 0;
    height: auto;
    padding: 6px 14px;
    line-height: 1.2;
}

.thsc-admin-shell {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 18px;
}

.thsc-admin-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(54, 33, 22, 0.78);
    border: 1px solid rgba(251, 146, 60, 0.18);
    margin-bottom: 16px;
}

.thsc-admin-tabs {
    display: inline-flex;
    gap: 4px;
    background: rgba(15, 8, 4, 0.45);
    padding: 4px;
    border-radius: 10px;
}

.thsc-admin-tab {
    padding: 6px 14px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: #fde0bd;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}

.thsc-admin-tab.is-active {
    background: linear-gradient(180deg, #fdba74, #f97316);
    color: #4b1d05;
}

.thsc-admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thsc-admin-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(47, 29, 20, 0.92);
    border: 1px solid rgba(255, 214, 168, 0.14);
    color: #fff7ed;
    font-size: 13px;
}

.thsc-admin-row strong {
    display: block;
    color: #fed7aa;
    margin-bottom: 4px;
}

.thsc-admin-row .thsc-admin-actions {
    display: flex;
    gap: 6px;
}

.thsc-admin-detail-modal .thsc-modal-card {
    width: min(760px, 100%);
}

.thsc-admin-participants {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.thsc-admin-participant {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 70px 100px 100px;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(15, 8, 4, 0.45);
    border: 1px solid rgba(255, 214, 168, 0.1);
}

.thsc-admin-participant img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 720px) {
    .thsc-admin-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .thsc-admin-row .thsc-admin-actions {
        justify-content: flex-start;
    }
    .thsc-admin-participant {
        grid-template-columns: 32px 1fr;
        gap: 4px;
    }
    .thsc-admin-participant > :nth-child(n+3) {
        grid-column: 2 / -1;
    }
}

html, body.thsc-body { margin: 0; padding: 0; }

body.thsc-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1f2937;
    font-family: "PingFang SC", "PingFang TC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;

    background-color: #f3f4fb;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   背景 CS2 轮廓层（原色 + 灰色遮挡层双层结构）
   - <div id=thsc-bg-shapes> 承载 N 个 <img>，src 指向 /web_html/lksvg/*.svg。
     6 份彩色矢量插画由浏览器缓存，24 个实例共享。
   - 第 1 层：<img> 本体展示原始配色，透明度约 22%-38%（保留识别性但不喧宾夺主）；
              filter: saturate(0.72) contrast(0.9) 轻度降饱和，避免霓虹色刺眼。
   - 第 2 层：容器 ::after 铺一整层 body 同色系白雾（rgba(243,244,251,0.55)）叠在图上，
              进一步柔化，让 SVG 像"隔着一层毛玻璃"般融入背景。
   - 唯一被主线程更新的属性是容器上的 CSS 变量 --scroll，子元素通过 calc(...) 各自算位移，
     N 个 transform 由 GPU 合成，主线程负担 O(1)。
   - pointer-events:none + aria-hidden 保证零交互干扰、屏幕阅读器不朗读。
   ============================================================ */
.thsc-bg-shapes {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    /* 性能优化 1：contain 隔离 layout/paint/style，让容器成为独立的渲染子树；
       性能优化 2：filter 从每个 <img> 上移动到容器层，24 次滤镜运算 → 1 次。
       ::after 是纯灰色雾层，saturate/contrast 对它几乎无视觉影响，可以一起套。 */
    contain: layout paint style;
    filter: saturate(0.72) contrast(0.9);
    --scroll: 0px;
}

/* 灰色遮挡层：盖在所有 .thsc-bg-shape 之上，同色系白雾，柔化原色。
   同 stacking context 内 ::after 天然绘制在真实子元素之后，无需 z-index。 */
.thsc-bg-shapes::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(243, 244, 251, 0.45) 0%,
            rgba(243, 244, 251, 0.58) 100%
        );
    pointer-events: none;
}

.thsc-bg-shape {
    position: absolute;
    top: 0;
    left: 0;
    /* 尺寸/起终位/旋转/透明度/视差深度由 JS 通过 CSS 变量注入。 */
    width: var(--size, 96px);
    height: var(--size, 96px);
    object-fit: contain;
    opacity: 0;
    transform: translate3d(var(--x0, 0), -20vh, 0) rotate(var(--r0, 0deg));
    animation: thsc-bg-fall var(--duration, 4s) cubic-bezier(0.24, 1.05, 0.42, 1) var(--delay, 0s) forwards;
    will-change: transform, opacity;
    /* 性能优化 3：离开视口的形状跳过绘制（保留占位尺寸给合成器）。
       对固定 fixed 容器里的子元素同样有效——滚动时"越过视口范围"的形状会自动 skip render。 */
    content-visibility: auto;
    contain-intrinsic-size: 128px 128px;
    -webkit-user-drag: none;
    user-drag: none;
}

/* 触底后 JS 加 data-settled，切到纯视差表达 + 释放 will-change 让浏览器回收合成层。 */
.thsc-bg-shape[data-settled="true"] {
    animation: none;
    opacity: var(--o, 1);
    transform: translate3d(
        calc(var(--x1, 0) + var(--scroll, 0px) * var(--depth, 0.4)),
        var(--y1, 0),
        0
    ) rotate(var(--r1, 0deg));
    will-change: auto;
}

@keyframes thsc-bg-fall {
    0% {
        transform: translate3d(var(--x0, 0), -20vh, 0) rotate(var(--r0, 0deg));
        opacity: 0;
    }
    12% {
        opacity: var(--o, 1);
    }
    100% {
        transform: translate3d(var(--x1, 0), var(--y1, 0), 0) rotate(var(--r1, 0deg));
        opacity: var(--o, 1);
    }
}

/* 降级：用户偏好减少动效时直接静态贴底，跳过飘落。 */
@media (prefers-reduced-motion: reduce) {
    .thsc-bg-shape {
        animation: none;
        opacity: var(--o, 1);
        transform: translate3d(var(--x1, 0), var(--y1, 0), 0) rotate(var(--r1, 0deg));
        will-change: auto;
    }
}

/* 手机端：白雾稍加重，避免小屏上背景抢注意力。 */
@media (max-width: 767px) {
    .thsc-bg-shapes::after {
        background:
            linear-gradient(180deg,
                rgba(243, 244, 251, 0.55) 0%,
                rgba(243, 244, 251, 0.68) 100%
            );
    }
}

.thsc-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid #f1f5f9;
}

body.thsc-body {
    --thsc-topbar-offset: 47px;
}
.thsc-topbar-inner {
    width: min(960px, 100%);
    margin: 0 auto;
    padding: 1px 18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}
.thsc-topbar-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: #111827;
    letter-spacing: 1px;
}
.thsc-topbar-inner .thsc-cloud-filter-meta {
    margin-left: 0;
}

.thsc-seller-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    padding: 4px 6px 4px 4px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f9fafb;
    font-size: 12px;
    color: #374151;
    min-width: 0;
}

.thsc-seller-badge img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    background: #e5e7eb;
}

.thsc-seller-badge > span {
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.thsc-topbar-menu {
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
}
.thsc-topbar-menu:hover { background: #f9fafb; border-color: #d1d5db; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06); }
.thsc-topbar-menu svg { width: 20px; height: 20px; display: block; }
.thsc-topbar-menu[aria-expanded="true"] { background: #111827; color: #ffffff; border-color: #111827; }

.thsc-drawer {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}
.thsc-drawer[hidden] { display: none !important; }
.thsc-drawer-mask {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.32);
    pointer-events: auto;
    animation: thsc-fadein 0.2s ease;
}
.thsc-drawer-panel {
    position: relative;
    z-index: 1;
    width: min(360px, 92vw);
    height: 100%;
    background: #ffffff;
    border-left: 1px solid #f1f5f9;
    box-shadow: -16px 0 48px rgba(15, 23, 42, 0.12);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    color: #1f2937;
    animation: thsc-slidein 0.25s ease;
    overflow-y: auto;
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
    box-sizing: border-box;
}
@keyframes thsc-fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes thsc-slidein { from { transform: translateX(100%); } to { transform: translateX(0); } }

.thsc-drawer-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #1f2937;
    font-size: 20px;
    cursor: pointer;
    z-index: 5;
}
.thsc-drawer-close:hover { background: #f9fafb; }

.thsc-drawer-card {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 14px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    margin-top: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.thsc-drawer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f3f4f6;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #e5e7eb;
}
.thsc-drawer-id {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.thsc-drawer-id strong { font-size: 16px; color: #111827; word-break: break-all; }
.thsc-drawer-id small { color: #6b7280; font-size: 12px; }

.thsc-drawer-balance {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}
.thsc-drawer-balance > div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #f9fafb;
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #f3f4f6;
    min-width: 0;
}

.thsc-inv-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.thsc-drawer-balance .thsc-inv-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 2px;
    white-space: nowrap;
}
.thsc-drawer-balance .thsc-inv-title::after {
    content: "›";
    font-size: 17px;
    line-height: 1;
    color: #c0c6d0;
}
.thsc-inv-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.thsc-inv-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}
.thsc-drawer-balance .thsc-inv-label {
    display: inline;
    font-size: 11px;
    color: #9ca3af;
    margin: 0;
    white-space: nowrap;
}
.thsc-drawer-balance .thsc-inv-stat strong {
    display: inline;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;
    color: #2563eb;
}
.thsc-inv-stat small {
    font-size: 11px;
    color: #9ca3af;
}
.thsc-drawer-balance span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    white-space: nowrap;
}

.thsc-balance-recharge {
    border: none;
    padding: 2px 12px;
    border-radius: 999px;
    background: var(--green, #16a34a);
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.6;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.thsc-balance-recharge:hover { filter: brightness(0.94); text-decoration: none; }
.thsc-drawer-balance strong {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thsc-drawer-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}
.thsc-drawer-docs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding: 18px 8px 0;
    border-top: 1px solid #f1f5f9;
    color: #d1d5db;
    font-size: 13px;
}
.thsc-drawer-docs button {
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #4b5563;
    font: inherit;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease;
}
.thsc-drawer-docs button:hover {
    background: #f9fafb;
    color: #111827;
}
.thsc-drawer-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #f1f5f9;
    background: #ffffff;
    color: #1f2937;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.thsc-drawer-item:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.thsc-drawer-item:active { transform: scale(0.98); }
.thsc-drawer-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    flex-shrink: 0;
}
.thsc-drawer-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.thsc-drawer-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.thsc-drawer-label strong { font-size: 14px; color: #111827; }
.thsc-drawer-label small { font-size: 12px; color: #6b7280; }
.thsc-drawer-arrow { color: #9ca3af; font-size: 18px; }
.thsc-drawer-item-back {
    margin-top: 6px;
    border-style: dashed;
    border-color: #e5e7eb;
    background: #fafafa;
}

.thsc-entry-error {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 18px;
}
.thsc-entry-card {
    width: min(520px, 100%);
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 28px 26px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    text-align: left;
}
.thsc-entry-kicker {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #f3f4f6;
    color: #374151;
    margin-bottom: 14px;
    border: 1px solid #e5e7eb;
}
.thsc-entry-tip {
    margin: 0;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    letter-spacing: 0.04em;
}

.thsc-qr-login {
    width: min(360px, 100%);
    margin: 0 auto;
    padding: 28px 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    text-align: center;
}
.thsc-qr-login-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}
.thsc-qr-login-img {
    min-height: 220px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.thsc-qr-login-img img { width: 220px; height: 220px; object-fit: contain; }
.thsc-qr-login-img iframe { width: 220px; height: 220px; border: 0; }
.thsc-qr-login-tip {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.7;
    color: #6b7280;
}
.thsc-entry-card h2 { margin: 0 0 12px; font-size: 22px; color: #111827; }
.thsc-entry-card p { color: #4b5563; line-height: 1.6; margin: 0 0 18px; }
.thsc-entry-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.thsc-entry-hints {
    margin: 0;
    padding-left: 18px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.7;
}

.thsc-main {
    flex: 1;
    width: min(960px, 100%);
    margin: 0 auto;
    padding: 18px 16px 32px;
    box-sizing: border-box;
}
.thsc-app[hidden] { display: none; }

.thsc-row-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.thsc-plaza-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 10px;
    margin-bottom: 10px;
}
.thsc-plaza-quality {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #4b5563;
    font-weight: 500;
}
.thsc-plaza-quality-label { flex: 0 0 auto; }
.thsc-quality-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 25px;
    min-width: 88px;
    padding: 3px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.thsc-quality-trigger:hover,
.thsc-quality-trigger[aria-expanded="true"] {
    border-color: #c7d2fe;
}
.thsc-quality-trigger[aria-expanded="true"] {
    background: #eef2ff;
    color: #4338ca;
}
.thsc-quality-chevron {
    margin-left: auto;
    flex: 0 0 auto;
    opacity: 0.65;
    transition: transform 0.15s ease;
}
.thsc-quality-trigger[aria-expanded="true"] .thsc-quality-chevron {
    transform: rotate(180deg);
}
.thsc-quality-sheet[hidden] { display: none !important; }
.thsc-quality-sheet:not([hidden]) {
    position: absolute;
    inset: 0;
    z-index: 80;
    pointer-events: none;
}
.thsc-quality-sheet-mask {
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.42);
}
.thsc-quality-sheet-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 81;
    pointer-events: auto;
    max-height: min(62vh, 420px);
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
    background: #fff;
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.14);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.thsc-quality-sheet-handle {
    width: 36px;
    height: 4px;
    margin: 2px auto 10px;
    border-radius: 999px;
    background: #e5e7eb;
}
.thsc-quality-sheet-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    text-align: center;
}
.thsc-quality-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.thsc-quality-option {
    min-height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.thsc-quality-option:hover {
    border-color: #c7d2fe;
    color: #1f2937;
}
.thsc-quality-option.is-active {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4338ca;
    font-weight: 600;
}

@media (min-width: 768px) {
    .thsc-quality-sheet-mask { background: transparent; }
    .thsc-quality-sheet-panel {
        position: absolute;
        left: 0;
        right: auto;
        bottom: auto;
        top: calc(100% + 6px);
        width: 220px;
        max-height: 280px;
        padding: 8px;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    }
    .thsc-quality-sheet-handle,
    .thsc-quality-sheet-title { display: none; }
    .thsc-quality-options {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .thsc-quality-option {
        min-height: 34px;
        justify-content: flex-start;
        padding: 0 12px;
        text-align: left;
        background: #fff;
        border-color: transparent;
    }
    .thsc-quality-option.is-active {
        background: #eef2ff;
        border-color: transparent;
    }
}
.thsc-plaza-sorts {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.thsc-sort-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    width: fit-content;
    max-width: max-content;
    min-width: 0;
    min-height: 25px;
    margin: 0;
    padding: 3px 8px;
    border: 1px solid #e8e6e0;
    border-radius: 6px;
    background: #fff;
    color: #6b6760;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(33, 28, 16, 0.04);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.thsc-sort-chip:hover {
    color: var(--text);
    border-color: #d9d4c8;
    background: #faf9f6;
}
.thsc-sort-chip.is-active {
    border-color: #e6c84a;
    background: #fff8de;
    color: #8a6d00;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(154, 123, 0, 0.08);
}
.thsc-sort-arrow {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    color: inherit;
}
.thsc-sort-arrow:empty {
    display: none;
}

.thsc-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, max(250px, calc((100% - 30px) / 4))), 1fr));
    gap: 10px;
}

.recipe-card {
    position: relative;
    display: flex;
    min-height: 116px;
    overflow: hidden;
    border: 1px solid #f0f0ed;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(35, 31, 23, 0.07);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.recipe-card:hover {
    transform: translateY(-2px);
    border-color: #f1d35f;
    box-shadow: 0 8px 18px rgba(35, 31, 23, 0.11);
}

.recipe-card.is-disabled {
    cursor: default;
    opacity: 0.72;
}

.recipe-card.is-disabled:hover {
    transform: none;
    border-color: #f0f0ed;
    box-shadow: 0 4px 12px rgba(35, 31, 23, 0.07);
}

.recipe-card-media {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 108px;
    padding: 19px 12px 26px;
    background: linear-gradient(90deg, #fff 0%, #f8f8f6 100%);
}

.recipe-card-media img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    filter: drop-shadow(0 5px 6px rgba(20, 20, 20, 0.18));
}

.cost-tag {
    position: absolute;
    right: auto;
    bottom: 10px;
    left: 9px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    color: #26231f;
    background: transparent;
    font-size: 11px;
    font-weight: 900;
}

.cost-tag::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffc000;
    box-shadow: inset 0 0 0 2px #ffe58a;
}

.recipe-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 13px 12px 11px 10px;
}

.recipe-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 6px;
    white-space: nowrap;
}

.recipe-title {
    margin: 0;
    overflow: hidden;
    color: #171511;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 900;
    text-overflow: ellipsis;
}

.recipe-stat-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 4px 14px;
    min-width: 0;

    white-space: normal;
}

.inline-metric {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    min-width: 0;
    gap: 4px;
    color: #3a3732;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.inline-metric strong {
    flex: 0 0 auto;
    overflow: visible;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.inline-metric strong.green,
.inline-metric strong.blue,
.inline-metric strong.amber { color: var(--green); }
.inline-metric strong.red { color: var(--red); }

.profit-share {
    width: 100%;
    margin-top: 2px;
}

.profit-share-bar {
    display: flex;
    width: 100%;
    height: 9px;
    overflow: hidden;
    border: 1px solid #eee4cf;
    border-radius: 999px;
    background: #f7f2e8;
}

.profit-segment {
    display: block;
    min-width: 0;
    height: 100%;
}

.profit-high {
    background: linear-gradient(90deg, #15803d, #16a34a);
}

.profit-safe {
    background: linear-gradient(90deg, #86efac, #bbf7d0);
}

.profit-risk {
    background: linear-gradient(90deg, #ef4444, #fb7185);
}

.profit-share-labels {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
    color: #8c877d;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

.profit-label.high { color: #15803d; }
.profit-label.safe { color: #22c55e; }
.profit-label.risk { color: var(--red); }
.thsc-row-card {
    position: relative;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0;
    min-height: 180px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.thsc-row-card:hover {
    transform: translateY(-2px);
    border-color: #d1d5db;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
}
.thsc-row-card.is-disabled {
    cursor: not-allowed;
    opacity: 0.78;
    background: #fafafa;
}
.thsc-row-image {
    position: relative;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-right: 1px solid #f1f5f9;
}
.thsc-row-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    box-sizing: border-box;
}
.thsc-row-quality { position: absolute; top: 10px; left: 10px; z-index: 2; }
.thsc-row-status {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #111827;
    color: #ffffff;
    border: 1px solid #111827;
}
.thsc-row-status.thsc-status-2 {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
}
.thsc-row-status.thsc-status-3 {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.thsc-row-body {
    padding: 14px 16px 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 8px;
    min-width: 0;
}
.thsc-row-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thsc-row-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
    color: #4b5563;
    font-size: 13px;
}
.thsc-row-avatars { display: inline-flex; align-items: center; }
.thsc-row-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    background: #f3f4f6;
    margin-left: -8px;
    box-shadow: 0 0 0 1px #e5e7eb;
}
.thsc-row-avatar:first-child { margin-left: 0; }
.thsc-row-avatar-more {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: #111827;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: -8px;
}
.thsc-row-shares { font-size: 13px; color: #374151; font-weight: 600; }
.thsc-row-shares b { color: #111827; }
.thsc-row-shares em { font-style: normal; color: #111827; font-weight: 800; }

.thsc-row-line-cost b,
.thsc-row-line-range b { color: #111827; font-weight: 700; }
.thsc-row-line-cost-divider { color: #d1d5db; }
.thsc-row-progress {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: #f3f4f6;
    overflow: hidden;
    margin-top: 2px;
}
.thsc-row-progress span {
    display: block;
    height: 100%;
    background: #111827;
}

.thsc-empty {
    padding: 30px 18px;
    text-align: center;
    color: #6b7280;
    border-radius: 16px;
    border: 1px dashed #e5e7eb;
    background: #fafafa;
}
.thsc-loadmore { text-align: center; margin-top: 16px; }

.thsc-foot {
    margin-top: auto;
    padding: 11px 18px calc(11px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
}
.thsc-foot-divider { color: #d1d5db; }
.thsc-foot-filing {
    margin: 0;
    text-align: center;
    color: #6b7280;
    white-space: nowrap;
}
.thsc-foot-filing a {
    color: inherit;
    text-decoration: none;
}
.thsc-foot-filing a:hover {
    color: #1f2937;
    text-decoration: underline;
}

.thsc-view[hidden] { display: none !important; }

.thsc-view {
    width: min(640px, 100%);
    margin: 0 auto;
    color: #1f2937;
    box-sizing: border-box;
}

.thsc-recharge-records {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}
.thsc-recharge-records h4 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.thsc-recharge-record-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 10px;
    background: #fafafa;
    border: 1px solid #f1f5f9;
    font-size: 12.5px;
    color: #4b5563;
}
.thsc-recharge-record-row + .thsc-recharge-record-row { margin-top: 6px; }
.thsc-recharge-record-time { flex: 1; white-space: nowrap; }
.thsc-recharge-record-provider { color: #6b7280; }
.thsc-recharge-record-amount { color: #111827; font-size: 13px; }
.thsc-recharge-record-status { font-weight: 600; }
.thsc-recharge-record-status.is-ok { color: var(--green, #16a34a); }
.thsc-recharge-record-status.is-pending { color: #d97706; }
.thsc-recharge-record-status.is-fail { color: #dc2626; }

.thsc-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
}
.thsc-modal[hidden] { display: none !important; }
.thsc-modal-mask { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.42); }
.thsc-modal-card {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    max-height: 84vh;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 22px 22px 18px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
    color: #1f2937;
}
.thsc-modal-card-wide { width: min(640px, 100%); }

/* ============================================================
 * 活动福利 · 结算/查看弹窗
 *   settle 模式：显示表单 + 参与者预览表 + 确认结算按钮
 *   view   模式：隐藏表单，仅展示已结算的参与者分配明细
 * ========================================================= */
#admin-modal-benefit-settle .thsc-modal-card { width: min(760px, 100%); }
#admin-modal-benefit-settle[data-mode="view"] .thsc-benefit-settle-form { display: none; }
#admin-modal-benefit-settle[data-mode="settle"] .thsc-benefit-settle-view-only { display: none; }
.thsc-benefit-settle-participants {
    margin-top: 12px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
}
.thsc-benefit-settle-participants .thsc-admin-table-wrap {
    /* 覆盖默认 max-height，避免嵌套滚动容器 */
    max-height: none;
    overflow: visible;
}
.thsc-benefit-participants-table {
    font-size: 12.5px;
}
.thsc-benefit-participants-table th,
.thsc-benefit-participants-table td {
    padding: 8px 12px;
    white-space: nowrap;
}
.thsc-benefit-participants-table th:first-child,
.thsc-benefit-participants-table td:first-child { text-align: left; }
.thsc-benefit-participants-table th:not(:first-child),
.thsc-benefit-participants-table td:not(:first-child) { text-align: right; }
.thsc-benefit-participants-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.thsc-benefit-participants-user img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
    flex-shrink: 0;
}
.thsc-benefit-participants-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.thsc-benefit-participants-alloc {
    font-variant-numeric: tabular-nums;
    color: #b45309;
    font-weight: 600;
}
.thsc-benefit-participants-alloc.is-pending {
    color: #64748b;
    font-weight: 500;
}
.thsc-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #1f2937;
    font-size: 18px;
    cursor: pointer;
}
.thsc-modal-close:hover { background: #f9fafb; }
.thsc-modal-title { margin: 0 0 8px; color: #111827; font-size: 18px; }
.thsc-modal-desc { margin: 0 0 14px; color: #4b5563; font-size: 13px; line-height: 1.55; }
.thsc-amount-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.thsc-amount-presets button {
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    font-weight: 700;
}
.thsc-amount-presets button:hover { background: #f9fafb; border-color: #d1d5db; }
.thsc-modal-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #374151;
}
.thsc-modal-label input,
.thsc-modal-label select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #1f2937;
    font-size: 14px;
}
.thsc-modal-label input:focus,
.thsc-modal-label select:focus {
    outline: none;
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}

#thsc-modal-claim {
    overflow-y: auto;
}
#thsc-modal-claim .thsc-modal-mask {
    position: fixed;
}
#thsc-modal-claim .thsc-modal-card {
    position: relative;
    isolation: isolate;
    max-height: none;
    margin: auto;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, .78);
    background:
        radial-gradient(circle at 8% -8%, rgba(139, 123, 255, .22), transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(255, 210, 130, .2), transparent 55%),
        linear-gradient(158deg, #f8fafc 0%, #eef2ff 55%, #fdf6ec 100%);
    box-shadow:
        0 30px 70px rgba(15, 23, 42, .26),
        inset 0 1px 0 rgba(255, 255, 255, .7);
}

#thsc-modal-claim .thsc-modal-card::before {
    content: "";
    position: absolute;
    inset: -18%;
    z-index: -2;
    background-image: var(--claim-item-bg, none);
    background-repeat: no-repeat;
    background-position: 82% 68%;
    background-size: 78% auto;
    filter: blur(38px) saturate(1.2);
    opacity: .34;
    pointer-events: none;
}

#thsc-modal-claim .thsc-modal-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(255, 255, 255, .32) 0%, rgba(255, 255, 255, .1) 45%, rgba(255, 255, 255, .55) 100%);
    pointer-events: none;
}

#thsc-modal-claim .thsc-claim-item {
    background: rgba(255, 255, 255, .68);
    border-color: rgba(226, 232, 240, .8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#thsc-modal-claim .thsc-modal-title,
#thsc-modal-claim .thsc-modal-desc,
#thsc-modal-claim .thsc-modal-label > span {
    text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}

#thsc-modal-claim .thsc-modal-label {
    gap: 4px;
    margin-bottom: 8px;
}
#thsc-modal-claim .thsc-modal-label input,
#thsc-modal-claim .thsc-claim-select-trigger {
    height: 34px;
    padding: 6px 10px;
    font-size: 13px;
}
.thsc-claim-select {
    position: relative;
    width: 100%;
    min-width: 0;
}
.thsc-claim-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
}
.thsc-claim-select-trigger:hover {
    border-color: #d1d5db;
}
.thsc-claim-select-trigger.is-open {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}
.thsc-claim-select-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.thsc-claim-select-arrow {
    flex-shrink: 0;
    color: #6b7280;
    transition: transform .18s ease;
}
.thsc-claim-select-trigger.is-open .thsc-claim-select-arrow {
    transform: rotate(180deg);
}
.thsc-claim-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: 220px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    z-index: 40;
    padding: 4px;
}
.thsc-claim-select-dropdown[hidden] {
    display: none !important;
}
.thsc-claim-select-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
}
.thsc-claim-select-option:hover,
.thsc-claim-select-option.is-active {
    background: #f3f4f6;
}
.thsc-claim-select-option-title,
.thsc-claim-select-option-link {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.thsc-claim-select-option-title {
    font-size: 13px;
    font-weight: 600;
}
.thsc-claim-select-option-link {
    font-size: 12px;
    color: #6b7280;
}
.thsc-pay-method { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.thsc-pay-option {
    flex: 1;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.thsc-pay-option:hover { border-color: #d1d5db; background: #fafafa; }
.thsc-pay-option input { accent-color: #111827; }
.thsc-pay-logo { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; }

.thsc-asm-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}
.thsc-asm-metrics .metric { min-width: 0; gap: 1px; }
.thsc-asm-metrics .metric-label { font-size: 10px; }
.thsc-asm-metrics .metric-value {
    font-size: 12px;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}
.thsc-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.thsc-modal-hint { margin: 10px 0 0; color: #6b7280; font-size: 12.5px; }
.thsc-modal-hint.is-error { color: #b91c1c; }
.thsc-modal-hint.is-ok { color: #047857; }
.thsc-modal-payresult {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    border: 1px dashed #e5e7eb;
    background: #fafafa;
    text-align: center;
}
.thsc-modal-payresult img {
    max-width: 220px;
    height: auto;
    border-radius: 10px;
    background: white;
    padding: 6px;
    margin: 8px auto;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.thsc-qr-box {
    position: relative;
    display: inline-block;
    margin: 8px auto;
}
.thsc-modal-payresult .thsc-qr-img {
    margin: 0;
    display: block;
}
.thsc-modal-payresult .thsc-qr-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    max-width: 42px;
    padding: 4px;
    margin: 0;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    object-fit: contain;
}

.thsc-buy-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 16px 56px 12px 26px;
}
.thsc-buy-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 18px;
    width: 100%;
}
.thsc-buy-hero-row h2 { margin-bottom: 0; }
.thsc-buy-hero-row .detail-subtitle { margin: 0; flex: 0 1 auto; }

#thsc-modal-participate .item-name,
#thsc-modal-participate .outcome-name {
    font-size: 12px;
    text-align: left;
}

.thsc-buy-readonly #thsc-buy-hero-row2,
.thsc-buy-readonly .thsc-buy-bar { display: none !important; }

/*
 * 汰换预览弹窗顶部 hero 紧凑化：默认 .detail-hero(padding 26/18) 会盖住
 * .thsc-buy-hero 自己的 padding，导致 hero 高度偏大（168px+）。
 * 用 #thsc-modal-participate 前缀提升优先级把 padding / 行间距 / 字号一次压缩到位，
 * 保持内部 flex-column + 各行 flex-row 的原布局不变，仅缩小垂直占用。
 * 目标：整体高度较原始压缩 40%+（约 168px → ~100px）。
 * 注意：不影响 .thsc-benefit-detail 变体（其选择器优先级更高，已单独定义 compact）。
 */
#thsc-modal-participate .thsc-buy-hero {
    padding: 12px 56px 10px 26px;
    gap: 6px;
}
#thsc-modal-participate .thsc-buy-hero-row {
    gap: 6px 14px;
}
#thsc-modal-participate .thsc-buy-hero-row h2 {
    font-size: clamp(16px, 1.9vw, 19px);
    line-height: 1.3;
    margin: 0 0 3px;
}
#thsc-modal-participate .thsc-buy-hero .detail-subtitle {
    line-height: 1.4;
    font-size: 12.5px;
    margin-top: 0;
}
#thsc-modal-participate .thsc-buy-hero .detail-score {
    gap: 6px 16px;
}
#thsc-modal-participate .thsc-buy-hero .detail-score .metric {
    gap: 1px;
}
#thsc-modal-participate .thsc-buy-hero .detail-score .metric-label {
    font-size: 10.5px;
    line-height: 1.2;
}
#thsc-modal-participate .thsc-buy-hero .detail-score .metric-value {
    font-size: 14px;
    line-height: 1.35;
}
/* PC 端配方弹窗顶部 hero 重排（JS 在 desktop 断点把 #thsc-buy-score 移到第二行）：
   - 第 1 行：只剩标题 h2，左对齐即可
   - 第 2 行：subtitle（含 售价 ¥xx） | detail-score（4 指标） | actions（余额上 / 按钮下）
   - .thsc-buy-actions 改竖排，让 balance 和 btns 上下堆叠 */
@media (min-width: 681px) {
    #thsc-modal-participate #thsc-buy-hero-row2 {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px 18px;
        flex-wrap: nowrap;
    }
    #thsc-modal-participate #thsc-buy-hero-row2 > .detail-subtitle {
        flex: 0 1 auto;
        min-width: 0;
    }
    #thsc-modal-participate #thsc-buy-hero-row2 > #thsc-buy-score {
        flex: 1 1 auto;   /* 吃掉 subtitle 和 actions 之间的中间空间，视觉上"贴在 售价 右边" */
        justify-content: flex-start;
        margin-left: 4px;
    }
    #thsc-modal-participate #thsc-buy-hero-row2 > #thsc-buy-actions {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: flex-end;   /* 余额靠右，与下方按钮对齐 */
        gap: 4px;
        margin-left: 0;
    }
    #thsc-modal-participate #thsc-buy-hero-row2 > #thsc-buy-actions > .thsc-participate-balance {
        justify-content: flex-end;
    }
}
@media (max-width: 680px) {
    #thsc-modal-participate .thsc-buy-hero {
        padding: 6px 14px 6px;
    }
    #thsc-modal-participate .thsc-buy-hero-row h2 {
        font-size: 15px;
    }
    #thsc-modal-participate .thsc-buy-hero .detail-score .metric-value {
        font-size: 12px;
    }
    /* 移动端 4 个指标（保本率 / 期望收益 / 爆发率 / 收益区间）之前用 grid 4x1fr，
       每列宽度 = 行宽/4 ≈ 108px，实际内容只有 ~60-70px → 中间空出 ~40px 显得稀疏。
       改成 flex 内容自适应、整体宽度限制在 hero 的 80% 并靠左显示：
       - 右侧自然留出 20% 空间给绝对定位的关闭按钮，"收益区间"不会被 X 盖住
       - 指标之间只留 10px 列间距，看起来紧凑不再"隔那么宽" */
    #thsc-modal-participate .thsc-buy-hero .detail-score {
        display: flex;
        flex-wrap: nowrap;
        gap: 0 10px;
        justify-content: space-between;
        grid-template-columns: none;
        width: 80%;
        align-self: flex-start;
        box-sizing: border-box;
    }
    #thsc-modal-participate .thsc-buy-hero .detail-score .metric {
        flex: 0 1 auto;
        min-width: 0;
        text-align: left;
    }
}

.thsc-history-detail-btn {
    display: inline-flex;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #6681ff;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.thsc-history-detail-icon {
    width: 14px;
    height: 14px;
}
.thsc-history-detail-btn:hover {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #4f46e5;
    transform: translateY(-1px);
}
.thsc-history-detail-btn:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

.thsc-buy-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-left: auto;
}
.thsc-buy-actions .thsc-participate-balance {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    min-width: 0;
}
.thsc-buy-balance-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--muted);
}
.thsc-buy-balance-status.thsc-warn { color: #b91c1c; }
.thsc-buy-btns {
    display: flex;
    align-items: center;
    gap: 16px;
}
.thsc-buy-actions .thsc-modal-hint { width: 100%; margin: 0; }

/* 参与弹窗 / 上架售价确认按钮：对齐 BUFF 市场 i_Btn_mid / i_Btn_sub / i_Btn_D_red */
body.thsc-body #thsc-modal-participate .thsc-buy-btns .secondary-btn,
body.thsc-body #thsc-modal-participate .thsc-buy-btns .primary-btn,
body.thsc-body #thsc-modal-claim #thsc-sell-panel .thsc-modal-actions .secondary-btn,
body.thsc-body #thsc-modal-claim #thsc-sell-panel .thsc-modal-actions .primary-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    width: auto;
    height: 30px;
    min-height: 30px;
    padding: 0 15px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: none;
    transform: none;
    filter: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
body.thsc-body #thsc-modal-participate .thsc-buy-btns .secondary-btn,
body.thsc-body #thsc-modal-claim #thsc-sell-panel .thsc-modal-actions .secondary-btn {
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #959697 !important;
}
body.thsc-body #thsc-modal-participate .thsc-buy-btns .secondary-btn:hover,
body.thsc-body #thsc-modal-claim #thsc-sell-panel .thsc-modal-actions .secondary-btn:hover {
    background: #fff !important;
    color: #111 !important;
    border-color: #666 !important;
    box-shadow: none;
    transform: none;
}
body.thsc-body #thsc-modal-participate .thsc-buy-btns .primary-btn,
body.thsc-body #thsc-modal-claim #thsc-sell-panel .thsc-modal-actions .primary-btn {
    background: #e64343 !important;
    color: #fff !important;
    border: 1px solid #d83333 !important;
}
body.thsc-body #thsc-modal-participate .thsc-buy-btns .primary-btn:hover,
body.thsc-body #thsc-modal-claim #thsc-sell-panel .thsc-modal-actions .primary-btn:hover {
    background: #d83333 !important;
    border-color: #c62828 !important;
    box-shadow: none;
    transform: none;
    filter: none;
}
body.thsc-body #thsc-modal-participate .thsc-buy-btns .primary-btn:disabled,
body.thsc-body #thsc-modal-claim #thsc-sell-panel .thsc-modal-actions .primary-btn:disabled {
    background: #f3b4b4 !important;
    border-color: #efb0b0 !important;
    color: #fff !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    filter: none;
}

.thsc-buy-bar {
    flex: 0 0 auto;
    border-top: 1px solid var(--line);
    background: #fff;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
}
.thsc-buy-bar[hidden] { display: none; }
.thsc-buy-bar .thsc-buy-actions { gap: 8px; }
.thsc-buy-bar .thsc-participate-balance {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}
.thsc-buy-bar .thsc-buy-btns {
    width: 100%;
    justify-content: flex-end;
}
.thsc-buy-bar .secondary-btn,
.thsc-buy-bar .primary-btn {
    flex: 0 0 auto;
}

/*
 * 手机端 buy-bar 紧凑化：桌面 padding 10/12 + 三行说明 + hint 会累到 ~110-120px。
 * 移动端把 padding、行距、字号一起压缩（保留 safe-area-inset-bottom 避免刘海屏遮挡），
 * 只调尺寸不改 flex 结构，视觉不换布局。
 * 目标：119px → ~70-80px。
 */
@media (max-width: 680px) {
    #thsc-modal-participate .thsc-buy-bar {
        padding: 6px 12px calc(8px + env(safe-area-inset-bottom));
    }
    #thsc-modal-participate .thsc-buy-bar .thsc-buy-actions {
        gap: 4px 10px;
    }
    #thsc-modal-participate .thsc-buy-bar .thsc-participate-balance {
        gap: 2px;
    }
    #thsc-modal-participate.thsc-benefit-detail .thsc-benefit-rule {
        font-size: 12px;
        line-height: 1.3;
    }
    #thsc-modal-participate.thsc-benefit-detail .thsc-participate-balance small {
        font-size: 10.5px;
        line-height: 1.25;
    }
    #thsc-modal-participate #thsc-modal-participate-hint {
        font-size: 10.5px;
        line-height: 1.25;
        margin: 2px 0 0;
    }
}

@keyframes thsc-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 680px) {

    #thsc-modal-participate.detail-overlay {
        padding: 0;
        place-items: end stretch;
    }
    #thsc-modal-participate .detail-panel {
        width: 100%;
        max-height: 90vh;
        border-radius: 18px 18px 0 0;
        border-bottom: 0;
        animation: thsc-sheet-up 0.28s ease;
    }


    .thsc-buy-hero { gap: 6px; padding: 10px 14px 8px; }
    .thsc-buy-hero-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .thsc-buy-hero-row h2 { font-size: 17px; margin-bottom: 0; }
    .thsc-buy-hero .detail-subtitle { line-height: 1.3; }
    .thsc-buy-hero .detail-score {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    .thsc-buy-hero .detail-score .metric { min-width: 0; gap: 1px; }
    .thsc-buy-hero .detail-score .metric-label { font-size: 10px; }
    .thsc-buy-hero .detail-score .metric-value {
        font-size: 12px;
        text-decoration-thickness: 2px;
        text-underline-offset: 2px;
    }


    #thsc-modal-participate .detail-columns {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 14px 12px 16px;
    }
    #thsc-modal-participate .detail-section { padding: 0; }
    #thsc-modal-participate .detail-section > h3 { margin-bottom: 10px; }


    #thsc-modal-participate .material-grid,
    #thsc-modal-participate .group-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }


    #thsc-modal-participate .outcome-group {
        margin-bottom: 14px;
        border: 0;
        border-radius: 0;
        background: transparent;
        overflow: visible;
    }
    #thsc-modal-participate .group-header { padding: 0 0 8px; }
    #thsc-modal-participate .group-body { padding: 0; }


    #thsc-modal-participate .material-card,
    #thsc-modal-participate .outcome-card {
        height: auto;
    }
    #thsc-modal-participate .material-img,
    #thsc-modal-participate .outcome-img {
        height: 118px;
    }
    #thsc-modal-participate .material-info,
    #thsc-modal-participate .outcome-info {
        gap: 3px;
        padding: 6px 8px 8px;
    }
    #thsc-modal-participate .item-name,
    #thsc-modal-participate .outcome-name {
        font-size: 12px;
        text-align: left;
        white-space: normal;
        overflow: visible;
        line-height: 1.25;
    }
    #thsc-modal-participate .material-price-line,
    #thsc-modal-participate .outcome-price-line {
        flex-wrap: wrap;
        white-space: normal;
    }
    #thsc-modal-participate .material-case,
    #thsc-modal-participate .outcome-case {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    /* prob-sup 在移动端也走绝对定位（在 outcome-img 右上角），
       这里只微调尺寸与内边距，让触控目标不过大。 */
    #thsc-modal-participate .prob-sup {
        top: 4px;
        right: 4px;
        padding: 1px 6px;
        font-size: 10px;
    }
}

.thsc-history-list { display: flex; flex-direction: column; }
.thsc-history-row {
    padding: 14px 2px;
    border-bottom: 1px solid #e5e7eb;
}
.thsc-history-row:last-child { border-bottom: 0; }
.thsc-history-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.thsc-history-head strong { color: #111827; }
.thsc-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12.5px;
    color: #4b5563;
}
.thsc-history-price {
    margin-left: auto;
    font-weight: 700;
    color: #111827;
    font-size: 13px;
}

.thsc-ledger-filter {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 26px;
    min-width: 0;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}
.thsc-ledger-chip {
    position: relative;
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #64748b;
    padding: 0 2px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: color .2s ease;
}
.thsc-ledger-chip::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: var(--accent, #4f46e5);
    content: "";
    opacity: 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .25s cubic-bezier(.4, 0, .2, 1), opacity .25s ease;
}
.thsc-ledger-chip:hover { color: var(--accent-strong, #3730a3); }
.thsc-ledger-chip:hover::after {
    opacity: .45;
    transform: scaleX(.55);
}
.thsc-ledger-chip.is-active {
    background: transparent;
    color: var(--accent-strong, #3730a3);
}
.thsc-ledger-chip.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}
@media (max-width: 520px) {
    /* 移动端：所有 chip 用 flex:1 平分整条 tab 栏，形成一致的"等宽底部下划线
       tab"体验；避免 space-between 在 3 项/468px 场景下每两项间腾出 ~180px
       的空隙。claim-filter 变体在下一块里保留原有滚动样式，不受此改动影响。 */
    .thsc-ledger-filter {
        justify-content: stretch;
        gap: 4px;
    }
    .thsc-ledger-filter .thsc-ledger-chip {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 6px;
        min-height: 34px;
        font-size: 12px;
        letter-spacing: -.02em;
        text-align: center;
    }
}

.thsc-claim-filter {
    gap: 22px;
    margin: 0 0 12px;
    padding-right: 42px;
}
@media (max-width: 520px) {
    .thsc-ledger-filter.thsc-claim-filter {
        justify-content: flex-start;
        gap: 20px;
        padding-right: 44px;
    }
    .thsc-ledger-filter.thsc-claim-filter .thsc-ledger-chip {
        flex: 0 0 auto;
    }
}

/*
 * 管理后台按钮统一规范：
 * 严格复用首页 .detail-trend-btn 最终生效的紧凑灰底按钮样式。
 */
body.thsc-admin-shell-v2 button,
body.thsc-admin-shell-v2 button.primary-btn,
body.thsc-admin-shell-v2 button.secondary-btn,
body.thsc-admin-shell-v2 button.ghost-btn,
body.thsc-admin-shell-v2 button.primary-btn.danger,
body.thsc-admin-shell-v2 button.primary-btn.success,
body.thsc-admin-shell-v2 button.ghost-btn.danger,
body.thsc-admin-shell-v2 button.ghost-btn.success {
    box-sizing: border-box !important;
    display: inline-flex;
    width: auto;
    min-width: 0;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    align-items: center;
    justify-content: center;
    flex: none;
    gap: 4px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0 10px !important;
    border: 1px solid #e8e6e0 !important;
    border-radius: 6px !important;
    color: #000 !important;
    background: #fafafa !important;
    box-shadow: none !important;
    filter: none !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    vertical-align: middle;
    white-space: nowrap;
    cursor: pointer;
    transform: none !important;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

body.thsc-admin-shell-v2 button:hover:not(:disabled),
body.thsc-admin-shell-v2 button.primary-btn:hover:not(:disabled),
body.thsc-admin-shell-v2 button.secondary-btn:hover:not(:disabled),
body.thsc-admin-shell-v2 button.ghost-btn:hover:not(:disabled) {
    border-color: #d9d4c8 !important;
    color: #000 !important;
    background: #f3f3f3 !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
}

body.thsc-admin-shell-v2 button:focus-visible {
    outline: 2px solid #c8c4bc;
    outline-offset: 2px;
}

body.thsc-admin-shell-v2 button:disabled {
    border-color: #e8e6e0 !important;
    color: #9ca3af !important;
    background: #f3f3f3 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    opacity: .72;
}

body.thsc-admin-shell-v2 button[aria-selected="true"],
body.thsc-admin-shell-v2 button.is-active {
    border-color: #22201c !important;
    color: #fafafa !important;
    background: #22201c !important;
}

body.thsc-admin-shell-v2 button.danger,
body.thsc-admin-shell-v2 button.is-danger {
    color: #b91c1c !important;
}

body.thsc-admin-shell-v2 button.success {
    color: #166534 !important;
}

body.thsc-admin-shell-v2 button.thsc-modal-close,
body.thsc-admin-shell-v2 button.detail-close {
    width: 24px !important;
    padding: 0 !important;
}

/* 饰品市场管理后台 */
.item-market-toolbar {
    align-items: center;
    gap: 10px;
}

.item-market-toolbar .thsc-admin-tip {
    margin-left: auto;
}

.item-market-table-wrap {
    overflow-x: auto;
}

.item-market-table {
    min-width: 1260px;
}

.item-market-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 210px;
}

.item-market-item img {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border-radius: 8px;
    background: #f8fafc;
    object-fit: contain;
}

.item-market-item span,
.item-market-party,
.item-market-times {
    display: grid;
    gap: 3px;
}

.item-market-order-no {
    margin-bottom: 7px;
    color: #64748b;
    font-size: 12px;
}

.item-market-party + .item-market-party {
    margin-top: 8px;
}

.item-market-party code,
.item-market-table code {
    max-width: 220px;
    overflow: hidden;
    color: #64748b;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-market-steam-actions,
.item-market-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.item-market-issue {
    max-width: 190px;
    margin-top: 6px;
    color: #b45309;
    font-size: 12px;
    white-space: normal;
}

.item-market-times {
    margin-top: 7px;
    color: #64748b;
    font-size: 11px;
}

.item-market-status-paid_pending_delivery { background: #fef3c7; color: #92400e; }
.item-market-status-offer_sent { background: #dbeafe; color: #1d4ed8; }
.item-market-status-manual_review { background: #ffedd5; color: #c2410c; }
.item-market-status-completed { background: #dcfce7; color: #15803d; }
.item-market-status-refunded { background: #f1f5f9; color: #475569; }
.item-market-status-unknown { background: #f1f5f9; color: #475569; }

.thsc-ledger-tag {
    flex: 0 0 auto;
    padding: 2px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #f3f4f6;
    color: #6b7280;
}
.thsc-ledger-tag.is-recharge { background: #dcfce7; color: #15803d; }
.thsc-ledger-tag.is-consume { background: #fee2e2; color: #b91c1c; }
.thsc-ledger-tag.is-refund { background: #fef3c7; color: #b45309; }
.thsc-ledger-tag.is-reward { background: #fef9c3; color: #a16207; }
.thsc-ledger-tag.is-market { background: #ede9fe; color: #6d28d9; }
/* 云开汰换：靛青蓝，和"消费/饰品市场"区分开，一眼识别是云汰换出单 */
.thsc-ledger-tag.is-cloud { background: #dbeafe; color: #1d4ed8; }

.thsc-ledger-amount {
    margin-left: auto;
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
}
.thsc-ledger-amount--in { color: #16a34a; }
.thsc-ledger-amount--out { color: #dc2626; }
.thsc-activity-reward-meta {
    row-gap: 5px;
}
.thsc-activity-reward-meta span {
    padding: 2px 7px;
    border-radius: 5px;
    background: #fffbeb;
    color: #713f12;
}
.thsc-history-row .thsc-history-outcome {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    font-size: 12.5px;
    color: #1f2937;
}
.thsc-history-row .thsc-history-outcome img {
    width: 42px;
    height: 32px;
    object-fit: contain;
}
.thsc-claim-box {
    margin-top: 8px;
}
.thsc-claim-box .thsc-claim-btn {
    min-height: 0;
    padding: 5px 18px;
    font-size: 12.5px;
}
.thsc-claim-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.thsc-claim-form input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12.5px;
}
.thsc-claim-form .primary-btn {
    min-height: 0;
    padding: 5px 16px;
    font-size: 12.5px;
}
.thsc-claim-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #4b5563;
    word-break: break-all;
}
.thsc-claim-link .ghost-btn {
    min-height: 0;
    padding: 3px 12px;
    font-size: 12px;
    flex: 0 0 auto;
}

.thsc-doc-body { color: #374151; font-size: 13.5px; line-height: 1.75; }
.thsc-doc-body h4 { color: #111827; margin: 14px 0 6px; font-size: 14px; }
.thsc-doc-body p { margin: 6px 0; }
.thsc-doc-body ol,
.thsc-doc-body ul { margin: 6px 0 6px 18px; }
.thsc-doc-list {
    margin: 6px 0 12px 18px;
    color: #4b5563;
    line-height: 1.7;
    font-size: 13.5px;
}

.thsc-toast {
    position: fixed;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    border: 1px solid #111827;
    font-size: 13px;
    z-index: 4000;
    pointer-events: none;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
}
.thsc-toast[hidden] { display: none; }

body.thsc-body .primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    background: linear-gradient(135deg, #8b7bff 0%, #6a5bff 100%) !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 999px;
    padding: 5px 18px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(106, 91, 255, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
body.thsc-body .primary-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(106, 91, 255, 0.35);
}
body.thsc-body .primary-btn:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    filter: none;
}
body.thsc-body .secondary-btn,
body.thsc-body .ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    background: #ffffff !important;
    color: #6a5bff !important;
    border: 1px solid rgba(106, 91, 255, 0.45) !important;
    border-radius: 999px;
    padding: 5px 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
body.thsc-body .secondary-btn:hover,
body.thsc-body .ghost-btn:hover {
    background: rgba(106, 91, 255, 0.08) !important;
    border-color: #6a5bff !important;
}
body.thsc-body .link-btn {
    background: transparent !important;
    border: 0 !important;
    color: #6a5bff !important;
    font: inherit;
    cursor: pointer;
    padding: 0 4px;
    text-decoration: underline;
}

@media (max-width: 720px) {
    .thsc-topbar-inner { padding: 1px 14px; }
    .thsc-topbar-title { font-size: 18px; }
    body.thsc-body { --thsc-topbar-offset: 47px; }
    .thsc-main { padding: 14px 12px 28px; }
    #thsc-view-cloud { margin-top: -14px; }
    .thsc-row-card {
        grid-template-columns: 130px 1fr;
        min-height: 150px;
        border-radius: 16px;
    }
    .thsc-row-body { padding: 12px 12px 12px 14px; gap: 6px; }
    .thsc-row-title { font-size: 14px; }
    .thsc-row-line { font-size: 12.5px; gap: 8px; }
    .thsc-row-avatar,
    .thsc-row-avatar-more { width: 22px; height: 22px; margin-left: -7px; font-size: 10px; }
    .thsc-row-status { font-size: 10px; padding: 3px 8px; }
}
@media (max-width: 460px) {
    .thsc-row-card {
        grid-template-columns: 108px 1fr;
        min-height: 140px;
    }
    .thsc-row-body { padding: 10px 10px 10px 12px; gap: 6px; }
    .thsc-row-line { font-size: 12px; gap: 6px; }
    .thsc-row-title { font-size: 13.5px; }
    .thsc-foot {
        flex-wrap: wrap;
        column-gap: 8px;
        row-gap: 2px;
        font-size: 12.5px;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    }
    .thsc-foot-filing { flex-basis: 100%; }
    .thsc-modal { padding: 12px; }
    .thsc-modal-card { padding: 18px 16px 14px; border-radius: 16px; }
    .thsc-drawer-panel { width: 80vw; max-width: 80vw; padding: 16px 12px calc(20px + env(safe-area-inset-bottom)); }
    .thsc-drawer-card { padding: 14px 12px; gap: 10px; }
    .thsc-drawer-avatar { width: 48px; height: 48px; }
    .thsc-drawer-id strong { font-size: 15px; }
    .thsc-drawer-balance { grid-template-columns: 1fr 1fr; gap: 8px; }
    .thsc-drawer-balance > div { padding: 8px 10px; }
    .thsc-drawer-balance span { font-size: 11px; }
    .thsc-drawer-balance strong { font-size: 18px; }
    .thsc-drawer-balance .thsc-inv-stat strong { font-size: 14px; }
}

body.thsc-admin-shell-v2 {
    margin: 0;
    background: #f6f7fb;
    color: #1f2330;
    font-family: "PingFang SC", "PingFang TC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    min-height: 100vh;
}

.thsc-admin-mobile-block {
    display: none;
    padding: 32px 16px;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.thsc-admin-mobile-card {
    max-width: 360px;
    padding: 24px 20px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    text-align: center;
}
.thsc-admin-mobile-card h2 { margin: 0 0 8px; font-size: 18px; color: #111827; }
.thsc-admin-mobile-card p { margin: 0; color: #6b7280; font-size: 13px; line-height: 1.6; }

.thsc-admin-noauth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.thsc-admin-noauth-card {
    max-width: 420px;
    width: 100%;
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    text-align: center;
}
.thsc-admin-noauth-card h2 { margin: 0 0 8px; font-size: 20px; color: #111827; }
.thsc-admin-noauth-card p { color: #6b7280; font-size: 13px; line-height: 1.7; }
.thsc-admin-noauth-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}
.thsc-admin-noauth-actions .primary-btn,
.thsc-admin-noauth-actions .secondary-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    width: auto;
    height: 30px;
    min-height: 30px;
    padding: 0 15px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none;
    box-shadow: none;
    transform: none;
    filter: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.thsc-admin-noauth-actions .primary-btn {
    border: 1px solid #d83333 !important;
    background: #e64343 !important;
    color: #fff !important;
}
.thsc-admin-noauth-actions .primary-btn:hover {
    border-color: #c62828 !important;
    background: #d83333 !important;
    color: #fff !important;
    box-shadow: none;
    transform: none;
    filter: none;
}
.thsc-admin-noauth-actions .secondary-btn {
    border: 1px solid #959697 !important;
    background: #fff !important;
    color: #333 !important;
}
.thsc-admin-noauth-actions .secondary-btn:hover {
    border-color: #666 !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: none;
    transform: none;
}

.thsc-admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 60px 1fr;
    grid-template-areas: "topbar topbar" "sidebar main";
    min-height: 100vh;
}

.thsc-admin-topbar {
    grid-area: topbar;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.thsc-admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111827;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
}
.thsc-admin-userline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    font-size: 13px;
}
.thsc-admin-userhint {
    padding: 2px 8px;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 999px;
    font-size: 11px;
}
.thsc-admin-username { font-weight: 600; color: #111827; }

.thsc-admin-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: 60px;
    align-self: start;
    height: calc(100vh - 60px);
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}
.thsc-admin-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.thsc-admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.thsc-admin-nav-item:hover {
    background: #f3f4f6;
    color: #111827;
}
.thsc-admin-nav-item.is-active {
    background: #eef2ff;
    color: #1d4ed8;
    font-weight: 600;
}
.thsc-admin-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #f3f4f6;
    font-weight: 700;
    color: #1f2937;
}
.thsc-admin-nav-icon svg { display: block; }
.thsc-admin-nav-item.is-active .thsc-admin-nav-icon {
    background: #1d4ed8;
    color: #fff;
}
.thsc-admin-sidebar-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: flex-end;
}

.thsc-admin-sidebar-foot .ghost-btn {
    min-height: 0;
    padding: 4px 12px;
    font-size: 12px;
    line-height: 1.4;
}

.thsc-admin-plaza-card {
    margin-top: auto;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.thsc-admin-plaza-card + .thsc-admin-sidebar-foot {
    margin-top: 12px;
}

.thsc-admin-plaza-card h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    border-bottom: 1px dashed transparent;
}

.thsc-admin-plaza-card h4:hover {
    color: var(--green, #16a34a);
    border-bottom-color: currentColor;
}

.thsc-admin-plaza-qr {
    width: 120px;
    height: 120px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thsc-admin-plaza-qr img,
.thsc-admin-plaza-qr canvas {
    width: 108px !important;
    height: 108px !important;
}

.thsc-admin-plaza-card .ghost-btn {
    min-height: 0;
    padding: 5px 14px;
    font-size: 12px;
}

.thsc-admin-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.thsc-admin-pager .ghost-btn {
    min-height: 0;
    padding: 5px 14px;
    font-size: 12px;
}

.thsc-admin-pager .ghost-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.thsc-admin-pager-info {
    font-size: 12px;
    color: #6b7280;
}

.thsc-admin-usercell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.thsc-admin-usercell img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    background: #e5e7eb;
}

.thsc-admin-usercell .nick {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.thsc-admin-perm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.thsc-admin-perm-badge.is-on {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.thsc-admin-perm-badge.is-off {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

.thsc-admin-main {
    grid-area: main;
    padding: 22px 28px 40px;
    overflow-x: auto;
}

.thsc-admin-panel { display: none; }
.thsc-admin-panel.is-active { display: block; }

.thsc-admin-panel-head {
    margin-bottom: 16px;
}
.thsc-admin-panel-head--row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.thsc-admin-panel-head--row > div { min-width: 0; }
.thsc-cloud-head-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.thsc-cloud-head-left > .cloud-account-info {
    margin-left: 4px;
}
.thsc-cloud-head-left > .cloud-account-info[hidden] { display: none; }

#assembly-refresh-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: 29px;
    padding: 0 20px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1;
    transform: skewX(-12deg);
}
#assembly-refresh-btn > span {
    display: inline-block;
    transform: skewX(12deg);
}
#assembly-refresh-btn[disabled] { opacity: .6; cursor: not-allowed; }
.thsc-admin-panel-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
    color: #111827;
}
.thsc-admin-panel-head p { margin: 0; color: #6b7280; font-size: 13px; }

.thsc-admin-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 18px 14px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.thsc-admin-card h3 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #111827;
}
.thsc-admin-card-flat {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
/* ==========================================================================
   囤货工作台（thsc-admin.html #panel-hotmaterials）
   ========================================================================== */

.thsc-stocking-toolbar {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 4px 0 14px;
    border-bottom: 1px dashed #e2e8f0;
    margin-bottom: 14px;
}
.thsc-stocking-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #475569;
    min-width: 96px;
}
.thsc-stocking-toolbar .cloud-filter-select { min-width: 112px; }
.thsc-stocking-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.thsc-stocking-input {
    width: 112px;
    height: 32px;
    padding: 0 24px 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #0f172a;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.thsc-stocking-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}
.thsc-stocking-input-suffix {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 12px;
    pointer-events: none;
}
.thsc-stocking-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}
.thsc-stocking-toolbar-actions .primary-btn,
.thsc-stocking-toolbar-actions .ghost-btn {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
}

.thsc-stocking-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 10px;
    color: #334155;
    font-size: 13px;
    margin-bottom: 12px;
}
.thsc-stocking-summary[hidden] { display: none !important; }
.thsc-stocking-summary strong { color: #1d4ed8; font-weight: 700; }
.thsc-stocking-summary-item { white-space: nowrap; }
.thsc-stocking-summary-sep { color: #94a3b8; }
.thsc-stocking-summary-elapsed {
    margin-left: auto;
    color: #94a3b8;
    font-size: 12px;
}

.thsc-stocking-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 12px;
    color: #475569;
    font-size: 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    margin-bottom: 12px;
}
.thsc-stocking-state[hidden] { display: none !important; }
.thsc-stocking-state[data-kind="error"] { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.thsc-stocking-state[data-kind="empty"] { color: #64748b; }

/* ==========================================================================
   囤货工作台 · 主表（4 列：饰品详情 / 需求数据 / 参与配方 / 总需要）
   ========================================================================== */
.thsc-stocking-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}
.thsc-stocking-table-wrap[hidden] { display: none !important; }
.thsc-stocking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 900px;
    table-layout: fixed;
}
.thsc-stocking-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    z-index: 1;
}
.thsc-stocking-table thead th.col-item     { width: 26%; }
.thsc-stocking-table thead th.col-buckets  { width: 44%; }
.thsc-stocking-table thead th.col-recipes  { width: 20%; text-align: left; }
.thsc-stocking-table thead th.col-total    { width: 10%; text-align: right; }
.thsc-stocking-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}
.thsc-stocking-table tbody tr:last-child td { border-bottom: 0; }
.thsc-stocking-row:hover { background: #f8fafc; }
.thsc-stocking-row.is-recipes-open {
    background: linear-gradient(180deg, #eef2ff 0%, #ffffff 60%);
}

/* --- 列1：饰品详情 --- */
.thsc-stocking-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}
.thsc-stocking-thumb {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    flex-shrink: 0;
}
.thsc-stocking-item-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1;
}
.thsc-stocking-item-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: color .15s ease, border-color .15s ease;
}
.thsc-stocking-item-link:hover,
.thsc-stocking-item-link:focus-visible {
    color: #eab308;
    border-bottom-color: #eab308;
}
.thsc-stocking-item-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}
.thsc-stocking-item-name > span {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;
}
.thsc-stocking-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
/* .wear-tier-chip 全局默认 position:absolute，在这里改成 static 让它跟着 flex 排队 */
.thsc-stocking-item-meta .wear-tier-chip,
.thsc-stocking-bucket-row .wear-tier-chip {
    position: static;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}
.thsc-stocking-container {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    align-self: flex-start;
}
.thsc-stocking-container.is-empty {
    background: transparent;
    border: 1px dashed #e2e8f0;
    color: #94a3b8;
}
.thsc-stocking-stattrak {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 0 5px;
    height: 18px;
    border-radius: 3px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.thsc-stocking-quality {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #64748b;
    letter-spacing: 0.02em;
}
.thsc-stocking-quality.quality-milspec     { background: #4b69ff; }
.thsc-stocking-quality.quality-restricted  { background: #8847ff; }
.thsc-stocking-quality.quality-classified  { background: #d32ce6; }
.thsc-stocking-quality.quality-covert      { background: #eb4b4b; }
.thsc-stocking-quality.quality-extraordinary { background: linear-gradient(135deg, #eab308 0%, #b45309 100%); }

/* --- 列2：需求数据（每档一行，允许多行撑高） --- */
.thsc-stocking-bucket-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.thsc-stocking-bucket-row {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) 80px 80px 100px;
    align-items: center;
    gap: 8px 12px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
}
.thsc-stocking-bucket-range {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    color: #0f172a;
    font-weight: 600;
}
.thsc-stocking-bucket-need {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.thsc-stocking-bucket-need strong {
    color: #1d4ed8;
    font-size: 14px;
}
.thsc-stocking-bucket-price {
    color: #b45309;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.thsc-stocking-bucket-subtotal {
    color: #059669;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.thsc-stocking-bucket-empty {
    padding: 10px;
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
}

/* --- 列3：参与配方（可展开下拉） --- */
.thsc-stocking-recipes-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    color: #4338ca;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.thsc-stocking-recipes-toggle strong {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.thsc-stocking-recipes-toggle:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
}
.thsc-stocking-recipes-toggle.is-open {
    background: #4338ca;
    color: #fff;
    border-color: #4338ca;
}
.thsc-stocking-recipes-toggle-arrow {
    font-size: 10px;
    opacity: .8;
}
/* 展开的配方 subrow：只跨"需求数据 + 参与配方"两列，两侧留白 */
.thsc-stocking-recipes-subrow > td {
    background: linear-gradient(180deg, #eef2ff 0%, #ffffff 90%);
    padding: 0 !important;
    border-bottom: 1px solid #f1f5f9;
}
.thsc-stocking-recipes-gap { background: #fff !important; }
.thsc-stocking-recipes-slot { padding: 10px 12px 14px !important; }
.thsc-stocking-recipes-empty {
    padding: 12px;
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}

/* --- 配方列表：CSS 表格，6 列（配方标识 + 5 指标） --- */
.thsc-stocking-recipes-listbox {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.thsc-stocking-recipes-listhead,
.thsc-stocking-recipe-listrow {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) 1fr 1fr 1fr 1fr 1.2fr;
    align-items: center;
    gap: 8px 12px;
    padding: 8px 14px;
}
.thsc-stocking-recipes-listhead {
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1;
}
.thsc-stocking-recipes-listhead > div { text-align: right; }
.thsc-stocking-recipes-listhead > div:first-child { text-align: left; }

.thsc-stocking-recipes-listbody {
    max-height: 420px;
    overflow-y: auto;
}
.thsc-stocking-recipe-listrow {
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s ease;
    position: relative;
}
.thsc-stocking-recipe-listrow:last-child { border-bottom: 0; }
.thsc-stocking-recipe-listrow:hover { background: #f8fafc; }
.thsc-stocking-recipe-listrow:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: -2px;
}
/* 左侧盈亏色条 */
.thsc-stocking-recipe-listrow::before {
    content: "";
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 3px;
    background: #cbd5e1;
    border-radius: 0 2px 2px 0;
}
.thsc-stocking-recipe-listrow.is-profit::before { background: linear-gradient(180deg, #10b981, #059669); }
.thsc-stocking-recipe-listrow.is-loss::before   { background: linear-gradient(180deg, #ef4444, #dc2626); }

/* 配方标识列 */
.thsc-stocking-recipe-ident {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.thsc-stocking-recipe-ident-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.thsc-stocking-recipe-pfid {
    padding: 1px 7px;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    letter-spacing: 0.03em;
}
.thsc-stocking-recipe-quality {
    padding: 1px 6px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
}
.thsc-stocking-recipe-case {
    color: #475569;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 5 个指标单元格：默认右对齐，等宽字体 */
.thsc-stocking-recipe-cell {
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.thsc-stocking-recipe-cost { color: #b45309; }
.thsc-stocking-recipe-listrow.is-profit .thsc-stocking-recipe-roi { color: #059669; }
.thsc-stocking-recipe-listrow.is-loss   .thsc-stocking-recipe-roi { color: #dc2626; }
.thsc-stocking-recipe-price {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 12px;
}
/* --- 列4：总需要 --- */
.thsc-stocking-total {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
}
.thsc-stocking-total strong {
    font-size: 24px;
    font-weight: 800;
    color: #1d4ed8;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.thsc-stocking-total span {
    color: #64748b;
    font-size: 12px;
}
.thsc-stocking-total-hint {
    margin-top: 4px;
    text-align: right;
    color: #94a3b8;
    font-size: 11px;
}
.thsc-stocking-table td.col-total { text-align: right; }

/* --- 配方详情弹窗 --- */
.thsc-stocking-recipe-modal .thsc-stocking-recipe-card {
    max-width: 560px;
    width: 92vw;
}
.thsc-stocking-recipe-modal .thsc-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 16px;
}
.thsc-stocking-recipe-modal .thsc-modal-desc {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #475569;
    font-size: 13px;
}
.thsc-stocking-recipe-modal-body { margin: 8px 0 16px; }
.thsc-stocking-recipe-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.thsc-stocking-recipe-modal-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.thsc-stocking-recipe-modal-metric-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}
.thsc-stocking-recipe-modal-metric strong {
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.thsc-stocking-recipe-modal-metric.is-cost strong    { color: #b45309; }
.thsc-stocking-recipe-modal-metric.is-is-profit strong,
.thsc-stocking-recipe-modal-metric.is-profit strong  { color: #059669; }
.thsc-stocking-recipe-modal-metric.is-is-loss strong,
.thsc-stocking-recipe-modal-metric.is-loss strong    { color: #dc2626; }
.thsc-stocking-recipe-modal-metric.is-warn strong    { color: #d97706; }

@media (max-width: 900px) {
    .thsc-stocking-toolbar { gap: 10px; }
    .thsc-stocking-toolbar label { min-width: 84px; }
    .thsc-stocking-input { width: 96px; }
    .thsc-stocking-toolbar-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
    .thsc-stocking-summary-elapsed { margin-left: 0; width: 100%; }
    .thsc-stocking-table { min-width: 780px; }
    .thsc-stocking-bucket-row {
        grid-template-columns: auto 1fr;
        row-gap: 4px;
    }
    .thsc-stocking-bucket-need,
    .thsc-stocking-bucket-price,
    .thsc-stocking-bucket-subtotal {
        text-align: left;
    }
    .thsc-stocking-recipe-modal-grid { grid-template-columns: 1fr; }
}

.thsc-admin-formline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin-bottom: 10px;
}
.thsc-admin-panel-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}
.thsc-benefit-add-btn {
    flex: 0 0 auto;
    min-height: 0;
    height: 32px;
    padding: 0 16px;
    border-radius: 0;
    font-size: 13px;
}
.thsc-benefit-modal-tabs {
    margin-bottom: 14px;
}
.thsc-admin-formline-inline {
    flex-wrap: wrap;
    row-gap: 8px;
}
.thsc-admin-formline-inline input[type="text"] {
    flex: 0 1 280px;
    min-width: 0;
    height: 30px;
    padding: 0 10px;
}
.thsc-admin-formline-inline .primary-btn {
    flex: 0 0 auto;
    min-height: 0;
    height: 30px;
    padding: 0 16px;
    font-size: 13px;
    line-height: 1;
}
.thsc-admin-formline-inline .ghost-btn {
    flex: 0 0 auto;
    min-height: 0;
    height: 30px;
    padding: 0 14px;
    font-size: 13px;
    line-height: 1;
}
.thsc-admin-formline-inline .thsc-admin-tip { flex: 0 0 auto; white-space: nowrap; }
.thsc-admin-formline .thsc-admin-filter-check,
.thsc-admin-filter-check {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #4b5563;
    white-space: nowrap;
    cursor: pointer;
}
.thsc-admin-filter-check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    accent-color: #6366f1;
    cursor: pointer;
}
.thsc-admin-formgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.thsc-publish-marketline {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 13px;
    color: #4b5563;
}
.thsc-publish-marketline strong {
    color: #16a34a;
    font-size: 15px;
    font-weight: 700;
}
.thsc-admin-formgrid label,
.thsc-admin-formline label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #4b5563;
}
.thsc-admin-formfull { grid-column: 1 / -1; }
.thsc-admin-formgrid input,
.thsc-admin-formgrid select,
.thsc-admin-formline input,
.thsc-admin-formline select {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-size: 13px;
}
.thsc-admin-formgrid input:focus,
.thsc-admin-formline input:focus,
.thsc-admin-formgrid select:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.thsc-admin-tip {
    font-size: 12px;
    color: #6b7280;
}
.thsc-admin-tip[data-level="error"] { color: #dc2626; }
.thsc-admin-tip[data-level="ok"] { color: #16a34a; }
.thsc-admin-tip[data-level="info"] { color: #4b5563; }

.thsc-admin-formline-inline select {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 8px;
}
.thsc-admin-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.thsc-admin-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
}
.thsc-admin-stat-label {
    font-size: 12px;
    color: #6b7280;
}
.thsc-admin-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}
.thsc-admin-stat-profit { color: #16a34a; }
.thsc-admin-stat-profit[data-negative="1"] { color: #dc2626; }

.thsc-admin-snapshot {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed #d1d5db;
    background: #fafafa;
}
.thsc-admin-snapshot-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px 14px;
    font-size: 13px;
    color: #374151;
}
.thsc-admin-snapshot-grid { margin-top: 10px; }
.thsc-admin-outcome-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px;
}
.thsc-admin-outcome {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
}
.thsc-admin-outcome-name { color: #111827; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thsc-admin-outcome-rate { color: #4b5563; }

.thsc-admin-listing-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.thsc-admin-mini-tab {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 999px;
    font-size: 12px;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.thsc-admin-mini-tab:hover { color: #111827; }
.thsc-admin-mini-tab.is-active {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}

.thsc-admin-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.thsc-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #1f2937;
    background: #fff;
}
.thsc-admin-table thead th {
    background: #f9fafb;
    color: #4b5563;
    font-weight: 600;
    text-align: left;
    padding: 6px 12px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.thsc-admin-table tbody td {
    padding: 5px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.thsc-admin-table tbody tr:last-child td { border-bottom: none; }

#panel-publish .thsc-admin-table tbody td { padding-top: 11px; padding-bottom: 11px; }
.thsc-admin-table-empty {
    padding: 22px 12px;
    text-align: center;
    color: #9ca3af;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}
.thsc-admin-table-loading {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #475569;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
}
.thsc-admin-table-loading[hidden] { display: none !important; }
.thsc-admin-loading-spinner {
    width: 18px;
    height: 18px;
    flex: none;
    border: 2px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: thsc-admin-loading-spin .75s linear infinite;
}
@keyframes thsc-admin-loading-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .thsc-admin-loading-spinner { animation: none; }
}
.thsc-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.thsc-admin-actions .ghost-btn,
.thsc-admin-actions .primary-btn,
.thsc-admin-actions .secondary-btn {
    min-height: 0;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.3;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
}
.thsc-admin-actions .primary-btn {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}
.thsc-admin-actions .ghost-btn.danger {
    color: #b91c1c;
    border-color: #fca5a5;
}
.thsc-admin-actions .ghost-btn:hover { background: #f3f4f6; }
.thsc-admin-actions .primary-btn:hover { background: #1e40af; border-color: #1e40af; }

body.thsc-admin-shell-v2 .thsc-modal-actions .primary-btn,
body.thsc-admin-shell-v2 .thsc-modal-actions .secondary-btn,
body.thsc-admin-shell-v2 .thsc-modal-actions .ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: 34px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}
body.thsc-admin-shell-v2 .thsc-modal-actions .primary-btn {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}
body.thsc-admin-shell-v2 .thsc-modal-actions .secondary-btn:hover,
body.thsc-admin-shell-v2 .thsc-modal-actions .ghost-btn:hover {
    background: #f3f4f6;
}
body.thsc-admin-shell-v2 .thsc-modal-actions .primary-btn:hover {
    background: #1e40af;
    border-color: #1e40af;
}
body.thsc-admin-shell-v2 .thsc-modal-actions .ghost-btn.danger {
    color: #b91c1c;
    border-color: #fca5a5;
}

.thsc-admin-settle-summary {
    background: #f3f4f6;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    color: #1f2937;
    font-size: 13px;
}

body.thsc-admin-shell-v2 .primary-btn.danger {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
}
body.thsc-admin-shell-v2 .primary-btn.danger:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}
body.thsc-admin-shell-v2 .primary-btn.success {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #fff !important;
}
body.thsc-admin-shell-v2 .primary-btn.success:hover {
    background: #15803d !important;
    border-color: #15803d !important;
}

.thsc-stage-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.thsc-stage-chip.thsc-stage-0 {
    background: #fee2e2;
    color: #b91c1c;
}
.thsc-stage-chip.thsc-stage-1 {
    background: #fef3c7;
    color: #92400e;
}
.thsc-stage-chip.thsc-stage-2 {
    background: #dcfce7;
    color: #15803d;
}
.thsc-stage-chip.thsc-stage-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.thsc-ship-outcome-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 2px;
}

.thsc-ship-outcome {
    display: block;
    position: relative;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
}
.thsc-ship-outcome .outcome-card { cursor: pointer; }
.thsc-ship-outcome:hover { border-color: #93c5fd; }
.thsc-ship-outcome.selected {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
}
.thsc-ship-outcome input[type="radio"] { display: none; }

.thsc-ship-outcome-legacy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.thsc-ship-outcome-legacy:hover {
    border-color: #93c5fd;
}
.thsc-ship-outcome-legacy.selected {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.18);
}
.thsc-ship-outcome-legacy input[type="radio"] {
    display: none;
}
.thsc-ship-outcome-legacy img {
    width: 84px;
    height: 64px;
    object-fit: contain;
}
.thsc-ship-outcome-name {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}
.thsc-ship-outcome-meta {
    font-size: 11px;
    color: #6b7280;
}

.thsc-history-user,
.thsc-history-outcome {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #1f2937;
}
.thsc-history-user img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}
.thsc-history-outcome img {
    width: 34px;
    height: 26px;
    object-fit: contain;
}

.thsc-history-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}
.thsc-history-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed #e5e7eb;
}
.thsc-history-detail-row:last-child {
    border-bottom: 0;
}
.thsc-history-detail-key {
    flex: 0 0 110px;
    color: #6b7280;
    font-weight: 600;
}
.thsc-history-detail-val {
    flex: 1;
    color: #1f2937;
    word-break: break-all;
}
.thsc-admin-share-head,
.thsc-admin-share-row {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 0.8fr 1fr 0.8fr;
    gap: 8px;
    padding: 6px 10px;
    font-size: 12px;
}
.thsc-admin-share-head {
    background: #f9fafb;
    border-radius: 8px;
    color: #4b5563;
    font-weight: 600;
}
.thsc-admin-share-row + .thsc-admin-share-row {
    border-top: 1px dashed #e5e7eb;
}
.thsc-admin-settle-preview {
    margin: 10px 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px;
}

.thsc-admin-detail-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #fff;
}
.thsc-admin-detail-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.thsc-admin-detail-head h4 { margin: 0; font-size: 16px; color: #111827; }

.thsc-admin-detail-head .quality-badge { position: static; }
.thsc-admin-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px 14px;
    color: #4b5563;
    font-size: 12px;
}
.thsc-admin-detail-h4 {
    margin: 14px 0 6px;
    font-size: 13px;
    color: #1f2937;
}
.thsc-admin-participants {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
}
.thsc-admin-participant {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr 0.8fr 0.8fr;
    gap: 6px;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 12px;
    color: #1f2937;
}
.thsc-admin-payout {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    color: #1f2937;
    font-size: 13px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px 14px;
}
.thsc-admin-share-table {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px;
    background: #fff;
}
.thsc-admin-log-list {
    margin: 0;
    padding-left: 18px;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.8;
}

@media (max-width: 959px) {
    .thsc-admin-mobile-block { display: flex !important; }
    .thsc-admin-layout,
    .thsc-admin-noauth { display: none !important; }
}

.state {
    padding: 26px 16px;
    color: #8e8b84;
    text-align: center;
    border: 1px dashed #e9e9e6;
    border-radius: 18px;
    background: #fff;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.subtitle,
.detail-subtitle {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

.detail-separator {
    margin: 0 6px;
    color: var(--subtle);
}

.detail-cost {
    color: var(--text);
    font-weight: 900;
    text-decoration-line: underline;
    text-decoration-color: var(--green);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.detail-info-tag,
.detail-save-btn,
.detail-optimize-btn,
.detail-trend-btn,
.detail-share-btn {
    box-sizing: border-box;
    height: 24px;
    min-height: 24px;
    vertical-align: middle;
    line-height: 1;
}

.detail-info-tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 4px;
    margin-left: 10px;
    padding: 2px 10px 2px 6px;
    border: 1px solid #f0c31d;
    border-radius: 999px;
    color: #8a5d00;
    background: #fff7d8;
    font-size: 12px;
    font-weight: 800;
    cursor: help;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.detail-info-tag svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.detail-info-tag:hover,
.detail-info-tag:focus-visible {
    border-color: #e0a100;
    background: #ffeead;
    outline: none;
}

.detail-info-tag::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    width: max-content;
    max-width: 360px;
    padding: 10px 14px;
    border: 1px solid #ece7d7;
    border-radius: 14px;
    color: var(--text);
    background: #fffaf0;
    box-shadow: 0 14px 32px -10px rgba(35, 31, 23, 0.32);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.65;
    letter-spacing: 0.01em;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.detail-info-tag::before {
    content: "";
    position: absolute;
    top: calc(100% + 2px);
    left: 16px;
    z-index: 21;
    width: 10px;
    height: 10px;
    border: 1px solid #ece7d7;
    border-right: 0;
    border-bottom: 0;
    background: #fffaf0;
    transform: rotate(45deg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.detail-info-tag:hover::after,
.detail-info-tag:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.detail-info-tag:hover::before,
.detail-info-tag:focus-visible::before {
    opacity: 1;
}

.refresh-btn,
.detail-close {
    border: 1px solid var(--line);
    color: var(--text);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(16, 185, 129, 0.2));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.recipe-card-media img,
.material-img img,
.outcome-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.4));
}

.metric {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.metric-label {
    color: #6b6256;
    font-size: 11px;
    font-weight: 800;
}

.metric-value {
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    text-decoration-line: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
}

.metric-value.green { color: var(--green); }

.metric-value.blue { color: var(--blue); }

.metric-value.amber { color: var(--amber); }

.metric-value.red { color: var(--red); }

.metric-value.purple { color: var(--purple); }

.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.detail-overlay[hidden] {
    display: none;
}

.detail-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(980px, 100%);
    max-height: min(75vh, 820px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: var(--shadow);
}

.detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    opacity: 0.78;
    transition: opacity 160ms ease, transform 160ms ease;
}

.detail-close svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.detail-close:hover {
    opacity: 1;
    transform: scale(1.06);
}

.detail-hero {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 56px 18px 26px;
    border-bottom: 1px solid var(--line);
}

.detail-hero-head {
    flex: 1 1 auto;
    min-width: 0;
}

.detail-hero > .detail-subtitle {
    flex: 0 0 100%;
    width: 100%;
    margin-top: 4px;
}

.detail-hero h2 {
    margin-bottom: 8px;
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 650;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.detail-score {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 22px;
    min-width: 0;
}

.detail-side {
    flex: 0 0 auto;
    display: grid;
    justify-items: end;
    align-items: start;
    align-content: start;
    gap: 12px;
}

.material-optimize-row-wear.wear-tier-fn .material-optimize-row-tier { color: #2563eb; }

.material-optimize-row-wear.wear-tier-mw .material-optimize-row-tier { color: #16a34a; }

.material-optimize-row-wear.wear-tier-ft .material-optimize-row-tier { color: #d97706; }

.material-optimize-row-wear.wear-tier-ww .material-optimize-row-tier { color: #ea580c; }

.material-optimize-row-wear.wear-tier-bs .material-optimize-row-tier { color: #dc2626; }

.detail-columns {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 16px;
    padding: 20px 26px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.detail-section {
    min-width: 0;
    padding: 0;
}

.detail-section > h3 {
    margin-bottom: 12px;
    font-size: 18px;
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.thsc-inventory-toolbar {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.thsc-ledger-filter.thsc-inventory-filter {
    flex: 1 1 auto;
    min-width: 0;
    gap: 22px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.thsc-ledger-filter.thsc-inventory-filter::-webkit-scrollbar { display: none; }

.thsc-inventory-grid {
    display: grid;
    /* PC/宽屏：固定每行 4 张卡片。用 minmax(0, 1fr) 而不是 1fr，防止内部长饰品名
       撑破网格轨道（grid item 默认 min-width=auto，长文本会强行拉宽列）。 */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 680px) {
    /* 库存筛选也走 flex:1 平分整行，与 ledger-filter 完全一致；5 个 chip 在
       ~468px 宽里各占 ~90px，足够容纳 2–3 字标签(全部/已发货/待取货/已上架/
       待发货)。此时 overflow-x:auto 自然失效(内容不再溢出)，无需再改。 */
    .thsc-ledger-filter.thsc-inventory-filter {
        gap: 4px;
    }
    .thsc-ledger-filter.thsc-inventory-filter .thsc-ledger-chip {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 4px;
        text-align: center;
    }
    /* 移动端窄屏空间不够塞 4 张，落回 2 张一行，保持卡片信息可读性。 */
    .thsc-inventory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}
.thsc-inv-item {
    position: relative;
}

.thsc-inv-badge {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 2px 8px;
    border-radius: 6px 0 0 0;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #6b7280;
}
.thsc-inv-badge--claim { background: #2563eb; }
.thsc-inv-badge--done { background: #9ca3af; }

.thsc-inv-item--claimable {
    cursor: pointer;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb, 0 4px 12px rgba(37, 99, 235, 0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.thsc-inv-item--claimable:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px #2563eb, 0 8px 18px rgba(37, 99, 235, 0.25);
}

.thsc-inv-item--delivered {
    filter: grayscale(1);
    opacity: 0.7;
}

.thsc-inv-item--placeholder {
    cursor: pointer;
    border-style: dashed;
}
.thsc-inv-wait {
    margin: 4px 0 0;
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.4;
}

.thsc-drawer-balance > .thsc-drawer-balance-reserved {
    cursor: pointer;
    transition: background 0.15s ease;
}
.thsc-drawer-balance > .thsc-drawer-balance-reserved:hover {
    background: #f3f4f6;
}
.thsc-drawer-balance > .thsc-drawer-balance-reserved:hover .thsc-inv-title::after {
    color: #6b7280;
    transform: translateX(2px);
}
.thsc-drawer-balance .thsc-inv-title::after { transition: transform 0.15s ease, color 0.15s ease; }

.thsc-claim-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 12px;
    padding: 8px 10px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
}
.thsc-claim-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent;
    border-radius: 0;
}
.thsc-claim-item div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.thsc-claim-item strong { font-size: 13px; color: #111827; }
.thsc-claim-item span { font-size: 12px; color: #6b7280; }

.material-card {
    overflow: hidden;
    width: 100%;
    height: 220px;
    border: 1px solid #d8d8d8;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}

.material-img {
    position: relative;
    height: 150px;
    overflow: hidden;
    padding: 0;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.72), transparent 50%),
        linear-gradient(180deg, #f4f1ea, #ddd6ca);
}

.material-img::before {
    content: "汰换魔方  汰换魔方  汰换魔方  汰换魔方";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    z-index: 0;
    color: rgba(96, 88, 76, 0.12);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.9;
    letter-spacing: 0.08em;
    text-align: center;
    word-spacing: 12px;
    transform: translate(-50%, -50%) rotate(-18deg);
    pointer-events: none;
}

.material-img img {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: 90%;
    height: 90%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    filter: drop-shadow(0 5px 7px rgba(20, 20, 20, 0.16));
    transform: translate(-50%, -50%);
}

.material-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 8px 5px;
}

.item-name {
    margin: 0;
    overflow: hidden;
    color: #25221d;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.item-name span {
    color: #25221d;
}

.item-name .item-name-copy {
    cursor: pointer;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

.item-name .item-name-copy:hover {
    color: #15803d;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.item-name .item-name-copy:active {
    color: #166534;
}

.material-price-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    line-height: 1.15;
}

.material-case {
    margin-left: auto;
    max-width: 120px;
    color: #16a34a;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.outcome-group {
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.54);
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 13px 14px;
    border: 0;
    color: var(--text);
    background: transparent;
    cursor: pointer;
}

.group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
}

.group-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.group-high .group-dot { background: var(--green); }

.group-safe .group-dot { background: var(--amber); }

.group-risk .group-dot { background: var(--red); }

.group-summary {
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.group-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 12px 12px;
}

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

.outcome-card {
    position: relative; /* 关键：给 .prob-sup(position:absolute) 提供本卡片的定位锚点，
                           否则会一路向上找到 .detail-panel，
                           所有 chip 都会飞到弹窗右上角、层叠在 hero 上。 */
    overflow: hidden;
    width: 100%;
    height: 220px;
    border: 1px solid #d8d8d8;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}
.outcome-card.is-actual {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, .22), 0 1px 4px rgba(15, 23, 42, .18);
}

.outcome-img {
    position: relative;
    height: 146px;
    overflow: hidden;
    padding: 0;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.72), transparent 50%),
        linear-gradient(180deg, #f4f1ea, #ddd6ca);
}

.outcome-img::before {
    content: "汰换魔方  汰换魔方  汰换魔方  汰换魔方";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    z-index: 0;
    color: rgba(96, 88, 76, 0.12);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.9;
    letter-spacing: 0.08em;
    text-align: center;
    word-spacing: 12px;
    transform: translate(-50%, -50%) rotate(-18deg);
    pointer-events: none;
}

.outcome-img img {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: 90%;
    height: 90%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    filter: drop-shadow(0 5px 7px rgba(20, 20, 20, 0.16));
    transform: translate(-50%, -50%);
}
.outcome-actual-check {
    position: absolute;
    z-index: 4;
    top: 8px;
    right: 8px;
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    box-shadow: 0 2px 7px rgba(22, 163, 74, .35);
}
.outcome-actual-check svg {
    width: 17px;
    height: 17px;
}

.material-img:hover .market-links,
.outcome-img:hover .market-links {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.material-img:hover .market-btn,
.outcome-img:hover .market-btn {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.material-img:hover .market-btn-buff,
.outcome-img:hover .market-btn-buff {
    transition-delay: 0.04s;
}

.material-img:hover .market-btn-uu,
.outcome-img:hover .market-btn-uu {
    transition-delay: 0.12s;
}

.wear-tier-chip {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    padding: 2px 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
}

.wear-tier-row {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    display: flex;
    align-items: stretch;
}
.wear-tier-row .wear-tier-chip {
    position: static;
}
.wear-st-chip {
    background: #cf6a32;
    letter-spacing: .02em;
}

/* 云开库存卡片：品质色条（贴住卡片左边缘，紧邻饰品名称左侧） */
#thsc-cloud-inv-grid .material-card .material-info {
    position: relative;
}
#thsc-cloud-inv-grid .material-card .material-info::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 6px;
    height: 18px;
    background: rgba(255, 255, 255, .55);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .22);
    pointer-events: none;
}
#thsc-cloud-inv-grid .material-card .item-name {
    padding-left: 4px;
}
#thsc-cloud-inv-grid .material-card.quality-consumer   .material-info::before { background: #b0c3d9; }
#thsc-cloud-inv-grid .material-card.quality-industrial .material-info::before { background: #5e98d9; }
#thsc-cloud-inv-grid .material-card.quality-milspec    .material-info::before { background: #4b69ff; }
#thsc-cloud-inv-grid .material-card.quality-restricted .material-info::before { background: #8847ff; }
#thsc-cloud-inv-grid .material-card.quality-classified .material-info::before { background: #d32ce6; }
#thsc-cloud-inv-grid .material-card.quality-covert     .material-info::before { background: #eb4b4b; }
#thsc-cloud-inv-grid .material-card.quality-contraband .material-info::before { background: #e4ae39; }

.wear-tier-fn {
    background: #2563eb;
}

.wear-tier-mw {
    background: #16a34a;
}

.wear-tier-ft {
    background: #d97706;
}

.wear-tier-ww {
    background: #ea580c;
}

.wear-tier-bs {
    background: #dc2626;
}

.wear {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.wear-value {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    height: 14px;
    padding: 0 5px;
    box-sizing: border-box;
    color: #d7dde8;
    background: rgba(31, 41, 55, 0.72);
    font-size: 11px;
    font-weight: 700;
    transform: translateY(-2px);
}

.wear-track {
    position: absolute;
    right: 0;
    bottom: 2px;
    left: 0;
    height: 6px;
    margin: 0;
    border-radius: 0;
    background: linear-gradient(
        90deg,
        #3b82f6 0%,
        #3b82f6 7%,
        #22c55e 7%,
        #22c55e 15%,
        #f59e0b 15%,
        #f59e0b 38%,
        #f97316 38%,
        #f97316 45%,
        #ef4444 45%,
        #ef4444 100%
    );
}

.wear-pointer {
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-right: 4px solid transparent;
    border-bottom: 5px solid #fff;
    border-left: 4px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.35);
    transform: translate(-50%, -105%);
}

.outcome-info {
    display: flex;
    flex-direction: column;
    padding: 5px 10px 6px;
}

.outcome-name {
    margin: 0 0 2px;
    overflow: hidden;
    color: #25221d;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.25;
    text-align: left;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.outcome-name span {
    color: #25221d;
}

.outcome-case {
    margin: auto 0;
    overflow: hidden;
    color: #4b443b;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.outcome-price-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.outcome-price-line > * {
    flex-shrink: 0;
    white-space: nowrap;
}

.sell-order-price {
    color: #f59e0b;
    font-size: 14px;
    font-weight: 900;
}
.cloud-inventory-grid .sell-order-price.is-price-filling {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #2563eb;
    white-space: nowrap;
}
.cloud-price-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(37, 99, 235, .24);
    border-top-color: #2563eb;
    border-radius: 50%;
    box-sizing: border-box;
    animation: cloud-price-spinner-rotate .7s linear infinite;
}
@keyframes cloud-price-spinner-rotate {
    to { transform: rotate(360deg); }
}
.cloud-inventory-grid .material-card.is-price-failed .sell-order-price {
    color: #dc2626;
}

.profit-delta {
    font-size: 11px;
    font-weight: 900;
}

.profit-delta.green {
    color: #16a34a;
}

.profit-delta.red {
    color: #dc2626;
}

/* 出货概率 chip：绝对定位在 outcome-img 右上角，
   半透明深色底 + 白字 + 绿色箭头，图片背景下可读性好。
   使用 sup 保留旧的语义结构（不影响其他复用点）。 */
.prob-sup {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .3px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    margin-left: 0;
    vertical-align: baseline;
    pointer-events: none;
}
.prob-sup::first-letter {
    color: #4ade80;   /* 箭头 ⬆ 用亮绿色突出"上涨/概率"语义 */
    font-weight: 900;
    margin-right: 1px;
}

@media (max-width: 680px) {

    .page-header,
    .detail-hero {
        flex-direction: column;
    }

    .detail-panel {
        max-height: 92vh;
        border-radius: 22px;
    }

    .detail-side {
        justify-items: stretch;
    }

    #thsc-modal-participate .thsc-buy-hero .detail-score {
        display: grid;
        grid-template-columns: repeat(4, auto);
        align-items: start;
        justify-content: space-between;
        gap: 6px;
        overflow: visible;
    }
    #thsc-modal-participate .thsc-buy-hero .detail-score .metric {
        min-width: 0;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        white-space: nowrap;
    }

    .detail-hero,
    .detail-columns {
        padding-left: 16px;
        padding-right: 16px;
    }

    .detail-columns {
        grid-template-columns: 1fr;
    }

    .material-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {

    .metric {
        min-width: 66px;
    }
}

.detail-overlay {
    background: transparent;
}

.detail-panel {
    border-color: #ece7d7;
    background: #fff;
}

.detail-columns {
    scrollbar-width: thin;
    scrollbar-color: #f3b300 #f6f1e4;
}

.detail-columns::-webkit-scrollbar {
    width: 10px;
}

.detail-columns::-webkit-scrollbar-track {
    margin: 6px 0;
    border-radius: 999px;
    background: #f6f1e4;
}

.detail-columns::-webkit-scrollbar-thumb {
    border: 2px solid #f6f1e4;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffd33d, #f3b300);
}

.detail-columns::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffe173, #e0a100);
}

.detail-close {
    color: #5f4100;
    border-color: #f0c31d;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
}

.detail-hero,
.detail-section h3,
.item-name,
.outcome-price {
    color: var(--text);
}

.detail-hero {
    border-bottom-color: #ece7d7;
}

.outcome-group {
    border-color: #eeeeea;
    background: #fffaf0;
}

.group-header {
    color: var(--text);
}

.inv-card-wear-track .wear-pointer {
    top: 0;
    border-bottom-color: #fff;
    transform: translate(-50%, -100%);
}

.inv-card-media-tags .wear-tier-chip {
    position: static;
}

.thsc-admin-subtabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 8px;
    padding: 3px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f3f4f6;
}
.thsc-admin-subtab {
    appearance: none;
    border: 0;
    margin: 0;
    padding: 7px 16px;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.thsc-admin-subtab:hover { color: #111827; }
.thsc-admin-subtab.is-active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.thsc-publish-subpanel[hidden] { display: none !important; }

.thsc-uw-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 6px 0 4px;
}
.thsc-uw-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 10px;
}
.thsc-uw-stat-label {
    font-size: 12px;
    color: var(--muted);
}
.thsc-uw-stat strong {
    font-size: 18px;
    color: var(--text);
}
.thsc-uw-stat:first-child strong {
    color: var(--green);
}
.thsc-uw-adjust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.thsc-uw-dir {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.thsc-uw-dir-btn {
    border: 0;
    background: #fff;
    color: var(--muted);
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease;
}
.thsc-uw-dir-btn + .thsc-uw-dir-btn {
    border-left: 1px solid var(--line);
}
.thsc-uw-dir-btn.is-active[data-dir="add"] {
    background: var(--green);
    color: #fff;
}
.thsc-uw-dir-btn.is-active[data-dir="sub"] {
    background: var(--red);
    color: #fff;
}
.thsc-uw-adjust #uw-amount {
    width: 130px;
}
.thsc-uw-adjust #uw-note {
    flex: 1 1 180px;
    min-width: 160px;
}
.thsc-uw-adjust input {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    background: #fff;
}
.thsc-uw-adjust input:focus {
    outline: none;
    border-color: var(--green);
}
.thsc-uw-adjust #uw-submit {
    min-height: 33.6px;
    height: 33.6px;
    line-height: 1;
    padding: 0 18px;
}
.thsc-uw-tx-wrap {
    max-height: 320px;
    overflow-y: auto;
}
.thsc-uw-amount.is-in {
    color: var(--green);
    font-weight: 600;
}
.thsc-uw-amount.is-out {
    color: var(--red);
    font-weight: 600;
}
@media (max-width: 640px) {
    .thsc-uw-summary {
        grid-template-columns: 1fr;
    }
}

.thsc-admin-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#panel-cloudopen .ghost-btn,
#panel-cloudopen .primary-btn {
    flex: none;
    min-height: 0;
    height: auto;
    padding: 6px 10px;
    border: 1px solid #e8e6e0;
    border-radius: 6px;
    background: #fafafa;
    color: #000;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
#panel-cloudopen .ghost-btn:hover,
#panel-cloudopen .primary-btn:hover {
    background: #f3f3f3;
    border-color: #d9d4c8;
    color: #000;
    box-shadow: none;
    transform: none;
}
#panel-cloudopen .ghost-btn:focus-visible,
#panel-cloudopen .primary-btn:focus-visible {
    outline: 2px solid #c8c4bc;
    outline-offset: 2px;
}

.cloud-account-bar {
    margin-bottom: 12px;
}

.cloud-account-select-wrap {
    position: relative;
    display: inline-block;
    min-width: 200px;
}

.cloud-select-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 12px;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 8px;
    background: rgba(148, 163, 184, .08);
    color: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
    user-select: none;
}
.cloud-select-trigger:hover {
    border-color: rgba(96, 165, 250, .5);
    background: rgba(96, 165, 250, .08);
}
.cloud-select-trigger.is-open {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, .12);
}
.cloud-select-label {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.cloud-select-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cloud-publish-status {
    flex-shrink: 0;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
}
.cloud-publish-status.is-published {
    color: #15803d;
    background: rgba(34, 197, 94, .14);
}
.cloud-publish-status.is-unpublished {
    color: #b45309;
    background: rgba(245, 158, 11, .15);
}
.cloud-select-arrow {
    flex-shrink: 0;
    transition: transform .2s ease;
    opacity: .55;
}
.cloud-select-trigger.is-open .cloud-select-arrow {
    transform: rotate(180deg);
}

.cloud-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, .3);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    z-index: 120;
    padding: 4px;
}

.cloud-select-group-label {
    padding: 6px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: .04em;
    user-select: none;
}

.cloud-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s ease;
}
.cloud-select-option:hover {
    background: rgba(96, 165, 250, .14);
}
.cloud-select-option.is-active {
    background: rgba(96, 165, 250, .18);
    font-weight: 600;
}
.cloud-select-option-name {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.cloud-select-check {
    flex-shrink: 0;
    color: #60a5fa;
}

.cloud-account-empty {
    color: var(--muted, #94a3b8);
    font-size: 13px;
    padding: 6px 0;
}

.cloud-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #94a3b8;
}
.cloud-chip-dot.is-online { background: #34d399; }
.cloud-chip-dot.is-offline { background: #94a3b8; }
.cloud-chip-tail {
    color: var(--muted, #94a3b8);
    font-size: 12px;
}

.cloud-account-info {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 0;
    border: none;
    margin: 0;
    font-size: 12px;
}
.cloud-info-item { color: var(--muted, #94a3b8); white-space: nowrap; }
.cloud-info-item strong { color: inherit; }
.cloud-info-item strong.cloud-info-online-on { color: #29a071; }
.cloud-info-item strong.cloud-info-online-off { color: #b1273a; }

.cloud-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.cloud-filter-select {
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font-size: 12px;
    cursor: pointer;
    min-width: 100px;
    max-width: 200px;
    appearance: auto;
}

.thsc-admin-task-audit {
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(96, 165, 250, .25);
    border-radius: 10px;
    background: rgba(15, 23, 42, .72);
}

.thsc-admin-task-audit h4,
.thsc-admin-task-audit p {
    margin: 0 0 8px;
}

.thsc-admin-task-audit ol {
    margin: 8px 0 0;
    padding-left: 20px;
}

.thsc-admin-task-audit li {
    margin: 5px 0;
    color: #cbd5e1;
}

.thsc-admin-task-audit time {
    color: #64748b;
}

.thsc-cloud-task-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
}

.thsc-cloud-task-filters {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: #f3f4f6;
}

.thsc-cloud-task-filters .thsc-admin-subtab {
    padding: 6px 10px;
    font-size: 12px;
}

.thsc-cloud-task-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    color: #64748b;
    font-size: 12px;
}

.thsc-cloud-task-summary span {
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
}

.thsc-cloud-task-summary .is-clear {
    background: #ecfdf5;
    color: #047857;
}

.thsc-cloud-task-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.thsc-cloud-task-status.is-pending { background: #eff6ff; color: #1d4ed8; }
.thsc-cloud-task-status.is-warning { background: #fffbeb; color: #a16207; }
.thsc-cloud-task-status.is-danger { background: #fef2f2; color: #b91c1c; }
.thsc-cloud-task-status.is-success { background: #ecfdf5; color: #047857; }
.thsc-cloud-task-status.is-muted { background: #f3f4f6; color: #6b7280; }

.thsc-cloud-task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 150px;
}
.thsc-cloud-task-actions .ghost-btn {
    min-height: 32px;
    padding: 5px 8px;
    cursor: pointer;
}
.thsc-cloud-task-actions .ghost-btn.is-danger {
    border-color: #fecaca;
    background: #fff7f7;
    color: #b91c1c;
}
.thsc-cloud-task-actions .ghost-btn.is-danger:hover:not(:disabled) {
    border-color: #ef4444;
    background: #fef2f2;
}
.thsc-cloud-task-trade-no {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 10px;
    font-weight: 400;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .thsc-cloud-task-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .thsc-cloud-task-filters {
        max-width: 100%;
        overflow-x: auto;
    }
    .thsc-cloud-task-filters .thsc-admin-subtab {
        flex: 0 0 auto;
    }
    .thsc-cloud-task-summary {
        justify-content: flex-start;
    }
}

.thsc-admin-inline-title {
    margin: 0;
    padding: 12px 16px 8px;
    font-size: 14px;
}

.thsc-admin-task-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 12px;
}
.cloud-filter-select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, .18);
}
.cloud-filter-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted, #94a3b8);
    white-space: nowrap;
}
@media (max-width: 480px) {
    .cloud-filter-bar {
        gap: 6px;
        padding: 8px 0;
    }
    .cloud-filter-select {
        min-width: 80px;
        font-size: 11px;
        padding: 4px 6px;
    }
}

.cloud-inventory-state {
    color: var(--muted, #94a3b8);
    font-size: 13px;
    padding: 24px 0;
    text-align: center;
}

.cloud-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
    gap: 16px;
}

.cloud-account-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.cloud-viewer-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .12);
    color: #16a34a;
    font-size: 12px;
    font-weight: 500;
    margin-left: auto;
}
.cloud-viewer-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
    animation: cloud-viewer-pulse 1.8s ease-in-out infinite;
}
@keyframes cloud-viewer-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}

.cloud-craft-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
    margin: 10px 0 14px;
    border: 1px solid rgba(96, 165, 250, .35);
    border-radius: 10px;
    background: rgba(96, 165, 250, .08);
}
.cloud-craft-select-info {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: inherit;
}
.cloud-craft-count strong {
    font-size: 15px;
    color: #2563eb;
    font-weight: 700;
    margin: 0 2px;
}
.cloud-craft-cost strong {
    font-weight: 700;
    color: #f59e0b;
}
.cloud-craft-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cloud-craft-recipe {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted, #94a3b8);
}
.cloud-craft-recipe input[type="number"] {
    width: 64px;
    padding: 5px 8px;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font-size: 13px;
    text-align: center;
}
.cloud-craft-recipe input[type="number"]:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .18);
}

.cloud-inventory-grid .material-card {
    position: relative;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    border: 2px solid transparent;
}
.cloud-inventory-grid .material-card:hover:not(.is-locked):not(.is-consumed) {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.cloud-inventory-grid .material-card.is-pricing {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
    animation: cloud-price-fill-pulse 1s ease-in-out infinite;
}
.cloud-inventory-grid .material-card.is-price-failed {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .12);
}
@keyframes cloud-price-fill-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
    50% { box-shadow: 0 0 0 5px rgba(37, 99, 235, .24); }
}
.cloud-inventory-grid .material-card .card-select-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(37, 99, 235, .35);
    z-index: 2;
}
.cloud-inventory-grid .material-card.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.cloud-inventory-grid .material-card.is-selected .card-select-check {
    display: flex;
}
.cloud-inventory-grid .material-card.is-locked {
    cursor: not-allowed;
    opacity: .55;
    filter: saturate(.7);
}
.cloud-inventory-grid .material-card.is-locked::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}
.card-lock-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .85);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    z-index: 3;
    pointer-events: none;
    max-width: calc(100% - 16px);
}
.card-lock-icon { font-size: 11px; }
.card-lock-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.cloud-inventory-grid .material-card.is-consumed {
    cursor: not-allowed;
    opacity: .35;
    filter: grayscale(.8);
    pointer-events: none;
}

#thsc-view-cloud {
    width: min(960px, 100%);
    margin: -18px auto 0;
    padding: 8px 14px 100px;
}

/* 库存视图与云开汰换视图共用同一列宽和内边距，避免用户在两个 tab 间来回切时
   页面主区域左右抖动。默认的 .thsc-view (640px) 对 4 列卡片偏窄，套上 960px
   之后每张卡片约 220px 宽，跟原来 minmax(170px, 1fr) 的下限一致更舒适。 */
#thsc-view-inventory {
    width: min(960px, 100%);
    padding-left: 14px;
    padding-right: 14px;
    box-sizing: border-box;
}

.thsc-cloud-sticky-head {
    position: sticky;
    top: var(--thsc-topbar-offset, 73px);
    z-index: 41;
    isolation: isolate;
    overflow-anchor: none;
    margin-bottom: 12px;
    padding: 9px 10px;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 16px;
    background-image:
        radial-gradient(circle at 0 0, rgba(114, 91, 255, .13), transparent 38%),
        linear-gradient(135deg, rgba(255, 255, 255, .97), rgba(248, 249, 255, .94));
    box-shadow:
        0 14px 34px rgba(39, 36, 81, .11),
        0 2px 7px rgba(39, 36, 81, .05),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    transition: padding .2s ease, border-radius .2s ease, box-shadow .2s ease;
}
.thsc-cloud-sticky-head::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -1px;
    right: 24px;
    left: 24px;
    height: 2px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, transparent, #7767ff 28%, #55b8ff 68%, transparent);
    opacity: .85;
}

.thsc-cloud-compact-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 3px 4px;
    border: 1px solid rgba(126, 116, 184, .1);
    border-radius: 10px;
    background: rgba(239, 240, 248, .66);
}

.thsc-cloud-row1 {
    display: flex;
    align-items: center;
    gap: 10px;
    max-height: 42px;
    margin-bottom: 8px;
    min-width: 0;
    opacity: 1;
    transform: translateY(0);
    transition:
        max-height .2s ease,
        margin-bottom .2s ease,
        opacity .14s ease,
        transform .2s ease;
}
.thsc-cloud-sticky-head.is-scroll-compact {
    padding: 0;
    border-color: transparent;
    background: none;
    box-shadow: none;
}
.thsc-cloud-sticky-head.is-scroll-compact::before { display: none; }
.thsc-cloud-sticky-head.is-scroll-compact .thsc-cloud-row1 {
    max-height: 0;
    margin-bottom: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
}
.thsc-cloud-filter-caption {
    flex: 0 0 auto;
    padding-left: 8px;
    color: #8a88a0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}
.thsc-cloud-accounts-scroll {
    position: relative;
    flex: 0 0 268px;
    max-width: 100%;
    height: 42px;
    min-width: 0;
    padding: 0;
}
.thsc-cloud-account-trigger {
    width: 100%;
    height: 42px;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border: 1px solid rgba(112, 95, 234, .22);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(248, 246, 255, .98), rgba(255, 255, 255, .99));
    color: #29263e;
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    box-shadow:
        0 3px 10px rgba(52, 47, 108, .07),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    transition: transform .15s ease, border-color .18s ease, box-shadow .18s ease;
}
.thsc-cloud-account-trigger:hover,
.thsc-cloud-accounts-scroll.is-open .thsc-cloud-account-trigger {
    border-color: rgba(106, 91, 255, .55);
    box-shadow:
        0 8px 20px rgba(52, 47, 108, .14),
        0 0 0 3px rgba(106, 91, 255, .1),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    transform: translateY(-1px);
}
.thsc-cloud-account-trigger:disabled {
    cursor: wait;
    opacity: .68;
    transform: none;
}
.thsc-cloud-account-trigger:disabled:hover {
    border-color: rgba(112, 95, 234, .22);
    box-shadow: 0 3px 10px rgba(52, 47, 108, .07), inset 0 1px 0 rgba(255, 255, 255, .9);
    transform: none;
}

.thsc-cloud-account-current {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 10px 0 12px;
}
.thsc-cloud-account-current-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.15;
}
.thsc-cloud-account-current-name,
.thsc-cloud-account-option-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.thsc-cloud-account-current-name {
    font-size: 13px;
    font-weight: 800;
    color: #1f1b3a;
}
.thsc-cloud-account-current-count,
.thsc-cloud-account-option-count {
    flex-shrink: 0;
    color: #77738d;
    font-size: 11px;
    font-weight: 700;
}
.thsc-cloud-account-switch-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 0 0 auto;
    padding: 0 12px;
    border-left: 1px solid rgba(112, 95, 234, .18);
    background: linear-gradient(135deg, rgba(119, 103, 255, .08), rgba(119, 103, 255, .16));
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    transition: background .18s ease, color .18s ease;
}
.thsc-cloud-account-trigger:hover .thsc-cloud-account-switch-cta,
.thsc-cloud-accounts-scroll.is-open .thsc-cloud-account-switch-cta {
    background: linear-gradient(135deg, rgba(119, 103, 255, .18), rgba(119, 103, 255, .28));
    color: #000;
}
.thsc-cloud-account-switch-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    transition: transform .35s ease;
}
.thsc-cloud-account-switch-label {
    white-space: nowrap;
    line-height: 1;
}
.thsc-cloud-accounts-scroll.is-open .thsc-cloud-account-switch-icon,
.thsc-cloud-account-trigger:hover .thsc-cloud-account-switch-icon {
    transform: rotate(180deg);
}
.thsc-cloud-account-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 20;
    width: 240px;
    max-width: calc(100vw - 28px);
    max-height: 260px;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid rgba(106, 91, 255, .16);
    border-radius: 12px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 38px rgba(35, 31, 79, .18), 0 4px 10px rgba(35, 31, 79, .07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.thsc-cloud-account-dropdown[hidden] {
    display: none;
}
.thsc-cloud-account-option {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #444;
    cursor: pointer;
    text-align: left;
}
.thsc-cloud-account-option:hover {
    background: #f5f3ff;
}
.thsc-cloud-account-option.is-active {
    color: #5546d9;
    background: #f2efff;
    font-weight: 700;
}
.thsc-cloud-account-option-name {
    flex: 1;
    font-size: 14px;
}
.thsc-cloud-no-accounts {
    font-size: 13px;
    color: #999;
    padding: 0;
    line-height: 42px;
}

.thsc-cloud-compact-bar .thsc-cloud-row2 {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 5px;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.thsc-cloud-compact-bar .thsc-cloud-row2::-webkit-scrollbar { display: none; }
.thsc-cloud-compact-bar .cloud-filter-select {
    flex: 0 0 auto;
    height: 30px;
    min-width: 0;
    padding: 0 30px 0 10px;
    appearance: none;
    border-color: transparent;
    border-radius: 8px;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5' fill='none' stroke='%23787396' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    color: #464359;
    font-size: 12px;
    font-weight: 700;
    transition: background-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.thsc-cloud-compact-bar .cloud-filter-select:hover {
    background-color: rgba(255, 255, 255, .76);
    color: #2f2b48;
}
.thsc-cloud-compact-bar .cloud-filter-select:focus {
    border-color: transparent;
    background-color: #fff;
    box-shadow: 0 3px 10px rgba(50, 45, 98, .1), 0 0 0 1px rgba(112, 95, 234, .2);
}
#thsc-cloud-filter-rarity { min-width: 112px; }
#thsc-cloud-filter-crate { min-width: 168px; }
#thsc-cloud-filter-sort { min-width: 158px; }
.thsc-cloud-compact-bar .thsc-cloud-filter-trigger { display: none; }
.thsc-cloud-filter-sheet[hidden] { display: none !important; }
.thsc-cloud-filter-sheet:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 520;
}
.thsc-cloud-filter-sheet-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .46);
}
.thsc-cloud-filter-sheet-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    max-height: min(68vh, 560px);
    flex-direction: column;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    background: #fff;
    box-shadow: 0 -12px 36px rgba(15, 23, 42, .18);
}
.thsc-cloud-filter-sheet-handle {
    width: 38px;
    height: 4px;
    margin: 1px auto 10px;
    border-radius: 999px;
    background: #dbe2ea;
}
.thsc-cloud-filter-sheet-title {
    margin-bottom: 10px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}
.thsc-cloud-filter-sheet-options {
    display: grid;
    gap: 5px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.thsc-cloud-filter-sheet-option {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
    text-align: left;
}
.thsc-cloud-filter-sheet-option svg {
    width: 18px;
    height: 18px;
    fill: none;
    opacity: 0;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
}
.thsc-cloud-filter-sheet-option.is-active {
    border-color: #818cf8;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 800;
}
.thsc-cloud-filter-sheet-option.is-active svg { opacity: 1; }
.thsc-cloud-filter-sheet.is-dropdown .thsc-cloud-filter-sheet-mask {
    background: transparent;
}
.thsc-cloud-filter-sheet.is-dropdown .thsc-cloud-filter-sheet-panel {
    position: fixed;
    top: var(--cloud-filter-dropdown-top);
    right: auto;
    bottom: auto;
    left: var(--cloud-filter-dropdown-left);
    width: var(--cloud-filter-dropdown-width);
    max-height: min(52vh, 360px);
    box-sizing: border-box;
    padding: 6px;
    border: 1px solid #dbe2ea;
    border-radius: 11px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}
.thsc-cloud-filter-sheet.is-dropdown .thsc-cloud-filter-sheet-handle,
.thsc-cloud-filter-sheet.is-dropdown .thsc-cloud-filter-sheet-title {
    display: none;
}
.thsc-cloud-filter-sheet.is-dropdown .thsc-cloud-filter-sheet-options {
    gap: 3px;
}
.thsc-cloud-filter-sheet.is-dropdown .thsc-cloud-filter-sheet-option {
    min-height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 13px;
}
.thsc-cloud-filter-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-left: auto;
    flex: 0 0 auto;
}
.thsc-cloud-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #94a3b8;
}
.thsc-cloud-dot.is-online { background: #34d399; }
.thsc-cloud-dot.is-offline { background: #94a3b8; }
.thsc-cloud-tail {
    color: var(--muted, #94a3b8);
    font-size: 12px;
}
.thsc-cloud-viewer-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted, #94a3b8);
    font-size: 12px;
    white-space: nowrap;
    min-width: 0;
    max-width: 220px;
    margin-left: 0;
    overflow: hidden;
}
.thsc-topbar-inner .thsc-cloud-viewer-count {
    flex: 0 0 auto;
    max-width: none;
    overflow: visible;
}
.thsc-topbar-inner #thsc-cloud-viewer-count-text {
    overflow: visible;
    text-overflow: clip;
}
#thsc-cloud-viewer-count-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.thsc-cloud-viewer-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: thsc-cloud-viewer-pulse 1.8s ease-in-out infinite;
}
@keyframes thsc-cloud-viewer-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}

.thsc-cloud-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: rgba(148, 163, 184, .1);
    border-radius: 10px;
    margin-bottom: 12px;
}
.thsc-cloud-tab {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted, #94a3b8);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.thsc-cloud-tab:hover { color: inherit; }
.thsc-cloud-tab.is-active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.thsc-cloud-shield-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .15s ease;
}
.thsc-cloud-shield-btn:hover { transform: scale(1.1); }
.thsc-cloud-shield-btn:active { transform: scale(0.95); }

.thsc-cloud-verify-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
}
.thsc-cloud-verify-overlay[hidden] { display: none; }
.thsc-cloud-verify-panel {
    position: relative;
    width: min(400px, 90vw);
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
    text-align: center;
}
.thsc-cloud-verify-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: none;
    background: transparent;
    font-size: 22px;
    color: var(--muted, #94a3b8);
    cursor: pointer;
    line-height: 1;
}
.thsc-cloud-verify-close:hover { color: #1f2937; }
.thsc-cloud-verify-shield {
    margin-bottom: 12px;
}
.thsc-cloud-verify-title {
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px;
}
.thsc-cloud-verify-list {
    text-align: left;
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 13px;
    line-height: 1.7;
    color: #475569;
}
.thsc-cloud-verify-list li {
    margin-bottom: 8px;
}
.thsc-cloud-verify-list li:last-child { margin-bottom: 0; }
.thsc-cloud-verify-copy {
    display: inline;
    padding: 2px 8px;
    border: 1px solid #2563eb;
    border-radius: 4px;
    background: rgba(37, 99, 235, .08);
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.thsc-cloud-verify-copy:hover { background: rgba(37, 99, 235, .18); }

.thsc-cloud-tray {
    --thsc-cloud-tray-footer-offset: 0px;
    position: fixed;
    right: max(16px, calc((100vw - 1180px) / 2));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--thsc-cloud-tray-footer-offset));
    left: auto;
    z-index: 200;
    width: min(390px, calc(100vw - 24px));
    height: 56px;
    box-sizing: border-box;
    padding: 0 8px 0 16px;
    border: 1px solid rgba(148, 163, 184, .32);
    border-radius: 28px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-family: "PingFang SC", "PingFang TC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: #1e293b;
    overflow: hidden;
    transition:
        width .22s ease,
        height .22s ease,
        bottom .2s ease,
        padding .22s ease,
        border-radius .22s ease,
        box-shadow .22s ease;
}
.thsc-cloud-tray.is-expanded {
    display: flex;
    width: min(860px, calc(100vw - 32px));
    height: min(380px, calc(100dvh - 32px - env(safe-area-inset-bottom, 0px) - var(--thsc-cloud-tray-footer-offset)));
    min-height: 240px;
    flex-direction: column;
    padding: 10px 14px 14px;
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(15, 23, 42, .2), 0 4px 12px rgba(15, 23, 42, .1);
}
.thsc-cloud-tray.is-expanded:has(.has-cloud-recommendations) {
    height: min(460px, calc(100dvh - 32px - env(safe-area-inset-bottom, 0px) - var(--thsc-cloud-tray-footer-offset)));
}
.thsc-cloud-tray-summary {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
    font-size: 13px;
    white-space: nowrap;
}
.thsc-cloud-tray:not(.is-expanded) .thsc-cloud-tray-summary {
    box-sizing: border-box;
    padding-right: 52px;
}
/* compact 态整个 tray 都可点击展开 → 加 cursor:pointer 的视觉暗示 */
.thsc-cloud-tray:not(.is-expanded) {
    cursor: pointer;
}
.thsc-cloud-tray-stat {
    color: #64748b;
    line-height: 1.2;
}
.thsc-cloud-tray-summary strong {
    color: #0f4c81;
    font-size: 15px;
}
.thsc-cloud-tray-reset {
    min-width: 44px;
    min-height: 35px;
    padding: 0 10px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff7f7;
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.thsc-cloud-tray-reset:hover { background: #fee2e2; }
.thsc-cloud-recommend-clear,
.thsc-cloud-recommend-shuffle,
.thsc-cloud-recommend-reset {
    height: 35px;
    min-height: 35px;
    min-width: 44px;
    padding: 0 9px;
    border: 1px solid #1d4ed8;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}
.thsc-cloud-recommend-clear {
    border-color: #94a3b8;
    color: #475569;
}
.thsc-cloud-recommend-clear:hover {
    border-color: #64748b;
    background: #f1f5f9;
    color: #1e293b;
}
.thsc-cloud-recommend-shuffle {
    border-color: #7c3aed;
    color: #6d28d9;
}
.thsc-cloud-recommend-shuffle:hover {
    background: #7c3aed;
    color: #fff;
}
.thsc-cloud-recommend-reset:hover {
    background: #1d4ed8;
    color: #fff;
}
.thsc-cloud-tray-toggle {
    position: absolute;
    top: 5px;
    right: 6px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 26px;
    height: 26px;
    border: 0;
    flex: 0 0 26px;
    border-radius: 0;
    background: transparent;
    color: #2563eb;
    box-shadow: none;
    cursor: pointer;
    transition: color .18s ease, transform .18s ease;
}
.thsc-cloud-tray-toggle svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}
.thsc-cloud-tray-toggle svg path {
    stroke: currentColor;
    stroke-width: 28px;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.thsc-cloud-tray-toggle .cloud-toggle-vertical {
    transform-origin: center;
    transition: opacity .18s ease, transform .18s ease;
}
.thsc-cloud-tray-toggle:hover {
    background: transparent;
    color: #1d4ed8;
}
.thsc-cloud-tray-toggle:focus-visible {
    outline: 2px solid rgba(31, 128, 190, .52);
    outline-offset: 2px;
}
.thsc-cloud-tray-toggle:active { transform: translateY(0); }
.thsc-cloud-tray:not(.is-expanded) .thsc-cloud-tray-toggle {
    top: 50%;
    transform: translateY(-50%);
}
.thsc-cloud-tray:not(.is-expanded) .thsc-cloud-tray-toggle:active {
    transform: translateY(-50%);
}
.is-expanded .thsc-cloud-tray-toggle {
    top: 10px;
    right: 14px;
    background: transparent;
}
.is-expanded .thsc-cloud-tray-toggle .cloud-toggle-vertical {
    opacity: 0;
    transform: scaleY(0);
}
.thsc-cloud-tray:not(.is-expanded) .thsc-cloud-tray-buttons,
.thsc-cloud-tray:not(.is-expanded) .thsc-cloud-tray-reset,
.thsc-cloud-tray:not(.is-expanded) .thsc-cloud-recommend-clear,
.thsc-cloud-tray:not(.is-expanded) .thsc-cloud-recommend-shuffle,
.thsc-cloud-tray:not(.is-expanded) .thsc-cloud-recommend-reset { display: none !important; }
.is-expanded .thsc-cloud-tray-summary {
    order: 2;
    height: 50px;
    flex: 0 0 50px;
    justify-content: flex-start;
    gap: 12px;
    border-top: 1px solid rgba(148, 163, 184, .18);
}
.thsc-cloud-tray-expanded { display: none; }
.is-expanded .thsc-cloud-tray-expanded {
    order: 1;
    flex: 1;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}
.is-expanded .thsc-cloud-tray-items:not(.has-cloud-recommendations) {
    padding-top: 48px;
}
.is-expanded .thsc-cloud-tray-items.has-cloud-recommendations .thsc-cloud-recommend-head {
    box-sizing: border-box;
    padding-right: 52px;
}
.is-expanded .thsc-cloud-tray-actions { min-height: 0; }
.thsc-cloud-tray-items {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 7px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    align-content: stretch;
}
.thsc-cloud-tray-thumb {
    position: relative;
    cursor: pointer;
    min-width: 0;
    min-height: 0;
    height: 100%;
    aspect-ratio: auto;
    border: 1px solid #d8d8d8;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.thsc-cloud-tray-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, .22);
}
.thsc-cloud-tray-thumb-image {
    position: relative;
    height: 68%;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .72), transparent 50%),
        linear-gradient(180deg, #f4f1ea, #ddd6ca);
}
.thsc-cloud-tray-thumb img {
    position: absolute;
    inset: 5%;
    width: 90%;
    height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 5px 7px rgba(20, 20, 20, .16));
}
.thsc-cloud-tray-wear {
    position: absolute;
    top: 0;
    left: 0;
    padding: 2px 5px;
    color: #fff;
    background: rgba(15, 23, 42, .62);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.thsc-cloud-tray-wear-value {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 3px 4px;
    color: #fff;
    background: rgba(15, 23, 42, .76);
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
}
.thsc-cloud-tray-thumb-info {
    display: flex;
    height: 32%;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px 7px;
    box-sizing: border-box;
}
.thsc-cloud-tray-name {
    display: block;
    color: #25221d;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.thsc-cloud-tray-price {
    color: #b45309;
    font-size: 12px;
    line-height: 1;
}
.thsc-cloud-tray-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
}
.thsc-cloud-tray-buttons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.thsc-cloud-tray-submit,
.thsc-cloud-tray-pay {
    min-width: 88px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 13px;
    white-space: nowrap;
}
body.thsc-body .thsc-cloud-tray-submit,
body.thsc-body .thsc-cloud-tray-pay {
    flex: 0 0 88px;
    width: 88px;
    min-width: 88px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 10px;
}
.thsc-cloud-tray-error { margin: 0; color: #dc2626; font-size: 12px; }

.thsc-cloud-tray-items.has-cloud-recommendations {
    display: block;
    overflow: hidden;
}
.thsc-cloud-recommend {
    display: flex;
    height: 100%;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
    color: #1e293b;
}
.thsc-cloud-recommend-head {
    position: relative;
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(255, 211, 61, .17), rgba(255, 255, 255, 0) 58%);
}
.thsc-cloud-recommend-head .thsc-cloud-recommend-ai-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    line-height: 0;
    flex: 0 0 auto;
    filter: drop-shadow(0 2px 4px rgba(250, 161, 22, .28));
}
.thsc-cloud-recommend-head .thsc-cloud-recommend-ai-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.thsc-cloud-recommend-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1 1 auto;
}
.thsc-cloud-recommend-head h3 {
    margin: 0;
    color: #24201a;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.01em;
}
.thsc-cloud-recommend-head p {
    overflow: hidden;
    margin: 0;
    color: #625b4e;
    font-size: 11px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.thsc-cloud-output-tabs {
    display: flex;
    width: fit-content;
    max-width: 100%;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
    border-bottom: 1px solid #e5e7eb;
}
.thsc-cloud-output-tabs > span {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.thsc-cloud-output-tabs > div {
    display: flex;
    flex: 0 1 auto;
    align-items: stretch;
    justify-content: flex-start;
    min-width: 0;
    gap: 4px;
}
.thsc-cloud-output-tab {
    position: relative;
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #64748b;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: color .2s ease;
}
.thsc-cloud-output-tab::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: #4f46e5;
    content: "";
    opacity: 0;
    transform: scaleX(0);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1), opacity .25s ease;
}
.thsc-cloud-output-tab:hover { color: #3730a3; }
.thsc-cloud-output-tab:hover::after { opacity: .45; transform: scaleX(.55); }
.thsc-cloud-output-tab.is-active { color: #3730a3; }
.thsc-cloud-output-tab.is-active::after { opacity: 1; transform: scaleX(1); }
.thsc-cloud-recommend-run,
.thsc-cloud-recommend-use,
.thsc-cloud-priority-buttons button {
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.thsc-cloud-recommend-run {
    flex: 0 0 auto;
    min-height: 32px;
    height: 32px;
    padding: 0 16px;
    border: 1px solid #1d4ed8;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.thsc-cloud-recommend-run:hover:not(:disabled),
.thsc-cloud-recommend-use:hover {
    background: #1d4ed8;
}
.thsc-cloud-recommend-run:disabled {
    cursor: wait;
    opacity: .58;
}
.thsc-cloud-priority-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.thsc-cloud-priority-item {
    display: flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    gap: 6px;
    padding: 0 4px 0 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    cursor: grab;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.thsc-cloud-priority-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}
.thsc-cloud-priority-item:focus-visible,
.thsc-cloud-recommend-run:focus-visible,
.thsc-cloud-recommend-use:focus-visible,
.thsc-cloud-priority-buttons button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.thsc-cloud-priority-item.is-dragging {
    cursor: grabbing;
    opacity: .48;
}
.thsc-cloud-priority-grip {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: #94a3b8;
}
.thsc-cloud-priority-item > span:not(.thsc-cloud-priority-buttons) {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.thsc-cloud-priority-item b {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
}
.thsc-cloud-priority-buttons {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 2px;
    margin-left: auto;
}
.thsc-cloud-priority-buttons button {
    display: inline-flex;
    width: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475569;
}
.thsc-cloud-priority-buttons button:hover:not(:disabled) {
    background: #dbeafe;
    color: #1d4ed8;
}
.thsc-cloud-priority-buttons button:disabled {
    cursor: not-allowed;
    opacity: .28;
}
.thsc-cloud-priority-buttons svg {
    width: 18px;
    height: 18px;
}
.thsc-cloud-recommend-status {
    min-height: 16px;
    margin: 0;
    color: #64748b;
    font-size: 11px;
    line-height: 16px;
}
.thsc-cloud-recommend-status.is-loading {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #1d4ed8;
}
.thsc-cloud-recommend-status.is-loading span {
    width: 12px;
    height: 12px;
    border: 2px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: thsc-cloud-recommend-spin .8s linear infinite;
}
.thsc-cloud-recommend-status.is-error { color: #b91c1c; }
.thsc-cloud-recommend-status.is-warn { color: #a16207; }
@keyframes thsc-cloud-recommend-spin { to { transform: rotate(360deg); } }
.thsc-cloud-recommend-list {
    display: flex;
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    flex-direction: column;
}
.thsc-cloud-recommend-row {
    display: grid;
    min-width: 0;
    grid-template-columns: 36px repeat(4, minmax(0, 1fr)) 56px;
    gap: 12px;
    min-height: 40px;
    align-items: center;
    padding: 5px 4px;
    border-bottom: 1px solid #dbe2ea;
    color: #475569;
    font-size: 12px;
}
.thsc-cloud-recommend-rank {
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}
.thsc-cloud-recommend-row > span {
    display: flex;
    min-width: 0;
    justify-content: space-between;
    gap: 6px;
    white-space: nowrap;
}
.thsc-cloud-recommend-row > span b {
    color: #1d4ed8;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thsc-cloud-recommend-use {
    position: relative;
    right: 8px;
    height: 26px;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid #1d4ed8;
    border-radius: 0;
    background: #fff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}
.thsc-cloud-recommend-use:hover {
    background: #1d4ed8;
    color: #fff;
}

#thsc-modal-participate.thsc-cloud-craft-progress-dialog .detail-hero,
#thsc-modal-participate.thsc-cloud-craft-progress-dialog .detail-columns {
    display: none;
}
#thsc-modal-participate.thsc-cloud-craft-progress-dialog.detail-overlay {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
#thsc-modal-participate.thsc-cloud-craft-progress-dialog .detail-panel {
    width: min(540px, 100%);
    min-height: 440px;
    align-items: center;
    justify-content: center;
    border-color: #243340;
    background: #0c131a;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .8);
}
.thsc-cloud-craft-progress {
    width: min(100%, 480px);
    padding: 30px;
    box-sizing: border-box;
    text-align: center;
}
.thsc-cloud-craft-progress-eyebrow {
    margin: 0 0 8px;
    color: #45c89a;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
}
.thsc-cloud-craft-progress h2 {
    margin: 0;
    color: #e2e8f0;
    font-size: 22px;
}
.thsc-cloud-craft-progress-message {
    min-height: 22px;
    margin: 12px 0 20px;
    color: #94a3b8;
    font-size: 14px;
}
.thsc-cloud-craft-progress-steps {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    text-align: left;
    list-style: none;
}
.thsc-cloud-craft-progress-steps li {
    position: relative;
    padding: 10px 12px 10px 36px;
    border-radius: 8px;
    color: #94a3b8;
    background: #121d26;
    font-size: 13px;
}
.thsc-cloud-craft-progress-steps li::before {
    position: absolute;
    left: 13px;
    top: 10px;
    width: 15px;
    height: 15px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    box-sizing: border-box;
    content: "";
}
.thsc-cloud-craft-progress-steps li.is-done { color: #6ee7b7; background: #10241f; }
.thsc-cloud-craft-progress-steps li.is-done::before {
    border-color: #22c55e;
    background: #22c55e;
    box-shadow: inset 0 0 0 3px #10241f;
}
.thsc-cloud-craft-progress-steps li.is-current { color: #7dd3fc; background: #10202b; font-weight: 700; }
.thsc-cloud-craft-progress-steps li.is-current::before {
    border-color: #0284c7;
    animation: thsc-craft-pulse 1.1s ease-in-out infinite;
}
.thsc-cloud-craft-progress-output {
    display: grid;
    gap: 7px;
    margin-top: 18px;
    text-align: left;
}
.thsc-cloud-craft-output-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
}
.thsc-cloud-craft-output-item img { width: 48px; height: 26px; object-fit: contain; }
.thsc-cloud-craft-progress-task { margin: 18px 0 0; color: #94a3b8; font-size: 12px; }

#thsc-modal-participate.thsc-cloud-reveal-dialog .detail-panel {
    width: min(760px, calc(100vw - 32px));
    min-height: min(560px, calc(100vh - 48px));
    padding: 0;
    overflow: hidden;
}
#thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-craft-progress {
    width: 100%;
    padding: 0;
}
#thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-craft-progress-eyebrow,
#thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-craft-progress > h2,
#thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-craft-progress-message,
#thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-craft-progress-steps,
#thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-craft-progress-output {
    display: none;
}
#thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-craft-progress-task {
    display: none;
}
.thsc-cloud-reveal {
    position: relative;
    width: 100%;
    height: min(560px, calc(100vh - 48px));
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(102, 126, 234, .25), transparent 46%),
        linear-gradient(145deg, #101721, #1a2430);
    touch-action: none;
}
.thsc-cloud-reveal-result {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}
.thsc-cloud-reveal-card {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 0;
    /* img / h3 / 磨损+价格行 / 归属武器箱行 —— 最后一行 auto，只有有 crate 时才占位 */
    grid-template-rows: minmax(0, 1fr) auto auto auto;
    row-gap: 4px;
    margin: 0;
    padding: 28px;
    /* 默认蓝调（无品质匹配时的回退），下方品质选择器会覆盖 --reveal-glow-* */
    --reveal-glow-rgb: 147, 197, 253;
    --reveal-glow-core-rgb: 102, 126, 234;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(var(--reveal-glow-rgb), .38);
    border-radius: 0;
    background: rgba(15, 23, 42, .58);
    box-sizing: border-box;
    text-align: center;
    animation: thsc-cloud-reveal-enter 850ms cubic-bezier(.2, .8, .2, 1) both;
}
.thsc-cloud-reveal-card img {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .42));
}
.thsc-cloud-reveal-card h3 {
    margin: 2px 0 7px;
    font-size: 19px;
    text-align: left;
}
.thsc-cloud-reveal-card .thsc-cloud-reveal-stat-row {
    display: flex;
    justify-content: flex-start;
    gap: 18px;
    color: #aebdca;
    font-size: 12px;
}
.thsc-cloud-reveal-card strong { color: #f8c15c; }

/* 归属武器箱：紧贴磨损行下方，单段胶囊小徽章，直接显示"XX武器箱" */
.thsc-cloud-reveal-card .thsc-cloud-reveal-crate {
    display: inline-flex;
    align-items: center;
    align-self: start;
    justify-self: start;
    max-width: 100%;
    padding: 2px 10px;
    border: 1px solid rgba(var(--reveal-glow-rgb), .32);
    border-radius: 999px;
    background: rgba(30, 41, 59, .55);
    font-size: 11px;
    line-height: 1.5;
    color: #e5edf7;
    font-weight: 500;
    letter-spacing: .01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =====================================================================
 * 云开揭晓卡片 · 品质光感氛围
 * ---------------------------------------------------------------------
 * 揭晓时刻的仪式感：饰品悬浮在与其品质匹配的能量光核之上。分层：
 *   - ::before  = 旋转光束（圆锥渐变 + 环形 mask，中心留空不糊图）
 *   - ::after   = 中心主光晕 + 卡底情绪淡光（叠加两个 radial-gradient）
 *   - img/文字  = z-index:1 始终位于所有光效之上
 *   - 入场      = 850ms 内从"过曝糊"渐变到正常，模拟聚焦成像
 *
 * 品质配色通过 CSS 变量注入：--reveal-glow-rgb / --reveal-glow-core-rgb。
 * ================================================================== */
.thsc-cloud-reveal-card.quality-contraband {
    --reveal-glow-rgb: 255, 210, 130;
    --reveal-glow-core-rgb: 228, 174, 57;
}
.thsc-cloud-reveal-card.quality-covert {
    --reveal-glow-rgb: 255, 96, 96;
    --reveal-glow-core-rgb: 235, 75, 75;
}
.thsc-cloud-reveal-card.quality-classified {
    --reveal-glow-rgb: 240, 110, 220;
    --reveal-glow-core-rgb: 211, 44, 230;
}
.thsc-cloud-reveal-card.quality-restricted {
    --reveal-glow-rgb: 170, 128, 255;
    --reveal-glow-core-rgb: 136, 71, 255;
}
.thsc-cloud-reveal-card.quality-milspec {
    --reveal-glow-rgb: 130, 158, 255;
    --reveal-glow-core-rgb: 75, 105, 255;
}
.thsc-cloud-reveal-card.quality-industrial {
    --reveal-glow-rgb: 140, 190, 240;
    --reveal-glow-core-rgb: 94, 152, 217;
}
.thsc-cloud-reveal-card.quality-consumer {
    --reveal-glow-rgb: 200, 214, 230;
    --reveal-glow-core-rgb: 176, 195, 217;
}

/* ::before —— 旋转放射光束，中心留空避免糊住饰品 */
.thsc-cloud-reveal-card::before {
    content: "";
    position: absolute;
    top: 40%;
    left: 50%;
    width: 130%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    transform-origin: 50% 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg 4deg,
        rgba(var(--reveal-glow-rgb), .55) 4deg 7deg,
        transparent 7deg 28deg,
        rgba(var(--reveal-glow-rgb), .32) 28deg 32deg,
        transparent 32deg 58deg,
        rgba(var(--reveal-glow-rgb), .55) 58deg 62deg,
        transparent 62deg 88deg,
        rgba(var(--reveal-glow-rgb), .28) 88deg 92deg,
        transparent 92deg 118deg,
        rgba(var(--reveal-glow-rgb), .55) 118deg 121deg,
        transparent 121deg 148deg,
        rgba(var(--reveal-glow-rgb), .32) 148deg 152deg,
        transparent 152deg 178deg,
        rgba(var(--reveal-glow-rgb), .55) 178deg 182deg,
        transparent 182deg 208deg,
        rgba(var(--reveal-glow-rgb), .28) 208deg 212deg,
        transparent 212deg 238deg,
        rgba(var(--reveal-glow-rgb), .55) 238deg 241deg,
        transparent 241deg 268deg,
        rgba(var(--reveal-glow-rgb), .32) 268deg 272deg,
        transparent 272deg 298deg,
        rgba(var(--reveal-glow-rgb), .55) 298deg 302deg,
        transparent 302deg 328deg,
        rgba(var(--reveal-glow-rgb), .28) 328deg 332deg,
        transparent 332deg 360deg
    );
    -webkit-mask-image:
        radial-gradient(circle at 50% 50%,
            transparent 0%,
            transparent 15%,
            #000 32%,
            #000 62%,
            transparent 88%);
    mask-image:
        radial-gradient(circle at 50% 50%,
            transparent 0%,
            transparent 15%,
            #000 32%,
            #000 62%,
            transparent 88%);
    animation: thsc-cloud-reveal-spin 22s linear infinite;
    will-change: transform;
    z-index: 0;
    pointer-events: none;
}

/* ::after —— 中心主光晕 + 卡底情绪淡光（两层 radial 叠加） */
.thsc-cloud-reveal-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 40%,
            rgba(var(--reveal-glow-rgb), .55) 0%,
            rgba(var(--reveal-glow-core-rgb), .30) 20%,
            rgba(var(--reveal-glow-core-rgb), .12) 42%,
            transparent 66%),
        radial-gradient(ellipse at 50% 100%,
            rgba(var(--reveal-glow-core-rgb), .16) 0%,
            transparent 60%);
    animation: thsc-cloud-reveal-halo 3.6s ease-in-out infinite;
    will-change: transform, opacity;
    z-index: 0;
    pointer-events: none;
}

/* 饰品图与文字层：置于光效之上，不被遮挡 */
.thsc-cloud-reveal-card > * {
    position: relative;
    z-index: 1;
}

@keyframes thsc-cloud-reveal-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes thsc-cloud-reveal-halo {
    0%, 100% { opacity: .88; transform: scale(.96); }
    50%      { opacity: 1;   transform: scale(1.04); }
}
@keyframes thsc-cloud-reveal-enter {
    0%   { filter: brightness(1.8) saturate(1.3) blur(6px); opacity: 0; }
    45%  { filter: brightness(1.25) saturate(1.15) blur(0); opacity: 1; }
    100% { filter: none; opacity: 1; }
}

/* 系统偏好"减少动效"：停旋转/呼吸/入场缩放，静态光晕保留 */
@media (prefers-reduced-motion: reduce) {
    .thsc-cloud-reveal-card,
    .thsc-cloud-reveal-card::before,
    .thsc-cloud-reveal-card::after {
        animation: none;
    }
}
.thsc-cloud-console {
    --reveal-x: 0px;
    --reveal-y: 0px;
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-rows: 36px minmax(0, 1fr) auto;
    overflow: hidden;
    color: #a9bdc9;
    background: #000;
    font-family: Consolas, "SFMono-Regular", "Liberation Mono", monospace;
    transform: translate3d(var(--reveal-x), var(--reveal-y), 0);
    transition: transform .24s cubic-bezier(.2, .78, .24, 1), opacity .2s ease;
    user-select: none;
    touch-action: none;
}
.thsc-cloud-console.is-ready { cursor: grab; }
.thsc-cloud-console.is-dragging {
    cursor: grabbing;
    transition: none;
}
.thsc-cloud-console.is-revealed {
    pointer-events: none;
    opacity: 0;
    transform: scale(.96);
}
.thsc-cloud-console-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 11px;
    border-bottom: 1px solid #2e404c;
    color: #d2dde4;
    background: #17242d;
    font-size: 12px;
}
.thsc-cloud-console-titlebar span:last-child { color: #77d89d; }
.thsc-cloud-console-event {
    display: grid;
    align-content: center;
    gap: 7px;
    margin: 0;
    padding: 24px;
    overflow: hidden;
    color: #9bb9cb;
    font-size: clamp(14px, 2.5vw, 18px);
    line-height: 1.7;
}
.thsc-cloud-console-event p {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    margin: 0;
    animation: thsc-console-line-in .16s steps(2, end);
}
.thsc-cloud-console-event time { color: #587384; white-space: nowrap; }
.thsc-cloud-console-event .is-success span { color: #74d99b; }
.thsc-cloud-console-event .is-error span { color: #f18484; }
.thsc-cloud-console-event .is-warn span { color: #f4c86d; }
.thsc-cloud-console-event .is-final span {
    color: #f4c86d;
    font-weight: 700;
}
.thsc-cloud-console-hint {
    margin: 0;
    padding: 8px 12px;
    border-top: 1px solid #263a46;
    color: #7f9aaa;
    background: #111c23;
    font-size: 10px;
}
.thsc-cloud-console-hint::before {
    color: #6fdb9b;
    content: "> ";
}
@keyframes thsc-craft-pulse {
    50% { transform: scale(1.18); box-shadow: 0 0 0 5px rgba(2, 132, 199, .12); }
}
@keyframes thsc-console-line-in {
    from { opacity: 0; transform: translateY(3px); }
}

@media (max-width: 680px) {
    #thsc-modal-participate.thsc-cloud-reveal-dialog .detail-panel {
        width: calc(100vw - 28px);
        height: 33.333dvh;
        min-height: 0;
        max-height: 33.333dvh;
        border-radius: 12px;
    }
    .thsc-cloud-reveal { height: 100%; }
    .thsc-cloud-reveal-card h3 { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .thsc-cloud-console { transition: opacity .01ms linear; }
    .thsc-cloud-console-event p { animation: none; }
}

@media (min-width: 768px) {
    .thsc-cloud-tray-items {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        justify-content: stretch;
        gap: 8px;
    }
}

@media (min-width: 681px) {
    #thsc-modal-participate.thsc-cloud-tray-dialog {
        top: auto;
        right: auto;
        bottom: 0;
        left: 50%;
        z-index: 201;
        display: block;
        width: min(980px, calc(100% - 32px));
        height: auto;
        padding: 0;
        transform: translateX(-50%);
        background: transparent;
    }
    #thsc-modal-participate.thsc-cloud-tray-dialog .detail-panel {
        width: 100%;
        max-height: calc(100vh - 32px);
        border-bottom: 0;
        border-radius: 14px 14px 0 0;
        animation: thsc-sheet-up .24s ease-out;
    }
    #thsc-modal-participate.thsc-cloud-tray-dialog .detail-close {
        font-size: 24px;
        font-weight: 700;
        line-height: .8;
    }
}

@media (max-width: 680px) {
    .thsc-cloud-tray-summary {
        flex-wrap: nowrap;
        gap: 8px;
        overflow: visible;
        justify-content: flex-start;
        font-size: 11px;
        white-space: nowrap;
    }
    .thsc-cloud-tray-summary > span,
    .thsc-cloud-tray-summary > button,
    .thsc-cloud-tray-summary > div { flex: 0 0 auto; }
    .thsc-cloud-tray-summary strong { font-size: 13px; }
    .is-expanded .thsc-cloud-tray-summary {
        height: auto;
        min-height: 50px;
        flex: 0 0 auto;
        flex-wrap: wrap;
        padding-bottom: 6px;
    }
    .is-expanded .thsc-cloud-tray-reset {
        padding: 0 7px;
        font-size: 11px;
    }
    .is-expanded .thsc-cloud-tray-buttons {
        order: 2;
        width: 100%;
        gap: 3px;
        margin-left: auto;
        justify-content: flex-end;
    }
    .is-expanded .thsc-cloud-tray-submit,
    .is-expanded .thsc-cloud-tray-pay {
        min-width: 82px;
        padding: 0 8px;
        font-size: 12px;
    }
    body.thsc-body .is-expanded .thsc-cloud-tray-submit,
    body.thsc-body .is-expanded .thsc-cloud-tray-pay {
        flex-basis: 82px;
        width: 82px;
        min-width: 82px;
        height: 44px;
        min-height: 44px;
    }
    .is-expanded .thsc-cloud-tray-toggle svg { width: 23px; height: 23px; }
}

.thsc-cloud-tip {
    padding: 8px 12px;
    background: rgba(148, 163, 184, .08);
    border-radius: 8px;
    color: var(--muted, #94a3b8);
    font-size: 13px;
    margin-bottom: 10px;
}
.thsc-cloud-loading {
    display: flex;
    height: 42px;
    min-width: 0;
    flex: 0 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    padding-left: 8px;
    color: #475569;
    font-size: 12px;
    white-space: nowrap;
}
.thsc-cloud-loading-spinner,
.thsc-cloud-chip-spinner {
    display: inline-block;
    flex: none;
    border: 2px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: thsc-cloud-loading-spin .75s linear infinite;
}
.thsc-cloud-loading-spinner {
    width: 15px;
    height: 15px;
}
.thsc-cloud-chip-spinner {
    width: 13px;
    height: 13px;
}
@keyframes thsc-cloud-loading-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .thsc-cloud-loading-spinner,
    .thsc-cloud-chip-spinner { animation: none; }
}

.thsc-cloud-inv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
}
@media (min-width: 768px) {
    .thsc-cloud-inv-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}
.thsc-cloud-inv-grid .material-card {
    position: relative;
    height: auto;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    border: 2px solid transparent;
}
.thsc-cloud-inv-grid.is-syncing .material-card {
    cursor: wait;
    opacity: .55;
    pointer-events: none;
}
.thsc-cloud-inv-grid .material-card:hover:not(.is-consumed):not(.no-price) {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.thsc-cloud-inv-grid .material-card .card-select-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(37, 99, 235, .35);
    z-index: 2;
}
.thsc-cloud-inv-grid .material-card.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.thsc-cloud-inv-grid .material-card.is-selected .card-select-check { display: flex; }
.thsc-cloud-inv-grid .card-selection-hint {
    position: absolute;
    left: 50%;
    bottom: 28%;
    z-index: 4;
    transform: translateX(-50%);
    max-width: calc(100% - 12px);
    padding: 3px 6px;
    border-radius: 4px;
    color: #dc2626;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 1px 5px rgba(127, 29, 29, .2);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    animation: thsc-cloud-selection-shake 1.4s ease-in-out infinite;
}
@keyframes thsc-cloud-selection-shake {
    0%, 72%, 100% { transform: translateX(-50%); }
    78% { transform: translateX(calc(-50% - 2px)); }
    84% { transform: translateX(calc(-50% + 2px)); }
    90% { transform: translateX(calc(-50% - 1px)); }
    96% { transform: translateX(calc(-50% + 1px)); }
}
.thsc-cloud-inv-grid .material-card.is-consumed {
    cursor: not-allowed;
    opacity: .35;
    filter: grayscale(.8);
    pointer-events: none;
}
.thsc-cloud-inv-grid .material-card.no-price {
    cursor: not-allowed;
}

.thsc-cloud-outputs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.thsc-cloud-output {
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}
.thsc-cloud-output-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    margin-bottom: 8px;
}
.thsc-cloud-output-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}
.thsc-cloud-output-status.is-success { background: rgba(34, 197, 94, .15); color: #16a34a; }
.thsc-cloud-output-status.is-failed  { background: rgba(239, 68, 68, .15); color: #ef4444; }
.thsc-cloud-output-status.is-running { background: rgba(59, 130, 246, .15); color: #3b82f6; }
.thsc-cloud-output-recipe { color: var(--muted, #94a3b8); }
.thsc-cloud-output-cost   { font-weight: 600; }
.thsc-cloud-output-refunded {
    margin-left: 4px;
    padding: 1px 6px;
    background: rgba(59, 130, 246, .15);
    color: #3b82f6;
    border-radius: 3px;
    font-size: 10px;
}
.thsc-cloud-output-time { color: var(--muted, #94a3b8); margin-left: auto; }
.thsc-cloud-output-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.thsc-cloud-output-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(148, 163, 184, .08);
    border-radius: 6px;
    min-width: 160px;
}
.thsc-cloud-output-item img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: rgba(148, 163, 184, .08);
    border-radius: 4px;
}
.thsc-cloud-output-item-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 160px;
}
.thsc-cloud-output-item-wear {
    font-size: 11px;
    color: var(--muted, #94a3b8);
}
.thsc-cloud-output-empty-items {
    font-size: 12px;
    color: var(--muted, #94a3b8);
    margin: 0;
}

@media (max-width: 480px) {
    #thsc-view-cloud {
        padding: 6px 6px 90px;
    }
    #thsc-view-cloud .material-card {
        container-type: inline-size;
        height: auto;
        aspect-ratio: 207 / 220;
    }

    #thsc-view-cloud .thsc-cloud-inv-grid .material-card {
        aspect-ratio: auto;
    }
    #thsc-view-cloud .thsc-cloud-inv-grid .material-img {
        height: auto;
        aspect-ratio: 207 / 150;
    }
    #thsc-view-cloud .material-img {
        height: 68.1818%;
    }
    #thsc-view-cloud .material-img::before {
        font-size: calc(17 * 100cqi / 207);
        word-spacing: calc(12 * 100cqi / 207);
    }
    #thsc-view-cloud .material-info {
        gap: calc(2 * 100cqi / 207);
        padding:
            calc(4 * 100cqi / 207)
            calc(8 * 100cqi / 207)
            calc(5 * 100cqi / 207);
    }
    #thsc-view-cloud .item-name {
        font-size: calc(12 * 100cqi / 207);
    }
    #thsc-view-cloud .sell-order-price {
        font-size: calc(14 * 100cqi / 207);
    }
    #thsc-view-cloud .material-price-line {
        gap: calc(6 * 100cqi / 207);
    }
    #thsc-view-cloud .material-case {
        max-width: calc(120 * 100cqi / 207);
        font-size: calc(11 * 100cqi / 207);
    }
    #thsc-view-cloud .wear-tier-chip {
        padding:
            calc(2 * 100cqi / 207)
            calc(6 * 100cqi / 207);
        font-size: calc(12 * 100cqi / 207);
    }
    #thsc-view-cloud .wear {
        height: calc(20 * 100cqi / 207);
    }
    #thsc-view-cloud .wear-value {
        height: calc(14 * 100cqi / 207);
        padding: 0 calc(5 * 100cqi / 207);
        font-size: calc(11 * 100cqi / 207);
        transform: translateY(calc(-2 * 100cqi / 207));
    }
    #thsc-view-cloud .wear-track {
        bottom: calc(2 * 100cqi / 207);
        height: calc(6 * 100cqi / 207);
    }
    #thsc-view-cloud .wear-pointer {
        border-right-width: calc(4 * 100cqi / 207);
        border-bottom-width: calc(5 * 100cqi / 207);
        border-left-width: calc(4 * 100cqi / 207);
    }
    #thsc-view-cloud .thsc-cloud-inv-grid .material-card .card-select-check {
        top: calc(8 * 100cqi / 207);
        right: calc(8 * 100cqi / 207);
        width: calc(22 * 100cqi / 207);
        height: calc(22 * 100cqi / 207);
        font-size: calc(13 * 100cqi / 207);
    }
    .thsc-cloud-row1 { gap: 8px; }
    .thsc-cloud-sticky-head {
        padding: 7px;
        border-radius: 13px;
    }
    .thsc-cloud-filter-caption {
        display: none;
    }
    .thsc-cloud-compact-bar {
        gap: 4px;
        padding: 3px;
    }
    .thsc-cloud-accounts-scroll {
        flex: 1 1 auto;
        min-width: 0;
        height: 38px;
    }
    .thsc-cloud-account-trigger {
        height: 38px;
        padding: 0;
    }
    .thsc-cloud-account-current {
        gap: 8px;
        padding: 0 8px 0 10px;
    }
    .thsc-cloud-account-current-name { font-size: 12px; }
    .thsc-cloud-account-current-count { font-size: 10px; }
    .thsc-cloud-account-switch-cta {
        padding: 0 10px;
        font-size: 11px;
        gap: 4px;
    }
    .thsc-cloud-account-switch-icon {
        width: 13px;
        height: 13px;
    }
    .thsc-cloud-account-current-name {
        font-size: 15px;
    }
    .thsc-cloud-account-dropdown {
        max-height: 220px;
    }
    .thsc-cloud-no-accounts { line-height: 38px; font-size: 12px; }
    .thsc-cloud-compact-bar .thsc-cloud-row2 {
        gap: 4px;
        /* 移动端只有 3 个筛选按钮(flex:1 1 0 平分)，本身就该刚好铺满一行；
           保留 overflow-x:auto 会因像素取整 / 滑动惯性 / 焦点 scrollIntoView
           导致 scrollLeft 被卷偏，视觉上"下拉之后偏离"。这里锁死为 clip
           + scrollLeft 归零，杜绝任何水平滚动可能。 */
        overflow-x: clip;
        overflow-y: visible;
        scroll-padding-inline: 0;
        overscroll-behavior-x: contain;
    }
    .thsc-cloud-compact-bar .cloud-filter-select {
        display: none !important;
    }
    .thsc-cloud-compact-bar .thsc-cloud-filter-trigger {
        display: inline-flex;
        height: 30px;
        min-width: 0;
        flex: 1 1 0;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        padding: 0 8px;
        border: 1px solid #dbe2ea;
        border-radius: 8px;
        background: #fff;
        color: #334155;
        font-size: 12px;
        font-weight: 700;
    }
    .thsc-cloud-filter-trigger span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .thsc-cloud-filter-trigger svg {
        width: 10px;
        height: 10px;
        flex: 0 0 10px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.8;
        transition: transform .18s ease;
    }
    .thsc-cloud-filter-trigger[aria-expanded="true"] svg {
        transform: rotate(180deg);
    }
    .thsc-cloud-filter-meta {
        flex: 0 0 auto;
        justify-content: flex-end;
        max-width: 100%;
        margin-left: 0;
    }
    .thsc-cloud-viewer-count { max-width: none; }
    .thsc-cloud-output-head {
        font-size: 11px;
    }
    .thsc-cloud-output-time {
        width: 100%;
        margin-left: 0;
    }
    /* 移动端汰换材料栏：
       - 「compact 底部横条」用 fit-content + max-width 80vw + min-width: min-content，
         让 tray 宽度贴合"材料 X/10 · 总价 · 余额 · + 按钮"的实际内容：
         · 屏幕够宽时按内容自然大小（约 60-70% 屏宽）
         · 屏幕过窄时 min-content 兜底，保证内容和 + 按钮不挤在一起
         · 上限 80vw 防止占满整个屏幕
       - 「is-expanded 弹窗形态」仍要展示 10 个饰品缩略图、操作按钮，保留原
         接近全屏的宽度 */
    .thsc-cloud-tray {
        right: 8px;
        width: fit-content;
        min-width: min-content;
        max-width: min(80vw, calc(100vw - 16px));
        padding: 0 6px 0 12px;
    }
    .thsc-cloud-tray.is-expanded {
        width: calc(100vw - 16px);
        min-width: 0;   /* 覆盖 compact 态的 min-content：5 张缩略图 min-content 会撑爆屏 */
        max-width: none;
        height: min(320px, calc(100dvh - 28px - env(safe-area-inset-bottom, 0px) - var(--thsc-cloud-tray-footer-offset)));
        min-height: 0;
        padding: 7px 8px 9px;
    }
    .thsc-cloud-tray.is-expanded:has(.has-cloud-recommendations) {
        height: min(410px, calc(100dvh - 28px - env(safe-area-inset-bottom, 0px) - var(--thsc-cloud-tray-footer-offset)));
    }
    /* compact 横条里 summary 的右内边距：
       + 按钮 (position:absolute; right:14px; width:26px) 占据右侧 40px，
       所以给 46px 留出至少 6px 视觉呼吸区，避免"余额"数字紧贴按钮。 */
    .thsc-cloud-tray:not(.is-expanded) .thsc-cloud-tray-summary {
        gap: 10px;
        padding-right: 46px;
    }
    .thsc-cloud-recommend {
        gap: 5px;
    }
    .thsc-cloud-recommend-head {
        min-height: 40px;
    }
    .thsc-cloud-recommend-head h3 { font-size: 17px; font-weight: 800; }
    .thsc-cloud-recommend-head p { font-size: 12px; font-weight: 700; }
    .thsc-cloud-output-tabs {
        gap: 8px;
    }
    .thsc-cloud-output-tabs > span {
        font-size: 11px;
    }
    .thsc-cloud-output-tabs > div {
        gap: 6px;
    }
    .thsc-cloud-output-tab {
        min-height: 30px;
        font-size: 11px;
    }
    .thsc-cloud-recommend-run { padding: 0 12px; font-size: 14px; font-weight: 800; }
    .thsc-cloud-priority-list {
        display: flex;
        overflow: visible;
        flex-direction: column;
        gap: 4px;
    }
    .thsc-cloud-priority-item {
        width: 100%;
        min-width: 0;
        flex: 0 0 44px;
    }
    .thsc-cloud-recommend-list {
        display: flex;
        overflow-y: auto;
        padding-bottom: 0;
    }
    .thsc-cloud-recommend-row {
        grid-template-columns: 27px repeat(4, minmax(0, 1fr)) 43px;
        gap: 3px;
        min-height: 46px;
        padding: 4px 0;
        font-size: 12px;
        font-weight: 700;
    }
    .thsc-cloud-recommend-rank {
        font-size: 13px;
        font-weight: 800;
    }
    .thsc-cloud-recommend-row > span {
        flex-direction: column;
        gap: 1px;
        overflow: hidden;
    }
    .thsc-cloud-recommend-row > span b {
        font-size: 12px;
        font-weight: 800;
    }
    .thsc-cloud-recommend-use {
        height: 25px;
        min-height: 25px;
        padding: 0 4px;
        font-size: 12px;
        font-weight: 800;
    }
    .thsc-cloud-recommend-reset,
    .thsc-cloud-recommend-shuffle {
        height: 35px;
        min-height: 35px;
        padding: 0 6px;
        font-size: 12px;
        font-weight: 800;
    }
    .thsc-cloud-recommend-clear {
        height: 35px;
        min-height: 35px;
        padding: 0 6px;
        font-size: 12px;
        font-weight: 800;
    }
    .thsc-cloud-recommend-status,
    .thsc-cloud-tray-error { font-size: 12px; font-weight: 700; }
    .is-expanded .thsc-cloud-tray-summary { gap: 4px; font-size: 12px; font-weight: 700; justify-content: flex-start; }
    .is-expanded .thsc-cloud-tray-summary strong { font-size: 14px; font-weight: 800; }
    .is-expanded .thsc-cloud-tray-reset { padding: 0 7px; font-size: 12px; font-weight: 800; }
    .is-expanded .thsc-cloud-tray-toggle svg { width: 23px; height: 23px; }
    .thsc-cloud-tray-items { gap: 4px; }
    .thsc-cloud-tray-wear { padding: 1px 3px; font-size: 10px; font-weight: 700; }
    .thsc-cloud-tray-wear-value { padding: 2px; font-size: 10px; font-weight: 700; }
    .thsc-cloud-tray-thumb-info { gap: 1px; padding: 2px 3px; }
    .thsc-cloud-tray-name,
    .thsc-cloud-tray-price { font-size: 11px; font-weight: 800; }
    .is-expanded .thsc-cloud-tray-buttons { gap: 3px; }
    .is-expanded .thsc-cloud-tray-submit,
    .is-expanded .thsc-cloud-tray-pay { min-width: 82px; padding: 0 8px; font-size: 12px; font-weight: 800; }
    .thsc-cloud-craft-progress { padding: 22px 16px; }
    .thsc-cloud-craft-progress h2 { font-size: 19px; }
}

@media (max-width: 680px) {
    #thsc-modal-participate.thsc-cloud-tray-dialog.detail-overlay {
        inset: 0;
        padding: 0;
        place-items: end stretch;
        background: transparent;
    }
    #thsc-modal-participate.thsc-cloud-tray-dialog .detail-panel {
        width: 100%;
        max-height: calc(100vh - 16px);
        border-radius: 18px 18px 0 0;
        border-bottom: 0;
        animation: thsc-sheet-up .28s ease;
    }
    #thsc-modal-participate.thsc-cloud-craft-progress-dialog.detail-overlay {
        padding: 16px;
        place-items: center;
    }
    #thsc-modal-participate.thsc-cloud-craft-progress-dialog .detail-panel {
        width: min(540px, 100%);
        min-height: min(440px, calc(100vh - 32px));
        max-height: calc(100vh - 32px);
        border: 1px solid var(--line);
        border-radius: 18px;
        animation: none;
    }

    #thsc-modal-participate.thsc-cloud-craft-progress-dialog.thsc-cloud-reveal-dialog.detail-overlay {
        padding: 0;
        place-items: center;
    }
    #thsc-modal-participate.thsc-cloud-craft-progress-dialog.thsc-cloud-reveal-dialog .detail-panel {
        width: calc(100vw - 28px);
        height: 33.333dvh;
        min-height: 0;
        max-height: 33.333dvh;
        border: 0;
        border-radius: 12px;
    }
    #thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-buy-bar {
        display: none !important;
    }
}

.thsc-cloud-compact-bar .thsc-cloud-row2 .cloud-filter-select { flex: 0 0 auto; }
.thsc-cloud-row1 .thsc-cloud-filter-meta { margin-left: auto; }

#thsc-modal-participate.thsc-cloud-reveal-dialog.detail-overlay {
    --thsc-reveal-width: min(760px, calc(100vw - 32px));
    --thsc-reveal-height: min(560px, calc(100dvh - 48px));
    inset: 0;
    display: grid;
    padding: 0;
    place-items: center;
    background: transparent;
}
#thsc-modal-participate.thsc-cloud-reveal-dialog .detail-panel {
    display: block;
    width: var(--thsc-reveal-width);
    height: var(--thsc-reveal-height);
    min-height: 0;
    max-height: var(--thsc-reveal-height);
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    animation: none;
}
#thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-craft-progress,
#thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-reveal {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
}
#thsc-modal-participate.thsc-cloud-reveal-dialog .detail-hero,
#thsc-modal-participate.thsc-cloud-reveal-dialog .detail-columns,
#thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-buy-bar {
    display: none !important;
}
@media (max-width: 680px) {
    #thsc-modal-participate.thsc-cloud-reveal-dialog.detail-overlay {
        --thsc-reveal-width: calc(100vw - 28px);
        --thsc-reveal-height: 33.333vh;
    }
    #thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-console-event {
        gap: 3px;
        padding: 10px 12px;
        font-size: 11px;
        line-height: 1.35;
    }
    #thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-console-event p {
        gap: 5px;
    }
    #thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-console-event time {
        font-size: 9px;
    }
    #thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-console-hint {
        padding: 6px 10px;
        font-size: 9px;
    }
    #thsc-modal-participate.thsc-cloud-reveal-dialog .thsc-cloud-reveal-card {
        padding: 12px;
    }
}
@supports (height: 100dvh) {
    @media (max-width: 680px) {
        #thsc-modal-participate.thsc-cloud-reveal-dialog.detail-overlay {
            --thsc-reveal-height: 33.333dvh;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .thsc-cloud-recommend-status.is-loading span { animation-duration: 1.6s; }
    .thsc-cloud-tray,
    .thsc-cloud-tray-toggle,
    .thsc-cloud-tray-toggle .cloud-toggle-vertical {
        transition-duration: .01ms;
    }
    .thsc-cloud-recommend-card,
    .thsc-cloud-priority-item,
    .thsc-cloud-recommend-run,
    .thsc-cloud-recommend-use,
    .thsc-cloud-priority-buttons button { transition-duration: .01ms; }
}

.thsc-cloud-tray-stats {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

@media (max-width: 680px) {
    .thsc-cloud-tray-toggle {
        top: 15px;
        right: 14px;
        width: 26px;
        height: 26px;
        min-width: 0;
        min-height: 0;
        flex: 0 0 26px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .thsc-cloud-tray-toggle:hover {
        border-color: transparent;
        background: transparent;
    }

    .thsc-cloud-tray.is-expanded:not(:has(.has-cloud-recommendations)) {
        height: min(248px, calc(100dvh - 24px - env(safe-area-inset-bottom, 0px) - var(--thsc-cloud-tray-footer-offset)));
        min-height: 0;
    }

    .is-expanded:not(:has(.has-cloud-recommendations))::before {
        content: "已选材料 · 左右滑动查看";
        position: absolute;
        top: 22px;
        left: 14px;
        z-index: 1;
        color: #475569;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
    }

    .is-expanded .thsc-cloud-tray-items:not(.has-cloud-recommendations) {
        display: flex;
        min-height: 0;
        padding: 42px 0 0;
        box-sizing: border-box;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        align-items: stretch;
        align-content: unset;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .is-expanded .thsc-cloud-tray-items:not(.has-cloud-recommendations)::-webkit-scrollbar {
        display: none;
    }
    .is-expanded .thsc-cloud-tray-items:not(.has-cloud-recommendations) .thsc-cloud-tray-thumb {
        flex: 0 0 94px;
        width: 94px;
        height: min(140px, 100%);
        align-self: flex-start;
        scroll-snap-align: start;
    }
    .is-expanded .thsc-cloud-tray-items:not(.has-cloud-recommendations) .thsc-cloud-tray-thumb-image {
        height: 71.4%;
    }
    .is-expanded .thsc-cloud-tray-items:not(.has-cloud-recommendations) .thsc-cloud-tray-thumb-info {
        height: 28.6%;
        gap: 1px;
        padding: 3px 5px;
    }

    .is-expanded .thsc-cloud-tray-toggle {
        top: 18px;
        right: 14px;
        width: 23px;
        height: 23px;
        min-width: 0;
        min-height: 0;
        flex: 0 0 23px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .is-expanded:not(:has(.has-cloud-recommendations)) .thsc-cloud-tray-summary {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        height: auto;
        min-height: 0;
        flex: 0 0 auto;
        gap: 6px 8px;
        padding: 7px 0 0;
    }
    .is-expanded:not(:has(.has-cloud-recommendations)) .thsc-cloud-tray-stats {
        min-width: 0;
        gap: 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    .is-expanded:not(:has(.has-cloud-recommendations)) .thsc-cloud-tray-stats strong {
        font-size: 13px;
    }
    .is-expanded:not(:has(.has-cloud-recommendations)) .thsc-cloud-tray-reset {
        min-width: 44px;
        min-height: 32px;
        padding: 0 8px;
    }
    .is-expanded:not(:has(.has-cloud-recommendations)) .thsc-cloud-tray-buttons {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        margin: 0;
        gap: 6px;
        order: initial;
    }
    body.thsc-body .is-expanded:not(:has(.has-cloud-recommendations)) .thsc-cloud-tray-submit,
    body.thsc-body .is-expanded:not(:has(.has-cloud-recommendations)) .thsc-cloud-tray-pay {
        width: 100%;
        min-width: 0;
        height: 40px;
        min-height: 40px;
    }
}

/* 登录重试与云汰换操作按钮：统一为参与弹窗的 BUFF 风格 */
body.thsc-body #thsc-qr-retry,
body.thsc-body #thsc-cloud-submit-btn,
body.thsc-body #thsc-cloud-pay-btn,
body.thsc-body #thsc-cloud-tray-reset {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 96px;
    height: 30px;
    min-height: 30px;
    padding: 0 15px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    box-shadow: none;
    transform: none;
    filter: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

body.thsc-body #thsc-cloud-submit-btn,
body.thsc-body #thsc-cloud-tray-reset {
    border: 1px solid #959697 !important;
    background: #fff !important;
    color: #333 !important;
}

body.thsc-body #thsc-cloud-submit-btn:hover,
body.thsc-body #thsc-cloud-tray-reset:hover {
    border-color: #666 !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: none;
    transform: none;
}

body.thsc-body #thsc-qr-retry,
body.thsc-body #thsc-cloud-pay-btn {
    border: 1px solid #d83333 !important;
    background: #e64343 !important;
    color: #fff !important;
}

body.thsc-body #thsc-qr-retry:hover,
body.thsc-body #thsc-cloud-pay-btn:hover {
    border-color: #c62828 !important;
    background: #d83333 !important;
    box-shadow: none;
    transform: none;
    filter: none;
}

body.thsc-body #thsc-cloud-submit-btn:disabled,
body.thsc-body #thsc-cloud-pay-btn:disabled {
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    filter: none;
}

body.thsc-body #thsc-cloud-submit-btn:disabled {
    border-color: #d1d5db !important;
    background: #f8fafc !important;
    color: #9ca3af !important;
}

body.thsc-body #thsc-cloud-pay-btn:disabled {
    border-color: #efb0b0 !important;
    background: #f3b4b4 !important;
    color: #fff !important;
}

/* 饰品市场 */
.thsc-market-view {
    min-height: 360px;
}

.thsc-segmented {
    display: grid;
    gap: 4px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.thsc-segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 8px 0 12px;
}

.thsc-segmented button {
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.thsc-segmented button:hover {
    color: #4338ca;
}

.thsc-segmented button:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: .65;
}

.thsc-segmented button.is-active {
    background: #fff;
    color: #4338ca;
    box-shadow: 0 1px 5px rgba(15, 23, 42, .12);
}

.thsc-segmented button:focus-visible,
.thsc-market-card-actions button:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.thsc-market-grid {
    margin-top: 12px;
}

.thsc-market-grid .material-card:has(.thsc-market-card-actions) {
    height: auto;
    min-height: 0;
}

.thsc-inv-item:has(.thsc-inv-market-action) {
    height: 220px;
    min-height: 0;
}

.thsc-market-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 5px;
}

.thsc-market-card-actions:has(> :only-child) {
    grid-template-columns: 1fr;
}

.thsc-market-card-actions button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
    cursor: pointer;
}

.thsc-market-card-actions button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.thsc-market-card-actions .primary-btn {
    gap: 6px;
}

.thsc-market-buy-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.thsc-market-card-actions .primary-btn:not(:disabled) .thsc-market-buy-icon path:nth-child(-n + 2) {
    fill: #ffe7a6;
}

.thsc-market-card-actions .primary-btn:not(:disabled) .thsc-market-buy-icon path:last-child {
    fill: #f1c45d;
}

.thsc-market-card-actions .primary-btn:disabled .thsc-market-buy-icon path:nth-child(-n + 2) {
    fill: #9ca3af;
}

.thsc-market-card-actions .primary-btn:disabled .thsc-market-buy-icon path:last-child {
    fill: #64748b;
}

.thsc-market-card-actions .primary-btn:not(:disabled) {
    border: 1px solid #c99b42 !important;
    color: #ffe7a6 !important;
    background:
        linear-gradient(115deg, rgba(255, 234, 172, .16), transparent 42%),
        linear-gradient(135deg, #3b3020 0%, #1e1a15 52%, #11100e 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 241, 198, .34),
        inset 0 -1px 0 rgba(0, 0, 0, .38),
        0 4px 10px rgba(47, 35, 17, .28) !important;
    font-weight: 700;
    letter-spacing: .08em;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .48);
}

.thsc-market-card-actions .primary-btn:not(:disabled):hover {
    border-color: #f1c45d !important;
    color: #fff3cc !important;
    background:
        linear-gradient(115deg, rgba(255, 242, 198, .24), transparent 42%),
        linear-gradient(135deg, #4a3b24 0%, #272015 52%, #17130e 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 247, 215, .42),
        inset 0 -1px 0 rgba(0, 0, 0, .38),
        0 7px 15px rgba(47, 35, 17, .34) !important;
    filter: none;
    transform: translateY(-1px);
}

.thsc-market-card-actions .primary-btn:not(:disabled):active {
    transform: translateY(0);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, .34),
        0 2px 5px rgba(47, 35, 17, .2) !important;
}

.thsc-market-card-actions .thsc-market-buy--mine {
    position: relative;
    padding-right: 30px;
}

.thsc-market-own-mark {
    position: absolute;
    top: 3px;
    right: 5px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}


.thsc-market-empty {
    grid-column: 1 / -1;
    margin: 24px 0;
    color: #64748b;
    text-align: center;
}

.thsc-market-price-options {
    display: grid;
    gap: 8px;
    margin: 12px 0;
    padding: 0;
    border: 0;
}

.thsc-market-price-options legend {
    margin-bottom: 7px;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.thsc-market-price-options label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
    border: 1px solid #dbe2ea;
    border-radius: 9px;
    cursor: pointer;
}

.thsc-market-price-options label:has(input:checked) {
    border-color: #6366f1;
    background: #eef2ff;
}

.thsc-market-price-options label:has(input:disabled) {
    cursor: not-allowed;
    opacity: .5;
}

.thsc-market-price-options strong {
    color: #dc2626;
    font-size: 13px;
}

.thsc-market-price-options label > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #1f2937;
    font-weight: 600;
    font-size: 13px;
}

.thsc-price-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid #f5c469;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff7dd, #ffe6a3);
    color: #8a5a00;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.thsc-claim-item b {
    color: #dc2626;
    font-size: 12px;
}

.thsc-inv-market-action {
    position: absolute;
    right: 0;
    bottom: 20px;
    left: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, .58));
}

.thsc-inv-item:not(:has(.wear)) .thsc-inv-market-action {
    bottom: 0;
}

.thsc-inv-market-action button {
    min-height: 30px;
    padding: 0 8px;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(17, 24, 39, .82) !important;
    color: #ffe7a6 !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1;
    box-shadow: none !important;
    filter: none !important;
    transition: background 0.15s ease, color 0.15s ease;
}

.thsc-inv-market-action button + button {
    border-left: 1px solid rgba(255, 231, 166, .28) !important;
}

.thsc-inv-market-action button:hover:not(:disabled) {
    background: rgba(31, 41, 55, .94) !important;
    color: #fff3cc !important;
    transform: none !important;
}

.thsc-inv-market-action button.is-danger {
    color: #fca5a5 !important;
    border-color: transparent !important;
}

.thsc-inv-market-action button.is-danger:hover:not(:disabled) {
    background: rgba(127, 29, 29, .9) !important;
    color: #fee2e2 !important;
}

.thsc-inv-market-action > span {
    overflow: hidden;
    color: #7c3aed;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thsc-inv-badge--market { background: #7c3aed; }
.thsc-inv-badge--sold { background: #d97706; }
.thsc-inv-badge--safe {
    top: 0;
    right: 0;
    bottom: auto;
    border-radius: 0 0 0 6px;
    background: #059669;
}
.thsc-inv-item--market { border-color: #a78bfa; }
.thsc-inv-item--market-sold { border-color: #f59e0b; }

@media (max-width: 680px) {
    #thsc-modal-claim .thsc-modal-card,
    #thsc-modal-market-buy .thsc-modal-card {
        max-height: none;
    }
}

/* ========================================================
 * ROLL 房活动样式（管理端 + 用户端）
 * ======================================================== */

/* 管理端：BUFF ID 输入 + 查询按钮 */
.thsc-roll-buff-input {
    display: flex;
    align-items: center;
    gap: 8px;
}
.thsc-roll-buff-input input {
    flex: 1;
    min-width: 0;
}
.thsc-roll-buff-input button {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* 管理端：饰品预览卡（BUFF ID 查询成功后展示） */
.thsc-roll-preview {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    align-items: center;
}
.thsc-roll-preview-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 6px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    flex: 0 0 auto;
}
.thsc-roll-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.thsc-roll-preview-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.thsc-roll-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12px;
    color: #475569;
}
.thsc-roll-preview-price {
    color: #dc2626;
    font-weight: 700;
    font-size: 13px;
}

/* 管理端：开奖结果中奖名单 */
.thsc-roll-draw-result {
    margin-top: 16px;
    padding: 12px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}
.thsc-roll-draw-result h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #166534;
}
.thsc-roll-winners {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}
.thsc-roll-winners li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
}
.thsc-roll-winners li img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}
.thsc-roll-winners li span {
    flex: 1;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.thsc-roll-winners li em {
    font-style: normal;
    color: #dc2626;
    font-weight: 700;
}

/* 用户端：卡片饰品图底部「共 N 份」标签 */
.thsc-roll-quantity-badge {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 3px 8px;
    background: rgba(15, 23, 42, .82);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    line-height: 1;
    letter-spacing: .3px;
    pointer-events: none;
    z-index: 2;
}

/* ROLL 卡片和默认卡片保持相同外壳，避免额外差异 */
.thsc-roll-card .recipe-card-media {
    position: relative;
}
.thsc-roll-card .inline-metric strong.blue {
    color: #0f172a;
}
.thsc-roll-card .inline-metric strong.green {
    color: #ea580c;
}

/* ========================================================
 * ROLL 房详情弹窗（.thsc-roll-detail 变体）：
 * 始终居中，双层结构：
 *   L1 hero：Row1 标题+关闭 / Row2 元信息 / Row3 状态+说明+按钮
 *   L2 body：仅展示饰品卡片
 * PC / 手机同一套布局，尺寸与字号随屏幕降级。
 * ======================================================== */

/* 弹窗尺寸：居中，最大 640×min(720,90vh)，不再全屏 */
#thsc-modal-participate.thsc-roll-detail.detail-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .48);
}
#thsc-modal-participate.thsc-roll-detail .detail-panel {
    width: 100%;
    max-width: 640px;
    max-height: min(720px, 90vh);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: #fff;
}
#thsc-modal-participate.thsc-roll-detail .detail-close {
    top: 12px;
    right: 12px;
    z-index: 5;
}

/* 隐藏配方相关区块（材料输入区 / outcome 分组标题 / detail-score） */
#thsc-modal-participate.thsc-roll-detail .detail-columns > section:first-child,
#thsc-modal-participate.thsc-roll-detail .detail-columns > section > h3,
#thsc-modal-participate.thsc-roll-detail #thsc-buy-outcomes > .outcome-groups,
#thsc-modal-participate.thsc-roll-detail #thsc-buy-score {
    display: none !important;
}
/* 电脑端操作区仍在 hero 里，底栏保持隐藏。
   手机端 JS 会把说明 + 参与按钮挪进 #thsc-buy-bar，所以底栏必须显示。 */
@media (min-width: 681px) {
    #thsc-modal-participate.thsc-roll-detail #thsc-buy-bar {
        display: none !important;
    }
}
.thsc-roll-join-bar {
    display: none;
}

/* ========== L1 hero 布局：3 行竖排（紧凑版：-40% 高度） ========== */
#thsc-modal-participate.thsc-roll-detail .thsc-buy-hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 20px 8px;
    border-bottom: 1px solid #f1f5f9;
    flex: 0 0 auto;
}

/* Row 1：标题（右侧 .detail-close 是 absolute 定位，不占位） */
#thsc-modal-participate.thsc-roll-detail .thsc-buy-hero-row:first-child {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-right: 32px; /* 给关闭按钮留位 */
    min-height: 24px;
}
#thsc-modal-participate.thsc-roll-detail #thsc-buy-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Row 2：元信息（开始于 · 参与条件 · 饰品数量） */
#thsc-modal-participate.thsc-roll-detail #thsc-buy-hero-row2 {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 0;
}
#thsc-modal-participate.thsc-roll-detail #thsc-buy-subtitle {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    font-size: 11.5px;
    line-height: 1.3;
    color: #64748b;
    font-weight: 500;
}
#thsc-modal-participate.thsc-roll-detail #thsc-buy-subtitle .detail-separator {
    color: #cbd5e1;
}

/* Row 3：状态左 · 说明中 · 按钮右
   注意：desktop 通用媒体查询把 #thsc-buy-actions 改成了 flex-column（3 个 ID），
   这里必须用同等或更高优先级的完整路径 + 类，才能覆盖回横向布局。 */
#thsc-modal-participate.thsc-roll-detail #thsc-buy-hero-row2 #thsc-buy-actions,
#thsc-modal-participate.thsc-roll-detail .thsc-buy-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px 10px !important;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
#thsc-modal-participate.thsc-roll-detail #thsc-buy-hero-row2 #thsc-buy-actions > .thsc-participate-balance,
#thsc-modal-participate.thsc-roll-detail .thsc-participate-balance {
    order: 1;
    flex: 0 0 auto !important;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start !important;
    gap: 6px;
    white-space: nowrap;
}
.thsc-roll-status-line {
    font-size: 12.5px;
    font-weight: 700;
    color: #dc2626;
    line-height: 1.3;
}
/* 电脑端：提示单独一行，紧贴副标题下方 */
#thsc-modal-participate.thsc-roll-detail #thsc-buy-hero-row2 > #thsc-modal-participate-hint {
    display: block;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 3px 0 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #92400e;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    text-align: left;
    overflow: visible;
}
#thsc-modal-participate.thsc-roll-detail #thsc-buy-hero-row2 > #thsc-modal-participate-hint.is-error {
    color: #b91c1c;
}
#thsc-modal-participate.thsc-roll-detail #thsc-buy-hero-row2 > #thsc-modal-participate-hint.is-ok {
    color: #166534;
}
#thsc-modal-participate.thsc-roll-detail #thsc-buy-hero-row2 > #thsc-modal-participate-hint[hidden] {
    display: none;
}

/* 按钮组：最右 */
#thsc-modal-participate.thsc-roll-detail.thsc-benefit-detail #thsc-buy-hero-row2 #thsc-buy-actions > .thsc-buy-btns,
#thsc-modal-participate.thsc-roll-detail #thsc-buy-hero-row2 #thsc-buy-actions > .thsc-buy-btns,
#thsc-modal-participate.thsc-roll-detail.thsc-benefit-detail .thsc-buy-btns,
#thsc-modal-participate.thsc-roll-detail .thsc-buy-btns {
    display: flex !important;
    order: 3;
    flex: 0 0 auto !important;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto !important;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    position: static;
    width: auto !important;
    flex-direction: row !important;
}
/* 移除「取消」按钮：ROLL 房详情弹窗只保留确定参与按钮，通过 X 关闭 */
#thsc-modal-participate.thsc-roll-detail .thsc-buy-btns #thsc-buy-cancel,
#thsc-modal-participate.thsc-roll-detail .thsc-buy-btns .secondary-btn {
    display: none !important;
}
#thsc-modal-participate.thsc-roll-detail #thsc-btn-confirm-participate {
    min-width: 112px;
    min-height: 32px;
    padding: 0 18px;
    font-size: 13px;
    background: linear-gradient(135deg, #f97316, #dc2626);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(220, 38, 38, .24);
    font-weight: 800;
    border-radius: 999px;
}
#thsc-modal-participate.thsc-roll-detail #thsc-btn-confirm-participate:hover:not(:disabled) {
    filter: brightness(1.05);
}
#thsc-modal-participate.thsc-roll-detail #thsc-btn-confirm-participate:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* ========== L2 body：仅饰品信息（去除多层容器嵌套） ==========
   HTML 层级本是 .detail-columns > section > #thsc-buy-outcomes > (内容)，
   ROLL 房里把中间两层用 display: contents 透传，让饰品图 / 信息直接成为
   .detail-columns 的 flex 子项，视觉上就是"直接展示信息"。 */
#thsc-modal-participate.thsc-roll-detail .detail-columns {
    flex: 1;
    display: flex !important;
    grid-template-columns: none;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #f8fafc;
}
#thsc-modal-participate.thsc-roll-detail .detail-columns > section {
    display: contents;
}
#thsc-modal-participate.thsc-roll-detail #thsc-buy-outcomes {
    display: contents;
}

.thsc-roll-item-media {
    position: relative;
    flex: 0 0 auto;
    width: 126px;
    height: 126px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    box-shadow: none;
}
.thsc-roll-item-media img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.thsc-roll-item-media .quality-badge {
    display: none;
}
.thsc-roll-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.thsc-roll-item-name {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-word;
}
.thsc-roll-item-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #334155;
}
.thsc-roll-item-meta > span {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.thsc-roll-item-meta em {
    font-style: normal;
    color: #94a3b8;
    font-weight: 600;
    min-width: 42px;
    flex: 0 0 auto;
}
.thsc-roll-item-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
}
.thsc-roll-item-price em {
    font-style: normal;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
    min-width: 42px;
    flex: 0 0 auto;
}
.thsc-roll-item-price strong {
    font-size: 15px;
    font-weight: 800;
    color: #dc2626;
    line-height: 1.3;
}

/* ========== 仅手机端：按内容收缩，横向排饰品，避免竖向空档 ========== */
@media (max-width: 720px) {
    #thsc-modal-participate.thsc-roll-detail.detail-overlay {
        padding: 16px 12px;
        align-items: center;
        justify-content: center;
    }
    #thsc-modal-participate.thsc-roll-detail .detail-panel {
        width: 100%;
        max-width: 420px;
        height: auto;
        max-height: 88vh;
        border-radius: 14px;
        flex: 0 0 auto;
    }
    #thsc-modal-participate.thsc-roll-detail .thsc-buy-hero {
        padding: 10px 14px 8px;
        gap: 3px;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-buy-title {
        font-size: 15px;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-buy-hero-row2 > #thsc-modal-participate-hint {
        display: none !important;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-buy-subtitle {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: flex-start;
        font-size: 11px;
        gap: 2px;
        line-height: 1.45;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-buy-subtitle > span {
        display: block;
        width: 100%;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-buy-subtitle .detail-separator {
        display: none;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-buy-hero-row2 #thsc-buy-actions,
    #thsc-modal-participate.thsc-roll-detail .thsc-buy-actions {
        flex-wrap: wrap !important;
        gap: 4px 8px !important;
    }
    #thsc-modal-participate.thsc-roll-detail .thsc-participate-balance {
        white-space: nowrap;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-modal-participate-hint {
        max-width: 160px;
        font-size: 11px;
    }
    /* 共享 buy-bar 在手机端仍被配方购买逻辑占用，ROLL 改用独立底栏 */
    #thsc-modal-participate.thsc-roll-detail #thsc-buy-bar,
    #thsc-modal-participate.thsc-roll-detail #thsc-buy-bar[hidden] {
        display: none !important;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-roll-join-bar {
        display: flex !important;
        align-items: center;
        gap: 10px;
        flex: 0 0 auto;
        padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
        border-top: 1px solid #f1f5f9;
        background: #fff;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-roll-join-note {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
        color: #92400e;
        font-size: 12px;
        line-height: 1.35;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-roll-join-note.is-ok {
        color: #166534;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-roll-join-note.is-error {
        color: #b91c1c;
        white-space: normal;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-roll-join-note[hidden] {
        display: none;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-roll-join-btn {
        flex: 0 0 auto;
        min-width: 104px;
        min-height: 36px;
        padding: 0 16px;
        font-size: 13px;
        font-weight: 800;
        border: none;
        border-radius: 999px;
        color: #fff;
        background: linear-gradient(135deg, #f97316, #dc2626);
        box-shadow: 0 4px 12px rgba(220, 38, 38, .24);
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-roll-join-btn:disabled {
        background: #94a3b8;
        box-shadow: none;
    }
    /* 不再 flex:1 撑满剩余高度；图+信息横向并排，高度跟图片走 */
    #thsc-modal-participate.thsc-roll-detail .detail-columns {
        flex: 0 0 auto !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        gap: 12px;
        padding: 10px 14px 12px;
    }
    #thsc-modal-participate.thsc-roll-detail .thsc-roll-item-media {
        width: 96px;
        height: 96px;
        background: transparent;
        border: none;
        box-shadow: none;
    }
    #thsc-modal-participate.thsc-roll-detail .thsc-roll-item-body {
        align-items: flex-start;
        gap: 4px;
        width: auto;
    }
    #thsc-modal-participate.thsc-roll-detail .thsc-roll-item-name {
        font-size: 14px;
        line-height: 1.3;
    }
    #thsc-modal-participate.thsc-roll-detail .thsc-roll-item-meta {
        align-items: flex-start;
        gap: 2px;
        font-size: 12px;
    }
    #thsc-modal-participate.thsc-roll-detail .thsc-roll-item-meta > span,
    #thsc-modal-participate.thsc-roll-detail .thsc-roll-item-price {
        justify-content: flex-start;
    }
    #thsc-modal-participate.thsc-roll-detail .thsc-roll-item-price strong {
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    #thsc-modal-participate.thsc-roll-detail #thsc-buy-title {
        font-size: 14.5px;
    }
    #thsc-modal-participate.thsc-roll-detail #thsc-btn-confirm-participate {
        min-width: 88px;
    }
    #thsc-modal-participate.thsc-roll-detail .thsc-roll-item-media {
        width: 84px;
        height: 84px;
    }
}
