/* ==========================================
   7. 个人中心抽屉 (标签/时间/两排统计)
   ========================================== */
.wb-drawer {
    position: fixed;
    top: calc(var(--header-h) + var(--layout-gap));
    right: calc(0px - var(--drawer-w) - 40px);
    width: var(--drawer-w);
    bottom: var(--frame-content-offset);
    background: var(--glass-panel-bg);
    backdrop-filter: var(--glass-panel-backdrop);
    -webkit-backdrop-filter: var(--glass-panel-backdrop);
    box-shadow: var(--glass-panel-shadow);
    border-radius: var(--radius-base);
    z-index: var(--z-drawer);
    padding: 25px;
    transition: right var(--anim-drawer-d) var(--ease-apple), opacity var(--anim-fade-d) ease;
    display: flex;
    flex-direction: column;
}
body.wb-drawer-open .wb-drawer { right: var(--frame-content-offset); }

/* 老 wb-drawer 顶部容器 selectors (.drawer-header / .drawer-user-info /
   .name-row / .drawer-title / .expiry-date-line) 已删: 新版用 .wb-account-user
   / .wb-account-expire 替代, grep 全项目无 HTML/JS 引用. */

.wb-account-badge { padding: 1px 4px; border-radius: var(--radius-sm); font-size: 9px; color: #fff; font-weight: 700; white-space: nowrap; display: none; }
.badge-orange { background: var(--vitality-purple); }
.badge-blue { background: var(--vitality-blue); }
.wb-account-badge--grey { background: rgba(142, 142, 147, 0.5); }

/* X 按钮: 28x28 容器 + 16px SVG 几何居中. 内部用 SVG 而不是 × 字符 —
   PingFang 中文字体的 × 字符视觉中心比行盒中心偏低, 跟标题中文字符的偏上中心
   做不到完美对齐 (字体度量不对称). SVG 由 viewBox 0 0 24 24 内部对称定位,
   居中精度跟字体无关. top/right 跟 .wb-drawer 的 padding (25px) 对齐. */
.wb-drawer-close { position: absolute; top: 25px; right: 25px; width: 28px; height: 28px; background: transparent; border: none; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-grey); border-radius: 999px; transition: color 0.3s ease; z-index: 2; }
.wb-drawer-close:hover { background: transparent; color: var(--btn-danger); transform: none; }

/* 老 .user-stats / .stat-* / .user-history / .history-header / .history-note 已删:
   新版 .wb-credit / .wb-credit-row / .wb-credit-progress (额度) +
   .wb-history-list (历史) 替代, grep 全项目无 HTML/JS 引用. */

/* 历史记录列表 */
.wb-history-list {
    display: flex; flex-direction: column; gap: 8px;
    overflow-y: auto; scrollbar-width: none;
    padding: 0; flex: 1; min-height: 0;
}
.wb-history-list::-webkit-scrollbar { display: none; }

/* 学员分组 */
.history-group {
}

