/* ========== 定时任务 Hub（监控指挥中心，自包含高对比配色 + 纯白实底）
   设计方向：1:1 照搬 定时任务中心-demo.html 的布局与信息密度。
   - 窗口纯白不透明（#ffffff 实色），不使用 backdrop-filter / 半透明背景，兼容旧 CEF。
   防回归：旧 base.css / CDN 边缘缓存可能使全局 --text-primary 解析为白字，
   导致弹窗白字隐没。此处用 .modal.task-hub-modal 作用域内的 --th-* 变量自包含配色。 ========== */

.modal.task-hub-modal {
    /* 浅色默认配色（自包含，不引用任何全局变量） */
    --th-text: #0f172a;
    --th-text-2: #475569;
    --th-text-3: #64748b;
    --th-bg: #ffffff;
    --th-bg-2: #f8fafc;
    --th-bg-3: #f1f5f9;
    --th-bg-hover: #eef2ff;
    --th-border: #e2e8f0;
    --th-border-2: #f1f5f9;
    --th-primary: #6366f1;
    --th-primary-soft: rgba(99, 102, 241, 0.12);
    --th-success: #16a34a;
    --th-success-bg: rgba(34, 197, 94, 0.12);
    --th-warning: #d97706;
    --th-warning-bg: rgba(245, 158, 11, 0.12);
    --th-danger: #dc2626;
    --th-danger-bg: rgba(239, 68, 68, 0.1);
    --th-radius-sm: 8px;
    --th-radius-md: 10px;
    --th-radius-lg: 14px;
    --th-radius-xl: 18px;
    --th-radius-full: 9999px;
    --th-shadow-sm: none; /* 浅色：卡片默认无重阴影 */
    --th-shadow: none; /* 弹窗整体不投影，避免在灰色遮罩上形成“右侧阴影” */
    --th-card-hover: 0 6px 18px rgba(15, 23, 42, 0.08); /* 浅色：hover 仅极轻浮起 */
    --th-glow: 0; /* 浅色：关闭卡片右上光晕（即“右侧重阴影”） */
    --th-icon-shadow: none; /* 浅色：图标无彩色投影 */
    --th-icon-glow: 0; /* 浅色：图标无外发光 */

    width: 960px;
    max-width: 94vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    position: relative;
    background: var(--th-bg);
    color: var(--th-text);
    box-shadow: var(--th-shadow);
    border: 1px solid var(--th-border);
    /* 兼容性：不支持 backdrop-filter 的引擎保持实色，绝不透明 */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
/* 纯白实底，无环境光 / 光球（用户要求窗口纯白、不透明） */
.modal.task-hub-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: transparent;
    z-index: 0;
}

