:root {
    --bg: #1a0f0a;
    --panel: rgba(54, 33, 22, 0.9);
    --panel-soft: rgba(88, 57, 39, 0.72);
    --card: rgba(47, 29, 20, 0.92);
    --line: rgba(255, 214, 168, 0.18);
    --text: #fff7ed;
    --muted: #d8b99b;
    --subtle: #a98262;
    --green: #86efac;
    --blue: #fdba74;
    --amber: #facc15;
    --red: #fb7185;
    --purple: #f0abfc;
    --accent: #f97316;
    --accent-strong: #fb923c;
    --shadow: 0 22px 70px rgba(80, 37, 8, 0.38);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    min-height: 100%;
}

html {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 18% 0%, rgba(249, 115, 22, 0.28), transparent 34%),
        radial-gradient(circle at 82% 8%, rgba(251, 191, 36, 0.16), transparent 30%),
        linear-gradient(180deg, rgba(67, 31, 17, 0.55), transparent 44%),
        var(--bg);
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    flex: 1 0 auto;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 22px 16px 40px;
}

.floatbar {
    position: fixed;
    right: 18px;
    top: 50%;
    z-index: 120;
    display: flex;
    flex-direction: column;
    width: 72px;
    border: 1px solid #eadfc7;
    border-radius: 16px;
    background:
        radial-gradient(circle at 80% 0%, rgba(246, 184, 0, 0.16), transparent 42%),
        linear-gradient(180deg, #fffdf6 0%, #fff7e8 100%);
    box-shadow: 0 14px 34px rgba(80, 37, 8, 0.16);
    overflow: visible;
    transform: translateY(-50%);
    transition: width 220ms ease, border-radius 220ms ease;
}

.floatbar-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 30px;
    padding: 5px 6px;
    border: 0;
    border-bottom: 1px solid #efe4cf;
    border-radius: 15px 15px 0 0;
    color: #c77822;
    background: transparent;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, min-height 220ms ease, border-radius 220ms ease;
}

.floatbar-toggle:hover,
.floatbar-toggle:focus-visible {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
    outline: none;
}

.floatbar-toggle svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    fill: currentColor;
    transition: transform 240ms ease;
    /* 默认（展开态）箭头指向左侧 = "把面板收向右边" */
    transform: rotate(180deg);
}

.floatbar-toggle-text {
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* 折叠态：整个 floatbar 缩成窄条，箭头翻回来指向左侧；文案竖排「展开」 */
.floatbar.is-collapsed {
    width: 36px;
    border-radius: 16px;
}

.floatbar.is-collapsed .floatbar-toggle {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 8px 4px;
    border-bottom: 0;
    border-radius: 16px;
}

.floatbar.is-collapsed .floatbar-toggle svg {
    transform: rotate(0deg);
}

.floatbar.is-collapsed .floatbar-toggle-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    white-space: normal;
    font-size: 10px;
    letter-spacing: 0.04em;
}

.floatbar.is-collapsed .floatbar-items {
    display: none;
}

.floatbar-item {
    position: relative;
}

.floatbar-item + .floatbar-item {
    border-top: 1px solid #efe4cf;
}

.floatbar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 68px;
    padding: 9px 7px;
    border: 0;
    color: #4b3626;
    background: transparent;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease;
}

.floatbar-link svg {
    width: 22px;
    height: 22px;
    fill: #c77822;
    transition: fill 180ms ease, transform 180ms ease;
}

.floatbar-link span {
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
}

.floatbar-item:first-child .floatbar-link {
    border-radius: 15px 15px 0 0;
}

.floatbar-item:last-child .floatbar-link {
    border-radius: 0 0 15px 15px;
}

.floatbar-item:hover .floatbar-link,
.floatbar-item:focus-within .floatbar-link {
    color: #8a4b0f;
    background: rgba(249, 115, 22, 0.1);
}

.floatbar-item:hover .floatbar-link svg,
.floatbar-item:focus-within .floatbar-link svg {
    fill: #f97316;
    transform: translateY(-1px);
}

.floatbar-popover {
    position: absolute;
    top: 50%;
    right: calc(100% + 12px);
    width: 188px;
    padding: 14px;
    border: 1px solid rgba(255, 214, 168, 0.28);
    border-radius: 18px;
    background:
        radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.2), transparent 42%),
        rgba(47, 29, 20, 0.98);
    box-shadow: 0 22px 58px rgba(25, 12, 5, 0.48);
    color: #fff7ed;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(10px, -50%);
    transition: opacity 180ms ease, transform 180ms ease;
}

.floatbar-popover::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -7px;
    width: 12px;
    height: 12px;
    border-top: 1px solid rgba(255, 214, 168, 0.28);
    border-right: 1px solid rgba(255, 214, 168, 0.28);
    background: rgba(47, 29, 20, 0.98);
    transform: translateY(-50%) rotate(45deg);
}

.floatbar-item:hover .floatbar-popover,
.floatbar-item:focus-within .floatbar-popover {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%);
}

.floatbar-popover strong {
    display: block;
    margin-bottom: 10px;
    color: #fdba74;
    font-size: 14px;
    font-weight: 900;
}

.floatbar-popover img {
    display: block;
    width: 150px;
    height: 150px;
    margin: 0 auto 10px;
    padding: 6px;
    border-radius: 14px;
    background: #fffaf0;
    object-fit: cover;
}

.floatbar-popover span {
    display: block;
    color: #d8b99b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.oa-bind-panel {
    margin-top: 10px;
    padding: 9px 8px;
    border: 1px solid rgba(253, 186, 116, 0.22);
    border-radius: 12px;
    background: rgba(255, 247, 237, 0.08);
}

.oa-bind-panel strong {
    margin-bottom: 4px;
    color: #fed7aa;
    font-size: 12px;
}

.oa-bind-panel span {
    color: #f6d7bd;
    font-size: 11px;
}

.oa-bind-panel b {
    color: #fdba74;
    font-size: 14px;
    letter-spacing: 0.08em;
}

.oa-bind-panel button {
    min-height: 26px;
    margin-top: 7px;
    padding: 0 10px;
    border: 1px solid rgba(253, 186, 116, 0.42);
    border-radius: 999px;
    color: #5f370e;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(26px, 6vw, 42px);
    line-height: 1.05;
}

.subtitle,
.detail-subtitle {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

.detail-separator {
    margin: 0 6px;
    color: var(--subtle);
}

.quality-text {
    font-weight: 900;
}

.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; }

/* 我的配方专属角标：右上角红色"已下线"提示，配方在广场被复评 DELETE 后才出现。
   - 只显示在 saved-recipes 列表（is_recipe_alive === false）
   - 仅作提示作用，不阻塞"配方标定"按钮（后端走 saved snapshot fallback） */
.recipe-card .recipe-offline-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 4;
    width: 8px;
    height: 8px;
    overflow: hidden;
    border-radius: 50%;
    color: transparent;
    font-size: 0;
    background: #dc2626;
}

.recipe-card.is-offline {
    outline: 2px dashed rgba(220, 38, 38, 0.5);
    outline-offset: -2px;
}

.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-recipe-times {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-left: 12px;
    vertical-align: middle;
}

.detail-recipe-times .detail-created-at,
.detail-recipe-times .detail-updated-at {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.detail-recipe-times .detail-created-at[hidden],
.detail-recipe-times .detail-updated-at[hidden] {
    display: none;
}

/* 详情面板 subtitle 行内按钮：配方说明 / 优化 / 保存到我的配方 / 分享 高度统一 */
.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;
}

.refresh-btn {
    flex: 0 0 auto;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 800;
}

.toolbar {
    position: sticky;
    top: 14px;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(67, 38, 24, 0.9), rgba(42, 24, 17, 0.82));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 237, 213, 0.08);
    backdrop-filter: blur(18px);
}

.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 18px;
    border: 1px solid rgba(255, 214, 168, 0.2);
    border-radius: 18px;
    background: rgba(255, 247, 237, 0.08);
}

.search-field svg,
.filter-toggle svg {
    width: 22px;
    height: 22px;
    fill: var(--accent-strong);
}

.search-field input {
    width: 100%;
    border: 0;
    color: var(--text);
    background: transparent;
    outline: none;
    font-size: 15px;
    font-weight: 700;
}

.search-field input::placeholder {
    color: rgba(216, 185, 155, 0.72);
}

.filter-toggle,
.panel-close,
.ghost-btn,
.primary-btn {
    border: 1px solid var(--line);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.filter-toggle {
    display: grid;
    place-items: center;
    width: 54px;
    min-height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.28), rgba(251, 191, 36, 0.16));
}

.filter-toggle:hover,
.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);
}

.filter-panel {
    position: fixed;
    top: 98px;
    right: max(16px, calc((100vw - 1180px) / 2 + 16px));
    z-index: 40;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 120px);
    overflow: auto;
    padding: 18px;
    border: 1px solid rgba(255, 214, 168, 0.2);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(74, 45, 29, 0.98), rgba(32, 18, 12, 0.97));
    box-shadow: 0 28px 80px rgba(32, 13, 4, 0.58);
    backdrop-filter: blur(20px);
}

.filter-panel[hidden] {
    display: none;
}

.filter-panel-head {
    position: sticky;
    top: -18px;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin: -18px -18px 16px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(255, 214, 168, 0.16);
    border-radius: 28px 28px 0 0;
    background: linear-gradient(145deg, rgba(74, 45, 29, 0.98), rgba(32, 18, 12, 0.97));
    backdrop-filter: blur(20px);
}

.panel-kicker {
    margin: 0 0 4px;
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.filter-panel h2 {
    margin: 0;
    font-size: 24px;
}

.panel-close {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(255, 247, 237, 0.08);
    font-size: 24px;
    line-height: 1;
}

.filter-grid {
    display: grid;
    gap: 12px;
}

.filter-group {
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(255, 214, 168, 0.16);
    border-radius: 20px;
    background: rgba(255, 247, 237, 0.06);
}

.filter-group legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.filter-group legend .legend-hint {
    margin-left: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    opacity: 0.7;
}

.range-row,
.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.range-row input {
    flex: 1 1 150px;
    min-width: 0;
}

.choice-row label {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid rgba(255, 214, 168, 0.14);
    border-radius: 999px;
    color: var(--text);
    background: rgba(27, 16, 11, 0.32);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.choice-row input {
    accent-color: var(--accent);
}

.sort-order-badge {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    color: #2a160c;
    background: linear-gradient(135deg, var(--amber), var(--accent-strong));
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.sort-order-badge[hidden] {
    display: none;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.ghost-btn,
.primary-btn {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 900;
}

.ghost-btn {
    background: rgba(255, 247, 237, 0.07);
}

.primary-btn {
    border-color: rgba(251, 146, 60, 0.62);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.95), rgba(234, 88, 12, 0.85));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.field input,
.field select,
.filter-group input[type="number"] {
    width: 100%;
    border: 1px solid rgba(255, 214, 168, 0.22);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(27, 16, 11, 0.72);
    outline: none;
}

.state {
    padding: 26px 16px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: rgba(54, 33, 22, 0.45);
}

.state-error {
    color: var(--red);
    border-color: rgba(248, 113, 113, 0.32);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 22px auto 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.pagination-bar[hidden] {
    display: none;
}

.pagination-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pagination-summary {
    color: rgba(82, 55, 0, 0.72);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    margin-left: 6px;
    white-space: nowrap;
}

.page-list {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.page-btn,
.page-number {
    min-width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 214, 168, 0.22);
    border-radius: 4px;
    color: var(--text);
    background: rgba(255, 247, 237, 0.08);
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.page-btn {
    padding: 0 12px;
}

.page-btn:hover:not(:disabled),
.page-number:hover,
.page-number.active {
    border-color: rgba(251, 146, 60, 0.55);
    background: rgba(249, 115, 22, 0.22);
    box-shadow: 0 12px 28px rgba(249, 115, 22, 0.18);
}

.page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.recipe-card {
    position: relative;
    display: flex;
    min-height: 138px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(91, 55, 34, 0.94), rgba(39, 23, 16, 0.97)),
        radial-gradient(circle at 18% 18%, rgba(251, 146, 60, 0.24), transparent 42%);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.recipe-card:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 146, 60, 0.48);
}

.recipe-card-media {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 100px;
    padding: 8px;
    background: radial-gradient(circle at center, rgba(251, 146, 60, 0.3), rgba(42, 24, 17, 0.08) 68%);
}

.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));
}

.cost-tag {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    background: rgba(24, 13, 8, 0.72);
    text-decoration-line: underline;
    text-decoration-color: var(--green);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.recipe-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px 11px;
}

.profit-share {
    width: 100%;
    margin-top: 2px;
}

.profit-share-bar {
    display: flex;
    width: 100%;
    height: 9px;
    overflow: hidden;
    border: 1px solid rgba(255, 214, 168, 0.12);
    border-radius: 999px;
    background: rgba(27, 16, 11, 0.55);
}

.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: var(--muted);
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.profit-label.high {
    color: #15803d;
}

.profit-label.safe {
    color: #22c55e;
}

.profit-label.risk {
    color: var(--red);
}

.recipe-value-preview {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 252, 247, 0.78)),
        rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(18px) saturate(1.32);
    -webkit-backdrop-filter: blur(18px) saturate(1.32);
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px) scale(0.985);
    transition: opacity 220ms ease, transform 240ms cubic-bezier(.2,.8,.2,1);
}

.recipe-card.is-value-preview-open .recipe-value-preview {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.recipe-value-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 22px;
    margin-left: auto;
    border: 0;
    border-radius: 0;
    color: inherit;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transition: opacity 160ms ease, transform 160ms ease;
}

.recipe-value-toggle img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
    pointer-events: none;
}

.recipe-value-toggle:hover,
.recipe-value-toggle[aria-expanded="true"] {
    opacity: 0.82;
    transform: translateY(-1px);
}

.recipe-value-preview-chart {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.recipe-value-tooltip {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    max-width: calc(100% - 24px);
    overflow: hidden;
    padding: 0;
    color: #14532d;
    background: transparent;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.recipe-value-tooltip.is-show {
    opacity: 1;
    transform: translateY(0);
}

.recipe-value-line,
.recipe-value-line-glow,
.recipe-value-cursor-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.recipe-value-cursor-line {
    stroke: rgba(75, 85, 99, 0.42);
    stroke-width: 1;
    stroke-dasharray: 4 5;
    opacity: 0;
    transition: opacity 120ms ease;
}

.recipe-value-cursor-line.is-show {
    opacity: 1;
}

.recipe-value-line-glow {
    stroke: rgba(107, 114, 128, 0.18);
    stroke-width: 4;
}

.recipe-value-line {
    stroke: #6b7280;
    stroke-width: 1.4;
}

.recipe-value-dot {
    fill: #ef4444;
    stroke: #fff7ed;
    stroke-width: 1.8;
    cursor: help;
    transition: r 140ms ease, fill 140ms ease;
}

.recipe-value-dot.value-high {
    fill: #16a34a;
}

.recipe-value-dot.value-safe {
    fill: #86efac;
    stroke: #15803d;
}

.recipe-value-dot.value-risk {
    fill: #ef4444;
}

.recipe-value-dot:hover {
    r: 5.8;
}

.recipe-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 12px;
    white-space: nowrap;
}

.recipe-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    white-space: nowrap;
}

.recipe-title {
    margin: 0;
    overflow: hidden;
    color: #fffaf0;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 900;
    text-overflow: ellipsis;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.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); }

.pfid-chip {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    color: #fed7aa;
    font-size: 11px;
    font-weight: 900;
    background: rgba(249, 115, 22, 0.16);
}

.inline-metric {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.inline-metric strong {
    flex: 0 0 auto;
    overflow: visible;
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
}

.inline-metric strong.green { color: var(--green); }
.inline-metric strong.blue { color: var(--blue); }
.inline-metric strong.amber { color: var(--amber); }
.inline-metric strong.red { color: var(--red); }
.inline-metric strong.purple { color: var(--purple); }

.recipe-updated {
    overflow: hidden;
    color: var(--subtle);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.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(88vh, 980px);
    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;
    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: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(22px, 5vw, 34px);
}

.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;
}