.history-group-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; cursor: pointer;
    border-radius: var(--radius-base);
    transition: background 0.2s;
    position: sticky; top: 0; z-index: 2;
    background: transparent;
}
.history-group.expanded .history-group-header {
    background: #ececee;
}
[data-theme="dark"] .history-group.expanded .history-group-header {
    background: #232529;
}
.history-group-header:hover { background: rgba(0,0,0,0.05); }
[data-theme="dark"] .history-group-header:hover { background: var(--chip-bg-hover); }
.history-group.expanded .history-group-header:hover { background: #e2e2e6; }
[data-theme="dark"] .history-group.expanded .history-group-header:hover { background: #2a2c31; }

.history-group-info {
    display: flex; flex-direction: column; gap: 4px;
    min-width: 0; flex: 1;
}

.history-group-name-row {
    display: flex; align-items: center; gap: 6px;
}

.history-group-name {
    font-size: var(--font-md); font-weight: 600;
    color: var(--text-primary, #1d1d1f);
    line-height: 1.2;
}
[data-theme="dark"] .history-group-name {
    color: var(--text-primary, #f5f5f7);
}

.history-group-count {
    font-size: var(--font-xs); color: var(--text-grey);
    line-height: 1;
}

.history-group-time {
    font-size: var(--font-xs); color: var(--text-grey);
    line-height: 1;
}

.history-group-arrow {
    flex-shrink: 0;
    transition: transform 0.3s;
    color: var(--text-grey);
}
.history-group.expanded .history-group-arrow {
    transform: rotate(180deg);
}

/* 报告列表（折叠/展开，同考试类别下拉动画） */
.history-group-list {
    max-height: 0; overflow: hidden; opacity: 0;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.history-group.expanded .history-group-list {
    max-height: 2000px; opacity: 1;
    pointer-events: auto;
    margin-top: 6px;
    display: flex; flex-direction: column; gap: 4px;
}

/* 单条报告 */
.history-item {
    display: flex; flex-direction: column; gap: 4px;
    padding: 8px 12px 8px 32px; cursor: pointer;
    border-radius: var(--radius-base);
    transition: background 0.2s;
}
.history-item:hover {
    background: var(--chip-bg);
}
.history-item.active {
    background: var(--accent-soft-bg);
}
[data-theme="dark"] .history-item.active {
    background: var(--accent-soft-bg-strong);
}

.history-item-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}

.history-item-title {
    position: relative;
    display: block;
    font-size: var(--font-sm); font-weight: 500;
    color: var(--text-primary, #1d1d1f);
    line-height: 1.2;
    white-space: nowrap; overflow: visible;
    min-width: 0; flex: 1;
}
[data-theme="dark"] .history-item-title {
    color: var(--text-primary, #f5f5f7);
}
/* 有学习资料的标识: 标题左侧的小文档图标 (替代原蓝点) */
.history-material-icon {
    position: absolute;
    left: -21px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--vitality-blue);
}

/* 有学习资料的记录: wrapper 包住报告行 + 可展开的「学习资料」子项 */
.history-record {
    display: flex;
    flex-direction: column;
}
.history-sub-list {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.24s ease,
                margin-top 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.history-record.expanded .history-sub-list {
    max-height: 80px;
    opacity: 1;
    pointer-events: auto;
    margin-top: 3px;
}
.history-sub-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px 7px 36px;
    border-radius: var(--radius-base);
    cursor: pointer;
    transition: background 0.2s;
}
.history-sub-item:hover {
    background: var(--chip-bg);
}
.history-sub-item.active {
    background: var(--accent-soft-bg);
}
[data-theme="dark"] .history-sub-item.active {
    background: var(--accent-soft-bg-strong);
}
.history-sub-icon {
    width: 13px;
    height: 13px;
    color: var(--vitality-blue);
    flex-shrink: 0;
}
.history-sub-text {
    flex: 1;
    min-width: 0;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-primary, #1d1d1f);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
[data-theme="dark"] .history-sub-text {
    color: var(--text-primary, #f5f5f7);
}
.history-sub-time {
    flex-shrink: 0;
    font-size: var(--font-xs);
    color: var(--text-grey);
    line-height: 1;
}
.history-item-title-text {
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-time {
    font-size: var(--font-xs); color: var(--text-grey);
    line-height: 1;
}

.history-item-actions {
    display: flex; align-items: center; gap: 6px;
    flex-shrink: 0;
}

.history-download-btn {
    width: 20px; height: 20px; background: none; border: none;
    cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center;
    color: var(--text-grey); border-radius: var(--radius-sm); transition: 0.2s;
}
.history-download-btn:hover { color: var(--vitality-blue); background: var(--accent-soft-bg); }
.history-download-btn:disabled { cursor: default; opacity: 0.9; }
.history-download-btn.is-loading:hover { color: var(--text-grey); background: transparent; }

/* 失败 / 批改中 状态 */
.history-item.is-failed .history-item-title {
    color: var(--btn-danger);
}
.history-item.is-processing { cursor: default; }
.history-item.is-processing:hover { background: transparent; }
[data-theme="dark"] .history-item.is-processing:hover { background: transparent; }
.history-item.is-processing .history-item-title {
    color: var(--text-grey);
}

.history-status-tag {
    font-size: var(--font-xs);
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 999px;
    line-height: 1;
    white-space: nowrap;
}
.history-status-tag.status-failed {
    background: var(--danger-soft-bg);
    color: var(--btn-danger);
}
.history-status-tag.status-processing {
    background: rgba(127, 127, 127, 0.18);
    color: var(--text-grey);
}

/* 下载到期倒计时 */
.history-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.history-expiry-hint {
    font-size: var(--font-xs);
    line-height: 1;
    color: var(--text-grey);
    white-space: nowrap;
}
.history-expiry-hint.is-soon {
    color: var(--warning-ink);
    font-weight: 500;
}
.history-expiry-hint.is-expired {
    color: var(--btn-danger);
    font-weight: 500;
}
.history-download-btn.is-expired {
    color: var(--text-grey);
    opacity: 0.42;
}
.history-download-btn.is-expired:hover {
    color: var(--text-grey);
    background: transparent;
}

.drawer-actions { display: flex; gap: 10px; margin-top: 12px; flex-direction: column; }
.btn-action-row { display: flex; gap: 10px; }

/* 文件列表容器默认隐藏，有文件时由JS显示 */
#file-list-container { display: none; }
#file-list-container.has-files { display: block; }

.btn-replenish, .btn-renew { 
    flex: 1; padding: 14px 0; border: none; outline: none; border-radius: var(--radius-base); font-weight: 600; font-size: var(--font-md); cursor: pointer; transition: 0.3s; 
}
.btn-replenish {
    background: var(--drawer-btn-rep-bg);
    color: var(--drawer-btn-rep-text);
    border: 1px solid var(--accent-soft-border);
}
.btn-replenish:hover {
    background: var(--drawer-btn-rep-bg-hover);
    border-color: var(--accent-soft-border-strong);
    transform: translateY(-2px);
}
[data-theme="dark"] .btn-replenish:hover {
    background: var(--drawer-btn-rep-bg-hover);
    border-color: rgba(0, 100, 210, 0.68);
}

.btn-renew {
    background: var(--drawer-btn-ren-bg) !important;
    color: var(--drawer-btn-ren-text) !important;
    box-shadow: none;
}
.btn-renew:hover {
    background: var(--drawer-btn-ren-bg-hover) !important;
    transform: translateY(-2px);
}
[data-theme="dark"] .btn-renew:hover {
    background: var(--drawer-btn-ren-bg-hover) !important;
}

.btn-logout { width: 100%; padding: 14px 0; background: var(--input-bg); color: var(--text-main); border: none; outline: none; box-shadow: none; border-radius: var(--radius-base); font-weight: 600; font-size: var(--font-md); cursor: pointer; transition: 0.3s; }
.btn-logout:hover { background: var(--danger-soft-bg); color: var(--btn-danger); box-shadow: none; transform: translateY(-2px); }

.wb-mobile-bar { display: none; }

/* ==========================================
   8. 响应式布局与 Toast 动画
   ========================================== */
@media (max-width: 768px) {
    :root {
        --touch-header-offset: calc(var(--header-h) + 8px);
        --touch-bottom-clearance: calc(var(--app-viewport-bottom-gap) + 68px + env(safe-area-inset-bottom, 0));
    }

    html, body { overflow-y: auto; height: auto; min-height: var(--app-viewport-height); overflow-x: hidden; }
    .app-chrome,
    .app-curtain { display: none; }
    .app-shell-surfaces { display: none; }
    header { top: 0; left: 0; width: 100%; border-radius: 0; padding: 0 10px 0 14px; box-shadow: none; clip-path: none; background: var(--glass-panel-bg); backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%); }
    .wb-topbar-user { max-width: calc(100vw - 110px); min-width: 0; }
    .wb-topbar-user-name { max-width: min(42vw, 220px); }
    .wb-topbar-tooltip,
    .wb-topbar-user:hover .wb-topbar-tooltip { display: none !important; opacity: 0 !important; visibility: hidden !important; transform: none !important; }
    .wb-shell { flex-direction: column; height: auto; min-height: var(--app-viewport-height); padding: 60px 8px calc(var(--app-viewport-bottom-gap) + 120px) 8px; display: flex; }
    aside { width: auto; height: auto; margin: 0; overflow: visible !important; padding: 0; border: none; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; display: block; }
    aside::before { display: none; }
    .wb-rail { position: fixed; bottom: var(--app-viewport-bottom-gap); left: 0; right: 0; z-index: var(--z-m-nav); width: 100%; height: calc(60px + env(safe-area-inset-bottom, 0)); flex-direction: row; justify-content: space-around; align-items: center; padding: 0 16px; margin: 0; border: none; border-top: 1px solid transparent; border-radius: 0; background: var(--glass-panel-bg); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); box-shadow: 0 -4px 10px rgba(0,0,0,0.05); padding-bottom: env(safe-area-inset-bottom, 0); }
    .wb-rail-menu { display: none; }
    .wb-rail-group--top, .wb-rail-group--bottom { flex-direction: row; gap: 0; margin: 0; padding: 0; align-items: center; justify-content: space-evenly; flex: 1; }
    .wb-rail-tab { flex-direction: column; gap: 3px; width: auto; height: auto; padding: 6px 0; border-radius: 0; background: transparent !important; flex: 1; color: var(--text-grey) !important; min-width: 0; text-align: center; align-items: center; }
    .wb-rail-tab.active { background: transparent !important; color: var(--vitality-blue) !important; }
    .wb-rail-tab svg { width: 20px; height: 20px; }
    .wb-rail-tab::after { display: block !important; content: attr(data-label); font-size: 10px; font-weight: 500; color: inherit; line-height: 1; white-space: nowrap; }
    .wb-aside { position: static; min-height: 0; height: auto; background: var(--glass-panel-bg); backdrop-filter: blur(34px) saturate(180%) brightness(1.05); -webkit-backdrop-filter: blur(34px) saturate(180%) brightness(1.05); border: none; border-radius: var(--radius-base); box-shadow: none; overflow: visible; padding: 24px 20px; margin: 0 auto; max-width: 400px; width: 100%; }
    .wb-aside-panel { position: static; inset: auto; opacity: 1; transform: none; transition: none; display: none; }
    .wb-aside-panel.is-active { display: block; pointer-events: auto; }
    .wb-aside-scroll { overflow: visible; margin: 0; padding: 0; }
    
    /* Center form inputs */
    .wb-field-group label { text-align: center; margin-left: 0; }
    .wb-field-input, .wb-select-display, .wb-seg { justify-content: center; text-align: center; }
    select.wb-field-input { background-position: calc(50% + 40px) center; }

    .wb-orb-glow, .wb-orb { display: none !important; }
    #exhibit-zone { position: static; flex: none; height: 0; min-height: 0; overflow: visible; }
    #exhibit-zone > *:not(.wb-modal) { display: none !important; }
    #exhibit-zone.wb-is-generating ~ #upload-zone { display: none !important; }
    
    section#content-area { display: flex; flex-direction: column; overflow: visible; will-change: auto; transform: none !important; padding-left: 0; }
    #detail-modal, #initial-setup-modal, #settings-modal { padding: 20px; }
    #upload-zone { flex-direction: column; height: auto; gap: var(--surface-gap); display: flex; max-width: 400px; width: 100%; margin: var(--surface-gap) auto 0; }
    .wb-upload-card { height: 120px; padding: 20px; }
    .wb-mobile-bar { position: fixed; bottom: var(--touch-bottom-clearance); left: 50%; transform: translateX(-50%); width: calc(100% - 16px); max-width: 400px; padding: 12px; background: var(--glass-panel-bg); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border: none; z-index: var(--z-m-bar); display: block; box-shadow: none; border-radius: var(--radius-base); }
    .wb-btn--generate { margin-top: 0; width: 100%; }
    aside .wb-btn--generate, .wb-aside .wb-btn--generate { display: none !important; }

    /* H5: 上传区域在PC端按钮上方（仅PC有效） */
    @media (min-width: 769px) {
        .wb-aside-actions { display: flex; flex-direction: column-reverse; gap: 16px; }
        .wb-aside-actions #file-list-container { margin-top: 0; }
    }

    /* Downloads layout for H5 */
    .wb-downloads-menu { position: fixed; left: 8px; top: var(--touch-header-offset); width: 36%; max-width: 200px; min-width: 130px; bottom: auto; height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); max-height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); transform: translateY(0); transition: all 0.3s ease; z-index: var(--z-m-view); background: var(--glass-panel-bg); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
    .wb-downloads-menu.is-list-expanded { width: auto; right: 8px; max-width: none; border-radius: var(--radius-base); box-shadow: none; }
    .wb-downloads-list { position: fixed; left: calc(36% + 8px); top: var(--touch-header-offset); right: 8px; width: auto; bottom: auto; height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); max-height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); transform: translateX(20px); opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: var(--z-m-view); background: var(--glass-panel-bg); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; border-left: 1px solid transparent; border-radius: 0; }
    .wb-downloads-list.is-open { transform: translateX(0); opacity: 1; pointer-events: auto; }
    .wb-downloads-preview { position: fixed; left: 8px; right: 8px; top: var(--touch-header-offset); bottom: auto; width: auto; height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); max-height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); transform: translateY(100%); opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: var(--z-m-view-top); background: var(--glass-panel-bg); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
    .wb-downloads-preview.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .wb-downloads-preview-close { display: inline-flex; }
    .wb-modal { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important; border-radius: 0 !important; transform: translateY(100%) scale(1) !important; z-index: var(--z-m-overlay) !important; background: var(--bg-page) !important; }
    .wb-modal.show { transform: translateY(0) scale(1) !important; }
    .wb-modal.is-split-left, .wb-modal.is-split-right { right: 0 !important; left: 0 !important; }
    .wb-modal-close { top: 15px; right: 15px; background: rgba(127,127,127,0.08); border-radius: 50%; width: 36px; height: 36px; }
    .report-layout { flex-direction: column; overflow-y: auto; padding: 20px; padding-bottom: 80px; }
    .report-main { overflow-y: visible; }
    .report-sidebar { width: 100%; border-left: none; border-top: none; padding-left: 0; padding-top: 20px; margin-top: 20px; }
    .wb-drawer { width: calc(100% - 16px); height: calc(var(--app-viewport-height) - var(--app-viewport-bottom-gap) - 16px); max-height: calc(var(--app-viewport-height) - var(--app-viewport-bottom-gap) - 16px); top: auto; bottom: calc(-100% - var(--app-viewport-bottom-gap)); right: 8px; border-radius: var(--radius-base); transition: bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1); z-index: var(--z-m-sheet); background: var(--glass-panel-bg); backdrop-filter: blur(34px) saturate(180%) brightness(1.05); -webkit-backdrop-filter: blur(34px) saturate(180%) brightness(1.05); }
    body.wb-drawer-open .wb-drawer { bottom: calc(8px + var(--app-viewport-bottom-gap)); right: 8px; }
    body.wb-drawer-open .wb-shell { padding-right: 8px; }
    body.wb-drawer-open #content-area { transform: none; }
    body.wb-rail-open .wb-aside,
    body.wb-rail-open section#content-area,
    body.wb-rail-open .wb-drawer {
        filter: none;
        opacity: 1;
        pointer-events: auto;
    }
}

html.touch-mobile-layout {
    --touch-header-offset: calc(var(--header-h) + 8px);
    --touch-bottom-clearance: calc(var(--app-viewport-bottom-gap) + 68px + env(safe-area-inset-bottom, 0));
}

html.touch-mobile-layout,
html.touch-mobile-layout body { overflow-y: auto; height: auto; min-height: var(--app-viewport-height); overflow-x: hidden; }
html.touch-mobile-layout .app-chrome,
html.touch-mobile-layout .app-curtain,
html.touch-mobile-layout .app-shell-surfaces { display: none; }
html.touch-mobile-layout header { top: 0; left: 0; width: 100%; border-radius: 0; padding: 0 10px 0 14px; box-shadow: none; clip-path: none; background: var(--glass-panel-bg); backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%); }
html.touch-mobile-layout .wb-topbar-user { max-width: calc(100vw - 110px); min-width: 0; }
html.touch-mobile-layout .wb-topbar-user-name { max-width: min(42vw, 220px); }
html.touch-mobile-layout .wb-topbar-tooltip,
html.touch-mobile-layout .wb-topbar-user:hover .wb-topbar-tooltip { display: none !important; opacity: 0 !important; visibility: hidden !important; transform: none !important; }
html.touch-mobile-layout .wb-shell { flex-direction: column; height: auto; min-height: var(--app-viewport-height); padding: 60px 8px calc(var(--app-viewport-bottom-gap) + 120px) 8px; display: flex; }
html.touch-mobile-layout aside { width: auto; height: auto; margin: 0; overflow: visible !important; padding: 0; border: none; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; display: block; }
html.touch-mobile-layout aside::before,
html.touch-mobile-layout .wb-rail-menu { display: none; }
html.touch-mobile-layout .wb-rail { position: fixed; bottom: var(--app-viewport-bottom-gap); left: 0; right: 0; z-index: var(--z-m-nav); width: 100%; height: calc(60px + env(safe-area-inset-bottom, 0)); flex-direction: row; justify-content: space-around; align-items: center; padding: 0 16px env(safe-area-inset-bottom, 0); margin: 0; border: none; border-top: 1px solid transparent; border-radius: 0; background: var(--glass-panel-bg); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); box-shadow: 0 -4px 10px rgba(0,0,0,0.05); }
html.touch-mobile-layout .wb-rail-group--top,
html.touch-mobile-layout .wb-rail-group--bottom { flex-direction: row; gap: 0; margin: 0; padding: 0; align-items: center; justify-content: space-evenly; flex: 1; }
html.touch-mobile-layout .wb-rail-tab { flex-direction: column; gap: 3px; width: auto; height: auto; padding: 6px 0; border-radius: 0; background: transparent !important; flex: 1; color: var(--text-grey) !important; min-width: 0; text-align: center; align-items: center; }
html.touch-mobile-layout .wb-rail-tab.active { background: transparent !important; color: var(--vitality-blue) !important; }
html.touch-mobile-layout .wb-rail-tab svg { width: 20px; height: 20px; }
html.touch-mobile-layout .wb-rail-tab::after { display: block !important; content: attr(data-label); font-size: 10px; font-weight: 500; color: inherit; line-height: 1; white-space: nowrap; }
/* 展开式单行重构: 桌面把图标+文字放进同一按钮(.wb-rail-icon/.wb-rail-label); 移动端底部 nav 仍用 ::after 显示文字, 故隐藏内联文字 span + 重置图标容器(否则 flex:0 0 40px 会撑乱竖排) */
html.touch-mobile-layout .wb-rail { overflow: visible; }
html.touch-mobile-layout .wb-rail-label { display: none; }
html.touch-mobile-layout .wb-rail-icon { flex: none; display: flex; align-items: center; justify-content: center; }
html.touch-mobile-layout .wb-aside { position: static; min-height: 0; height: auto; background: var(--glass-panel-bg); backdrop-filter: blur(34px) saturate(180%) brightness(1.05); -webkit-backdrop-filter: blur(34px) saturate(180%) brightness(1.05); border: none; border-radius: var(--radius-base); box-shadow: none; overflow: visible; padding: 24px 20px; margin: 0 auto; max-width: 400px; width: 100%; }
html.touch-mobile-layout .wb-aside-panel { position: static; inset: auto; opacity: 1; transform: none; transition: none; display: none; }
html.touch-mobile-layout .wb-aside-panel.is-active { display: block; pointer-events: auto; }
html.touch-mobile-layout .wb-aside-scroll { overflow: visible; margin: 0; padding: 0; }
html.touch-mobile-layout .wb-field-group label { text-align: center; margin-left: 0; }
html.touch-mobile-layout .wb-field-input,
html.touch-mobile-layout .wb-select-display,
html.touch-mobile-layout .wb-seg { justify-content: center; text-align: center; }
html.touch-mobile-layout select.wb-field-input { background-position: calc(50% + 40px) center; }
html.touch-mobile-layout .wb-orb-glow,
html.touch-mobile-layout .wb-orb { display: none !important; }
html.touch-mobile-layout #exhibit-zone { position: static; flex: none; height: 0; min-height: 0; overflow: visible; }
html.touch-mobile-layout #exhibit-zone > *:not(.wb-modal) { display: none !important; }
html.touch-mobile-layout #exhibit-zone.wb-is-generating ~ #upload-zone { display: none !important; }
html.touch-mobile-layout section#content-area { display: flex; flex-direction: column; overflow: visible; will-change: auto; transform: none !important; padding-left: 0; }
html.touch-mobile-layout #detail-modal,
html.touch-mobile-layout #initial-setup-modal,
html.touch-mobile-layout #settings-modal { padding: 20px; }
html.touch-mobile-layout #upload-zone { flex-direction: column; height: auto; gap: var(--surface-gap); display: flex; max-width: 400px; width: 100%; margin: var(--surface-gap) auto 0; }
html.touch-mobile-layout .wb-upload-card { height: 120px; padding: 20px; }
html.touch-mobile-layout .wb-mobile-bar { position: fixed; bottom: var(--touch-bottom-clearance); left: 50%; transform: translateX(-50%); width: calc(100% - 16px); max-width: 400px; padding: 12px; background: var(--glass-panel-bg); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border: none; z-index: var(--z-m-bar); display: block; box-shadow: none; border-radius: var(--radius-base); }
html.touch-mobile-layout .wb-btn--generate { margin-top: 0; width: 100%; }
html.touch-mobile-layout aside .wb-btn--generate,
html.touch-mobile-layout .wb-aside .wb-btn--generate { display: none !important; }
html.touch-mobile-layout .wb-downloads-menu { position: fixed; left: 8px; top: var(--touch-header-offset); width: 36%; max-width: 200px; min-width: 130px; bottom: auto; height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); max-height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); transform: translateY(0); transition: all 0.3s ease; z-index: var(--z-m-view); background: var(--glass-panel-bg); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
html.touch-mobile-layout .wb-downloads-menu.is-list-expanded { width: auto; right: 8px; max-width: none; border-radius: var(--radius-base); box-shadow: none; }
html.touch-mobile-layout .wb-downloads-list { position: fixed; left: calc(36% + 8px); top: var(--touch-header-offset); right: 8px; width: auto; bottom: auto; height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); max-height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); transform: translateX(20px); opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: var(--z-m-view); background: var(--glass-panel-bg); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; border-left: 1px solid transparent; border-radius: 0; }
html.touch-mobile-layout .wb-downloads-list.is-open { transform: translateX(0); opacity: 1; pointer-events: auto; }
html.touch-mobile-layout .wb-downloads-preview { position: fixed; left: 8px; right: 8px; top: var(--touch-header-offset); bottom: auto; width: auto; height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); max-height: calc(var(--app-viewport-height) - var(--touch-header-offset) - var(--touch-bottom-clearance)); transform: translateY(100%); opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: var(--z-m-view-top); background: var(--glass-panel-bg); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
html.touch-mobile-layout .wb-downloads-preview.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
html.touch-mobile-layout .wb-downloads-preview-close { display: inline-flex; }
html.touch-mobile-layout .wb-modal { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important; border-radius: 0 !important; transform: translateY(100%) scale(1) !important; z-index: var(--z-m-overlay) !important; background: var(--bg-page) !important; }
html.touch-mobile-layout .wb-modal.show { transform: translateY(0) scale(1) !important; }
html.touch-mobile-layout .wb-modal.is-split-left,
html.touch-mobile-layout .wb-modal.is-split-right { right: 0 !important; left: 0 !important; }
html.touch-mobile-layout .wb-modal-close { top: 15px; right: 15px; background: rgba(127,127,127,0.08); border-radius: 50%; width: 36px; height: 36px; }
html.touch-mobile-layout .report-layout { flex-direction: column; overflow-y: auto; padding: 20px 20px 80px; }
html.touch-mobile-layout .report-main { overflow-y: visible; }
html.touch-mobile-layout .report-sidebar { width: 100%; border-left: none; border-top: none; padding-left: 0; padding-top: 20px; margin-top: 20px; }
html.touch-mobile-layout .wb-drawer { width: calc(100% - 16px); height: calc(var(--app-viewport-height) - var(--app-viewport-bottom-gap) - 16px); max-height: calc(var(--app-viewport-height) - var(--app-viewport-bottom-gap) - 16px); top: auto; bottom: calc(-100% - var(--app-viewport-bottom-gap)); right: 8px; border-radius: var(--radius-base); transition: bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1); z-index: var(--z-m-sheet); background: var(--glass-panel-bg); backdrop-filter: blur(34px) saturate(180%) brightness(1.05); -webkit-backdrop-filter: blur(34px) saturate(180%) brightness(1.05); }
body.touch-mobile-layout.wb-drawer-open .wb-drawer { bottom: calc(8px + var(--app-viewport-bottom-gap)); right: 8px; }
body.touch-mobile-layout.wb-drawer-open .wb-shell { padding-right: 8px; }
body.touch-mobile-layout.wb-drawer-open #content-area { transform: none; }
body.touch-mobile-layout.wb-rail-open .wb-aside,
body.touch-mobile-layout.wb-rail-open section#content-area,
body.touch-mobile-layout.wb-rail-open .wb-drawer { filter: none; opacity: 1; pointer-events: auto; }