/* 修复：给弹窗内所有可见元素建立独立层叠上下文，确保文字/卡片/详情正常渲染（旧 CEF 合成层坑） */
.modal.task-hub-modal,
.modal.task-hub-modal .modal-header,
.modal.task-hub-modal .task-hub-header,
.modal.task-hub-modal .th-kpis,
.modal.task-hub-modal .th-kpi,
.modal.task-hub-modal .th-kpi-num,
.modal.task-hub-modal .th-kpi-label,
.modal.task-hub-modal .th-kpi-sub,
.modal.task-hub-modal .th-kpi-ico,
.modal.task-hub-modal .modal-title,
.modal.task-hub-modal .th-grid,
.modal.task-hub-modal .task-hub-card,
.modal.task-hub-modal .th-card-head,
.modal.task-hub-modal .th-card-ico,
.modal.task-hub-modal .th-card-title,
.modal.task-hub-modal .th-card-name,
.modal.task-hub-modal .th-card-sched,
.modal.task-hub-modal .th-card-spark,
.modal.task-hub-modal .th-card-foot,
.modal.task-hub-modal .th-card-count,
.modal.task-hub-modal .th-card-last,
.modal.task-hub-modal .th-badge,
.modal.task-hub-modal .th-switch,
.modal.task-hub-modal .task-hub-drawer,
.modal.task-hub-modal .task-hub-scrim,
.modal.task-hub-modal .th-drawer-head,
.modal.task-hub-modal .th-drawer-name,
.modal.task-hub-modal .th-drawer-body,
.modal.task-hub-modal .th-ring-hero,
.modal.task-hub-modal .th-ring,
.modal.task-hub-modal .th-block,
.modal.task-hub-modal .th-fold,
.modal.task-hub-modal .th-section-title,
.modal.task-hub-modal .th-field-name,
.modal.task-hub-modal .th-field-desc,
.modal.task-hub-modal .th-run-shop,
.modal.task-hub-modal .th-run-row,
.modal.task-hub-modal .task-hub-empty {
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .modal.task-hub-modal {
    --th-text: #eef2ff;
    --th-text-2: #c7d2fe;
    --th-text-3: #8b96b8;
    --th-bg: #0f172a;
    --th-bg-2: #141d33;
    --th-bg-3: #1b2540;
    --th-bg-hover: #1d2c4b;
    --th-border: #2a3553;
    --th-border-2: #141d33;
    --th-primary: #818cf8;
    --th-primary-soft: rgba(129, 140, 248, 0.18);
    --th-success: #34d399;
    --th-success-bg: rgba(52, 211, 153, 0.16);
    --th-warning: #fbbf24;
    --th-warning-bg: rgba(251, 191, 36, 0.16);
    --th-danger: #f87171;
    --th-danger-bg: rgba(248, 113, 113, 0.18);
    --th-shadow-sm: none;
    --th-shadow: none; /* 深色：弹窗整体同样不投影 */
    --th-card-hover: 0 24px 56px rgba(0, 0, 0, 0.5);
    --th-glow: 0.18; /* 暗色：保留卡片右上光晕 */
    --th-icon-shadow: 0 8px 22px -6px var(--th-accent, var(--th-primary));
    --th-icon-glow: 0.45;
    border-color: var(--th-border);
}

/* ===== 头部：标题 + 关闭 ===== */
.task-hub-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--th-border-2);
    flex: 0 0 auto;
}
.task-hub-header .modal-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--th-text);
}
.task-hub-header .modal-close { margin-left: auto; }

/* ===== 主体：KPI 行 + 监控卡片网格 ===== */
.task-hub-body {
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== 顶部 KPI（照搬 demo：4 张大卡，图标块 + 大数字 + 火花线）===== */
.th-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 18px 20px 4px;
    flex: 0 0 auto;
}
.th-kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    border-radius: var(--th-radius-xl);
    background: linear-gradient(145deg, var(--th-bg) 0%, var(--th-bg-2) 100%);
    border: 1px solid var(--th-border);
    overflow: hidden;
    box-shadow: var(--th-shadow-sm);
    animation: thRise 0.5s cubic-bezier(0.19, 1, 0.22, 1) both;
}
.th-kpis .th-kpi:nth-child(2) { animation-delay: 0.05s; }
.th-kpis .th-kpi:nth-child(3) { animation-delay: 0.1s; }
.th-kpis .th-kpi:nth-child(4) { animation-delay: 0.15s; }
@keyframes thRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.th-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.th-kpi-label { font-size: 12px; color: var(--th-text-3); font-weight: 600; letter-spacing: 0.02em; }
.th-kpi-ico {
    width: 30px; height: 30px; border-radius: var(--th-radius-md);
    display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.th-kpi-num {
    font-size: 30px; font-weight: 800; line-height: 1.05;
    margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; color: var(--th-text);
}
.th-kpi--danger .th-kpi-num { color: var(--th-danger); }
.th-kpi--ok .th-kpi-num { color: var(--th-success); }
.th-kpi-sub { font-size: 11.5px; color: var(--th-text-3); margin-top: 3px; }
.th-kpi-spark { position: absolute; right: 10px; bottom: 8px; width: 78px; height: 34px; opacity: 0.9; pointer-events: none; }

/* ===== 监控卡片网格 ===== */
.th-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    padding: 16px 20px 20px;
    overflow: auto;
    align-content: start;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
}
.th-grid.th-grid--single { grid-template-columns: 1fr; justify-items: center; }
.th-grid.th-grid--single .task-hub-card { width: 100%; max-width: 400px; }