.detail-save-btn {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 4px;
    margin-left: 10px;
    padding: 2px 10px;
    border: 1px solid #f0c31d;
    border-radius: 999px;
    background: #fff7d8;
    color: #8a5d00;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.16s ease;
}

.detail-save-btn:hover:not(:disabled),
.detail-save-btn:focus-visible:not(:disabled) {
    border-color: #e0a100;
    background: #ffeead;
    outline: none;
}

.detail-save-btn.is-saved {
    border-color: #86efac;
    background: #dcfce7;
    color: #166534;
}

.detail-save-btn.is-saved:hover:not(:disabled),
.detail-save-btn.is-saved:focus-visible:not(:disabled) {
    border-color: #4ade80;
    background: #bbf7d0;
}

/* 「我的配方」详情里把"已保存"按钮重定位为红色「删除」入口 —— 与配方广场的绿色已保存区分开 */
.detail-save-btn.is-delete {
    border-color: #fca5a5;
    background: #fee2e2;
    color: #b91c1c;
}

.detail-save-btn.is-delete:hover:not(:disabled),
.detail-save-btn.is-delete:focus-visible:not(:disabled) {
    border-color: #f87171;
    background: #fecaca;
    color: #991b1b;
    outline: none;
}

.detail-save-btn:disabled {
    cursor: not-allowed;
    opacity: .72;
}

/* 「我的配方」专属：分享按钮（蓝色实心胶囊）。与红色「删除」按钮形成明显对比，
   提醒用户这是一个"对外行动"。仅在 detailHideOptimize=true 的弹窗里出现。 */
.detail-share-btn {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 12px;
    border: 1px solid #2563eb;
    border-radius: 999px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 6px -2px rgba(37, 99, 235, 0.45);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.detail-share-btn:hover:not(:disabled),
.detail-share-btn:focus-visible:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    box-shadow: 0 4px 10px -2px rgba(37, 99, 235, 0.55);
    outline: none;
}

.detail-share-btn:active:not(:disabled) {
    transform: scale(0.97);
    box-shadow: 0 1px 3px -1px rgba(37, 99, 235, 0.45);
}

.detail-share-btn:disabled {
    cursor: not-allowed;
    opacity: .72;
}

.detail-trend-btn {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 11px;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.16s ease;
}

.detail-trend-btn:hover:not(:disabled),
.detail-trend-btn:focus-visible:not(:disabled) {
    border-color: #34d399;
    background: #d1fae5;
    color: #065f46;
    outline: none;
}

.detail-trend-btn.is-active {
    border-color: #10b981;
    background: #10b981;
    color: #ffffff;
}

.detail-trend-btn:disabled {
    cursor: progress;
    opacity: .72;
}

/* ============================================================
 * 详情面板「优化」按钮 + 兄弟材料候选面板
 * ============================================================ */
.detail-optimize-btn {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 4px;
    margin-left: 10px;
    padding: 2px 10px;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.16s ease;
}

.detail-optimize-btn:hover:not(:disabled),
.detail-optimize-btn:focus-visible:not(:disabled) {
    border-color: #3b82f6;
    background: #dbeafe;
    color: #1e3a8a;
    outline: none;
}

.detail-optimize-btn.is-active {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.detail-optimize-btn.is-active:hover:not(:disabled),
.detail-optimize-btn.is-active:focus-visible:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.detail-optimize-btn:disabled {
    cursor: progress;
    opacity: .72;
}

/* 优化工具条：去掉描边卡片背景，只保留一行紧凑的棱形按钮。
   两颗按钮用 clip-path 裁成 ▱ 平行四边形（棱形），独立、留 6px 间隙，不再拼接。 */
.material-optimize-toolbar {
    --skew: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0;
    flex-wrap: nowrap; /* 单行：永远不换行 */
}

/* 两颗棱形按钮共用形态：clip-path 切平行四边形，padding 给左边多留出"斜出量"以便文字视觉居中。 */
.material-recalc-btn,
.material-revert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 20px 7px 24px;
    border-radius: 0;
    border: 1px solid transparent;
    clip-path: polygon(var(--skew) 0, 100% 0, calc(100% - var(--skew)) 100%, 0 100%);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* 「重新计算」= 主操作：蓝色实底白字。 */
.material-recalc-btn {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.material-recalc-btn:hover,
.material-recalc-btn:focus-visible {
    background: #1d4ed8;
    border-color: #1d4ed8;
    outline: none;
}

/* 「还原」= 次级操作：白底灰字描边，与主操作拉开层级。 */
.material-revert-btn {
    background: #ffffff;
    color: #475569;
    border-color: #cbd5f5;
}

.material-revert-btn:hover,
.material-revert-btn:focus-visible {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
    outline: none;
}

.material-optimize-panel {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.material-optimize-empty {
    padding: 18px 14px;
    border: 1px dashed #cbd5f5;
    border-radius: 14px;
    color: #64748b;
    background: #f8fafc;
    text-align: center;
    font-size: 13px;
}

/* 配方优化 — 每个 slot：折叠时是一行加粗文字，不再做卡片样式。 */
.material-optimize-group {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-bottom: 1px solid #e5e7eb;
}

.material-optimize-group:last-child {
    border-bottom: none;
}

.material-optimize-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 6px;
    border-bottom: none;
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.material-optimize-header:hover,
.material-optimize-header:focus-visible {
    outline: none;
    background: #f8fafc;
}

/* 单行文字：所有字段统一字号 13px / 加粗。 */
.material-optimize-line {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.material-optimize-line-name {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.material-optimize-line-price {
    color: #b45309;
}

.material-optimize-line-count {
    color: #475569;
}

.material-optimize-line-cand {
    color: #1d4ed8;
}

.material-optimize-line-tail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.material-optimize-toggle-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #64748b;
    font-size: 14px;
    line-height: 1;
    transition: transform 0.18s ease;
}

.material-optimize-group.is-collapsed .material-optimize-toggle-arrow {
    transform: rotate(-90deg);
}

.material-optimize-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 6px 12px;
}

.material-optimize-group.is-collapsed .material-optimize-body {
    display: none;
}

.material-optimize-slot-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #1e293b;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.material-optimize-name {
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.material-optimize-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: #475569;
}

.material-optimize-price {
    font-weight: 800;
    color: #b45309;
}

.material-optimize-count {
    color: #64748b;
}

.material-optimize-savings {
    font-weight: 700;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 6px;
}

.savings-positive {
    color: #166534;
    background: #dcfce7;
}

.savings-negative {
    color: #b91c1c;
    background: #fee2e2;
}

.savings-neutral {
    color: #475569;
    background: #e2e8f0;
}

.material-optimize-tier-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

/* 单列候选行：名称 | 磨损等级：磨损值 | 价格；替换按钮改成悬浮浮层（见 .material-optimize-row-actions） */
.material-optimize-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    transition: border-color 0.15s ease, background 0.15s ease;
    overflow: hidden;
}

.material-optimize-row:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

/* 悬浮整行时浮出的 BUFF / 悠悠 / 替换 三按钮：
   做成一个紧凑的"分段控件 (segmented control)"——一条带轻微圆角的小长条，
   三个段无缝拼接、共享分隔线，BUFF/悠悠 走品牌色，替换是默认蓝色主操作，选中转绿。
   背景透明、整体靠左对齐，不遮挡候选行原本的名称/磨损/价格信息。 */
.material-optimize-row-actions {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding-left: 10px;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.material-optimize-row:hover .material-optimize-row-actions,
.material-optimize-row:focus-within .material-optimize-row-actions {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 分段按钮：扁平矩形 + 首末段两侧圆角；相邻段用 border 无缝拼接，
   .market-btn 全局样式（药丸大圆角 / 白字 / 大阴影）在这里全部覆盖。 */
.material-optimize-row-actions .market-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    min-width: 0;
    padding: 0 11px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    color: #1f2937;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
    transform: translateY(4px);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(.2,.8,.2,1), opacity 0.18s ease,
                background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* 拼接：除最后一段外去掉右边线，让相邻段的左边线充当分隔线，避免双重描边。 */
.material-optimize-row-actions .market-btn:not(:last-child) {
    border-right: 0;
}

/* 两端圆角，整体形态像一颗扁平胶囊；中段保持方角。 */
.material-optimize-row-actions .market-btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    padding-left: 13px;
}
.material-optimize-row-actions .market-btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    padding-right: 13px;
}

/* 行被悬浮 / 键盘聚焦时，按钮回到原位、淡入，并错落出场以增加细腻感。 */
.material-optimize-row:hover .material-optimize-row-actions .market-btn,
.material-optimize-row:focus-within .material-optimize-row-actions .market-btn {
    transform: translateY(0);
    opacity: 1;
}
.material-optimize-row:hover .material-optimize-row-actions .market-btn-buff { transition-delay: 0.02s; }
.material-optimize-row:hover .material-optimize-row-actions .market-btn-uu   { transition-delay: 0.06s; }
.material-optimize-row:hover .material-optimize-row-actions .market-btn-pick { transition-delay: 0.10s; }

/* BUFF 段：BUFF 主视觉黄；hover 时浅黄底 + 深琥珀字。 */
.material-optimize-row-actions .market-btn-buff:hover {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

/* 悠悠段：悠悠有品橙；hover 时浅橙底 + 深橘字。 */
.material-optimize-row-actions .market-btn-uu:hover {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fdba74;
}

/* 替换段：作为主操作默认就有蓝色提示，hover 加深；被选中后切换为绿色「已替换」。 */
.material-optimize-row-actions .market-btn-pick {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
    font-weight: 800;
}
.material-optimize-row-actions .market-btn-pick:hover {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}
.material-optimize-row-actions .market-btn-pick.is-picked,
.material-optimize-row-actions .market-btn-pick.is-picked:hover {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
    cursor: default;
}

/* 触屏没有 hover：用 :active 兜底，跟饰品图悬浮按钮一致。 */
@media (hover: none) {
    .material-optimize-row-actions {
        transition: opacity 0.2s ease;
    }
    .material-optimize-row:active .material-optimize-row-actions {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .material-optimize-row:active .material-optimize-row-actions .market-btn {
        transform: translateY(0);
        opacity: 1;
    }
}

.material-optimize-row.is-selected {
    border-color: #16a34a;
    background: #f0fdf4;
}

.material-optimize-row-name {
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-optimize-row-wear {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    /* 覆盖全局 .wear-tier-* 在 chip 上的 background，行内文字不要圆角底色 */
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

/* 磨损等级文字按档位上色，与全局 chip 颜色保持视觉一致。 */
.material-optimize-row-tier {
    font-weight: 800;
}

.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; }

.material-optimize-row-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b45309;
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.material-optimize-revert {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.material-optimize-revert:hover,
.material-optimize-revert:focus-visible {
    background: #fee2e2;
    border-color: #f87171;
    outline: none;
}

.material-card-overridden {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.12);
}

.material-override-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #16a34a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 4px 10px -4px rgba(22, 163, 74, 0.5);
    z-index: 2;
}

/* 输入材料卡片右上角：库存可替代件数（同饰品、版本一致、磨损 ≤ 当前 float）。
   与 .material-override-badge 共享右上角；二者同时出现时 override 在最右、绿点向左偏移避让。 */
.material-inv-match {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px 2px 6px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.95);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    box-shadow: 0 2px 6px -2px rgba(22, 163, 74, 0.6);
    z-index: 2;
    cursor: help;
}

.material-inv-match::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55);
}

.material-card-overridden .material-inv-match {
    right: 78px;
}

.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;
}

.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);
}

.recipe-trend-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #eadcae;
    border-radius: 16px;
    background: linear-gradient(180deg, #fffdf8 0%, #fff9e8 100%);
    box-shadow: 0 8px 22px rgba(33, 28, 16, 0.08);
}

.recipe-trend-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 10px;
}

.recipe-trend-head > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    white-space: nowrap;
}

.recipe-trend-head h4 {
    flex: 0 0 auto;
    margin: 0;
    color: #2f2a1b;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
}

.recipe-trend-head p {
    min-width: 0;
    margin: 0;
    color: #8a7d5e;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recipe-trend-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
}

.recipe-trend-tab {
    padding: 5px 9px;
    border: 1px solid #e8dcc0;
    border-radius: 999px;
    background: #ffffff;
    color: #7c6f52;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.recipe-trend-tab:hover,
.recipe-trend-tab:focus-visible {
    border-color: #d8a232;
    color: #8a5d00;
    outline: none;
}

.recipe-trend-tab.is-active {
    border-color: #f0c31d;
    background: #fff2bc;
    color: #6f4b00;
}

.recipe-trend-subnav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.recipe-trend-navbtn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border: 1px solid #e8dcc0;
    border-radius: 999px;
    background: #ffffff;
    color: #7c6f52;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
}

.recipe-trend-navbtn:hover:not(:disabled),
.recipe-trend-navbtn:focus-visible:not(:disabled) {
    border-color: #d8a232;
    color: #8a5d00;
    outline: none;
}

.recipe-trend-navbtn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.recipe-trend-subtabs {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.recipe-trend-subtabs .recipe-trend-tab {
    flex: 0 0 auto;
}

.recipe-trend-canvas {
    position: relative;
    width: 100%;
    height: 280px;
    border: 1px solid #f0e5c8;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}

.recipe-trend-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: #8a7d5e;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.material-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);
}

.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;
    justify-content: space-between;
    padding: 5px 10px 6px;
}

.item-name {
    margin: 0 0 2px;
    overflow: hidden;
    color: #25221d;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.25;
    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;
}

.inline-copy-toast {
    position: fixed;
    z-index: 10000;
    padding: 6px 12px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(22, 101, 52, 0.95);
    box-shadow: 0 6px 20px rgba(22, 101, 52, 0.25);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-50%) translateY(2px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.inline-copy-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.material-meta {
    margin: auto 0;
    overflow: hidden;
    color: #4b443b;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.material-price-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    line-height: 1.2;
}

.material-case {
    margin-left: auto;
    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 {
    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-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%);
}

/* ===== 鼠标悬浮在饰品图上时弹出的第三方市场跳转按钮 ===== */
.market-links {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.58) 100%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

.material-img:hover .market-links,
.outcome-img:hover .market-links {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.market-btn {
    min-width: 74px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(10px) scale(0.96);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(.2,.8,.2,1), opacity 0.2s ease,
                background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    user-select: none;
    cursor: pointer;
}

.material-img:hover .market-btn,
.outcome-img:hover .market-btn {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 错落出场：BUFF 先、悠悠后 */
.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;
}

.market-btn-buff,
.market-btn-uu {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.32);
}
.market-btn-buff:hover,
.market-btn-uu:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.32);
    transform: translateY(-2px) scale(1.02);
}

/* 触屏设备没有 hover，统一改为点击/轻触时短暂显示；不挡内容即可 */
@media (hover: none) {
    .market-links {
        transition: opacity 0.2s ease;
    }
    .material-img:active .market-links,
    .outcome-img:active .market-links {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

.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-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: 11px;
    font-weight: 900;
    line-height: 1.25;
    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;
}

.profit-delta {
    font-size: 11px;
    font-weight: 900;
}

.profit-delta.green {
    color: #16a34a;
}

.profit-delta.red {
    color: #dc2626;
}

.prob-sup {
    margin-left: auto;
    color: #16a34a;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    vertical-align: baseline;
    top: 0;
}

.muted {
    color: var(--muted);
}

@media (max-width: 680px) {
    .page-header,
    .detail-hero {
        flex-direction: column;
    }

    .toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .field.grow {
        grid-column: 1 / -1;
    }

    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .detail-panel {
        max-height: 92vh;
        border-radius: 22px;
    }

    .detail-side {
        justify-items: stretch;
    }

    .detail-score {
        flex-wrap: wrap;
    }

    .detail-hero,
    .detail-columns {
        padding-left: 16px;
        padding-right: 16px;
    }

    .detail-columns {
        grid-template-columns: 1fr;
    }

    .material-grid {
        grid-template-columns: 1fr;
    }

    .recipe-trend-head {
        flex-direction: column;
    }

    .recipe-trend-tabs {
        justify-content: flex-start;
    }

    .recipe-trend-canvas {
        height: 240px;
    }

    .material-optimize-name {
        max-width: 100%;
    }

    /* 窄屏：名称单独一行、其余压在第二行右对齐；行内不再有 pick 按钮（改为悬浮浮层）。 */
    .material-optimize-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name name"
            "wear price";
        row-gap: 4px;
    }

    .material-optimize-row > .material-optimize-row-name { grid-area: name; }
    .material-optimize-row > .material-optimize-row-wear { grid-area: wear; align-self: center; }
    .material-optimize-row > .material-optimize-row-price { grid-area: price; justify-self: end; }
}