/* ===== 手机版"信息填写区"重排: 表单 → 上传区 → 生成按钮 排成一条正常竖直流 =====
   原来上传区 / 生成栏各自 position:fixed 钉死(上传区被钉到屏幕外、生成钮钉在底部), 现在全部改成
   正常流式, 按文档顺序(aside 表单 → content-area 上传区 → body 末尾的 .wb-mobile-bar 生成钮)自然往下排。
   关键: .wb-shell 取消 min-height 撑满整屏(否则会把它后面的生成栏顶出屏幕外), 给底部固定导航让位的
   留白从 .wb-shell 移到 body。本段在已有手机规则之后, 覆盖它们的 fixed 定位。 */
@media (max-width: 768px) {
    #upload-zone { position: static; left: auto; right: auto; bottom: auto; }
    .wb-mobile-bar { position: static; left: auto; right: auto; bottom: auto; transform: none; margin: 16px auto 0; padding: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
    section#content-area { padding-bottom: 0; }
    .wb-shell { min-height: 0; padding-bottom: 0; }
    body { padding-bottom: calc(var(--app-viewport-bottom-gap) + 92px + env(safe-area-inset-bottom, 0px)); }
}
html.touch-mobile-layout #upload-zone { position: static; left: auto; right: auto; bottom: auto; }
html.touch-mobile-layout .wb-mobile-bar { position: static; left: auto; right: auto; bottom: auto; transform: none; margin: 16px auto 0; padding: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
html.touch-mobile-layout section#content-area { padding-bottom: 0; }
html.touch-mobile-layout .wb-shell { min-height: 0; padding-bottom: 0; }
html.touch-mobile-layout body { padding-bottom: calc(var(--app-viewport-bottom-gap) + 92px + env(safe-area-inset-bottom, 0px)); }

/* ===== 显示模式按钮: 手机版从底部导航挪到顶栏左上角 ===== */
@media (max-width: 768px) {
    .wb-topbar-theme-btn { display: inline-flex; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
    .wb-rail-tab[data-rail-target="display-mode"],
    .wb-rail-action[data-rail-target="display-mode"] { display: none !important; }
}
html.touch-mobile-layout .wb-topbar-theme-btn { display: inline-flex; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
html.touch-mobile-layout .wb-rail-tab[data-rail-target="display-mode"],
html.touch-mobile-layout .wb-rail-action[data-rail-target="display-mode"] { display: none !important; }

/* ===== 手机版预览 / 弹窗 / 底栏 修复 ===== */
@media (max-width: 768px) {
    /* 报告弹窗等全屏浮层要真正盖住下面: content-area 不再当独立层叠上下文 —— 否则它的 z:100 会把
       里面 z:9500 的 modal 困住, 让 z:500 的批改表单(.wb-aside)反而浮在 modal 之上挡住预览。
       去掉 z-index 后, 里面的 fixed modal 逃逸到根层叠上下文, 正常盖住一切。 */
    section#content-area { z-index: auto; }
    /* 资料中心三块面板改不透明底: 原本用 glass 底(0.72 透明)+ 手机端关掉了 backdrop 模糊 → 透出下层内容。 */
    .wb-downloads-preview, .wb-downloads-menu, .wb-downloads-list { background: var(--bg-page); }
    /* 资料预览打开时整屏覆盖(向下盖住底部导航), 做沉浸式预览; 退出走预览头部的 ✕。
       原来高度只到底部导航上方、且 z(700) 低于导航(1010), 所以导航露在外面。 */
    .wb-downloads-preview { bottom: 0; height: auto; max-height: none; z-index: var(--z-m-overlay); }
    /* 底栏导航: 把上下两个分组拍平, 让三个按钮在底栏整体均匀分布(不再"批改+资料"挤左、"设置"独占右半)。 */
    .wb-rail-group--top, .wb-rail-group--bottom { display: contents; }
}
html.touch-mobile-layout section#content-area { z-index: auto; }
html.touch-mobile-layout .wb-downloads-preview,
html.touch-mobile-layout .wb-downloads-menu,
html.touch-mobile-layout .wb-downloads-list { background: var(--bg-page); }
html.touch-mobile-layout .wb-downloads-preview { bottom: 0; height: auto; max-height: none; z-index: var(--z-m-overlay); }
html.touch-mobile-layout .wb-rail-group--top,
html.touch-mobile-layout .wb-rail-group--bottom { display: contents; }

/* ===== 手机版"窗口"统一打开位置(以资料预览为基准) =====
   所有弹窗(.wb-modal: 报告预览 / 设置 / 详情 等)打开时统一改为: 顶栏下方留出(顶栏始终可见)、
   两侧各 8px(正好与正文 8px 内边距对齐, 不从边缝透出底层)。原来是 top:0 铺满整屏、连顶栏一起盖住。
   · 预览类(报告预览): 铺到屏幕底、向下盖住底部导航 —— 沉浸式, 与资料预览一致。
   · 功能面板类(设置 等): 底部停在导航上方, 保留底部导航在最上层可见可点。 */
@media (max-width: 768px) {
    .wb-modal { top: var(--touch-header-offset) !important; left: 8px !important; right: 8px !important; bottom: var(--touch-bottom-clearance) !important; }
    #report-modal.wb-modal { bottom: 0 !important; }
}
html.touch-mobile-layout .wb-modal { top: var(--touch-header-offset) !important; left: 8px !important; right: 8px !important; bottom: var(--touch-bottom-clearance) !important; }
html.touch-mobile-layout #report-modal.wb-modal { bottom: 0 !important; }

#toast-container { position: fixed; top: 40px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.apple-toast { padding: 14px 24px; border-radius: 100px; font-size: 14px; font-weight: 600; background: var(--glass-panel-bg); backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%); border: none; outline: none; box-shadow: var(--float-shadow-sm); animation: toastSlideDown 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; display: flex; align-items: center; gap: 10px; }
.apple-toast.success { color: var(--success-ink); }
.apple-toast.error { color: var(--btn-danger); }
.apple-toast.hide { animation: toastFadeOut 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

@keyframes toastSlideDown { 0% { opacity: 0; transform: translateY(-20px) scale(0.9); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastFadeOut { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-20px) scale(0.9); } }

/* ==========================================
   毛玻璃断连提示框
   ========================================== */
.disconnect-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.25); animation: toastSlideDown 0.35s ease-out forwards; }
.disconnect-card { max-width: 360px; padding: 40px 32px; background: var(--glass-panel-bg); backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%); border: none; border-radius: var(--radius-base); text-align: center; box-shadow: none; }
.disconnect-icon { font-size: 42px; margin-bottom: 18px; opacity: 0.75; }
.disconnect-text { font-size: 14px; color: var(--text-main); line-height: 2; margin-bottom: 28px; font-weight: 500; }
.disconnect-btn { padding: 12px 36px; background: var(--btn-aqua-bg); color: #fff; border: none; border-radius: var(--radius-base); font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.3s; }
.disconnect-btn:hover { background: var(--btn-aqua-hover); transform: translateY(-2px); box-shadow: none; }

.webgl-orb-active::before,
.webgl-orb-active::after { display: none !important; }


/* ============================================================================
   抽屉 3 个 view 切换 (个人中心 / 历史 / 明细) — by data-view 属性.

   稳态: display: none/flex 切换, 切换瞬时, 事件不会冒泡冲突 (旧 view 直接消失).
   动画期: JS 给老/新 view 同时打 .is-animating 类 → display:flex 都成立, 老 view
   absolute 浮起跑退场 transition, 新 view 跑进场 transition. 动画结束 JS 清类,
   CSS 接管(老 view 自动 display:none, 新 view 自动 display:flex).
   ========================================================================== */
.wb-drawer-view {
    display: none;
    flex: 1; min-height: 0;
    overflow-y: auto; scrollbar-width: none;
    flex-direction: column;
}
.wb-drawer-view::-webkit-scrollbar { width: 0; height: 0; }
.wb-drawer[data-view="account"] .wb-drawer-view--account,
.wb-drawer[data-view="history"] .wb-drawer-view--history,
.wb-drawer[data-view="details"] .wb-drawer-view--details,
.wb-drawer[data-view="invite"] .wb-drawer-view--invite {
    display: flex;
}

/* 个人中心: 整体不滚, 只让中间"点数详情"滚动;
   标题/用户/到期(上) 与 邀请卡/续费补充/订单退出(下) 固定不动。 */
.wb-drawer[data-view="account"] .wb-drawer-view--account { overflow-y: hidden; }
.wb-account-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}
.wb-account-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* JS 动画期: 显式 display flex + 老 view absolute 浮起来不挤压新 view. */
.wb-drawer-view.is-anim-exit,
.wb-drawer-view.is-anim-enter {
    display: flex !important;
    will-change: opacity, transform, filter;
}
.wb-drawer-view.is-anim-exit {
    position: absolute;
    top: 25px; left: 25px; right: 25px; bottom: 25px;
    pointer-events: none;
    z-index: 1;
}

/* 系统级"减少动效"偏好: macOS/iOS 用户在系统偏好里关动效时, 直接瞬时切换. */
@media (prefers-reduced-motion: reduce) {
    .wb-drawer-view.is-anim-exit,
    .wb-drawer-view.is-anim-enter {
        transition: none !important;
        filter: none !important;
        transform: none !important;
    }
}

.wb-drawer-view__title {
    margin: 0 0 16px;
    min-height: 28px;             /* 跟 .wb-drawer-close 同高 */
    line-height: 28px;            /* 强制单行 28px 高, 字符 baseline 与 X 中心精确对齐 */
    display: flex;
    align-items: center;
    padding-right: 36px;          /* 避让右上角 X 按钮 (28+8 间距), 防止长标题溢到 X 下面 */
    font-size: 13px; font-weight: 600;
    color: var(--text-grey);
    letter-spacing: 0.5px;
}

/* ============================================================================
   View 1: 个人中心 (用户身份 + 标签 + 额度卡 + 底部按钮)
   ========================================================================== */
.wb-account-user {
    font-size: 16px; font-weight: 700;
    margin-bottom: 3px;
    display: flex; align-items: center; gap: 8px;
    color: var(--text-main);
}
.wb-account-user.solo { margin-bottom: 28px; }
.wb-account-expire {
    font-size: 11px;
    color: var(--text-muted, var(--text-grey));
    opacity: 0.75;
    letter-spacing: 0.3px;
    margin-bottom: 28px;
}

/* 用户身份标签 (个人版橙 / 机构版蓝 / 非会员灰) - 跟 pricing 卡片标签一致 */
.wb-drawer-view--account .wb-account-badge {
    display: inline-flex; align-items: center;
    font-size: 10px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    line-height: 1.6;
    white-space: nowrap;
}
.wb-drawer-view--account .wb-account-badge.badge-orange {
    background: rgba(245,175,2,0.16); color: #A87000;
}
.wb-drawer-view--account .wb-account-badge.badge-blue {
    background: rgba(0,100,210,0.14); color: var(--vitality-blue);
}
.wb-drawer-view--account .wb-account-badge.wb-account-badge--grey {
    background: rgba(127,127,127,0.18); color: var(--text-grey);
}
[data-theme="dark"] .wb-drawer-view--account .wb-account-badge.badge-orange {
    background: rgba(245,175,2,0.22); color: #F5C547;
}
[data-theme="dark"] .wb-drawer-view--account .wb-account-badge.badge-blue {
    background: rgba(0,100,210,0.28); color: #6FA8E8;
}

/* 进度条模块 (会员点 / 赠送点 / 补充包) */
.wb-drawer-view--account .wb-credit { margin-bottom: 18px; }
.wb-drawer-view--account .wb-credit:last-of-type { margin-bottom: 18px; }
.wb-credit-row {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 13px;
}
.wb-credit-label { color: var(--text-grey); }
.wb-credit-value { font-weight: 700; color: var(--text-main); }
.wb-credit-value.warn { color: var(--vitality-orange); }
.wb-credit-value.danger { color: var(--danger-ink); }
.wb-credit-progress {
    height: 6px; border-radius: 3px;
    background: rgba(127,127,127,0.18);
    margin: 6px 0 5px;
    overflow: hidden;
}
.wb-credit-progress__fill {
    height: 100%; border-radius: 3px;
    transition: width .4s ease, background .2s;
    width: 0%;
}
.wb-credit-progress__fill.blue { background: var(--vitality-blue); }
.wb-credit-progress__fill.green { background: var(--vitality-green); }
.wb-credit-progress__fill.warn { background: var(--vitality-orange); }
.wb-credit-progress__fill.danger { background: var(--danger-ink); }
.wb-credit-reset {
    font-size: 11px; color: var(--text-muted, var(--text-grey));
    opacity: 0.7;
}
.wb-credit-reset.urgent { color: var(--vitality-orange); opacity: 1; }

/* 补充包按笔列表 */
.wb-grant-list { font-size: 12px; color: var(--text-grey); margin-top: 6px; }
.wb-grant-list .grant-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0;
}
.wb-grant-list .grant-item.warn { color: var(--vitality-orange); }
.wb-grant-list .grant-item.danger { color: var(--danger-ink); }

/* v2 总可用 + 底部按钮: margin-top:auto 把整块推到抽屉底部.
   去掉顶部横线 (mockup 反馈"总可用上面不需要横线"), 改用底部横线分隔下方按钮组. */
.wb-account-summary {
    margin-top: auto;
    padding: 6px 0 14px;
    border-bottom: 1px solid var(--divider);
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.wb-account-summary .wb-account-total__label {
    font-size: var(--font-md);
    color: var(--text-grey);
}
.wb-account-summary .total {
    font-size: var(--font-md);
    color: var(--text-grey);
}
.wb-account-summary .total b {
    font-size: var(--font-xxl);
    color: var(--text-main);
    margin-right: 4px;
    font-weight: 800;
    font-feature-settings: "tnum";
}
.wb-account-summary .total.danger b { color: var(--danger-ink); }

/* v2 底部按钮组: 拉开距离 (gap 14px 替代 10px), wb-btn--secondary 去边框,
   点数明细 + 退出登录 用 .wb-drawer-link-row 横向并排放在底部, 顶部 border-top 分隔分组. */
.wb-account-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.wb-account-actions .btn {
    width: 100%;
    padding: 12px 0;
    border-radius: var(--radius-base);
    font-size: var(--font-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
    transition: background .15s, color .15s, transform .12s;
}
.wb-account-actions .wb-btn--primary {
    background: var(--vitality-blue);
    color: #fff;
}
.wb-account-actions .wb-btn--primary:hover { background: var(--vitality-blue-hover); }
.wb-account-actions .wb-btn--primary:active { transform: translateY(1px); }
.wb-account-actions .wb-btn--secondary {
    background: var(--chip-bg);
    color: var(--text-main);
}
.wb-account-actions .wb-btn--secondary:hover { background: var(--chip-bg-hover); }

/* wb-drawer-link-row: 点数明细 + 退出登录 横向并排, 顶部分隔线 */
.wb-account-actions .wb-drawer-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 4px 0;
    margin-top: 4px;
    border-top: 1px solid var(--divider);
}
.wb-account-actions .wb-btn--text {
    width: auto;
    padding: 4px 0;
    background: transparent;
    color: var(--text-grey);
    font-size: var(--font-sm);
    font-weight: 500;
}
.wb-account-actions .wb-btn--text:hover { color: var(--vitality-blue); }
.wb-account-actions .wb-btn--text-danger:hover { color: var(--brand-secondary); }
/* 退出登录: 纯 icon (无文字), 居中可点; 颜色继承 text-grey, hover 转警示红 (复用 text-danger:hover) */
.wb-account-actions .wb-btn--logout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    line-height: 0;
}


/* ============================================================================
   View 3: 点数明细 (按月分组 + 顶部筛选)
   ========================================================================== */
.wb-ledger-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
    min-height: 28px;             /* 跟 .wb-drawer-close 同高, 让返回按钮中心跟 X 中心对齐 */
    padding-right: 36px;          /* 避让右上角 X 按钮 */
}
.wb-ledger-head .wb-drawer-back {
    background: transparent; border: none; color: var(--text-grey);
    cursor: pointer;
    padding: 0;            /* 改 0: 配合 .wb-ledger-head 的 min-height:28px, 内部不再加 padding 让 box 干净 */
    height: 28px;          /* 跟 .wb-drawer-close 同高, 中心对齐 X 按钮 */
    line-height: 28px;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; font-weight: 600;
}
.wb-ledger-head .wb-drawer-back:hover { color: var(--vitality-blue); }
.wb-ledger-filter {
    display: flex; gap: 8px; margin-bottom: 14px;
}
.wb-ledger-filter select {
    flex: 1; min-width: 0; cursor: pointer;
    appearance: none; -webkit-appearance: none;          /* 去掉浏览器原生外观 */
    background-color: var(--input-bg, var(--bg-page));
    color: var(--text-main);
    border: 1px solid var(--glass-stroke-soft, rgba(127,127,127,0.15));
    border-radius: 8px;
    padding: 7px 28px 7px 11px;                          /* 右侧留出自绘箭头位 */
    font-size: 12px; font-weight: 500;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 9px center; background-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wb-ledger-filter select:hover { border-color: rgba(127, 127, 127, 0.32); }
.wb-ledger-filter select:focus,
.wb-ledger-filter select:focus-visible {
    outline: none;
    border-color: rgba(127, 127, 127, 0.4);              /* 聚焦只加深灰边, 不要蓝色阴影圈 */
    box-shadow: none;
}
[data-theme="dark"] .wb-ledger-filter select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}
.wb-ledger-body { flex: 1; min-height: 0; overflow-y: auto; }