/* 监控卡片（照搬 demo：玻璃由 @supports 提供；左侧竖条 hover 显；图标外发光；hover 上浮）*/
.task-hub-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 14px;
    min-height: 188px;
    border-radius: var(--th-radius-lg);
    border: 1px solid var(--th-border);
    background: linear-gradient(155deg, var(--th-bg) 0%, var(--th-bg-2) 55%, var(--th-bg-3) 100%);
    color: var(--th-text);
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    animation: thCardIn 0.5s cubic-bezier(0.19, 1, 0.22, 1) both;
    box-shadow: none;
}
@keyframes thCardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.task-hub-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--th-accent, var(--th-primary)), var(--th-accent-2, var(--th-primary)));
    opacity: 0;
    transition: opacity 0.2s ease;
}
.task-hub-card:hover::before { opacity: 0.6; }
.task-hub-card:hover {
    transform: translateY(-5px);
    box-shadow: none;
    border-color: var(--th-accent, var(--th-primary));
}
.task-hub-card.active {
    border-color: var(--th-accent, var(--th-primary));
    box-shadow: 0 0 0 3px var(--th-primary-soft);
}
.task-hub-card .th-card-glow {
    display: none;
    position: absolute;
    width: 180px; height: 180px; border-radius: 50%;
    background: var(--th-accent, var(--th-primary));
    filter: blur(60px);
    opacity: var(--th-glow);
    top: -66px; right: -44px;
    pointer-events: none;
}
.th-card-head { display: flex; align-items: center; gap: 13px; }
.th-card-ico {
    flex: 0 0 40px; width: 40px; height: 40px;
    border-radius: var(--th-radius-md);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--th-accent, var(--th-primary)), var(--th-accent-2, var(--th-primary)));
    box-shadow: var(--th-icon-shadow);
    position: relative; z-index: 1;
}
.th-card-ico::after {
    content: ''; position: absolute; inset: -6px; border-radius: 13px;
    background: inherit; filter: blur(12px); opacity: var(--th-icon-glow); z-index: -1;
}
/* 无论深浅：图标外发光关闭，避免右侧/四周残留光圈阴影 */
.modal.task-hub-modal .th-card-ico::after { display: none; }
/* 卡片 / KPI 背景改为纯色实底 + 彻底去除任何投影（消除 155°/145° 渐变造成的“右侧深浅差”与右侧阴影） */
.modal.task-hub-modal .task-hub-card,
.modal.task-hub-modal .th-kpi { background: var(--th-bg); box-shadow: none; }
.th-card-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.th-card-name { font-size: 14.5px; font-weight: 700; color: var(--th-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-card-sched { font-size: 11.5px; color: var(--th-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-card-spark { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.th-card-spark-cap { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; font-weight: 600; color: var(--th-text-3); letter-spacing: 0.02em; }
.th-card-spark-cap .m { color: var(--th-success); font-weight: 700; }
.th-card-spark-body { width: 100%; height: 40px; display: block; }
.th-card-spark-body svg, .th-card-area { width: 100%; height: 100%; display: block; }
.th-card-spark--empty { align-items: center; justify-content: center; min-height: 52px; }
.th-card-spark-empty { font-size: 11.5px; color: var(--th-text-3); }
.th-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.th-card-count { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.th-card-ring { flex: 0 0 auto; width: 24px; height: 24px; position: relative; display: inline-flex; }
.th-card-ring svg { display: block; transform: rotate(-90deg); }
.th-card-ring-track { fill: none; stroke: var(--th-border); stroke-width: 3; }
.th-card-ring-prog { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 0.9s linear; }
.th-card-count-txt { display: flex; flex-direction: column; line-height: 1.08; min-width: 0; }
.th-card-count-num { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; color: var(--th-text); }
.th-card-count-l { font-size: 10px; color: var(--th-text-3); font-weight: 600; }
.th-card-last {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
    background: var(--th-bg-3); color: var(--th-text-2); white-space: nowrap;
}
.th-card-last .d { width: 7px; height: 7px; border-radius: 50%; background: var(--th-text-3); }
.th-card-last.ok { color: var(--th-success); }
.th-card-last.ok .d { background: var(--th-success); }
.th-card-last.err { color: var(--th-danger); }
.th-card-last.err .d { background: var(--th-danger); }
.th-card-last.warn { color: var(--th-warning); }
.th-card-last.warn .d { background: var(--th-warning); }
.th-card-last.muted { color: var(--th-text-3); }

/* 自包含开关（修复原 .th-card-switch/.th-detail-switch 类名不匹配导致裸 checkbox 的 bug） */
.th-switch { position: relative; width: 38px; height: 21px; flex: 0 0 auto; display: inline-block; }
.th-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.th-switch .th-switch-track {
    position: absolute; inset: 0; border-radius: 999px;
    background: var(--th-border); cursor: pointer; transition: background 0.2s ease;
}
.th-switch .th-switch-track::after {
    content: ''; position: absolute; width: 17px; height: 17px; left: 2px; top: 2px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.th-switch input:checked + .th-switch-track { background: var(--th-accent, var(--th-primary)); }
.th-switch input:checked + .th-switch-track::after { transform: translateX(17px); }
.th-switch input:focus-visible + .th-switch-track { box-shadow: 0 0 0 3px var(--th-primary-soft); }

/* 状态徽章 + 运行中脉冲（照搬 demo .c-status） */
.th-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--th-radius-full);
    white-space: nowrap; flex: 0 0 auto;
}
.th-badge .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.th-badge--running { color: var(--th-success); background: var(--th-success-bg); }
.th-badge--running .d { box-shadow: 0 0 0 0 var(--th-success); animation: thBeat 1.5s ease-out infinite; }
@keyframes thBeat { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); } 70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.th-badge--idle { color: var(--th-text-3); background: var(--th-bg-3); }
.th-badge--paused { color: var(--th-warning); background: var(--th-warning-bg); }
.th-badge--error { color: var(--th-danger); background: var(--th-danger-bg); }

/* 卡片头部「任务设置」按钮（位于状态徽章左侧） */
.th-card-settings {
    flex: 0 0 auto;
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-right: 2px;
    border: 1px solid var(--th-border);
    background: var(--th-bg-2);
    color: var(--th-text-2);
    border-radius: 8px;
    cursor: pointer; padding: 0;
    transition: color .15s, background .15s, border-color .15s, transform .2s ease;
}
.th-card-settings:hover {
    color: var(--th-primary);
    background: var(--th-primary-soft);
    border-color: var(--th-primary);
    transform: rotate(35deg);
}
.th-card-settings:active { transform: rotate(35deg) scale(.9); }
.th-card-settings svg { display: block; }

/* ===== 详情抽屉（右侧滑出） ===== */
.task-hub-scrim {
    position: absolute; inset: 0;
    background: rgba(10, 15, 30, 0.42);
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    z-index: 5;
}
.task-hub-scrim.show { opacity: 1; visibility: visible; }
.task-hub-drawer {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 460px; max-width: 94%;
    background: var(--th-bg);
    border-left: 1px solid var(--th-border);
    box-shadow: none;
    transform: translateX(100%);
    transition: transform 0.34s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex; flex-direction: column;
    z-index: 10;
}
.task-hub-drawer.open { transform: none; }
.th-drawer-head {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px 14px; border-bottom: 1px solid var(--th-border-2);
    flex: 0 0 auto;
}
.th-drawer-name {
    flex: 1 1 auto; min-width: 0;
    display: flex; align-items: center; gap: 9px;
    font-size: 18px; font-weight: 800; color: var(--th-text);
}
.th-drawer-close {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: var(--th-radius-md);
    border: 1px solid var(--th-border); background: var(--th-bg-2); color: var(--th-text-2);
    cursor: pointer; display: grid; place-items: center;
    transition: border-color 0.15s, color 0.15s;
}
.th-drawer-close:hover { border-color: var(--th-danger); color: var(--th-danger); }
.th-drawer-body { flex: 1 1 auto; overflow: auto; padding: 20px 22px 28px; }

/* 倒计时圆环 hero（照搬 demo .hero） */
.th-ring-hero {
    display: flex; align-items: center; gap: 18px;
    padding: 18px; border-radius: var(--th-radius-lg);
    background: linear-gradient(135deg, var(--th-bg) 0%, var(--th-bg-2) 100%);
    border: 1px solid var(--th-border);
    margin-bottom: 22px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.th-ring { flex: 0 0 auto; position: relative; width: 80px; height: 80px; }
.th-ring svg { transform: rotate(-90deg); }
.th-ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.th-ring-big { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.th-ring-sm { font-size: 9px; color: var(--th-text-3); margin-top: 1px; }
.th-hero-info { flex: 1 1 auto; min-width: 0; }
.th-hero-label { font-size: 11px; color: var(--th-text-3); font-weight: 600; margin-bottom: 5px; }
.th-hero-row { display: flex; align-items: baseline; gap: 8px; }
.th-hero-time { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; color: var(--th-text); }
.th-hero-sched { font-size: 12px; color: var(--th-text-2); }
.th-hero-toggle { margin-top: 10px; display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--th-text-2); font-weight: 600; }

/* 24h 面积图 */
.th-block { margin-bottom: 22px; }
.th-block-t {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; font-weight: 700; color: var(--th-text-3);
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px;
}
.th-block-meta { font-weight: 600; text-transform: none; color: var(--th-text-2); }
.th-chart { width: 100%; height: 130px; display: block; }
.th-grid-line { stroke: var(--th-border); stroke-width: 1; }
.th-chart-dot { filter: drop-shadow(0 0 6px var(--th-accent, var(--th-primary))); }
.th-chart-empty { padding: 40px 0; text-align: center; color: var(--th-text-2); font-size: 12.5px; background: linear-gradient(135deg, var(--th-bg) 0%, var(--th-bg-2) 100%); border: 1px dashed var(--th-border); border-radius: var(--th-radius-md); }
.th-chart-hit { cursor: crosshair; }
.th-chart-tip {
    position: fixed; z-index: 9999; pointer-events: none;
    background: rgba(15, 23, 42, 0.92); color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 6px;
    padding: 4px 8px; font-size: 11px; font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    opacity: 0; transition: opacity 0.15s ease;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.th-chart-tip-dot { width: 6px; height: 6px; border-radius: 50%; }

/* 折叠设置 */
.th-fold { margin-top: 12px; background: transparent; }
.th-fold-title { font-size: 12px; font-weight: 700; color: var(--th-text-2); margin: 2px 0 8px; padding-left: 2px; }
.th-fold-b { display: block; }
.th-fold-b > div { overflow: visible; }

/* ===== 配置区块（沿用） ===== */
.th-section { margin-bottom: 20px; }
.th-section-title {
    font-size: 11px; font-weight: 700; color: var(--th-text-3);
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; padding-left: 2px;
}
.th-field {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 12px 2px; border-bottom: 1px solid var(--th-border-2);
}
.th-field:last-child { border-bottom: none; }
.th-field--block { flex-direction: column; align-items: stretch; gap: 8px; }
.th-field-info { min-width: 0; }
.th-field-name { font-size: 13px; font-weight: 600; color: var(--th-text); }
.th-field-desc { font-size: 11px; color: var(--th-text-2); margin-top: 3px; line-height: 1.55; }
.th-select {
    padding: 7px 10px; border-radius: var(--th-radius-sm); border: 1px solid var(--th-border);
    background: var(--th-bg); color: var(--th-text); font-size: 13px; min-width: 130px; cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.th-select:focus { outline: none; border-color: var(--th-primary); box-shadow: 0 0 0 3px var(--th-primary-soft); }
.th-time { width: 96px; padding: 6px 8px; border-radius: var(--th-radius-sm); border: 1px solid var(--th-border); background: var(--th-bg); color: var(--th-text); font-size: 13px; }
.th-quiet { display: flex; align-items: center; gap: 6px; }
.th-quiet-sep { color: var(--th-text-2); font-size: 12px; }

/* 运行记录 */
/* 运行记录：竖向时间轴 */
.th-runs { margin-top: 4px; font-size: 12px; color: var(--th-text-2); max-height: 300px; overflow: auto; }
.th-runs-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.th-sum-pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.th-sum-ok { color: var(--th-success); background: var(--th-success-bg); }
.th-sum-bad { color: var(--th-danger); background: var(--th-danger-bg); }
.th-sum-warn { color: var(--th-warning); background: var(--th-warning-bg); }
.th-sum-muted { color: var(--th-text-3); background: var(--th-bg-3); }
.th-runs-refresh { margin-left: auto; font-size: 12px; padding: 3px 10px; border-radius: var(--th-radius-sm); border: 1px solid var(--th-border); background: var(--th-bg); color: var(--th-text); cursor: pointer; transition: border-color 0.15s ease; }
.th-runs-refresh:hover { border-color: var(--th-primary); }
.th-tl { display: flex; flex-direction: column; }
.th-tl-item { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding-bottom: 14px; }
.th-tl-item:last-child { padding-bottom: 0; }
.th-tl-item::before { content: ''; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: var(--th-border-2); }
.th-tl-item:last-child::before { display: none; }
.th-tl-dot { width: 16px; height: 16px; border-radius: 50%; margin-top: 1px; background: var(--c, var(--th-success)); box-shadow: 0 0 0 3px var(--th-bg); }
.th-tl-body { min-width: 0; }
.th-tl-top { display: flex; align-items: center; gap: 8px; }
.th-tl-shop { font-weight: 600; color: var(--th-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-tl-status { font-weight: 700; font-size: 12px; color: var(--c, var(--th-text-2)); }
.th-tl-time { margin-left: auto; color: var(--th-text-3); font-size: 11px; white-space: nowrap; }
.th-tl-sub { margin-top: 3px; color: var(--th-text-2); font-size: 11.5px; }
.th-tl-err { margin-top: 5px; }
.th-tl-err summary { cursor: pointer; color: var(--th-danger); font-size: 11px; user-select: none; outline: none; }
.th-tl-err pre { margin: 5px 0 0; padding: 6px 8px; background: var(--th-bg-2); border-radius: var(--th-radius-sm); color: var(--th-danger); font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; max-height: 120px; overflow: auto; }
.th-runs-empty, .th-runs-loading { padding: 10px 0; color: var(--th-text-2); }

/* 空态 */
.task-hub-empty { padding: 48px 0; text-align: center; color: var(--th-text-2); font-size: 13px; }

/* 窄屏：网格单列 */
@media (max-width: 680px) {
    .th-kpis { grid-template-columns: repeat(2, 1fr); }
    .th-grid { grid-template-columns: 1fr; }
    .task-hub-drawer { width: 100%; }
}

/* 用户要求：窗口纯白、不透明 —— 已移除毛玻璃 / 浮动光球 / 半透明背景，全程实色。 */
@media (prefers-reduced-motion: reduce) {
    .modal.task-hub-modal *, .modal.task-hub-modal::before, .modal.task-hub-modal::after { animation: none !important; }
}

/* ===== 成就墙 ===== */
.achievement-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    padding: 4px 2px;
}
.achievement-card {
    position: relative;
    border-radius: 16px;
    padding: 18px 14px 16px;
    text-align: center;
    background: linear-gradient(160deg, var(--bg-card), color-mix(in srgb, var(--bg-card) 90%, var(--primary) 4%));
    border: 1px solid var(--border-color-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform .2s cubic-bezier(0.4,0,0.2,1), box-shadow .2s ease;
}
.achievement-card.locked { filter: grayscale(1); opacity: .5; }
.achievement-card.unlocked { border-color: color-mix(in srgb, var(--primary) 30%, var(--border-color-light)); }
.achievement-card.unlocked:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.1); }
.achievement-icon {
    font-size: 36px; line-height: 1; margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}
.achievement-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.achievement-desc { font-size: 11.5px; color: var(--text-secondary); margin: 4px 0 10px; line-height: 1.4; }
.achievement-reward {
    display: inline-block; font-size: 12px; color: var(--primary); font-weight: 700;
    padding: 2px 10px; border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.achievement-badge {
    position: absolute; top: 9px; right: 9px;
    font-size: 10px; padding: 2px 7px; border-radius: 8px; font-weight: 700;
    background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success);
    letter-spacing: .3px;
}
.achievement-badge.locked { background: var(--bg-tertiary); color: var(--text-tertiary); }
/* 稀有度边框 + 光效 */
.achievement-card.ach-rare { border-color: #60a5fa; box-shadow: 0 0 0 1px #60a5fa inset, 0 0 14px rgba(96,165,250,0.25); }
.achievement-card.ach-epic { border-color: #a78bfa; box-shadow: 0 0 0 1px #a78bfa inset, 0 0 16px rgba(167,139,250,0.3); }
.achievement-card.ach-legendary {
    border-color: #f59e0b;
    background: linear-gradient(160deg, color-mix(in srgb, #f59e0b 10%, var(--bg-card)), var(--bg-card));
    box-shadow: 0 0 0 1px #f59e0b inset, 0 0 20px rgba(245,158,11,0.45);
}