@media (max-width: 420px) {
    .recipe-card {
        grid-template-columns: 96px 1fr;
    }

    .recipe-card-body {
        padding: 12px 10px;
    }

    .metric {
        min-width: 66px;
    }
}

/* Light marketplace redesign based on the provided mockup. */
:root {
    --bg: #f8f8f7;
    --panel: #ffffff;
    --panel-soft: #fffaf0;
    --card: #ffffff;
    --line: #eeeeea;
    --text: #22201c;
    --muted: #8e8b84;
    --subtle: #b3aea3;
    --green: #18b365;
    --blue: #f6b800;
    --amber: #f6b800;
    --red: #e05252;
    --purple: #9b7a14;
    --accent: #ffc400;
    --accent-strong: #f3b300;
    --shadow: 0 8px 22px rgba(33, 28, 16, 0.08);
}

body {
    color: var(--text);
    background:
        radial-gradient(circle at 96% 18%, rgba(246, 184, 0, 0.13) 0 2px, transparent 2px 8px),
        linear-gradient(132deg, transparent 0 7%, rgba(230, 230, 226, 0.5) 7% 11%, transparent 11%),
        linear-gradient(128deg, transparent 83%, rgba(255, 196, 0, 0.2) 83% 84.2%, transparent 84.2%),
        #fbfbfa;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 56px;
    border-bottom: 1px solid #e9e9e6;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 7px rgba(31, 31, 31, 0.08);
    backdrop-filter: blur(12px);
}

.site-header-inner {
    display: flex;
    align-items: center;
    width: min(1580px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 132px;
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 132px;
    height: 55px;
    object-fit: contain;
}

.main-nav {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    gap: 34px;
    margin-left: 28px;
}

.main-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #3f3d39;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.main-nav a.active {
    color: var(--accent-strong);
}

.main-nav a.active::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: 0;
    left: -4px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: var(--accent);
}

.user-menu-wrap {
    position: relative;
    margin-left: auto;
}

.user-menu {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    max-width: 178px;
    border: 0;
    color: #33302c;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.user-menu:disabled {
    cursor: wait;
    opacity: 0.72;
}

.user-menu svg {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.user-menu-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-menu-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-vip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 1px 6px;
    border-radius: 999px;
    color: #5f370e;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 3px 8px rgba(180, 83, 9, 0.18);
    font-size: 10px;
    font-weight: 1000;
    letter-spacing: 0.04em;
}

.avatar {
    position: relative;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #eeeeea;
    background:
        radial-gradient(circle at 50% 36%, #b9b8c2 0 5px, transparent 5px),
        radial-gradient(circle at 50% 105%, #9f9eaa 0 13px, transparent 13px),
        #f3f3f3;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.avatar.wx-login-icon {
    border-color: rgba(26, 250, 41, 0.22);
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1137 1024'%3E%3Cpath d='M814.276923 310.153846h9.694675c-32.795266-176.094675-203.512426-310.153846-408.804734-310.153846C186.168047 0 0.454438 166.627219 0.454438 371.881657A347.531361 347.531361 0 0 0 93.046154 606.295858v168.52071l128.302958-74.224852a449.211834 449.211834 0 0 0 193.817752 43.171598c8.028402 0 16.359763-0.378698 24.426035-0.378699a329.997633 329.997633 0 0 1-8.861538-77.254437c-0.530178-196.16568 171.512426-355.976331 383.545562-355.976332z m-261.301775-92.781065a61.91716 61.91716 0 1 1-61.462722 61.727811 61.689941 61.689941 0 0 1 61.614201-61.727811zM276.525444 341.207101a61.91716 61.91716 0 1 1 61.500592-62.106509A61.80355 61.80355 0 0 1 276.639053 341.207101z m537.751479 31.053254c-178.215385 0-322.613018 131.786982-322.613018 294.627219s144.397633 294.627219 322.613018 294.627219a351.053254 351.053254 0 0 0 98.461539-14.011834l131.521893 76.118343v-150.343195a281.183432 281.183432 0 0 0 92.591716-206.390533c-0.189349-162.840237-144.586982-294.627219-322.575148-294.627219z m-92.326627 248.047337a46.579882 46.579882 0 1 1 46.163313-46.579881 46.352663 46.352663 0 0 1-46.163313 46.579881z m214.986982 0a46.579882 46.579882 0 1 1 46.201184-46.579881 46.352663 46.352663 0 0 1-46.201184 46.579881z' fill='%231afa29'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 24px 24px;
}

.avatar.is-logged-in {
    border-color: #fff;
    background-color: #f3f3f3;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    width: min(332px, calc(100vw - 24px));
    padding: 10px;
    border: 1px solid rgba(39, 36, 30, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 44px rgba(31, 28, 22, 0.18);
    backdrop-filter: blur(14px);
}

.user-dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-top: 1px solid rgba(39, 36, 30, 0.08);
    border-left: 1px solid rgba(39, 36, 30, 0.08);
    background: rgba(255, 255, 255, 0.98);
    transform: rotate(45deg);
}

.user-dropdown[hidden] {
    display: none;
}

.user-dropdown-group {
    display: grid;
    gap: 4px;
    padding: 4px 0 2px;
}

.user-dropdown-footer {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #efebe2;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    color: #33302c;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.user-dropdown-item:hover,
.user-dropdown-item:focus-visible {
    outline: none;
    background: #f6f3ea;
    transform: translateX(1px);
}

.user-dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #6b4b1d;
    background: #fbf2d8;
}

.user-dropdown-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.user-dropdown-icon svg path,
.user-dropdown-icon svg circle {
    vector-effect: non-scaling-stroke;
}

.user-dropdown-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.user-dropdown-label {
    color: #25221d;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.user-dropdown-desc {
    color: #89847a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.user-dropdown-item.danger .user-dropdown-icon {
    color: #b91c1c;
    background: #fee2e2;
}

.user-dropdown-item.danger .user-dropdown-label {
    color: #b91c1c;
}

.user-vip-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-bottom: 8px;
    padding: 14px;
    border: 1px solid rgba(217, 119, 6, 0.2);
    border-radius: 8px;
    color: #3a2d1f;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0)),
        #fff6dc;
    cursor: pointer;
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.user-vip-card:hover,
.user-vip-card:focus-visible {
    border-color: rgba(217, 119, 6, 0.44);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 12px 26px rgba(180, 83, 9, 0.16);
}

.user-vip-card.is-member {
    position: relative;
    overflow: hidden;
    border-color: rgba(246, 184, 0, 0.42);
    color: #fff7df;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 34%),
        linear-gradient(135deg, #242018 0%, #3a2a16 52%, #8a5a17 100%);
}

.user-vip-card.is-member::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -38px;
    width: 130px;
    height: 130px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.user-vip-card-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.user-vip-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.user-vip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 21px;
    padding: 2px 9px;
    border-radius: 999px;
    color: #3b2608;
    background: linear-gradient(180deg, #ffe28a, #f3b300);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: 0.08em;
}

.user-vip-state {
    color: #8a5a17;
    font-size: 12px;
    font-weight: 900;
}

.user-vip-card.is-member .user-vip-state {
    color: rgba(255, 247, 223, 0.84);
}

.user-vip-renew {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    color: #7c4d12;
    background: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 1000;
}

.user-vip-card.is-member .user-vip-renew {
    color: #ffe7a2;
    background: rgba(255, 255, 255, 0.12);
}

.user-vip-title {
    position: relative;
    z-index: 1;
    font-size: 15px;
    font-weight: 1000;
    line-height: 1.35;
}

.user-vip-expire {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #7f6d57;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.user-vip-card.is-member .user-vip-expire {
    color: rgba(255, 247, 223, 0.78);
}

.user-vip-expire strong {
    color: #5f370e;
    font-size: 13px;
    font-weight: 1000;
}

.user-vip-card.is-member .user-vip-expire strong {
    color: #fff8d8;
}

.user-vip-features {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.user-vip-features span {
    padding: 4px 7px;
    border-radius: 999px;
    color: #7c4d12;
    background: rgba(245, 158, 11, 0.14);
    font-size: 11px;
    font-weight: 900;
}

.user-vip-cta {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    position: relative;
    z-index: 1;
    min-height: 26px;
    margin-top: 2px;
    padding: 4px 10px;
    border-radius: 8px;
    color: #2b2215;
    background: #ffffff;
    font-size: 12px;
    font-weight: 1000;
}

.user-vip-cta::after {
    content: "→";
    margin-left: 5px;
}

.user-vip-card:hover .user-vip-cta,
.user-vip-card:focus-visible .user-vip-cta {
    color: #ffffff;
    background: #2f2a21;
}

.user-vip-card.is-member .user-vip-cta {
    color: #3b2608;
    background: #f6b800;
}

.user-vip-card.is-member:hover .user-vip-cta,
.user-vip-card.is-member:focus-visible .user-vip-cta {
    color: #2b2215;
    background: #ffd66b;
}

.app-shell {
    width: min(1580px, calc(100% - 32px));
    padding: 16px 0 34px;
}

.toolbar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 68px;
    gap: 8px;
    width: min(920px, 100%);
    margin: 0 auto 18px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.search-field {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #e6e6e2;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(31, 31, 31, 0.08);
}

.search-field svg {
    width: 16px;
    height: 16px;
    fill: #b5b5af;
}

.search-field input {
    color: #35322e;
    font-size: 12px;
    font-weight: 700;
}

.search-field input::placeholder {
    color: #aaa9a4;
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 68px;
    min-height: 32px;
    border: 0;
    border-radius: 5px;
    color: #5f4100;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
    box-shadow: 0 3px 8px rgba(246, 184, 0, 0.28);
    font-size: 12px;
    font-weight: 900;
}

.filter-toggle svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.filter-panel {
    top: 72px;
    right: max(16px, calc((100vw - 1580px) / 2));
    width: min(430px, calc(100vw - 32px));
    border-color: #e9e2ce;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 60px rgba(37, 31, 20, 0.16);
}

.filter-panel-head {
    border-bottom-color: #eee5cf;
    background: rgba(255, 255, 255, 0.98);
}

.filter-panel h2,
.filter-group label,
.choice-row label,
.panel-close,
.ghost-btn {
    color: var(--text);
}

.panel-kicker,
.filter-group legend {
    color: var(--accent-strong);
}

.panel-close,
.choice-row label,
.ghost-btn,
.filter-group input[type="number"] {
    border-color: #ebe5d4;
    background: #fffaf0;
}

.primary-btn {
    color: #5f4100;
    border-color: #f0c31d;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
}

.state {
    color: #8e8b84;
    border-color: #e9e9e6;
    background: #fff;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.pagination-bar {
    width: 100%;
    margin-top: 18px;
}

.page-btn,
.page-number {
    min-width: 34px;
    height: 34px;
    color: #5f4100;
    border-color: transparent;
    background: #f7f7f5;
    font-size: 12px;
}

.page-btn {
    min-width: 58px;
}

.page-btn:hover:not(:disabled),
.page-number:hover,
.page-number.active {
    color: #5f4100;
    border-color: #f0c31d;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
    box-shadow: 0 3px 8px rgba(246, 184, 0, 0.22);
}

.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);
    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-media {
    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 {
    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;
}

.assembly-count-tag {
    position: absolute;
    left: 9px;
    bottom: 27px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    color: #166534;
    background: transparent;
    font-size: 11px;
    font-weight: 900;
    pointer-events: none;
}

.assembly-count-tag::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: inset 0 0 0 2px #bbf7d0;
}

.cost-tag::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: inset 0 0 0 2px #ffe58a;
}

.recipe-card-body {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    gap: 7px;
    padding: 13px 12px 11px 10px;
}

/* ====== 配方广场骨架占位（点击「配方广场」时先显示，等接口数据回来再切真实卡片） ====== */
.recipe-grid-skeleton {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.recipe-grid-skeleton[hidden] {
    display: none;
}

.recipe-card-skeleton {
    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);
    pointer-events: none;
}

.recipe-card-skeleton .recipe-card-media-sk {
    flex: 0 0 108px;
    padding: 19px 12px 26px;
    background: linear-gradient(90deg, #fff 0%, #f8f8f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-card-skeleton .recipe-card-body-sk {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 13px 12px 11px 10px;
}

.sk-block {
    border-radius: 6px;
    background: linear-gradient(90deg, #ececec 0%, #f5f5f5 50%, #ececec 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.recipe-card-skeleton .sk-img {
    width: 100%;
    height: 60px;
    border-radius: 6px;
}

.recipe-card-skeleton .sk-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 38px;
    height: 14px;
    border-radius: 999px;
    z-index: 2;
}

.recipe-card-skeleton .sk-title {
    width: 72%;
    height: 15px;
}

.recipe-card-skeleton .sk-row {
    display: flex;
    gap: 14px;
}

.recipe-card-skeleton .sk-stat {
    flex: 1;
    height: 12px;
}

.recipe-card-skeleton .sk-range {
    width: 50%;
    height: 11px;
}

.recipe-card-skeleton .sk-time {
    width: 38%;
    height: 10px;
}

.recipe-card-skeleton .sk-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    margin-top: 4px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* 用户偏好减少动画时，骨架不再闪烁，但仍保留占位灰块 */
@media (prefers-reduced-motion: reduce) {
    .sk-block {
        animation: none;
    }
}

.profit-share-bar {
    border-color: #eee4cf;
    background: #f7f2e8;
}

.profit-share-labels {
    color: #8c877d;
    font-size: 9px;
}

.recipe-title-row {
    gap: 6px;
}

.recipe-title {
    color: #171511;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 900;
}

.pfid-chip {
    padding: 0;
    color: var(--accent-strong);
    background: transparent;
    font-size: 9px;
    font-weight: 900;
}

.recipe-stat-row {
    justify-content: flex-start;
    gap: 18px;
}

.inline-metric {
    gap: 4px;
    color: #3a3732;
    font-size: 11px;
    font-weight: 800;
}

.inline-metric strong {
    font-size: 12px;
    font-weight: 900;
}

.inline-metric strong.green {
    color: var(--green);
}

.inline-metric strong.blue,
.inline-metric strong.amber {
    color: var(--accent-strong);
}

.recipe-updated {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 3px;
    color: #aaa79f;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.recipe-updated .recipe-updated-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: right;
    flex: 1 1 auto;
    min-width: 0;
}

.recipe-updated .recipe-updated-placeholder {
    flex: 0 0 auto;
}

.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);
}

/* ===== 首页轮播图（独立块元素，与 .app-shell 同级，天然跟随屏幕宽度）===== */
.home-carousel {
    position: relative;
    display: block;
    width: 100%;
    flex-shrink: 0; /* body 是 flex-column，避免被其它子项挤压 */
    aspect-ratio: 16 / 5;
    max-height: 324px; /* 原 360px，按要求降低约 10% */
    overflow: hidden;
    background: #fffaf0;
    border-bottom: 1px solid #ece7d7;
    user-select: none;
}

.home-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.55s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
}

.home-carousel-slide {
    flex: 0 0 100%;
    min-width: 0;
    height: 100%;
    position: relative;
    background: #f5efe0;
}

.home-carousel-slide a,
.home-carousel-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    text-decoration: none;
}

.home-carousel-nav {
    position: absolute;
    top: 50%;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
    opacity: 0;
    z-index: 2;
}

.home-carousel:hover .home-carousel-nav,
.home-carousel:focus-within .home-carousel-nav {
    opacity: 1;
}

.home-carousel-nav:hover {
    background: rgba(15, 23, 42, 0.72);
    transform: translateY(-50%) scale(1.04);
}

.home-carousel-nav.prev { left: 14px; }
.home-carousel-nav.next { right: 14px; }

.home-carousel-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2;
}