/* ===== 我的订单 / 点数流水 手风琴 (两组互斥折叠) =====
   .wb-acc 全高 flex 列; .wb-acc-item 用 display:contents 让 头/面板 直接当 flex 子项。
   头部 flex:0 固定 (永不随内容上滑); 展开面板 flex-grow:1 撑满剩余并内部滚动, 收起面板高 0。
   于是: 我的订单展开 → 点数流水头被顶到底部; 点数流水展开 → 它紧贴我的订单头下方。无分隔线。
   动画: flex-grow 0↔1 平滑 + 内容淡入淡出。
   注: 订单组的 order_refund 开关改由 JS 控可见性, 不用 data-feature (避免 beta 的
       display:revert 冲掉 display:contents)。 */
.wb-acc { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wb-acc-item { display: contents; }
.wb-acc-head {
    flex: 0 0 auto;
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 14px 2px; background: transparent; border: none; cursor: pointer;
    font-size: 13px; font-weight: 600; color: var(--text-main); text-align: left;
}
.wb-acc-chev {
    color: var(--text-grey); flex: 0 0 auto;
    transition: transform .35s cubic-bezier(.32, .72, 0, 1);
}
.wb-acc-item.is-open .wb-acc-chev { transform: rotate(90deg); }
.wb-acc-panel {
    flex: 0 1 0; min-height: 0; overflow: hidden;
    transition: flex-grow .42s cubic-bezier(.32, .72, 0, 1);
}
.wb-acc-item.is-open .wb-acc-panel { flex-grow: 1; }
.wb-acc-panel__inner {
    height: 100%; min-height: 0; overflow-y: auto; scrollbar-width: none;
    padding-bottom: 8px;
    opacity: 0; transition: opacity .3s ease;
}
.wb-acc-panel__inner::-webkit-scrollbar { width: 0; height: 0; }
.wb-acc-item.is-open .wb-acc-panel__inner { opacity: 1; }
/* 列表用自然高度, 滚动交给 .wb-acc-panel__inner (避免嵌套双滚动) */
.wb-acc .wb-ledger-body { flex: none; overflow: visible; }
.wb-ledger-empty {
    color: var(--text-grey); font-size: 13px;
    text-align: center; padding: 32px 0;
}
.details-month-group { margin-bottom: 14px; }
.details-month-group:last-child { margin-bottom: 0; }
.details-month-label {
    font-size: 11px; font-weight: 700; color: var(--text-grey);
    letter-spacing: 1px;
    border-bottom: 1px solid var(--glass-stroke-soft, rgba(127,127,127,0.15));
    padding-bottom: 6px; margin-bottom: 6px;
}
.details-row {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    padding: 7px 0;
    font-size: 12px;
    gap: 8px;
}
.details-row .d-amount {
    font-weight: 700; font-size: 13px;
}
.details-row .d-amount.gain { color: var(--vitality-green); }
.details-row .d-amount.cost { color: var(--text-main); }
.details-row .d-desc { color: var(--text-main); }
.details-row .d-date { color: var(--text-grey); font-size: 11px; }


/* ============================================================================
   顶栏 icon 按钮 (历史入口) - 与现有 .wb-topbar-user 风格对齐
   ========================================================================== */
/* 跟 .wb-topbar-user (chrome.css:53) hover 风格对齐: 中性灰圆形按钮, 无 border. */
.wb-topbar-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 6px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    transition: background 0.3s ease;
}
.wb-topbar-icon-btn:hover {
    background: rgba(127, 127, 127, 0.08);
}
.wb-topbar-icon-btn svg { width: 18px; height: 18px; }


/* ============================================================================
   学习资料"重新生成"气泡确认 (按钮上方/下方 浮卡)
   ========================================================================== */
.regen-popover {
    position: fixed;
    z-index: 1800;
    background: var(--card-bg, var(--glass-panel-bg));
    border: 1px solid var(--glass-stroke-soft, rgba(127,127,127,0.2));
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--float-shadow);
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.55;
    opacity: 0;
    transform: translateY(4px) scale(0.97);
    transition: opacity .22s cubic-bezier(.32,.72,0,1),
                transform .26s cubic-bezier(.32,.72,0,1);
    pointer-events: none;
}
.regen-popover.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.regen-popover-body {
    color: var(--text-main);
    margin-bottom: 10px;
}
.regen-popover-body b {
    color: var(--vitality-blue, #0064D2);
}
/* 小三角箭头, 按 data-arrow-side 决定方向 */
.regen-popover-arrow {
    position: absolute;
    left: 50%; transform: translateX(-50%) rotate(45deg);
    width: 10px; height: 10px;
    background: var(--card-bg, var(--glass-panel-bg));
    border: 1px solid var(--glass-stroke-soft, rgba(127,127,127,0.2));
}
.regen-popover[data-arrow-side="bottom"] .regen-popover-arrow {
    bottom: -6px;
    border-top: none; border-left: none;
}
.regen-popover[data-arrow-side="top"] .regen-popover-arrow {
    top: -6px;
    border-bottom: none; border-right: none;
}
.regen-popover-dismiss {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 6px;
    font-size: 11px;
    color: var(--text-grey);
    cursor: pointer;
    user-select: none;
}
.regen-popover-dismiss input {
    width: 13px; height: 13px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--vitality-blue, #0064D2);
}
.regen-popover-dismiss:hover { color: var(--text-main); }


/* ============================================================================
   低额度预警浮层 (右上角 header 下方, 总剩余 <30 时 JS 弹出)
   ========================================================================== */
.wb-low-credit {
    position: fixed;
    top: calc(var(--header-h, 60px) + 12px);
    /* 右边距 = .wb-shell padding-right, 跟 wb-promo / 上传卡精确右对齐.
       抽屉打开时下方 body.wb-drawer-open 公式平移让位, transition 跟抽屉同曲线. */
    right: var(--frame-content-offset);
    width: 264px;  /* 跟 .wb-promo 同宽 */
    background: var(--glass-panel-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--glass-stroke-soft, rgba(127,127,127,0.18));
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--float-shadow);
    z-index: var(--z-toast);
    color: var(--text-main);
    transition: right 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.wb-low-credit[hidden] { display: none; }
body.wb-drawer-open .wb-low-credit {
    right: calc(var(--drawer-w) + var(--frame-content-offset) + var(--layout-gap));
}
.wb-low-credit .wb-low-credit-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
}
.wb-low-credit .wb-low-credit-title {
    font-size: 14px; font-weight: 700; color: var(--text-main);
}
.wb-low-credit .wb-low-credit-close {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-grey); font-size: 18px; padding: 0;
    width: 24px; height: 24px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.wb-low-credit .wb-low-credit-close:hover { background: rgba(127,127,127,0.12); color: var(--text-main); }