.home-carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.home-carousel-dot.is-active {
    width: 26px;
    background: #f59e0b;
}

.home-carousel.is-single .home-carousel-nav,
.home-carousel.is-single .home-carousel-dots {
    display: none;
}

/* ===== 武器箱 / 收藏品详情弹窗 ===== */
.source-case-overlay {
    position: fixed;
    inset: 0;
    z-index: 9300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: wxOverlayIn .18s ease-out;
}

.source-case-overlay[hidden] {
    display: none;
}

.source-case-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1010px, calc(100vw - 48px));
    height: min(720px, calc(100vh - 48px));
    overflow: hidden;
    border: 1px solid #eee3c9;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32);
}

.source-case-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid #f0c31d;
    border-radius: 999px;
    color: #5f4100;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(246, 184, 0, 0.24);
}

.source-case-head {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 18px;
    padding: 22px 54px 18px 22px;
    border-bottom: 1px solid #f0ead8;
    background:
        radial-gradient(circle at 92% 6%, rgba(255, 211, 61, 0.22), transparent 34%),
        linear-gradient(180deg, #fffaf0, #ffffff);
}

.source-case-cover {
    display: grid;
    place-items: center;
    width: 128px;
    height: 128px;
    overflow: hidden;
    border: 1px solid #eadfbf;
    border-radius: 12px;
    background: #fff7df;
}

.source-case-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.source-case-main {
    min-width: 0;
}

.source-case-kicker {
    margin: 0 0 5px;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.source-case-main h3 {
    margin: 0;
    color: var(--text);
    font-size: 26px;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.source-case-stats {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(96px, 1fr));
    gap: 8px;
    max-width: 560px;
}

.source-case-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid #f0e4c3;
    border-radius: 10px;
    background: #fffdf6;
}

.source-case-stat span {
    color: #84785e;
    font-size: 11px;
    font-weight: 800;
}

.source-case-stat strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
}