.wb-low-credit .wb-low-credit-layers {
    display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px;
}
.wb-low-credit .wb-low-credit-layer {
    display: flex; align-items: baseline; justify-content: space-between;
    font-size: 13px; gap: 12px;
}
.wb-low-credit .wb-low-credit-layer__name { color: var(--text-main); font-weight: 500; }
.wb-low-credit .wb-low-credit-layer__val { color: var(--danger-ink); font-weight: 700; white-space: nowrap; }
.wb-low-credit .wb-low-credit-layer__val b { font-size: 15px; margin: 0 1px; }
.wb-low-credit .wb-low-credit-promo {
    background: var(--bg-page, rgba(127,127,127,0.05));
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 12px; color: var(--text-grey);
}
.wb-low-credit .wb-low-credit-promo b { color: var(--text-main); }
.wb-low-credit .wb-low-credit-actions {
    display: flex; gap: 8px;
}
.wb-low-credit .wb-low-credit-btn {
    flex: 1; padding: 8px 0; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer; border: none;
    transition: filter .2s;
}
.wb-low-credit .wb-low-credit-btn--primary {
    background: var(--vitality-blue); color: #fff;
}
.wb-low-credit .wb-low-credit-btn--primary:hover { background: var(--vitality-blue-hover); }
/* 邀请好友按钮: 浅蓝色弱填充 + 边框, 跟个人中心 .wb-invite-entry 同视觉语言 —
   secondary 但不是 ghost, 跟主蓝色"立即升级"形成互补而非消失. */
.wb-low-credit .wb-low-credit-btn--secondary {
    background: rgba(0, 100, 210, 0.08);
    color: var(--vitality-blue);
    border: 1px solid rgba(0, 100, 210, 0.22);
}
.wb-low-credit .wb-low-credit-btn--secondary:hover {
    background: rgba(0, 100, 210, 0.14);
    color: var(--vitality-blue-hover, #004FB3);
}

/* 移动端: 浮层改贴顶部全宽, 不挤压 header */
@media (max-width: 768px) {
    .wb-low-credit {
        top: calc(var(--header-h, 60px) + 8px);
        right: 8px; left: 8px; width: auto;
    }
}


/* ============================================================================
   早鸟计划 Banner (右下浮卡, 深色 + 柔和奥金 #C9A961)
   仅对非会员 + 本会话未关闭 + 后端有 is_promotional 套餐时展示, 由 JS 控制
   ========================================================================== */
:root {
    --gold-base: #C9A961;
    --gold-light: #E8D29A;
    --gold-glow: rgba(201, 169, 97, 0.18);
}
/* Banner 配色: 亮色用浅金米黄底 (跟 #fff 主背景柔和过渡, 不撕裂),
   暗色用经典深色 + 柔金边. 通过 CSS 变量切换, 内部元素颜色跟着自动适配. */
.wb-promo {
    --promo-bg: linear-gradient(150deg, #FAF6E8 0%, #F2E9C8 100%);
    --promo-glow: radial-gradient(ellipse at top left, rgba(201,169,97,0.18) 0%, transparent 55%);
    --promo-border: rgba(160, 130, 70, 0.32);
    --promo-text: #3D2E1E;
    --promo-text-muted: rgba(61, 46, 30, 0.62);
    --promo-tag-color: #8E6F2A;
    --promo-tag-border: rgba(160, 130, 70, 0.5);
    --promo-price-color: #2A1F12;
    --promo-unit-color: #8E6F2A;
    --promo-save-color: #A87000;
    --promo-strike-color: rgba(61, 46, 30, 0.45);
    --promo-cta-bg: #C9A961;
    --promo-cta-color: #fff;
    --promo-close-color: rgba(61, 46, 30, 0.45);
    --promo-close-hover-bg: rgba(61, 46, 30, 0.08);
    --promo-close-hover-color: #3D2E1E;
    --promo-shadow: 0 16px 36px -18px rgba(160, 130, 70, 0.45);

    position: fixed;
    bottom: calc(20vh + 24px);
    right: var(--frame-content-offset);
    width: 264px;
    background: var(--promo-glow), var(--promo-bg);
    border: none;     /* 取消边框线, 只靠 shadow + 内部金色调来定义边界 */
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--promo-text);
    box-shadow: var(--promo-shadow);
    overflow: hidden;
    /* z-index 必须 < .wb-modal (var(--z-workspace-panel) = 1200), 这样中央
       报告/学习资料/上传面板弹出时会盖在 Banner 上层, 而不是 Banner 反过来挡操作.
       但仍 > 主内容区流式元素 (默认 0), 保证非弹窗状态下 Banner 浮在最前. */
    z-index: var(--z-overlay);
    /* right transition 跟抽屉 slide-in 同曲线同时长, 抽屉打开/关闭时 Banner 平滑左移. */
    transition: right 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    /* 入场动画: scale+fade 微妙的 spring 感, 跟 view 切换风格一致 */
    animation: promoBannerIn 460ms cubic-bezier(0.32, 0.72, 0, 1);
}

/* 暗色主题: 恢复经典深色 + 柔金边, 视觉对比更强 */
[data-theme="dark"] .wb-promo {
    --promo-bg: linear-gradient(150deg, #1a1a1f 0%, #0d0d12 100%);
    --promo-glow: radial-gradient(ellipse at top left, rgba(201,169,97,0.18) 0%, transparent 55%);
    --promo-border: rgba(201, 169, 97, 0.32);
    --promo-text: #fff;
    --promo-text-muted: rgba(255, 255, 255, 0.78);
    --promo-tag-color: var(--gold-light);
    --promo-tag-border: rgba(201, 169, 97, 0.5);
    --promo-price-color: #fff;
    --promo-unit-color: var(--gold-base);
    --promo-save-color: var(--gold-base);
    --promo-strike-color: rgba(255, 255, 255, 0.45);
    --promo-cta-bg: var(--gold-base);
    --promo-cta-color: #fff;
    --promo-close-color: rgba(255, 255, 255, 0.5);
    --promo-close-hover-bg: rgba(255, 255, 255, 0.1);
    --promo-close-hover-color: #fff;
    --promo-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.45);
}

/* 抽屉打开时 Banner 平移到抽屉左边, 仍然跟上传区右边对齐 (上传区也被推开了同样距离). */
body.wb-drawer-open .wb-promo {
    right: calc(var(--drawer-w) + var(--frame-content-offset) + var(--layout-gap));
}
.wb-promo[hidden] { display: none; }

/* 右下角通知堆叠区: 容器接管定位(原 .wb-promo 的 fixed/bottom/right/抽屉位移),
   早鸟卡与范本条作为堆叠项从底部向上排列, 新卡顶起旧卡。 */
.wb-corner-stack {
    position: fixed;
    bottom: calc(20vh + 72px);  /* 比原早鸟卡位置再抬高 ~48px, 让最下面那张卡和上传区留出间距 */
    right: var(--frame-content-offset);
    width: 264px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: var(--z-overlay);
    transition: right 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.wb-corner-stack > * { pointer-events: auto; }
body.wb-drawer-open .wb-corner-stack {
    right: calc(var(--drawer-w) + var(--frame-content-offset) + var(--layout-gap));
}
/* 早鸟卡进容器后交出定位(视觉样式全保留), 成为普通堆叠项 */
.wb-corner-stack .wb-promo {
    position: static;
    width: auto;
}
/* 范本提示条: 细长一条 = 一句话 + 查看(从底部弹入) */
.wb-sample-tip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: 320px;
    position: relative;
    background: var(--glass-panel-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--glass-stroke-soft, rgba(127,127,127,0.18));
    border-radius: 12px;
    padding: 12px 30px 12px 14px;
    box-shadow: var(--float-shadow);
    color: var(--text-main);
    font-size: 13px;
    animation: wbSampleTipIn 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.wb-sample-tip[hidden] { display: none; }
.wb-sample-tip-head { display: flex; flex-direction: column; gap: 3px; padding-right: 16px; }
.wb-sample-tip-title { font-weight: 600; font-size: 14.5px; line-height: 1.35; color: var(--text-main); }
.wb-sample-tip-sub { font-size: 12px; line-height: 1.5; color: var(--text-grey, rgba(127,127,127,0.85)); }
.wb-sample-opt {
    display: flex; align-items: center; gap: 11px; width: 100%;
    border: none; cursor: pointer; text-align: left;
    background: rgba(127,127,127,0.08);
    border-radius: 11px; padding: 11px 13px;
    transition: background 0.15s ease;
}
.wb-sample-opt:hover { background: var(--accent-soft-bg); }
.wb-sample-opt-ico { width: 18px; height: 18px; flex: none; color: var(--text-grey, rgba(127,127,127,0.8)); }
.wb-sample-opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wb-sample-opt-main .t { font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.wb-sample-opt-main .d { font-size: 11.5px; color: var(--text-grey, rgba(127,127,127,0.8)); }
.wb-sample-opt-arrow { width: 16px; height: 16px; flex: none; color: var(--text-grey, rgba(127,127,127,0.55)); }
.wb-sample-opt--primary { background: var(--accent-soft-bg); box-shadow: inset 0 0 0 1.5px var(--brand-primary); }
.wb-sample-opt--primary .wb-sample-opt-ico,
.wb-sample-opt--primary .wb-sample-opt-main .t,
.wb-sample-opt--primary .wb-sample-opt-main .d,
.wb-sample-opt--primary .wb-sample-opt-arrow { color: var(--brand-primary); }
.wb-sample-tip-close {
    position: absolute; top: 8px; right: 10px;
    flex: none; border: none; background: transparent; cursor: pointer;
    color: var(--text-grey, rgba(127,127,127,0.7));
    font-size: 16px; line-height: 1; padding: 0 2px;
}
@keyframes wbSampleTipIn {
    from { opacity: 0; transform: translateY(16px) scale(0.85); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes promoBannerIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}
.wb-promo::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 90% 90%, rgba(201,169,97,0.05) 0%, transparent 60%);
    pointer-events: none;
}
.wb-promo .wb-promo-close {
    position: absolute; top: 8px; right: 8px;
    background: transparent; border: none;
    color: var(--promo-close-color);
    font-size: 18px; cursor: pointer; line-height: 1;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background .2s, color .2s;
    padding: 0;
}
.wb-promo .wb-promo-close:hover {
    background: var(--promo-close-hover-bg);
    color: var(--promo-close-hover-color);
}
.wb-promo .wb-promo-tag {
    display: inline-block;
    border: 1px solid var(--promo-tag-border);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 10px; font-weight: 600;
    color: var(--promo-tag-color);
    letter-spacing: 1.2px;
    margin-bottom: 10px;
}
.wb-promo .wb-promo-headline { margin-bottom: 3px; }
.wb-promo .wb-promo-price {
    font-size: 26px; letter-spacing: -0.5px;
    color: var(--promo-price-color);
    font-weight: 700;
}
.wb-promo .wb-promo-unit {
    font-size: 13px;
    color: var(--promo-unit-color);
    font-weight: 600;
    margin-left: 2px;
}
.wb-promo .wb-promo-sub {
    font-size: 12px;
    color: var(--promo-text-muted);
    margin-bottom: 10px; font-weight: 400;
}
.wb-promo .wb-promo-priceline {
    display: flex; gap: 8px; align-items: baseline;
    margin-bottom: 12px;
    font-size: 11px;
}
.wb-promo .wb-promo-priceline .strike {
    color: var(--promo-strike-color);
    text-decoration: line-through;
}
.wb-promo .wb-promo-priceline .save {
    color: var(--promo-save-color);
    font-weight: 600;
}
.wb-promo .wb-promo-cta {
    display: block; width: 100%;
    background: var(--promo-cta-bg);
    color: var(--promo-cta-color);
    border: none;
    padding: 9px 0;
    border-radius: 8px;
    font-size: 13px; font-weight: 700;
    cursor: pointer; text-align: center;
    /* 白字在金底上对比度天然偏弱, 加极淡阴影"压"在底色上, 不飘. */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
    transition: filter .2s, transform .2s;
}
.wb-promo .wb-promo-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.wb-promo .wb-promo-quota {
    margin-top: 10px;
    font-size: 10px;
    color: var(--promo-tag-color);
    text-align: center;
    letter-spacing: 0.4px;
}
.wb-promo .wb-promo-quota b {
    color: var(--promo-save-color);
    font-weight: 700;
}

/* 移动端: 改成贴底全宽, 不挡上传按钮 (mobile 上传在底栏 wb-mobile-bar) */
@media (max-width: 768px) {
    .wb-promo {
        bottom: calc(var(--touch-bottom-clearance, 16px) + 90px);
        right: 8px; left: 8px; width: auto;
    }
}


/* ====================================================================
   点数明细 - 订单段 (上半段 "我的订单" + 下半段保留原流水)
   ==================================================================== */
/* (.wb-ledger-label 已随手风琴改造移除 — 标题改用 .wb-acc-head) */
.wb-ledger-orders { margin-bottom: 0; }
.wb-ledger-orders-empty {
    text-align: center; padding: 18px 0;
    color: var(--text-grey); font-size: 12px;
}

/* 订单卡 */
.order-card {
    background: var(--bg-page);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
}
.order-card:last-child { margin-bottom: 0; }
.order-card .o-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 4px;
}
.order-card .o-name {
    font-size: 13px; font-weight: 700; color: var(--text-main);
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; margin-right: 8px;
}
.order-card .o-amount {
    font-size: 13px; font-weight: 700; color: var(--text-main);
    flex-shrink: 0;
}
.order-card .o-meta {
    font-size: 11px; color: var(--text-grey);
    margin-bottom: 8px;
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.order-card .o-status {
    font-size: 10px; padding: 1px 8px; border-radius: 999px;
    flex-shrink: 0;
}
.order-card .o-status.s-active {
    background: rgba(134, 184, 23, 0.18); color: var(--vitality-green);
}
.order-card .o-status.s-refunded {
    background: rgba(127, 127, 127, 0.16); color: var(--text-grey);
}
.order-card .o-status.s-pending {
    background: rgba(245, 175, 2, 0.18); color: var(--vitality-orange);
}
.order-card .o-status.s-rejected {
    background: rgba(229, 50, 56, 0.14); color: var(--danger-ink, #E53238);
}
.order-card .o-actions {
    display: flex; justify-content: flex-end; align-items: center; gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-soft);
}
.order-card .o-hint {
    font-size: 10px; color: var(--text-muted, var(--text-grey));
    margin-right: auto; align-self: center;
    flex: 1; min-width: 0;
}
.order-card .o-btn {
    background: transparent; border: 1px solid var(--border-soft);
    color: var(--text-grey);
    padding: 4px 10px; border-radius: 6px;
    font-size: 11px; cursor: pointer; font-weight: 600;
    transition: color .15s, border-color .15s;
    flex-shrink: 0;
}
.order-card .o-btn:hover:not(:disabled) {
    color: var(--danger-ink, #E53238); border-color: var(--danger-ink, #E53238);
}
.order-card .o-btn:disabled {
    cursor: not-allowed; opacity: 0.5;
}

/* 退款确认弹窗: 液态玻璃面板 (与 app 其他面板同材质), 居中浮在暗化遮罩上.
   注: 旧版用 var(--card-bg) — 该令牌未定义 → 背景透明 → 透出遮罩成"灰盒子", 已改。 */
.refund-confirm-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: var(--z-confirm);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: inviteRewardMaskIn 200ms ease;
}
.refund-confirm-modal {
    background: var(--glass-panel-bg);
    backdrop-filter: var(--glass-panel-backdrop);
    -webkit-backdrop-filter: var(--glass-panel-backdrop);
    border: 1px solid var(--glass-stroke-soft, rgba(127, 127, 127, 0.14));
    border-radius: 16px;
    padding: 22px 22px 20px;
    width: 360px; max-width: 100%;
    box-shadow: var(--float-shadow);
    animation: inviteRewardIn 380ms cubic-bezier(.32, .72, 0, 1);
}
.refund-confirm-modal h3 {
    margin: 0 0 8px; font-size: var(--font-md, 16px); font-weight: 600;
    color: var(--text-main);
}
.refund-confirm-modal .desc {
    font-size: var(--font-xs, 12px); color: var(--text-grey); line-height: 1.6;
    margin-bottom: 16px;
}
.refund-confirm-modal .desc b { color: var(--text-main); font-weight: 600; }
.refund-confirm-modal textarea {
    width: 100%; min-height: 72px; resize: vertical;
    background: var(--field-bg); color: var(--text-main);
    border: 1px solid var(--glass-stroke-soft, rgba(127, 127, 127, 0.18));
    border-radius: 10px;
    padding: 10px 12px; font-size: var(--font-xs, 12px); box-sizing: border-box;
    font-family: inherit; line-height: 1.5;
    margin-bottom: 18px;
    transition: border-color .2s ease;
}
.refund-confirm-modal textarea:focus { outline: none; border-color: var(--vitality-blue); }
.refund-confirm-modal textarea::placeholder { color: var(--text-grey); opacity: 0.7; }
.refund-confirm-modal .actions { display: flex; gap: 10px; }
.refund-confirm-modal .btn-cancel {
    padding: 0 18px; height: 40px;
    background: transparent;
    border: 1px solid var(--glass-stroke-soft, rgba(127, 127, 127, 0.22));
    color: var(--text-grey);
    border-radius: 10px; font-weight: 500; font-size: var(--font-sm, 13px); cursor: pointer;
    transition: color .2s ease, background .2s ease;
}
.refund-confirm-modal .btn-cancel:hover { color: var(--text-main); background: rgba(127, 127, 127, 0.08); }
.refund-confirm-modal .btn-submit {
    flex: 1; height: 40px; padding: 0;
    background: var(--danger-ink, #E53238); color: #fff;
    border: none; border-radius: 10px;
    font-weight: 600; font-size: var(--font-sm, 13px); cursor: pointer;
    transition: opacity .2s ease, transform .1s ease;
}
.refund-confirm-modal .btn-submit:hover:not(:disabled) { opacity: 0.9; }
.refund-confirm-modal .btn-submit:active:not(:disabled) { transform: scale(0.98); }
.refund-confirm-modal .btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }


/* ====================================================================
   邀请入口 list 行 (个人中心额度卡下方, 独立信息行而非按钮)
   ==================================================================== */
/* v2 邀请入口: 去边框 (mockup 反馈), 用 field-bg 凹陷感, hover 用 chip-bg-hover */
.wb-invite-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    background: var(--field-bg);
    border: none;
    border-radius: var(--radius-base);
    cursor: pointer;
    transition: background .15s;
    margin: 0 0 8px 0;
    box-sizing: border-box;
    font-family: inherit;
    text-align: left;
}
.wb-invite-entry:hover {
    background: var(--chip-bg-hover);
}
.wb-invite-entry .wb-invite-entry__main {
    display: flex; flex-direction: column; gap: 2px;
    flex: 1; min-width: 0;
}
.wb-invite-entry .wb-invite-entry__title {
    font-size: 13px; font-weight: 600; color: var(--text-main);
    line-height: 1.3;
}
.wb-invite-entry .wb-invite-entry__meta {
    font-size: 11px; color: var(--text-grey);
    line-height: 1.4;
}
.wb-invite-entry .wb-invite-entry__meta b {
    color: var(--vitality-orange); font-weight: 700;
}
.wb-invite-entry .wb-invite-entry__chev {
    color: var(--text-muted, var(--text-grey));
    flex-shrink: 0; margin-left: 8px;
}
/* 新用户态 (还没邀请过) — 突出蓝色"可领" */
.wb-invite-entry.is-new .wb-invite-entry__title { color: var(--vitality-blue); }
.wb-invite-entry.is-new .wb-invite-entry__meta b { color: var(--vitality-blue); }

/* 触顶态 - 灰一点 */
.wb-invite-entry.is-capped .wb-invite-entry__title { color: var(--text-grey); }
.wb-invite-entry.is-capped .wb-invite-entry__meta b { color: var(--text-grey); }


/* ====================================================================
   /invite 抽屉 view
   ==================================================================== */
.wb-drawer-view--invite {
    gap: 0;
    padding-top: 0;
}

/* 统计卡 */
.wb-invite-stats {
    background: linear-gradient(135deg, rgba(0,100,210,0.06) 0%, rgba(245,175,2,0.08) 100%);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 18px;
}
.wb-invite-stats__line1 {
    font-size: 11px; color: var(--text-grey);
    margin-bottom: 4px;
}
.wb-invite-stats__line2 {
    font-size: 22px; font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
    font-feature-settings: "tnum";
}
.wb-invite-stats__line3 {
    font-size: 11px; color: var(--text-grey);
    margin-bottom: 2px;
}
.wb-invite-stats__line3 b {
    color: var(--vitality-orange); font-weight: 700;
    margin: 0 2px;
}
.wb-invite-stats__line4 {
    font-size: 11px; color: var(--text-grey);
}
.wb-invite-stats__line4 b {
    color: var(--text-main); font-weight: 700;
    margin: 0 2px;
}

/* section */
.wb-invite-section { margin-bottom: 18px; }
.wb-invite-section:last-child { margin-bottom: 0; }
.wb-invite-label {
    font-size: 11px; color: var(--text-grey);
    margin-bottom: 6px; letter-spacing: 0.3px;
}

/* 邀请码 */
.wb-invite-code-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-page);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 10px 14px;
}
.wb-invite-code-box .wb-invite-code {
    flex: 1; font-size: 18px; font-weight: 700;
    letter-spacing: 4px;
    font-family: ui-monospace, "SF Mono", Monaco, monospace;
    color: var(--text-main);
}
.wb-invite-copy {
    background: transparent; border: none; cursor: pointer;
    color: var(--vitality-blue); font-size: 11px; font-weight: 600;
    padding: 4px 8px; border-radius: 6px;
    transition: background .15s;
}
.wb-invite-copy:hover { background: rgba(0,100,210,0.08); }
.wb-invite-copy.is-copied {
    color: var(--vitality-green);
    background: rgba(134, 184, 23, 0.1);
}