.source-case-stat.hot strong,
.source-case-stat.amber strong { color: var(--accent-strong); }
.source-case-stat.green strong { color: var(--green); }
.source-case-stat.red strong { color: #d24c4c; }

.source-case-body {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 16px;
    padding: 16px 20px 18px;
}

.source-case-side,
.source-case-main-col {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.source-case-composition {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 0 2px 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #f3b300 #f6f1e4;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.source-case-composition::-webkit-scrollbar { width: 8px; }
.source-case-composition::-webkit-scrollbar-track { border-radius: 999px; background: #f6f1e4; }
.source-case-composition::-webkit-scrollbar-thumb {
    border: 2px solid #f6f1e4;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffd33d, #f3b300);
}

.source-case-comp-text {
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid #ede6d4;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
}

.source-case-comp-text:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

.source-case-items {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: #f3b300 #f6f1e4;
}

.source-case-items::-webkit-scrollbar {
    width: 10px;
}

.source-case-items::-webkit-scrollbar-track {
    border-radius: 999px;
    background: #f6f1e4;
}

.source-case-items::-webkit-scrollbar-thumb {
    border: 2px solid #f6f1e4;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffd33d, #f3b300);
}

.source-case-section-title {
    margin: 0 0 10px;
    color: #5a5346;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}

.source-case-rarity-group {
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
}

.source-case-rarity-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.source-case-rarity-bar.tone-special   { background: linear-gradient(180deg, #ffc34a, #f59415); }
.source-case-rarity-bar.tone-contraband{ background: linear-gradient(180deg, #f25b3a, #c63419); }
.source-case-rarity-bar.tone-covert    { background: linear-gradient(180deg, #ec4444, #c81e1e); }
.source-case-rarity-bar.tone-classified{ background: linear-gradient(180deg, #c75bd9, #8c25b0); }
.source-case-rarity-bar.tone-restricted{ background: linear-gradient(180deg, #8b5cf6, #5b2bbf); }
.source-case-rarity-bar.tone-milspec   { background: linear-gradient(180deg, #4f78ff, #1e40c0); }
.source-case-rarity-bar.tone-industrial{ background: linear-gradient(180deg, #5fb7ff, #2382d8); }
.source-case-rarity-bar.tone-consumer  { background: linear-gradient(180deg, #b3b3b3, #7d7d7d); }
.source-case-rarity-bar.tone-default   { background: linear-gradient(180deg, #c5b08a, #8b7344); }

.source-case-skin-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.source-case-skin {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f1ece0;
    background: #fff;
}

.source-case-skin:last-child {
    border-bottom: 0;
}

.source-case-skin-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 78px;
    overflow: hidden;
    border-radius: 6px;
    background: #f7f3e7;
    flex: 0 0 auto;
}

.source-case-skin-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.source-case-skin-thumb.is-special {
    color: #b07300;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 211, 61, 0.45), transparent 70%),
        #fff5d6;
}

.source-case-skin-thumb.is-special img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(176, 115, 0, 0.35));
}

.source-case-special-summary {
    position: relative;
    grid-template-columns: 110px minmax(0, 1fr) 36px;
}

.source-case-special-summary.is-expandable {
    cursor: pointer;
    transition: background-color 160ms ease;
}

.source-case-special-summary.is-expandable:hover,
.source-case-special-summary.is-expandable:focus-visible {
    background: #fffbe9;
    outline: none;
}

.source-case-special-summary .source-case-skin-price {
    color: #b07300;
    font-weight: 800;
}

.source-case-special-arrow {
    align-self: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(176, 115, 0, 0.12);
    color: #b07300;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 220ms ease, background-color 160ms ease;
}

.source-case-special-arrow:hover {
    background: rgba(176, 115, 0, 0.22);
}

.source-case-special-arrow svg {
    width: 18px;
    height: 18px;
}

.source-case-special-summary.is-open .source-case-special-arrow {
    transform: rotate(180deg);
}

.source-case-special-items {
    display: flex;
    flex-direction: column;
    border-top: 1px dashed #ecdca0;
    background: #fffaee;
    animation: source-case-special-fade 220ms ease;
}

.source-case-special-items[hidden] {
    display: none;
}

.source-case-special-items .source-case-skin {
    background: transparent;
    border-bottom: 1px dashed #f1e6c0;
}

.source-case-special-items .source-case-skin:last-child {
    border-bottom: 0;
}

@keyframes source-case-special-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.source-case-skin-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.source-case-skin-info strong {
    min-width: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-case-skin-price {
    color: #d97706;
    font-size: 13px;
    font-weight: 900;
}

.source-case-loading,
.source-case-empty {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: #8a7d5e;
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 720px) {
    .home-carousel {
        aspect-ratio: 16 / 9;
        border-radius: 0;
        margin-bottom: 16px;
        max-height: none; /* 手机端按 aspect-ratio 自适应即可，不再额外限高 */
    }
    .home-carousel-nav {
        width: 34px;
        height: 34px;
        font-size: 20px;
        opacity: 1;
    }
    .home-carousel-nav.prev { left: 8px; }
    .home-carousel-nav.next { right: 8px; }
    .home-carousel-dots { bottom: 10px; }
}

.overview-panel {
    margin-bottom: 18px;
    padding: 22px 24px 24px;
    border: 1px solid #ece7d7;
    border-radius: 24px;
    background: #fffaf0;
    box-shadow: var(--shadow);
}

.seo-hero {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.seo-hero h1 {
    max-width: 820px;
    margin: 0;
    color: var(--text);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 950;
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.seo-hero-desc {
    max-width: 860px;
    margin: 12px 0 0;
    color: #4d4a44;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.8;
}

.seo-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.seo-keywords span {
    padding: 7px 10px;
    border: 1px solid #f0e4b8;
    border-radius: 999px;
    background: #fffaf0;
    color: #5f4100;
    font-size: 12px;
    font-weight: 900;
}

.overview-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.overview-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.overview-status {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

/* ============================================================
   首页 overview 看板：引擎状态 / 品质概览 / 实时事件流三层分区
   ============================================================ */
.overview-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.overview-quality {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.overview-quality .overview-quality-card.is-skeleton {
    opacity: 0.72;
}

.overview-quality .overview-quality-card.is-skeleton .overview-quality-count,
.overview-quality .overview-quality-card.is-skeleton strong {
    color: #c8b99d;
}

/* —— 引擎实时状态卡（首页大卡，宽度占满） —— */
.engine-status-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 18px 22px;
    border-radius: 18px;
    border: 1px solid #f0ead8;
    background:
        radial-gradient(circle at 92% 4%, rgba(245, 166, 35, 0.18), transparent 42%),
        radial-gradient(circle at 4% 96%, rgba(72, 187, 120, 0.10), transparent 45%),
        linear-gradient(180deg, #fffaf0 0%, #ffffff 100%);
    box-shadow: 0 6px 24px -18px rgba(35, 31, 23, 0.32);
    overflow: hidden;
    isolation: isolate;
}

.engine-status-main {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.engine-status-card .engine-status-loading,
.engine-status-card .engine-status-error {
    color: #8a8068;
    font-size: 13px;
    font-weight: 700;
    padding: 12px 4px;
}

.engine-status-card .engine-status-error {
    color: #c0392b;
}

/* 独立事件流：放在品质卡下方，默认紧凑但首屏保留多条日志 */
.engine-event-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid #f0ead8;
    background:
        radial-gradient(circle at 98% 8%, rgba(72, 187, 120, 0.10), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #fffdf7 100%);
    box-shadow: 0 4px 16px -14px rgba(35, 31, 23, 0.24);
}

/* 背景扫描线：自上而下重复扫过，营造"机器在运转" */
.engine-status-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(245, 166, 35, 0.045) 0 2px,
            transparent 2px 14px
        );
    opacity: 0.55;
}

.engine-status-bg::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    top: -80px;
    background: linear-gradient(180deg, transparent, rgba(245, 166, 35, 0.18), transparent);
    animation: ess-scan 6s linear infinite;
}

@keyframes ess-scan {
    0%   { transform: translateY(0); }
    100% { transform: translateY(720px); }
}

.engine-status-main > *:not(.engine-status-bg) {
    position: relative;
    z-index: 1;
}

.overview-quality {
    position: relative;
    z-index: 1;
}

.engine-status-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.engine-status-title {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(72, 187, 120, 0.10), rgba(245, 166, 35, 0.08), transparent);
    box-shadow: inset 0 0 0 1px rgba(72, 187, 120, 0.12);
    overflow: hidden;
}

.engine-status-title::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 42%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
    transform: translateX(-130%);
    animation: ess-title-sweep 3.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ess-title-sweep {
    0%, 38% { transform: translateX(-130%); opacity: 0; }
    48%     { opacity: 0.8; }
    68%     { transform: translateX(260%); opacity: 0; }
    100%    { transform: translateX(260%); opacity: 0; }
}

.engine-status-pulse {
    position: relative;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #48bb78;
    box-shadow:
        0 0 0 0 rgba(72, 187, 120, 0.65),
        0 0 14px rgba(72, 187, 120, 0.82);
    animation: ess-pulse 1.1s ease-out infinite, ess-core-blink 0.72s ease-in-out infinite alternate;
}

.engine-status-pulse::before,
.engine-status-pulse::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(72, 187, 120, 0.55);
    animation: ess-ring 1.8s ease-out infinite;
}

.engine-status-pulse::after {
    inset: -11px;
    animation-delay: 0.45s;
    border-color: rgba(245, 166, 35, 0.38);
}

.engine-status-pulse.is-idle {
    background: #c8b99d;
    box-shadow:
        0 0 0 0 rgba(200, 185, 157, 0.48),
        0 0 10px rgba(200, 185, 157, 0.52);
    animation-duration: 2.2s, 1.4s;
}

.engine-status-pulse.is-idle::before,
.engine-status-pulse.is-idle::after {
    border-color: rgba(200, 185, 157, 0.35);
    animation-duration: 2.8s;
}

@keyframes ess-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.55); }
    70%  { box-shadow: 0 0 0 14px rgba(72, 187, 120, 0); }
    100% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0); }
}

@keyframes ess-ring {
    0%   { transform: scale(0.58); opacity: 0.72; }
    72%  { transform: scale(1.3); opacity: 0; }
    100% { transform: scale(1.3); opacity: 0; }
}

@keyframes ess-core-blink {
    0%   { filter: brightness(0.95); transform: scale(0.96); }
    100% { filter: brightness(1.35); transform: scale(1.08); }
}

.engine-status-label {
    color: #8a8068;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(245, 166, 35, 0.22);
}

.engine-status-state {
    position: relative;
    color: #2f855a;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.12em;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(72, 187, 120, 0.12);
    box-shadow: 0 0 0 1px rgba(72, 187, 120, 0.18), 0 0 16px rgba(72, 187, 120, 0.24);
    animation: ess-state-glow 1.4s ease-in-out infinite alternate;
}

.engine-status-state.is-idle {
    color: #8a8068;
    background: rgba(200, 185, 157, 0.18);
    box-shadow: 0 0 0 1px rgba(200, 185, 157, 0.22), 0 0 10px rgba(200, 185, 157, 0.18);
    animation-duration: 2.4s;
}

@keyframes ess-state-glow {
    0%   { opacity: 0.78; transform: translateY(0); }
    100% { opacity: 1; transform: translateY(-1px); }
}

.engine-status-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.engine-status-meta-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 92px;
}

.engine-status-meta-row em {
    color: #8a8068;
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.engine-status-meta-row strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.engine-status-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.engine-status-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #f0e6d3;
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.engine-status-cell::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent-strong, #f5a623), rgba(245, 166, 35, 0.2));
    opacity: 0.7;
}

.engine-status-cell-label {
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.engine-status-cell-value {
    color: var(--text);
    font-size: 26px;
    font-weight: 900;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    transition: color 0.25s ease, transform 0.25s ease;
}

.engine-status-cell-value.is-bumped {
    animation: ess-bump 0.55s ease-out;
}

@keyframes ess-bump {
    0%   { transform: translateY(0); color: var(--text); }
    35%  { transform: translateY(-2px); color: var(--accent-strong, #f5a623); }
    100% { transform: translateY(0); color: var(--text); }
}

.engine-status-cell-hint {
    color: #8a8068;
    font-size: 11px;
    font-weight: 700;
}

.engine-status-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.engine-status-log-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8a8068;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.engine-event-card .engine-status-log-head {
    align-self: stretch;
    padding-top: 3px;
}

.engine-status-log-head em {
    margin-left: auto;
    font-style: normal;
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.engine-status-log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-strong, #f5a623);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.18);
}

.engine-status-log {
    list-style: none;
    margin: 0;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px dashed #f0e6d3;
    background: rgba(255, 250, 240, 0.6);
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 138px;
    overflow: hidden;
}

.engine-event-card .engine-status-log {
    position: relative;
    display: block;
    min-height: 108px;
    max-height: 108px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255, 250, 240, 0.96), rgba(255, 250, 240, 0) 8%),
        linear-gradient(270deg, rgba(255, 250, 240, 0.96), rgba(255, 250, 240, 0) 8%),
        rgba(255, 250, 240, 0.62);
    --barrage-distance: max(1280px, 100vw);
}

.engine-status-log:empty::before {
    content: "等待挖掘器下一次心跳…";
    color: #b3a787;
    font-size: 12px;
    font-weight: 700;
}

.engine-status-log li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    animation: ess-log-in 0.32s ease-out both;
}

.engine-event-card .engine-status-log li {
    position: absolute;
    top: calc(10px + var(--barrage-track, 0) * 30px);
    left: 0;
    width: max-content;
    max-width: 980px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(245, 166, 35, 0.18);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 6px 16px -14px rgba(35, 31, 23, 0.45);
    white-space: nowrap;
    backdrop-filter: blur(8px);
    animation: ess-barrage-right-to-left var(--barrage-duration, 26s) linear var(--barrage-delay, 0s) infinite;
    will-change: transform;
}

.engine-event-card .engine-status-log:hover li {
    animation-play-state: paused;
}

.engine-status-log li span {
    flex: 1;
    min-width: 0;
    line-height: 1.45;
}

.engine-status-log li time {
    color: var(--accent-strong, #f5a623);
    font-size: 11px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    min-width: 64px;
}

@keyframes ess-log-in {
    0%   { opacity: 0; transform: translateY(-6px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes ess-barrage-right-to-left {
    0% {
        opacity: 0;
        transform: translateX(var(--barrage-distance));
    }
    8%, 92% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(-105%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .engine-event-card .engine-status-log {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-height: 108px;
        max-height: 108px;
        overflow: auto;
    }

    .engine-event-card .engine-status-log li {
        position: static;
        width: auto;
        max-width: none;
        white-space: normal;
        animation: none;
    }
}

.overview-quality-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid #eee4cf;
    border-left-width: 4px;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
    isolation: isolate;
}

.overview-quality-card.q-secret      { border-left-color: #ff4b4b; }
.overview-quality-card.q-classified  { border-left-color: #d04bff; }
.overview-quality-card.q-restricted  { border-left-color: #8847ff; }
.overview-quality-card.q-milspec     { border-left-color: #4b69ff; }

/* 右上角的代表饰品图（高价产出图）。用 ::after 渲染，
   --card-bg-image 由 JS 行内 style 注入，没图时变量默认 none，::after 静默不出。
   mask-image 让左侧渐隐融入卡片底色，opacity 默认 0.55 不抢前景文字。 */
.overview-quality-card::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -10px;
    width: 130px;
    height: 84px;
    background-image: var(--card-bg-image, none);
    background-repeat: no-repeat;
    background-position: right top;
    background-size: contain;
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: linear-gradient(to left, #000 35%, transparent 100%);
            mask-image: linear-gradient(to left, #000 35%, transparent 100%);
    transition: opacity 220ms ease, transform 220ms ease;
}

.overview-quality-card.has-bg:hover::after {
    opacity: 0.85;
    transform: translateX(-4px) scale(1.04);
}

/* 卡片内部所有内容必须盖在背景图之上，避免文字被压住 */
.overview-quality-card > * {
    position: relative;
    z-index: 1;
}

.overview-quality-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.overview-quality-count {
    color: var(--accent-strong);
    font-size: 24px;
    font-weight: 900;
    line-height: 1.05;
}

.overview-quality-row {
    display: flex;
    justify-content: space-between;
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
}

.overview-quality-row strong {
    color: var(--text);
    font-weight: 900;
}

/* ====== 武器箱配方榜 ====== */
.overview-ranking {
    margin-top: 18px;
    padding: 18px 20px 14px;
    border: 1px solid #eee4cf;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 4px 14px -10px rgba(35, 31, 23, 0.18);
}

.overview-ranking-header {
    margin-bottom: 12px;
}

.overview-ranking-header h3 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.overview-ranking-list {
    /* 3 列横向网格：grid 默认 row-major 排列，第 1/2/3 在第一行、4/5/6 在第二行……
       天然满足"排名以横行顺序排序"。内部不再纵向滚动，整个榜单一次铺开。 */
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
}

.overview-ranking-list > li {
    list-style: none;
}

.overview-ranking-item {
    /* 每张卡：左侧大图（占满卡片高）+ 右侧两行（名称 / 4 指标） */
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: 14px;
    row-gap: 6px;
    width: 100%;
    /* min-height 给单行卡兜底"块感"，左侧大图正好占满 */
    min-height: 116px;
    padding: 10px 14px 10px 10px;
    position: relative; /* 给 .overview-ranking-rank 绝对定位用 */
    border: 1px solid #f1ead7;
    border-radius: 12px;
    background: #fffaf0;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}

.overview-ranking-thumb {
    /* 大图占满卡片整高（左侧两行合并） */
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 96px;
    height: 96px;
    border-radius: 10px;
    background: #f8f1d7;
    object-fit: contain;
    /* 武器箱图为 webp/png，外缘大多有透明边，contain + 米色背景比 cover 更稳，
       不会把箱子四角裁掉，也不会出现拉伸变形 */
    border: 1px solid #ece1b8;
    align-self: center;
    display: block;
}

.overview-ranking-thumb.is-empty {
    /* 还没下发 image_path（如地图收藏品未跑过 武器箱图片获取.py --all）时的占位 */
    background:
        repeating-linear-gradient(
            45deg,
            #f6ecca 0,
            #f6ecca 6px,
            #f0e1ad 6px,
            #f0e1ad 12px
        );
}

.overview-ranking-item:hover {
    border-color: #f0c860;
    background: #fff5d6;
    transform: translateY(-1px);
}

.overview-ranking-item:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
}

.overview-ranking-rank {
    /* 排名徽章叠在卡片左上角，给大图也留出"角标"的视觉锚点 */
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #f3e9c4;
    color: #6e4d00;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.overview-ranking-item.is-top1 .overview-ranking-rank { background: #ffcf3c; color: #5a3a00; }
.overview-ranking-item.is-top2 .overview-ranking-rank { background: #ffe27a; color: #6b4a00; }
.overview-ranking-item.is-top3 .overview-ranking-rank { background: #ffeaa6; color: #7a5800; }

.overview-ranking-name {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    min-width: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-ranking-stats {
    grid-column: 2;
    grid-row: 2;
    /* 一张卡 ~430px，4 个指标横排基本能塞下；塞不下时自动换行（不会溢出卡片） */
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: normal;
}

.overview-ranking-stats strong {
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 900;
}

.overview-ranking-divider {
    color: #cbb98a;
    font-weight: 900;
}

.overview-ranking-roi {
    font-weight: 800;
}

.overview-ranking-roi.pos { color: var(--green); }
.overview-ranking-roi.neg { color: #d24c4c; }

.overview-ranking-extra {
    color: var(--text);
    font-weight: 700;
}

.overview-ranking-extra strong {
    color: var(--text);
    font-weight: 900;
}

.overview-ranking-empty {
    padding: 18px 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

/* ====== 近 30 日趋势图（ECharts Canvas） ====== */
.overview-trend {
    margin-top: 18px;
    padding: 18px 20px 12px;
    border: 1px solid #eee4cf;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 4px 14px -10px rgba(35, 31, 23, 0.18);
}

.overview-trend-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.overview-trend-header h3 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.overview-trend-canvas {
    position: relative;
    width: 100%;
    height: 280px;
    min-height: 280px;
    padding: 2px 0 0;
}

.overview-trend-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 260px;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 980px) {
    .site-header-inner,
    .app-shell {
        width: min(1580px, calc(100% - 24px));
    }

    .main-nav {
        gap: 18px;
        margin-left: 20px;
    }

    .recipe-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .recipe-grid-skeleton {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .engine-status-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .overview-quality {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .engine-event-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .overview-ranking-list {
        /* 中屏 3 列会挤，自动降到 2 列 */
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .floatbar {
        right: 10px;
        top: auto;
        bottom: 88px;
        width: 66px;
        transform: none;
    }

    .floatbar.is-collapsed {
        width: 36px;
    }

    .floatbar-link {
        min-height: 58px;
        padding: 8px 5px;
    }

    .floatbar-link span {
        font-size: 11px;
    }

    .floatbar-popover {
        right: calc(100% + 10px);
        width: 168px;
    }

    .floatbar-popover img {
        width: 132px;
        height: 132px;
    }

    .site-header {
        height: auto;
    }

    .site-header-inner {
        flex-wrap: wrap;
        gap: 8px 16px;
        padding: 8px 0;
    }

    .main-nav {
        order: 3;
        width: 100%;
        height: 34px;
        margin-left: 0;
        justify-content: space-around;
    }

    .user-menu span:not(.avatar) {
        display: none;
    }

    .toolbar {
        grid-template-columns: minmax(0, 1fr) 68px;
    }

    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .recipe-grid-skeleton {
        grid-template-columns: 1fr;
    }

    .engine-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-quality {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .engine-status-card {
        padding: 14px 16px;
    }

    .engine-event-card {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px 14px;
    }

    .overview-ranking-list {
        /* 小屏 1 列；和单列时代的紧凑感一致，但每张卡仍带左侧大图 */
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .overview-ranking-item {
        /* 小屏图片缩到 76×76，卡片仍是「左大图 + 右两行」结构 */
        grid-template-columns: 76px minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 4px;
        min-height: 96px;
        padding: 9px 12px 9px 9px;
    }

    .overview-ranking-thumb {
        width: 76px;
        height: 76px;
        border-radius: 8px;
    }

    .overview-ranking-name {
        font-size: 13px;
    }

    .overview-ranking-stats {
        font-size: 12px;
        gap: 3px 6px;
    }

    .pagination-bar {
        text-align: center;
    }

    .pagination-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .recipe-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .overview-panel {
        padding: 16px;
        border-radius: 18px;
    }

    .seo-hero {
        padding: 18px;
        border-radius: 16px;
    }

}

/* ===== 微信扫码登录弹窗 ===== */
body.modal-open {
    overflow: hidden;
}

.wx-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: wxOverlayIn .18s ease-out;
}

.wx-login-overlay[hidden] {
    display: none;
}

.wx-login-modal {
    position: relative;
    width: min(360px, 100%);
    background: #ffffff;
    border-radius: 18px;
    padding: 28px 24px 22px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .25);
    animation: wxModalIn .22s ease-out;
}

.wx-login-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.wx-login-close:hover {
    background: rgba(15, 23, 42, .06);
    color: #1f2937;
}

.wx-login-title {
    margin: 0 0 12px;
    text-align: center;
    color: #0f172a;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .5px;
}

.wx-login-qr {
    min-height: 430px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

/* 微信 SDK 注入的 iframe 高度需足够，避免扫码成功/等待确认等状态文字被裁剪 */
.wx-login-qr iframe {
    border: none;
    width: 300px !important;
    height: 430px !important;
    max-width: 100%;
}

.wx-login-hint {
    margin: 14px 0 0;
    text-align: center;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

@keyframes wxOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes wxModalIn {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== 积分明细弹窗 ===== */
.points-log-overlay {
    position: fixed;
    inset: 0;
    z-index: 9400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(34, 32, 28, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: wxOverlayIn .18s ease-out;
}

.points-log-overlay[hidden] {
    display: none;
}

.points-log-modal {
    position: relative;
    width: min(720px, 100%);
    max-height: min(70vh, 680px);
    padding: 24px;
    border: 1px solid #efe9d6;
    border-radius: 16px;
    background: #ffffff;
    color: #22201c;
    box-shadow: 0 30px 80px rgba(35, 31, 23, 0.22);
    animation: wxModalIn .22s ease-out;
    overflow: hidden;
}

.points-log-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #b3aea3;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.points-log-close:hover {
    background: rgba(34, 32, 28, .06);
    color: #22201c;
}

.points-log-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin: 0 28px 16px 0;
}

.points-log-head h3 {
    margin: 4px 0 0;
    color: #22201c;
    font-size: 20px;
    font-weight: 900;
}

.points-log-balance {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid #f0e4b8;
    border-radius: 999px;
    background: #fffaf0;
    color: #5f4100;
    font-size: 13px;
    font-weight: 900;
}

.points-log-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.points-checkin-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: linear-gradient(180deg, #dcfce7, #bbf7d0);
    color: #14532d;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.points-checkin-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #bbf7d0, #86efac);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
    transform: translateY(-1px);
}

.points-checkin-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.points-checkin-btn:disabled {
    cursor: not-allowed;
    color: #6b7280;
    background: #f3f4f6;
    border-color: #e5e7eb;
    box-shadow: none;
    transform: none;
}

.points-log-status {
    min-height: 20px;
    margin: 0 0 12px;
    color: #6b665d;
    font-size: 13px;
    font-weight: 700;
}

.points-log-table-wrap {
    max-height: calc(min(70vh, 680px) - 132px);
    overflow: auto;
    border: 1px solid #efe9d6;
    border-radius: 12px;
    background: #fffaf0;
}

.points-log-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
    font-size: 13px;
}

.points-log-table th,
.points-log-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #efe9d6;
    text-align: left;
    vertical-align: middle;
}

.points-log-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8efd9;
    color: #4d4a44;
    font-weight: 900;
}

.points-log-table tr:last-child td {
    border-bottom: 0;
}

.points-change-pos {
    color: #15803d;
    font-weight: 900;
}

.points-change-neg {
    color: #b91c1c;
    font-weight: 900;
}

.points-log-recipe-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .15s;
}

.points-log-recipe-link:hover {
    color: #1d4ed8;
}

.points-log-empty {
    padding: 20px;
    color: #6b665d;
    text-align: center;
    font-weight: 700;
}

/* ===== 自定义对话框（替代浏览器原生 confirm/alert） ===== */
.app-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(34, 32, 28, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: wxOverlayIn .18s ease-out;
}

.app-dialog-overlay[hidden] {
    display: none;
}

.app-dialog {
    position: relative;
    width: min(440px, 100%);
    padding: 28px 26px 22px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #efe9d6;
    box-shadow: 0 30px 80px rgba(35, 31, 23, 0.22);
    color: #22201c;
    animation: wxModalIn .22s ease-out;
}

.app-dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #b3aea3;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.app-dialog-close:hover {
    background: rgba(34, 32, 28, .06);
    color: #22201c;
}

.app-dialog-icon {
    width: 44px;
    height: 44px;
    margin: 2px 0 12px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #fff4c2, #ffe079);
    color: #5f4100;
    box-shadow: 0 6px 14px rgba(246, 184, 0, 0.22);
}

.app-dialog-icon img {
    width: 32px;
    height: 32px;
    display: block;
    object-fit: contain;
}

.app-dialog.is-danger .app-dialog-icon {
    background: linear-gradient(180deg, #ffd6d6, #f88e8e);
    color: #7a1d1d;
    box-shadow: 0 6px 14px rgba(224, 82, 82, 0.22);
}

.app-dialog-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 800;
    color: #22201c;
    letter-spacing: .3px;
}

.app-dialog-message {
    margin: 0 0 14px;
    color: #4d4a44;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.app-dialog-tip {
    margin: 0 0 18px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #f0e4b8;
    background: #fffaf0;
    color: #6b5b18;
    font-size: 12.5px;
    line-height: 1.6;
}

.app-dialog-tip strong {
    color: #5f4100;
}

.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.app-dialog-actions .ghost-btn,
.app-dialog-actions .primary-btn {
    min-height: 36px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
}

.app-dialog-actions .app-dialog-cancel {
    color: #6b665d;
    background: #f6f3ec;
    border-color: #e9e2ce;
}

.app-dialog-actions .app-dialog-cancel:hover {
    border-color: #d9cfa8;
    background: #f1ebd8;
    box-shadow: none;
}

.app-dialog.is-danger .app-dialog-actions .primary-btn {
    color: #ffffff;
    border-color: #c0392b;
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

/* ===== 帮助文档弹窗 ===== */
.help-overlay {
    position: fixed;
    inset: 0;
    z-index: 9400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(34, 32, 28, 0.46);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: wxOverlayIn .18s ease-out;
}

.help-overlay[hidden] {
    display: none;
}

.help-modal {
    position: relative;
    width: min(860px, 100%);
    max-height: min(82vh, 760px);
    display: flex;
    flex-direction: column;
    border: 1px solid #efe4cf;
    border-radius: 22px;
    background:
        radial-gradient(circle at 86% 0%, rgba(246, 184, 0, 0.18), transparent 35%),
        linear-gradient(180deg, #fffdf7 0%, #ffffff 46%, #fffaf0 100%);
    box-shadow: 0 30px 86px rgba(35, 31, 23, 0.28);
    color: #22201c;
    overflow: hidden;
    animation: wxModalIn .22s ease-out;
}

.help-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(34, 32, 28, 0.05);
    color: #8a8274;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.help-close:hover {
    background: rgba(249, 115, 22, 0.12);
    color: #c77822;
}

.help-head {
    padding: 28px 34px 18px;
    border-bottom: 1px solid #f0e4cf;
}

.help-head h3 {
    margin: 4px 42px 8px 0;
    color: #24190f;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: .2px;
}

.help-head p:last-child {
    margin: 0;
    color: #6f6255;
    font-size: 14px;
    line-height: 1.7;
}

.help-content {
    padding: 8px 34px 30px;
    overflow: auto;
}

.help-content section {
    padding: 18px 0;
    border-bottom: 1px solid #f5ead7;
}

.help-content section:last-child {
    border-bottom: 0;
}

.help-content h4 {
    margin: 0 0 10px;
    color: #8a4b0f;
    font-size: 17px;
    font-weight: 900;
}

.help-content p,
.help-content li {
    color: #4d453b;
    font-size: 14px;
    line-height: 1.8;
}

.help-content p {
    margin: 8px 0;
}

.help-content ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.help-content li + li {
    margin-top: 6px;
}

.help-content strong {
    color: #24190f;
}

.help-content code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #fff3d8;
    color: #9a4a00;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.help-note {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #f0d9a7;
    border-radius: 12px;
    background: #fff8e8;
    color: #5e4a22;
    font-size: 13px;
    line-height: 1.75;
}

@media (max-width: 480px) {
    .points-log-modal {
        padding: 20px 16px 16px;
        border-radius: 14px;
    }

    .points-log-head {
        flex-direction: column;
        gap: 10px;
        margin-right: 28px;
    }

    .points-log-balance {
        align-self: flex-start;
    }

    .points-log-head-actions {
        align-self: flex-start;
        flex-wrap: wrap;
    }

    .app-dialog {
        padding: 22px 18px 18px;
        border-radius: 14px;
    }

    .app-dialog-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .app-dialog-actions .ghost-btn,
    .app-dialog-actions .primary-btn {
        width: 100%;
    }

    .help-overlay {
        padding: 14px;
    }

    .help-modal {
        max-height: 86vh;
        border-radius: 18px;
    }

    .help-head {
        padding: 22px 18px 14px;
    }

    .help-head h3 {
        margin-right: 36px;
        font-size: 20px;
    }

    .help-content {
        padding: 4px 18px 22px;
    }
}

/* ===== 页脚横幅（Brand Footer）===== */
:root {
    --footer-logo-height: 80px;
}

.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    background: #ffffff;
    border-top: 1px solid rgba(217, 119, 6, 0.35);
    box-shadow: inset 0 1px 0 rgba(250, 204, 21, 0.18);
    color: #22201c;
    position: relative;
    overflow: hidden;
}

/* 右侧金色 CS2 饰品装饰：金色武器箱 */
.site-footer::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 24px;
    width: 150px;
    height: 92px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.22;
    filter: drop-shadow(0 2px 4px rgba(217, 119, 6, 0.18));
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 90'><path fill='%23facc15' d='M70 4 l4 10 10 2-7 7 2 10-9-5-9 5 2-10-7-7 10-2z'/><rect x='18' y='30' width='104' height='50' rx='4' fill='none' stroke='%23d97706' stroke-width='3'/><rect x='22' y='42' width='96' height='6' fill='%23f59e0b'/><circle cx='70' cy='58' r='5' fill='none' stroke='%23d97706' stroke-width='2.5'/><rect x='66' y='58' width='8' height='10' fill='%23d97706'/></svg>") no-repeat center / contain;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    width: min(1580px, calc(100% - 32px));
    margin: 0 auto;
    padding: 14px 0;
    position: relative;
    z-index: 1;
}

.footer-logo {
    display: block;
    height: var(--footer-logo-height);
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.footer-line {
    margin: 0;
    color: #5b5854;
    font-size: 13px;
    line-height: 1.55;
    letter-spacing: .2px;
}

.footer-line.footer-corp {
    color: #22201c;
    font-weight: 500;
}

.footer-link {
    color: #a16207;
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    transition: color .15s, border-color .15s;
}

.footer-link:hover,
.footer-link:focus {
    color: #ca8a04;
    border-bottom-color: currentColor;
}

.footer-disclaimer {
    color: #6b6861;
}

.footer-copyright {
    color: #8e8b84;
    font-size: 12px;
}

/* 移动端：图片在上、文字在下、整体居中；装饰元素隐藏避免拥挤 */
@media (max-width: 720px) {
    :root {
        --footer-logo-height: 64px;
    }
    .site-footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 18px 0;
    }
    .footer-meta {
        align-items: center;
    }
    .site-footer::after {
        display: none;
    }
}

/* ===== 我的配方 ===== */
.saved-panel {
    width: min(1580px, calc(100% - 32px));
    margin: 0 auto;
}

.saved-header,
.saved-login-state {
    border: 1px solid rgba(125, 110, 90, 0.18);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.saved-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.saved-filterbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.saved-filter-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.saved-filter-field select {
    appearance: none;
    -webkit-appearance: none;
    min-width: 92px;
    height: 32px;
    border: 1px solid rgba(125, 110, 90, 0.2);
    border-radius: 10px;
    padding: 0 26px 0 10px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    background:
        linear-gradient(45deg, transparent 50%, #a16207 50%) right 11px center / 6px 6px no-repeat,
        linear-gradient(135deg, #fffdf7, #fff7df);
    cursor: pointer;
}

.saved-filter-sort select {
    min-width: 112px;
}

.saved-filter-dir select {
    min-width: 96px;
}

.saved-login-state h3 {
    margin: 0;
    color: var(--text);
}

.saved-login-state p {
    color: var(--muted);
}

.saved-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding-left: 12px;
    border-left: 1px solid rgba(125, 110, 90, 0.18);
}

.saved-status-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    line-height: 1.25;
    text-align: center;
}

.saved-header-actions .saved-status {
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.saved-header-actions .saved-quality {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--muted);
    white-space: nowrap;
}

.saved-header-actions .saved-quality[hidden] {
    display: none;
}

.saved-header-actions .saved-quality .q-secret      { color: #ff4b4b; }
.saved-header-actions .saved-quality .q-classified  { color: #d04bff; }
.saved-header-actions .saved-quality .q-restricted  { color: #8847ff; }
.saved-header-actions .saved-quality .q-milspec     { color: #4b69ff; }

.saved-status {
    color: var(--muted);
    font-size: 12px;
}

.membership-overlay {
    position: fixed;
    inset: 0;
    z-index: 9450;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(35, 31, 23, 0.46);
    backdrop-filter: blur(8px);
}

.membership-modal {
    position: relative;
    width: min(1018px, 100%);
    max-height: min(760px, 92vh);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    color: #3b3328;
    background: #fffaf0;
    box-shadow: 0 28px 80px rgba(35, 31, 23, 0.26);
}

.membership-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 1px solid #f0c31d;
    border-radius: 999px;
    color: #5f4100;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(178, 118, 0, 0.24);
}

.membership-close:hover {
    color: #4a3200;
    background: linear-gradient(180deg, #ffe173, #e0a100);
}

.membership-body {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr);
    min-height: 600px;
}

.membership-value-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 34px 32px 28px;
    color: #f8efd8;
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 192, 25, 0.22), transparent 28%),
        linear-gradient(145deg, rgba(31, 29, 25, 0.98), rgba(52, 49, 41, 0.99)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 72px);
    overflow: hidden;
}

.membership-value-panel::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -90px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 34px solid rgba(255, 192, 25, 0.08);
    pointer-events: none;
}

.membership-hero {
    position: relative;
    z-index: 1;
}

.membership-eyebrow {
    margin: 0;
    color: #ffc019;
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.membership-value-panel h3 {
    margin: 10px 0 0;
    max-width: 360px;
    color: #fff8e8;
    font-size: 32px;
    line-height: 1.15;
}

.membership-value-panel #membership-status {
    margin: 14px 0 0;
    color: #d8c7a4;
    font-size: 14px;
    line-height: 1.65;
}

.membership-value-strip {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.membership-value-strip span {
    min-height: 72px;
    padding: 12px 10px;
    border: 1px solid rgba(255, 192, 25, 0.2);
    border-radius: 16px;
    color: #e8d7b2;
    background: rgba(255, 255, 255, 0.07);
    font-size: 12px;
    font-weight: 800;
}

.membership-value-strip strong {
    display: block;
    margin-bottom: 5px;
    color: #ffc019;
    font-size: 19px;
    line-height: 1;
}

.membership-order-panel {
    padding: 34px 34px 28px;
    background:
        linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
    overflow: auto;
}

.membership-order-head {
    margin-bottom: 14px;
}

.membership-order-head h4 {
    margin: 4px 0 0;
    color: #202124;
    font-size: 24px;
}

.membership-order-head p:last-child {
    margin: 8px 0 0;
    color: #786b59;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
}

.membership-order-highlight {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #f5d45f;
    border-radius: 16px;
    color: #5f4100;
    background: linear-gradient(90deg, #fff8d7, #fffdf4);
    box-shadow: 0 10px 24px rgba(180, 83, 9, 0.08);
}

.membership-order-highlight span {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    color: #fff8e8;
    background: #b98700;
    font-size: 11px;
    font-weight: 1000;
}

.membership-order-highlight strong {
    font-size: 13px;
    line-height: 1.5;
}

.membership-benefits {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.membership-benefits article {
    position: relative;
    min-height: 72px;
    padding: 12px 14px 12px 52px;
    border: 1px solid rgba(255, 192, 25, 0.18);
    border-radius: 14px;
    color: #fff3cf;
    background: rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.membership-benefit-index {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #5f4100;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
    font-size: 11px;
    font-weight: 1000;
}

.membership-benefits strong {
    display: block;
    font-size: 14px;
    font-weight: 1000;
}

.membership-benefits p {
    margin: 5px 0 0;
    color: #d8c7a4;
    font-size: 12px;
    line-height: 1.55;
}

.membership-plans {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.membership-plan {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 7px 12px;
    width: 100%;
    min-height: 152px;
    padding: 16px;
    border: 1px solid #ece7d7;
    border-radius: 18px;
    color: #3b3328;
    background: #fff;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 12px 28px rgba(35, 31, 23, 0.08);
}

.membership-plan:hover:not(:disabled),
.membership-plan.is-selected {
    border-color: #f0c31d;
    background: #fffdf4;
    box-shadow: 0 14px 32px rgba(180, 83, 9, 0.12);
}

.membership-plan.is-recommended {
    border-color: #f0c31d;
    background:
        linear-gradient(#fffdf4, #fffdf4) padding-box,
        linear-gradient(135deg, #ffd33d, #b98700) border-box;
}

.membership-plan.is-selected::after {
    content: "已选";
    grid-column: 2;
    grid-row: 4;
    justify-self: end;
    padding: 2px 8px;
    border-radius: 999px;
    color: #5f4100;
    background: #ffe173;
    font-size: 11px;
    font-weight: 900;
}

.membership-plan.is-disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.membership-plan-topline {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.membership-plan-name {
    font-size: 15px;
    font-weight: 1000;
}

.membership-plan-badge {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    color: #7c4a03;
    background: #fff1ad;
    font-size: 11px;
    font-weight: 1000;
}

.membership-plan-duration {
    grid-column: 1 / -1;
    color: #6f6658;
    font-size: 12px;
    font-weight: 800;
}

.membership-plan strong {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
    color: #b98700;
    font-size: 30px;
    line-height: 1;
}

.membership-pay-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.membership-pay-actions button {
    flex: 1;
}

.membership-plan small {
    grid-column: 1 / -1;
    display: block;
    min-height: 34px;
    margin-top: 0;
    color: #6f6658;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.membership-pay-note {
    margin: 14px 0 0;
    color: #7a6f5f;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
}

.membership-pay-actions .ghost-btn,
.membership-pay-actions .primary-btn {
    min-height: 46px;
    border-color: #f0c31d;
    color: #5f4100;
    background: linear-gradient(180deg, #ffd33d, #ffc000);
    box-shadow: none;
    cursor: pointer;
}

.membership-pay-actions .ghost-btn:hover,
.membership-pay-actions .primary-btn:hover {
    border-color: #e0a100;
    color: #4a3200;
    background: linear-gradient(180deg, #ffe173, #e0a100);
}

.membership-pay-result {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    color: #5f4100;
    background: #fff8d7;
    word-break: break-all;
}

.membership-pay-result[data-kind="error"] {
    color: #9f1239;
    background: #ffe4e6;
}

.membership-pay-result[data-kind="wechat"] {
    color: #234019;
    background: linear-gradient(180deg, #f0fdf4, #ecfdf5);
    border: 1px solid rgba(34, 197, 94, 0.24);
}

.membership-wechat-pay {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    gap: 12px;
}

.membership-wechat-qr {
    width: 130px;
    height: 130px;
    padding: 6px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(22, 101, 52, 0.12);
}

.membership-wechat-qr img,
.membership-wechat-qr canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.membership-wechat-qr-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #166534;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
}

.membership-wechat-copy strong,
.membership-wechat-copy span,
.membership-wechat-copy small,
.membership-wechat-copy a {
    display: block;
}

.membership-wechat-copy strong {
    color: #14532d;
    font-size: 15px;
    font-weight: 1000;
}

.membership-wechat-copy span {
    margin-top: 4px;
    color: #166534;
    font-size: 11px;
    font-weight: 900;
}

.membership-wechat-copy small {
    margin-top: 4px;
    color: #4b6b55;
    font-size: 11px;
    line-height: 1.4;
}

.membership-wechat-copy a {
    margin-top: 6px;
    color: #047857;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
}

.membership-wechat-paid-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    margin-top: 8px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(180deg, #22c55e, #16a34a);
    box-shadow: 0 10px 22px rgba(22, 163, 74, 0.18);
    cursor: pointer;
    font-size: 12px;
    font-weight: 1000;
}

.membership-wechat-paid-btn:hover {
    background: linear-gradient(180deg, #16a34a, #15803d);
}

.membership-wechat-copy a:hover {
    text-decoration: underline;
}

@media (max-width: 820px) {
    .membership-modal {
        overflow: auto;
    }

    .membership-body {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .membership-value-panel {
        padding: 28px 24px 24px;
    }

    .membership-value-panel h3 {
        max-width: none;
        font-size: 28px;
    }

    .membership-value-strip {
        grid-template-columns: 1fr;
    }

    .membership-benefits {
        grid-template-columns: 1fr;
        margin-top: 4px;
    }

    .membership-order-panel {
        padding: 24px;
    }

    .membership-plans {
        grid-template-columns: 1fr;
    }

    .membership-pay-actions {
        flex-direction: column;
    }

    .membership-wechat-pay {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
}

.saved-login-state {
    border-radius: 24px;
    padding: 34px;
    text-align: center;
}

.saved-login-state p {
    margin: 10px 0 18px;
}

.saved-grid {
    margin-top: 0;
}

.saved-empty {
    grid-column: 1 / -1;
    border: 1px solid rgba(125, 110, 90, 0.16);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted);
    padding: 36px;
    text-align: center;
}

/* ===== 配方雷达 ===== */
.push-panel {
    width: min(1580px, calc(100% - 32px));
    margin: 0 auto;
}

.push-login-state,
.push-rule-form,
.push-list-panel {
    border: 1px solid rgba(125, 110, 90, 0.18);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.push-section-head h3,
.push-login-state h3 {
    margin: 0;
    color: var(--text);
}

.push-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* 命中记录面板里的左侧标题块：标题 + 未读计数横排，gap 较小，
   保留原来 .push-section-head span 的 muted 样式给 unread-count。 */
.push-section-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.push-section-head-left span {
    color: var(--muted);
    font-size: 12px;
}

.push-status {
    color: var(--muted);
    font-size: 12px;
}

/* 命中记录面板右上角"刷新 / 全部已读"按钮压扁：
   通用 .ghost-btn / .primary-btn 是 min-height 42px 的胶囊按钮，
   这里覆盖成贴着字体高度的小按钮，与左侧未读计数视觉对齐。 */
.push-notice-panel .push-header-actions .ghost-btn,
.push-notice-panel .push-header-actions .primary-btn {
    min-height: 0;
    padding: 2px 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.push-login-state {
    border-radius: 24px;
    padding: 34px;
    text-align: center;
}

.push-login-state p {
    margin: 10px 0 18px;
    color: var(--muted);
}

.push-content {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.push-rule-form,
.push-list-panel {
    border-radius: 22px;
    padding: 20px;
}

.push-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.push-section-head span {
    color: var(--muted);
    font-size: 12px;
}

.push-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.push-field {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.push-field input,
.push-field select {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(125, 110, 90, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    padding: 0 12px;
    outline: none;
}

.push-field input:focus,
.push-field select:focus {
    border-color: rgba(217, 119, 6, 0.75);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

.push-checkbox-field {
    align-content: start;
}

.push-checkbox-inline {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    cursor: pointer;
}

.push-checkbox-inline input {
    width: 16px;
    min-height: 16px;
    flex: 0 0 16px;
    cursor: pointer;
}

/* form 底部"重置 + 保存"两个按钮 50/50 横排，
   margin-top 复用原 .push-save-btn 留出的与字段间距。 */
.push-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.push-form-actions .push-reset-btn,
.push-form-actions .push-save-btn {
    width: 100%;
}

.push-list-panel {
    min-height: 200px;
}

/* 双列布局：
   左列由 .push-left-stack 包裹 form 与"我的推送规则"上下堆叠，
   右列由"命中记录"独占，sticky 在 viewport 顶部跟随滚动。
   把它们各自当成单一 grid item 可以避免命中记录跨行时的高度
   摊到行轨道上、把 form 与下方面板撑出大块空白。 */
.push-left-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.push-notice-panel {
    align-self: start;
    position: sticky;
    top: 64px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.push-rule-list,
.push-notification-list {
    display: grid;
    gap: 12px;
}

.push-rule-card,
.push-notice-card,
.push-empty {
    border: 1px solid rgba(125, 110, 90, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    padding: 16px;
}

.push-empty {
    color: var(--muted);
    text-align: center;
}

.push-rule-card.is-disabled {
    opacity: .62;
}

.push-rule-main,
.push-notice-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.push-rule-main h4,
.push-notice-title-row h4 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
}

.push-rule-main p,
.push-notice-content,
.match-reason {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.push-rule-state {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .12);
    color: #22c55e;
    font-size: 12px;
}

.push-rule-card.is-disabled .push-rule-state {
    background: rgba(148, 163, 184, .16);
    color: #94a3b8;
}

.push-rule-actions,
.push-notice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.push-rule-actions {
    align-items: center;
    justify-content: space-between;
}

.push-rule-time {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.35;
}

.push-rule-actions .ghost-btn {
    min-height: 0;
    height: auto;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
}

.ghost-btn.danger {
    color: #ef4444;
}

.push-notice-card.is-unread {
    border-color: rgba(34, 197, 94, .35);
    box-shadow: inset 3px 0 0 rgba(34, 197, 94, .75);
}

.push-notice-title-row time {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.match-reason {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(217, 119, 6, .08);
    color: var(--text);
}

@media (max-width: 980px) {
    .push-content {
        grid-template-columns: 1fr;
    }
    /* 单列布局下取消 sticky，让命中记录跟随页面自然滚动。 */
    .push-notice-panel {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 720px) {
    .saved-header {
        justify-content: flex-start;
    }
    .saved-filterbar {
        width: 100%;
    }
    .saved-filter-field {
        flex: 1 1 132px;
    }
    .saved-filter-field select {
        flex: 1 1 auto;
        min-width: 0;
    }
    .saved-header-actions {
        justify-content: flex-start;
        width: 100%;
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid rgba(125, 110, 90, 0.18);
        padding-top: 8px;
    }
    .push-header-actions {
        justify-content: flex-start;
    }
    .push-section-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .push-form-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   库存管理（CS2 库存网格）
   ===================================================================== */
.inventory-panel {
    width: min(1580px, calc(100% - 32px));
    margin: 0 auto;
}

.inventory-login-state,
.inventory-bind-state {
    border: 1px solid rgba(125, 110, 90, 0.18);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 24px;
    padding: 34px;
    text-align: center;
}

.inventory-bind-state {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    align-items: stretch;
    gap: 22px;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 22%, rgba(27, 40, 56, 0.10), transparent 55%),
        radial-gradient(circle at 12% 88%, rgba(27, 40, 56, 0.08), transparent 60%),
        rgba(255, 255, 255, 0.04);
    text-align: left;
}

.inventory-bind-watermark {
    position: absolute;
    top: 50%;
    right: -56px;
    width: 360px;
    height: 360px;
    transform: translateY(-50%) rotate(-8deg);
    color: #1b2838;
    opacity: 0.07;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.inventory-bind-watermark path {
    fill: currentColor;
}

.inventory-bind-hint {
    position: relative;
    z-index: 1;
    margin: 10px 0 0;
    padding: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: .2px;
    max-width: 640px;
}

.inventory-vip-intro {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.inventory-vip-intro h3 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 28px;
    line-height: 1.2;
}

.inventory-vip-benefits {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.inventory-vip-benefits article {
    padding: 14px 16px;
    border: 1px solid rgba(217, 119, 6, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.inventory-vip-benefits strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 1000;
}

.inventory-vip-benefits span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
}

.inventory-vip-upgrade {
    margin-top: 18px;
    min-height: 44px;
    padding: 0 22px;
}

.inventory-bind-state .steam-login-form {
    position: relative;
    z-index: 1;
}

.inventory-bind-state.is-vip-locked {
    grid-template-columns: 1fr;
    max-width: 980px;
    margin: 0 auto;
}

.inventory-bind-state.is-vip-locked .inventory-vip-intro {
    text-align: center;
}

.inventory-bind-state.is-vip-locked .inventory-bind-hint,
.inventory-bind-state.is-vip-locked .inventory-vip-benefits {
    margin-right: auto;
    margin-left: auto;
}

.inventory-bind-state.is-vip-locked .inventory-vip-benefits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inventory-login-state h3 {
    margin: 0 0 12px;
    color: var(--text);
}

.inventory-login-state p {
    margin: 10px auto 18px;
    color: var(--muted);
    max-width: 520px;
    line-height: 1.6;
}

.inventory-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inventory-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border: 1px solid rgba(125, 110, 90, 0.18);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 18px;
}

.inventory-summary-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}

.inventory-summary-left em {
    color: var(--text);
    font-style: normal;
    font-weight: 700;
    margin-left: 4px;
}

.inv-summary-item {
    display: inline-flex;
    align-items: center;
}

.inv-summary-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.inv-summary-price {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 8px;
    border-left: 1px solid rgba(125, 110, 90, 0.22);
}

.inv-summary-price-main em {
    color: #d97706;
    font-size: 18px;
    font-weight: 800;
}

.inv-summary-breakdown {
    color: var(--muted);
    font-size: 11px;
}

.inv-summary-breakdown em {
    color: var(--text);
    font-weight: 700;
}

.inventory-summary-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inventory-summary-right .ghost-btn {
    min-height: 0;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
}

.recipe-notify-toggle.is-enabled {
    border-color: rgba(22, 163, 74, 0.35);
    color: #166534;
    background: #dcfce7;
}

.inventory-filterbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border: 1px solid rgba(125, 110, 90, 0.18);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
}

.inventory-filterbar select {
    appearance: none;
    -webkit-appearance: none;
    height: 34px;
    padding: 0 28px 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(125, 110, 90, 0.28);
    background: rgba(255, 255, 255, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23475569' d='M4.2 6.2 8 10l3.8-3.8 1.1 1.1L8 12.2 3.1 7.3z'/%3E%3C/svg%3E") right 8px center/14px no-repeat;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    min-width: 96px;
}

.inv-merge-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}

.inv-merge-toggle input {
    cursor: pointer;
}

.inv-search-field {
    margin-left: auto;
    min-width: 240px;
    flex: 0 1 320px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.inv-card {
    position: relative;
    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);
    display: flex;
    flex-direction: column;
    border-top: 3px solid var(--rarity, #b0c3d9);
    transition: box-shadow .15s ease, border-color .15s ease;
}

.inv-card:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, .18);
    border-color: #bfbfbf;
}

.inv-card-media {
    position: relative;
    width: 100%;
    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);
}

.inv-card-media::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;
}

.inv-card-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%);
}

.inv-card-img-empty {
    width: 56%;
    height: 56%;
    background: rgba(15, 23, 42, .05);
}

.inv-card-cooldown {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 0;
    padding: 2px 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
}

.inv-card-cooldown.is-tradable {
    background: #16a34a;
}

/* 「已被某套配方占用」标记：饰品图片右下角的红色小圆点。
   避开底部 4px 的 .inv-card-wear-track（如果存在）；不存在时贴到右下 6px。 */
.inv-card-media .inv-card-used-mark {
    position: absolute;
    z-index: 4;
    right: 8px;
    bottom: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc2626;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.92),
        0 1px 4px rgba(220, 38, 38, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    pointer-events: auto;
    cursor: help;
}

.inv-card-media:has(.inv-card-wear-track) .inv-card-used-mark {
    bottom: 12px;
}

.inv-card-media .inv-card-used-mark:hover {
    transform: scale(1.25);
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 1),
        0 2px 8px rgba(220, 38, 38, 0.65);
}

/* 冷却中：显示剩余时间时不需要色块，纯文字即可（与左下角磨损徽标对称） */
.inv-card-cooldown.is-locked {
    top: 2px;
    right: 4px;
    padding: 0;
    background: transparent;
    /* 与"可交易"绿底同色系，传达"等待这段时间后就能交易"的语义 */
    color: #15803d;
    font-size: 11px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    /* 浅色饰品图上加白晕，深色饰品图上也能清晰 */
    text-shadow:
        -1px -1px 0 rgba(255, 255, 255, 0.85),
         1px -1px 0 rgba(255, 255, 255, 0.85),
        -1px  1px 0 rgba(255, 255, 255, 0.85),
         1px  1px 0 rgba(255, 255, 255, 0.85);
}

.inv-card-count {
    position: absolute;
    z-index: 3;
    right: 4px;
    bottom: 4px;
    padding: 1px 6px;
    background: rgba(15, 23, 42, .82);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
}

.inv-card-media:has(.inv-card-wear-track) .inv-card-count {
    bottom: 6px;
}

.inv-card-wear-badge {
    position: absolute;
    z-index: 3;
    left: 4px;
    bottom: 0;
    padding: 0;
    color: #0f172a;
    background: transparent;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.35;
    letter-spacing: .2px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.inv-card-media:has(.inv-card-wear-track) .inv-card-wear-badge {
    bottom: 6px;
}

.inv-card-wear-track {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        #3b82f6 0%,
        #3b82f6 7%,
        #22c55e 7%,
        #22c55e 15%,
        #f59e0b 15%,
        #f59e0b 38%,
        #f97316 38%,
        #f97316 45%,
        #ef4444 45%,
        #ef4444 100%
    );
}

.inv-card-wear-track .wear-pointer {
    top: 0;
    border-bottom-color: #fff;
    transform: translate(-50%, -100%);
}

.inv-card-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    gap: 0;
    padding: 6px 10px 8px;
}

.inv-card-name {
    margin: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #000;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -.1px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 品质色块：竖条形 ≈ 文字 X-height，继承卡片 --rarity 变量。
   与顶部 3px 稀有度边条形成"远观/近读"双层指示，但视觉上不突兀。 */
.inv-card-rarity-mark {
    flex-shrink: 0;
    width: 4px;
    height: 14px;
    background: var(--rarity, #b0c3d9);
    border-radius: 1px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(0, 0, 0, 0.08);
}

.inv-card-case {
    margin: 0;
    overflow: hidden;
    color: #4b443b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.inv-card-name-text {
    flex: 1;
    overflow: hidden;
    color: #000;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.inv-card-tag {
    display: inline-block;
    flex-shrink: 0;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.3;
}

.inv-card-tag.is-stattrak {
    background: #ea580c;
    color: #fff;
}

/* 库存卡片左上角：磨损档位 + ST 标记并排（紧跟在 wear-tier-chip 之后） */
.inv-card-media-tags {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    display: flex;
    align-items: stretch;
}

.inv-card-media-tags .wear-tier-chip {
    position: static;
}

.inv-card-media-tags .inv-card-tag.is-stattrak {
    display: flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1.35;
}

.inv-card-tag.is-souvenir {
    background: #d97706;
    color: #fff;
}

/* 双价格条：通体宽度 = .inv-card-info 外缘宽度（用负 margin 突破 info 的 5px 10px 8px padding）
   高度 = 文字行高，不留上下 padding；垂直定位交给 info 的 justify-content: flex-end */
.inv-card-prices {
    display: flex;
    margin: 0 -10px -8px;
    width: calc(100% + 20px);
}

.inv-card-price {
    /* 每块比 50% 多 5px，配合 UU 的负 margin 形成 10px 重叠区，clip-path 在重叠区切出斜角棱线 */
    flex: 0 0 calc(50% + 5px);
    min-width: 0;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -.2px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    font-variant-numeric: tabular-nums;
}

.inv-card-price-buff {
    padding: 0 14px 0 8px;
    background: rgba(37, 99, 235, .14);
    color: #1d4ed8;
    clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.inv-card-price-uu {
    margin-left: -10px;
    padding: 0 8px 0 14px;
    /* 暖琥珀色系 ≈ 悠悠有品品牌色（#FFB400 系），与左侧 BUFF 蓝形成冷暖对比 */
    background: rgba(245, 158, 11, .18);
    color: #b45309;
    clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%);
}

.inv-card-price--missing {
    opacity: .4;
}

/* Steam 登录内联表单：直接嵌入 inventory-bind-state 卡片中 */
.steam-login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    text-align: left;
}

.steam-login-card {
    position: relative;
    z-index: 1;
    align-self: center;
    padding: 22px;
    border: 1px solid rgba(125, 110, 90, 0.18);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

.steam-login-card[hidden] {
    display: none;
}

.steam-login-title {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 1000;
}

.steam-login-subtitle {
    margin: -6px 0 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
}

.steam-login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.steam-login-field span {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.steam-login-field input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(15, 23, 42, .18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    color: #0f172a;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.steam-login-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
    background: #fff;
}

.steam-login-error {
    color: #dc2626;
    font-size: 12px;
    line-height: 1.4;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(239, 68, 68, .08);
    text-align: left;
}

.steam-login-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.steam-login-actions .primary-btn {
    min-height: 40px;
    padding: 0 22px;
    font-size: 14px;
}

/* 「刷新库存」按钮 60s 节流灯态：用更低饱和度 + 禁用光标暗示不可点 */
#inv-refresh-button.is-cooldown,
#inv-refresh-button.is-cooldown:hover {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    filter: grayscale(0.4);
}

@media (max-width: 720px) {
    .inventory-bind-state,
    .inventory-bind-state.is-vip-locked {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    .inventory-bind-state.is-vip-locked .inventory-vip-benefits {
        grid-template-columns: 1fr;
    }
    .inventory-vip-intro,
    .inventory-bind-state.is-vip-locked .inventory-vip-intro {
        text-align: left;
    }
    .inventory-vip-intro h3 {
        font-size: 24px;
    }
    .inventory-summary-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .inventory-summary-right {
        width: 100%;
        justify-content: flex-start;
    }
    .inv-search-field {
        margin-left: 0;
        flex: 1 1 100%;
    }
    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 8px;
    }
    .inv-card {
        height: 210px;
    }
    .inv-card-media {
        height: 138px;
    }
}

/* ============================================================
   库存 - 按配方统计 / 标定上传
   ============================================================ */
.inventory-grouped {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.recipe-group-loading {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.recipe-group {
    border: 1px solid rgba(125, 110, 90, 0.18);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 14px 38px rgba(15, 23, 42, .12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recipe-group-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(125, 110, 90, 0.22);
}

.recipe-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.recipe-group-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.recipe-group-pfid {
    font-size: 11px;
    color: var(--muted);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(125, 110, 90, 0.22);
    flex-shrink: 0;
}

.recipe-group-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.recipe-group-tag.is-stattrak {
    color: #fff;
    background: linear-gradient(135deg, #cf6a32, #f59e0b);
}

.recipe-group-stats {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 14px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
}

.recipe-group-stats .rg-stat {
    flex-shrink: 0;
    white-space: nowrap;
}

.rg-stat {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
}

.rg-stat label {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.4px;
}

.rg-stat em {
    color: var(--text);
    font-style: normal;
    font-weight: 700;
    font-size: 13px;
}

.rg-stat-progress em {
    color: #d97706;
}

.recipe-group-time {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--muted);
    font-size: 10px;
    text-align: right;
    white-space: nowrap;
}

.recipe-group-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.recipe-group-actions .ghost-btn,
.recipe-group-actions .primary-btn {
    min-height: 0;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
}

.rg-recompute-panel {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(125, 110, 90, 0.22);
    background: rgba(0, 0, 0, 0.03);
    color: #1f2933;
}

.rg-recompute-panel.is-loading,
.rg-recompute-panel.is-error {
    font-size: 12px;
    color: #4b5563;
}

.rg-recompute-panel.is-error {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.35);
}

.rg-recompute-title {
    font-size: 12px;
    font-weight: 700;
    color: #1f2933;
    margin-bottom: 4px;
}

.rg-recompute-warn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #b4791b;
    margin-bottom: 4px;
}

.rg-warn-tag {
    flex: none;
    padding: 1px 7px;
    border-radius: 6px;
    background: rgba(232, 177, 92, 0.18);
    font-weight: 700;
}

.rg-recompute-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.rg-rc-cell {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    border-left: 3px solid rgba(125, 110, 90, 0.3);
}

.rg-rc-cell.is-up {
    border-left-color: #2f9e54;
}

.rg-rc-cell.is-down {
    border-left-color: #d4543b;
}

.rg-rc-label {
    font-size: 11px;
    color: #4b5563;
}

.rg-rc-now {
    font-size: 13px;
    font-weight: 800;
    color: #111827;
}

.rg-rc-cell.is-up .rg-rc-now {
    color: #15803d;
}

.rg-rc-cell.is-down .rg-rc-now {
    color: #b91c1c;
}

.rg-rc-was {
    font-size: 11px;
    color: #6b7280;
    text-decoration: line-through;
}

@media (max-width: 768px) {
    .rg-recompute-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.recipe-group-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px;
}

.recipe-slot-card {
    position: relative;
    height: 158px;
    border-radius: 10px;
    border: 1px solid rgba(125, 110, 90, 0.18);
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.recipe-slot-card.is-empty {
    /* 实色浅底 + 黑字加粗：在深色页面背景下保持高对比度可读 */
    opacity: 1;
    filter: none;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.18);
    background: #f8fafc;
    cursor: pointer;
    align-items: stretch;
    justify-content: center;
    padding: 10px 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
}

.recipe-slot-card.is-empty:hover {
    transform: translateY(-1px);
    background: #ffffff;
    border-color: rgba(217, 119, 6, 0.45);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .28);
}

.slot-empty-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
}

.slot-empty-tags {
    display: flex;
    justify-content: center;
    gap: 4px;
    min-height: 16px;
}

.slot-empty-name {
    color: #0f172a;
    font-weight: 800;
    font-size: 14px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-empty-exterior {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-empty-wear {
    font-size: 12px;
    color: #0f172a;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-empty-action {
    margin-top: 2px;
    font-size: 12px;
    color: #b45309;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.slot-candidate-count {
    display: inline-block;
    margin: 4px auto 0;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.3px;
    color: #ffffff;
    background: #16a34a;
    box-shadow: 0 2px 6px rgba(22, 163, 74, .25);
    white-space: nowrap;
}

.slot-candidate-count.is-zero {
    background: #94a3b8;
    color: #ffffff;
    box-shadow: none;
}

.recipe-slot-card.is-empty:hover .slot-candidate-count.is-have {
    background: #15803d;
}

.recipe-slot-card.is-marked {
    cursor: default;
}

.slot-unmark-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 2;
    width: 20px;
    height: 20px;
    line-height: 1;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.slot-unmark-btn:hover {
    background: rgba(220, 38, 38, 0.92);
}

.slot-marked-media {
    position: relative;
    height: 86px;
    background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.slot-marked-img {
    max-width: 96%;
    max-height: 92%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25));
}

.slot-marked-img-empty {
    width: 100%;
    height: 100%;
    opacity: 0.25;
}

.slot-marked-info {
    flex: 1 1 auto;
    padding: 6px 6px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3px;
    color: #0f172a;
    font-weight: 700;
    min-height: 0;
}

.slot-marked-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}

.slot-marked-name .inv-card-tag {
    font-size: 9px;
    padding: 1px 4px;
}

.slot-marked-wear {
    font-size: 12px;
    color: #0f172a;
    font-weight: 700;
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.slot-wear-tier {
    font-weight: 700;
    font-size: 12px;
    color: #0f172a;
    background: transparent;
    padding: 0;
    border-radius: 0;
    line-height: 1.2;
}

/* 沿用 wear-tier-chip 同名色系，但作为纯文本（独立类名，避免和 .wear-tier-* 背景冲突）*/
.slot-tier-fn { color: #2563eb; }
.slot-tier-mw { color: #16a34a; }
.slot-tier-ft { color: #d97706; }
.slot-tier-ww { color: #ea580c; }
.slot-tier-bs { color: #dc2626; }

.slot-wear-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #0f172a;
    font-weight: 700;
    letter-spacing: -0.2px;
    font-size: 12px;
}

.slot-marked-prices {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    font-size: 11px;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.slot-marked-prices span {
    flex: 0 0 auto;
    overflow: visible;
    text-overflow: clip;
}

/* 标定弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 9100;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-mask[hidden] {
    display: none;
}

.modal-card {
    position: relative;
    width: min(560px, 100%);
    background: #ffffff;
    color: #0f172a;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-card.recipe-mark-picker-card {
    max-height: 80vh;
}

.modal-card .modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.modal-card .modal-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.modal-card .modal-close {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background .15s, color .15s;
}

.modal-card .modal-close:hover {
    background: rgba(15, 23, 42, .06);
    color: #1f2937;
}

.modal-card .modal-body {
    padding: 12px 18px 16px;
    overflow-y: auto;
}

.recipe-mark-picker-tip {
    margin: 0 0 10px;
    font-size: 12px;
    color: #475569;
}

.recipe-mark-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 50vh;
    overflow-y: auto;
}

.recipe-mark-picker-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto auto minmax(0, 1.6fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: #f8fafc;
    font-size: 12px;
    color: #0f172a;
}

.recipe-mark-picker-row:hover {
    background: #eef2ff;
    border-color: rgba(79, 70, 229, 0.25);
}

.rmpr-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rmpr-ext {
    font-size: 11px;
    color: #64748b;
}

.rmpr-wear {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: #1e293b;
}

.rmpr-price {
    color: #475569;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rmpr-trad {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
}

.rmpr-trad.is-tradable {
    color: #047857;
    background: rgba(16, 185, 129, 0.15);
}

.rmpr-trad.is-locked {
    color: #b45309;
    background: rgba(245, 158, 11, 0.15);
}

.rmpr-select {
    border: none;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: filter .15s, transform .15s;
}

.rmpr-select:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.recipe-mark-picker-empty {
    padding: 18px 8px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
}

/* ============================================================
   配方分组：已上传套卡片（assembly-card） + 标签 chip + 备注内联编辑
   ============================================================ */

/* 已存 N 套 chip：紫色 = 与 StatTrak 橙色区分，避免混淆 */
.recipe-group-tag.is-sets {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

/* 复评下线：用红色提醒"行情已停更"，但本套仍可继续标定（后端走 saved snapshot fallback） */
.recipe-group-tag.is-offline {
    color: #fff;
    background: linear-gradient(135deg, #f87171, #dc2626);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25);
}

/* 已上传视图主体：当配方下没有任何已保存套时显示 */
.recipe-empty-uploaded {
    padding: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    border: 1px dashed rgba(125, 110, 90, 0.22);
    border-radius: 10px;
}

/* 单张套卡：堆叠在 recipe-group 内（一行一张），自带标题 + tags + 10 槽 + 操作 */
.assembly-card {
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.04);
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.assembly-card + .assembly-card {
    margin-top: 10px;
}

.assembly-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

/* 单行排版：左侧依次为 [标签] [时间] [成本]，右侧操作按钮 */
.asm-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    font-size: 11px;
    color: var(--muted);
    min-width: 0;
}

.asm-tags-inline {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* 上传时间 / 配方成本：label 灰色 + em 黑色加粗加大，整体不换行 */
.asm-time,
.asm-cost {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    white-space: nowrap;
    font-size: 13px;
}

.asm-time label,
.asm-cost label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.asm-time em,
.asm-cost em {
    font-style: normal;
    color: #0f172a;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: -0.2px;
    font-variant-numeric: tabular-nums;
}

.asm-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.asm-actions .ghost-btn {
    min-height: 0;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}

.asm-del-btn {
    color: #b91c1c !important;
    border-color: rgba(220, 38, 38, 0.35) !important;
}

.asm-del-btn:hover {
    background: rgba(220, 38, 38, 0.08) !important;
}

/* tags chip：现在内嵌在 .asm-meta 行内，保留 chip 自身样式即可 */
.asm-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px 2px 8px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.25);
    line-height: 1.4;
}

.asm-tag-text {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asm-tag-del {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #047857;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background .15s, color .15s;
}

.asm-tag-del:hover {
    background: rgba(220, 38, 38, 0.18);
    color: #b91c1c;
}

.asm-tag-add {
    border: 1px dashed rgba(99, 102, 241, 0.4);
    background: transparent;
    color: #4338ca;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    cursor: pointer;
    line-height: 1.4;
    transition: background .15s, border-color .15s;
}

.asm-tag-add:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: #6366f1;
}

.asm-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid transparent;
}

.asm-status-chip.is-ready {
    color: #047857;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.asm-status-chip.is-locked {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fecaca;
}

.asm-tag-input {
    width: 96px;
    padding: 1px 6px;
    border: 1px solid #6366f1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* 已上传套卡内部网格 = recipe-group-grid 的只读版本；
   去掉 hover / cursor，避免误以为可以再标定 */
.recipe-group-grid.is-readonly .recipe-slot-card.is-empty,
.recipe-group-grid.is-readonly .recipe-slot-card.is-marked {
    cursor: default;
}

.recipe-group-grid.is-readonly .recipe-slot-card.is-empty:hover {
    transform: none;
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.18);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
}

.recipe-slot-card.is-marked.is-readonly {
    border-color: rgba(99, 102, 241, 0.2);
    background: rgba(255, 255, 255, 0.55);
}

/* 已上传过滤模式下，filterbar 部分控件被禁用时的灰化提示 */
.inventory-filterbar select.is-disabled-uploaded,
.inventory-filterbar label.is-disabled-uploaded,
.inv-merge-toggle.is-disabled-uploaded {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.6);
}

/* 响应式：窄屏下行头改多行、材料网格逐级降列 */
@media (max-width: 1280px) {
    .recipe-group-head {
        grid-template-columns: 1fr 1fr;
    }
    .recipe-group-time {
        text-align: left;
    }
    .recipe-group-actions {
        justify-content: flex-start;
    }
    .assembly-card-head {
        grid-template-columns: 1fr auto;
        row-gap: 6px;
    }
    .asm-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 1100px) {
    /* 容器变窄时 10 列单卡过窄，回落到 5 列（2 行） */
    .recipe-group-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }
    .recipe-slot-card {
        height: 168px;
    }
    .slot-marked-media {
        height: 96px;
    }
    .slot-empty-name,
    .slot-marked-name {
        font-size: 12px;
    }
}

@media (max-width: 720px) {
    .recipe-group-head {
        grid-template-columns: 1fr;
    }
    .recipe-group-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .recipe-slot-card {
        height: 178px;
    }
    .slot-marked-media {
        height: 110px;
    }
    .recipe-mark-picker-row {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
    }
    .rmpr-price,
    .rmpr-wear,
    .rmpr-ext {
        grid-column: 1 / -1;
    }
    .assembly-card-head {
        grid-template-columns: 1fr;
    }
}

.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.html)
 * ============================================================ */
.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;
    }
}

/* ============================================================
 * 汰换商城独立页 (csthsc.html) v2 — 纯白色系
 * 命名空间：thsc-*
 * ============================================================ */
html, body.thsc-body { margin: 0; padding: 0; }

body.thsc-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1f2937;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部栏 ---------- */
.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;
}
.thsc-topbar-inner {
    width: min(960px, 100%);
    margin: 0 auto;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.thsc-topbar-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: #111827;
    letter-spacing: 1px;
}
.thsc-topbar-menu {
    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 span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.thsc-topbar-menu[aria-expanded="true"] { background: #111827; color: #ffffff; border-color: #111827; }
.thsc-topbar-menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.thsc-topbar-menu[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.thsc-topbar-menu[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 侧边抽屉 ---------- */
.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-heading {
    position: absolute;
    top: 16px;
    left: 18px;
    z-index: 4;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 4px;
    color: #6b7280;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f9fafb;
    border: 1px solid #f1f5f9;
    user-select: none;
}
.thsc-drawer-collapse {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 4;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #111827;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.thsc-drawer-collapse:hover { background: #f9fafb; border-color: #d1d5db; }

.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: 28px;
    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 {
    background: #f9fafb;
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #f3f4f6;
}
.thsc-drawer-balance span {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    white-space: nowrap;
}
.thsc-drawer-balance strong {
    font-size: 16px;
    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-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: 36px;
    height: 36px;
    border-radius: 12px;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
}
.thsc-drawer-icon svg {
    width: 20px;
    height: 20px;
    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-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-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: 16px 18px calc(16px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #6b7280;
    font-size: 13px;
}
.thsc-foot button {
    border: 0;
    background: transparent;
    color: #1f2937;
    font: inherit;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.18s ease;
}
.thsc-foot button:hover { color: #111827; text-decoration: underline; }
.thsc-foot-divider { color: #d1d5db; }

/* ---------- 弹窗 ---------- */
.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%); }
.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 {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #1f2937;
    font-size: 14px;
}
.thsc-modal-label input:focus {
    outline: none;
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}
.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-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-participate-card {
    padding: 12px 14px;
    border-radius: 14px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    margin-bottom: 12px;
}
.thsc-participate-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.thsc-participate-head h4 { margin: 0; color: #111827; font-size: 15px; }
.thsc-participate-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 12.5px;
    color: #4b5563;
}
.thsc-participate-control { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.thsc-participate-control label { display: inline-flex; align-items: center; gap: 8px; color: #374151; font-size: 13px; }
.thsc-participate-control input {
    width: 90px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #1f2937;
}
.thsc-participate-amount { font-weight: 700; color: #111827; }
.thsc-participate-balance { margin: 0 0 12px; color: #4b5563; font-size: 13px; }
.thsc-participate-balance .thsc-warn { color: #b91c1c; }

.thsc-history-list { display: flex; flex-direction: column; gap: 10px; }
.thsc-history-row {
    padding: 10px 12px;
    border-radius: 12px;
    background: #fafafa;
    border: 1px solid #f1f5f9;
}
.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-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;
    bottom: 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: 300;
    pointer-events: none;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
}
.thsc-toast[hidden] { display: none; }

/* ---------- 通用按钮（独立页内纯白系覆写） ---------- */
body.thsc-body .primary-btn {
    background: #111827 !important;
    color: #ffffff !important;
    border: 1px solid #111827 !important;
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
body.thsc-body .primary-btn:hover { background: #1f2937 !important; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22); }
body.thsc-body .primary-btn:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
body.thsc-body .secondary-btn,
body.thsc-body .ghost-btn {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
body.thsc-body .secondary-btn:hover,
body.thsc-body .ghost-btn:hover { background: #f9fafb !important; border-color: #d1d5db !important; }
body.thsc-body .link-btn {
    background: transparent !important;
    border: 0 !important;
    color: #111827 !important;
    font: inherit;
    cursor: pointer;
    padding: 0 4px;
    text-decoration: underline;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
    .thsc-topbar-inner { padding: 12px 14px; }
    .thsc-topbar-title { font-size: 18px; }
    .thsc-main { padding: 14px 12px 28px; }
    .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 { font-size: 12.5px; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); }
    .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: 14px; }
}

/* ============================================================
   thsc-admin-shell-v2 —— 汰换商城后端管理：顶栏 + 固定左侧栏
   ============================================================ */
body.thsc-admin-shell-v2 {
    margin: 0;
    background: #f6f7fb;
    color: #1f2330;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang 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-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-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
}
.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-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;
}

.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 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-formline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin-bottom: 10px;
}
.thsc-admin-formgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.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-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: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.thsc-admin-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.thsc-admin-table tbody tr:last-child td { border-bottom: none; }
.thsc-admin-table-empty {
    padding: 22px 12px;
    text-align: center;
    color: #9ca3af;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}
.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 {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    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; }

.thsc-admin-settle-summary {
    background: #f3f4f6;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    color: #1f2937;
    font-size: 13px;
}
.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-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; }
}