/* 邀请链接 */
.wb-invite-link-box {
    display: flex; align-items: center; gap: 6px;
    background: var(--bg-page);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 8px 10px;
}
.wb-invite-link-box .wb-invite-link {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: ui-monospace, monospace;
    font-size: 11px;
    color: var(--text-grey);
}

/* 规则 */
.wb-invite-rules {
    background: var(--bg-page);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 11px; color: var(--text-grey);
    line-height: 1.7;
}
.wb-invite-rules .wb-invite-rule {
    display: block;
}
.wb-invite-rules .wb-invite-rule b.wb-invite-reward {
    color: var(--vitality-orange); font-weight: 600;
}

/* 邀请列表 */
.wb-invite-list .invitee {
    border-top: 1px solid var(--border-soft);
    padding: 12px 0;
}
.wb-invite-list .invitee:first-child {
    border-top: none; padding-top: 4px;
}
.wb-invite-list .invitee:last-child { padding-bottom: 0; }
.wb-invite-list .invitee .invitee-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 4px;
}
.wb-invite-list .invitee .invitee-name {
    font-weight: 600; font-size: 13px; color: var(--text-main);
}
.wb-invite-list .invitee .invitee-status {
    font-size: 10px; padding: 1px 8px; border-radius: 999px;
}
.wb-invite-list .invitee .invitee-status.s-registered {
    background: rgba(127,127,127,0.16); color: var(--text-grey);
}
.wb-invite-list .invitee .invitee-status.s-firstgrade {
    background: rgba(134,184,23,0.18); color: var(--vitality-green);
}
.wb-invite-list .invitee .invitee-status.s-paid_pending {
    background: rgba(245,175,2,0.18); color: var(--vitality-orange);
}
.wb-invite-list .invitee .invitee-status.s-paid_settled {
    background: rgba(0,100,210,0.12); color: var(--vitality-blue);
}
.wb-invite-list .invitee .invitee-meta {
    font-size: 11px; color: var(--text-grey);
}
.wb-invite-list-empty {
    text-align: center; padding: 24px 0;
    color: var(--text-grey); font-size: 12px;
    line-height: 1.6;
}


/* ====================================================================
   奖励 toast 栈 + 选择 modal
   ==================================================================== */
.invite-toast-stack {
    position: fixed; top: 16px; right: 16px; z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: 10px;
    width: 320px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
.invite-toast {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 32px 12px 14px;
    box-shadow: var(--float-shadow);
    font-size: 13px;
    color: var(--text-main);
    pointer-events: auto;
    animation: inviteToastIn 360ms cubic-bezier(.32,.72,0,1);
}
@keyframes inviteToastIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.invite-toast .toast-title {
    font-weight: 700; margin-bottom: 4px;
}
.invite-toast .toast-desc {
    color: var(--text-grey); font-size: 12px; line-height: 1.5;
}
.invite-toast .toast-cta {
    background: transparent; border: none; cursor: pointer;
    color: var(--vitality-blue); font-size: 12px; font-weight: 600;
    padding: 0; margin-top: 6px;
}
.invite-toast .toast-close {
    position: absolute; top: 6px; right: 10px;
    background: transparent; border: none; color: var(--text-grey);
    cursor: pointer; font-size: 16px; line-height: 1;
}
.invite-toast.is-leaving {
    animation: inviteToastOut 220ms ease forwards;
}
@keyframes inviteToastOut {
    to { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

/* 选择奖励 modal */
.invite-reward-mask {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    z-index: var(--z-mask);
    display: flex; align-items: center; justify-content: center;
    animation: inviteRewardMaskIn 200ms ease;
}
@keyframes inviteRewardMaskIn { from { opacity: 0; } to { opacity: 1; } }
.invite-reward-modal {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 28px;
    width: 380px; max-width: calc(100vw - 32px);
    box-shadow: var(--float-shadow);
    animation: inviteRewardIn 380ms cubic-bezier(.32,.72,0,1);
}
@keyframes inviteRewardIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); filter: blur(4px); }
    to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}
.invite-reward-modal h2 {
    margin: 0 0 4px; font-size: 17px; font-weight: 700;
    color: var(--text-main);
}
.invite-reward-modal .sub {
    font-size: 13px; color: var(--text-grey); margin-bottom: 22px;
    line-height: 1.5;
}
.invite-reward-modal .sub b { color: var(--text-main); font-weight: 600; }
.invite-reward-modal .opt-list {
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 16px;
}
.invite-reward-modal .opt {
    background: var(--bg-page);
    border: 2px solid var(--border-soft);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    display: flex; align-items: center; gap: 12px;
    transition: border-color .2s, background .2s;
}
.invite-reward-modal .opt:hover { border-color: var(--vitality-blue); }
.invite-reward-modal .opt.selected {
    border-color: var(--vitality-blue);
    background: rgba(0,100,210,0.06);
}
.invite-reward-modal .opt-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,100,210,0.08);
    color: var(--vitality-blue);
    flex-shrink: 0;
}
.invite-reward-modal .opt.opt-credits .opt-icon {
    background: rgba(245,175,2,0.12);
    color: var(--vitality-orange);
}
.invite-reward-modal .opt-body { flex: 1; }
.invite-reward-modal .opt-title {
    font-weight: 700; font-size: 14px; margin-bottom: 2px;
    color: var(--text-main);
}
.invite-reward-modal .opt-desc { font-size: 11px; color: var(--text-grey); }
.invite-reward-modal .opt-badge {
    font-size: 10px; padding: 2px 8px; border-radius: 999px;
    background: rgba(0,100,210,0.12); color: var(--vitality-blue);
    font-weight: 600;
}
.invite-reward-modal .actions { display: flex; gap: 10px; }
.invite-reward-modal .btn-confirm {
    flex: 1; padding: 11px 0;
    background: var(--vitality-blue); color: #fff;
    border: none; border-radius: 10px;
    font-weight: 700; font-size: 14px; cursor: pointer;
    transition: background .15s;
}
.invite-reward-modal .btn-confirm:hover { background: var(--vitality-blue-hover, #004FB3); }
.invite-reward-modal .btn-confirm:disabled {
    opacity: 0.5; cursor: not-allowed;
}
.invite-reward-modal .btn-cancel {
    padding: 11px 18px;
    background: var(--bg-page);
    border: 1px solid var(--border-soft); color: var(--text-main);
    border-radius: 10px; font-weight: 600; font-size: 13px; cursor: pointer;
}
