/* ============================================================
   xbd.css —— 「下班倒计时」独立组件样式
   - 看板小卡片：360×160 白色圆角卡，左侧“下班还有 + 时间 + 打工狗”，
     右侧 2×2 彩色统计块（发薪 / 假期 / 周五 / 日赚），卡片下方显示名称。
   - 设置弹窗（.xbd-mask）：点击卡片弹出，左侧实时预览，右侧 7 项设置。
   - 卡片字体色/背景色由 CSS 变量 --xbd-font / --xbd-bg 驱动，弹窗中可实时切换。
   ============================================================ */

/* ===== 看板卡片（完整版）：宽度撑满左侧组件区，高度为两排网址图标，
   与右侧网址图标在同一网格中排列；多张组件卡片在左侧组件区内垂直堆叠 ===== */
.widget-card[data-widget="countdown"] {
    width: 100%;
    max-width: 100%;
    --xbd-bg: #ffffff;
    --xbd-font: #454a58;
    background: var(--xbd-bg);
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 26px rgba(31, 45, 80, 0.14);
    padding: 12px 16px;
    height: var(--widget-h);  /* = 两排网址图标方块高度，卡片底对齐第二排图标底 */
    margin-bottom: 0;        /* 卡片名为绝对定位，名称空间由看板 padding-bottom 统一预留 */
    color: var(--xbd-font);
    overflow: visible; /* 允许下方名称显示在卡片之外（内容区自带滚动，不会溢出圆角） */
}
.widget-card[data-widget="countdown"]:hover {
    border: none;
    box-shadow: 0 14px 30px rgba(31, 45, 80, 0.2);
}

/* 卡片内不显示标题：标题栏透明覆盖在卡片顶部，仅作拖拽区与移除按钮容器 */
.widget-card[data-widget="countdown"] .widget-head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    margin-bottom: 0;
    z-index: 5;
}
.widget-card[data-widget="countdown"] .widget-title { visibility: hidden; }
.widget-card[data-widget="countdown"] .widget-remove {
    background: rgba(60, 65, 80, 0.08);
    color: #555c6b;
}
.widget-card[data-widget="countdown"] .widget-remove:hover { background: rgba(255, 95, 109, 0.9); color: #fff; }

.widget-card[data-widget="countdown"] .widget-body {
    overflow-y: auto;
    overflow-x: hidden;
    cursor: pointer; /* 点击卡片打开设置 */
}

/* 卡片下方的组件名称（与网站快捷方式名称同款：白字 + 阴影，适配壁纸背景） */
.xbd-card-name {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--icon-gap);   /* 与网址“图标→名称”间距一致，卡片名对齐第二排图标名称行 */
    height: var(--icon-name-h);
    line-height: var(--icon-name-h);
    text-align: center;
    font-size: var(--icon-name-size, 12px);  /* 组件名称与图标名称同字号，由设置「名称大小」统一控制 */
    font-weight: 600;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

/* 两套布局共存于一个卡片，未选中的那套用 [hidden] 收起 */
.xbd[hidden] { display: none; }

/* ===== 卡片上的左右切换箭头（切到卡片两侧外缘，点击切换 完整版/简版） ===== */
.xbd-card-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;     /* 容器不挡点击，仅箭头可点 */
    z-index: 6;
}
.xbd-card-nav .xbd-nav-arrow {
    pointer-events: auto;
    cursor: pointer;
    width: 30px;
    height: 30px;
    margin: 0 -22px;          /* 探出卡片左右外缘 */
    border-radius: 50%;
    line-height: 28px;
    font-size: 22px;
    text-align: center;
    background: rgba(255, 255, 255, 0.92);
    color: #8a92a6;
    box-shadow: 0 4px 12px rgba(31, 45, 80, 0.18);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s ease, transform 0.15s var(--ease-out), color 0.15s ease;
}
.widget-card[data-widget="countdown"]:hover .xbd-card-nav .xbd-nav-arrow {
    opacity: 1;
    transform: scale(1);
}
.xbd-card-nav .xbd-nav-arrow:hover { color: #f0a93b; }

/* ===== 简版（中卡片）：宽度 = 2 个网址图标（--widget-w-2），高度 = 两排网址图标；
   在左侧组件区内水平居中 ===== */
.widget-card[data-widget="countdown"].xbd-style-mini {
    width: 153px;           /* 像素兜底：base.css 变量未加载（缓存）时也不坍缩 */
    width: var(--widget-w-2, 153px);
    padding: 10px 12px;
    height: var(--widget-h);
}
.widget-card[data-widget="countdown"].xbd-style-mini .widget-body { overflow: hidden; }

/* 简版内容：垂直居中排列 */
.xbd-mini { justify-content: center; align-items: center; }
.xbd-mini-main {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 2px;
}
.xbd-mini .xbd-label { font-size: 14px; letter-spacing: 1px; }
.xbd-mini .xbd-time {
    font-size: 22px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.xbd-mini .xbd-mascot { width: 62px; margin-top: 4px; }
.xbd-mini.is-rest .xbd-mascot { width: 66px; }

/* ===== 横条形态（小卡片）：宽度 = 2 个网址图标（--widget-w-2，与中卡片同宽）、高约 1 个图标；
   左侧文字两行，右侧吉祥物。在左侧组件区内水平居中。
   尺寸带像素兜底：即使 base.css 的新变量未加载（缓存），也不会坍缩 */
.widget-card[data-widget="countdown"].xbd-style-bar {
    /* 宽度由 widgets.js 按实测格宽锚定成 2 整格像素；此处仅为无 JS 时的兜底 */
    width: var(--widget-w-2, 153px);
    min-width: 140px;
    max-width: 100%;
    padding: 0 10px 0 14px;
    height: 56px;
    height: var(--icon-size, 56px);
    min-height: 56px;
    border-radius: 18px;
}
.widget-card[data-widget="countdown"].xbd-style-bar .widget-body {
    overflow: hidden;
    display: flex;   /* 让横条内容铺满卡片高度 */
}
/* 注意：必须用 .xbd.xbd-bar 双类提权，否则会被后面同特异性的 .xbd{flex-direction:column} 覆盖回竖排 */
.xbd.xbd-bar {
    flex: 1 1 auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}
.xbd-bar-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.15;
}
.xbd-bar .xbd-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
    color: var(--xbd-font, #6b7490);
    opacity: 0.72;
}
.xbd-bar .xbd-time {
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--xbd-font, #454a58);
}
/* .xbd-bar-mascot 同时带 .xbd-mascot 类，需后代选择器提权，否则尺寸被 .xbd-mascot 覆盖 */
.xbd-bar .xbd-bar-mascot {
    width: auto;
    height: 40px;
    flex: none;
    object-fit: contain;
    filter: none;
}
/* 休息日：完整版规则 .xbd.is-rest .xbd-mascot{width:84px}（同为 0,3,0 且定义更靠后）
   会把横条图也撑成 84px 宽的盒子、向左压住时间文字。这里用 .widget-card 前缀
   提到 0,5,0 且仅限看板（预览舞台不在 .widget-card 内，不受影响），把宽拉回 auto；
   高度统一 40px（方形），保证“时间文字 + 间距 + 图”不超出 153px 卡片。 */
.widget-card .xbd.xbd-bar.is-rest .xbd-bar-mascot {
    width: auto;
    height: 40px;
}

/* ===== 主体：左倒计时 + 右统计网格 ===== */
.xbd { display: flex; flex-direction: column; height: 100%; }
.xbd-main {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: stretch;
    gap: 10px;
}

/* 左侧 */
.xbd-left {
    width: 34%;
    min-width: 122px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}
.xbd-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--xbd-font, #6b7490);
    letter-spacing: 1px;
}
.xbd-time {
    font-size: 25px;
    font-weight: 800;
    color: var(--xbd-font, #454a58);
    line-height: 1.2;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.xbd-mascot-wrap { margin-top: 2px; line-height: 0; }
/* 透明底 PNG：drop-shadow 贴合卡通马轮廓投柔和阴影，背景色变化时依然自然 */
.xbd-mascot {
    width: 85px;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(31, 45, 80, 0.18));
}
/* 休息时换成方形「马上退休」图（260×260 透明底），高度受卡片高度约束 */
.xbd.is-rest .xbd-mascot { width: 84px; }

/* 右侧 2×2 统计块 */
.xbd-stats {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
}
.xbd-stat[hidden] { display: none; }
.xbd-stat {
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 2px;
}
.xbd-stat-blue   { background: #dde8fb; }
.xbd-stat-pink   { background: #fde2e8; }
.xbd-stat-purple { background: #efe2fb; }
.xbd-stat-cyan   { background: #dcf4f6; }
.xbd-stat-label {
    font-size: 14px;
    font-weight: 700;
    color: #6f7a92;
    letter-spacing: 1px;
    max-width: 92%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}
.xbd-stat-value {
    font-size: 11px;
    font-weight: 500;
    color: #9098a8;
    line-height: 1.2;
}
.xbd-stat-num {
    font-size: 19px;
    font-weight: 800;
    color: #596173;
    font-variant-numeric: tabular-nums;
}

/* ===== 看板「完整版」紧凑适配（仅桌面网格 >620px）=====
   桌面大卡宽度仅 4 个图标格（16 列下约 272px），默认字号下右侧 2×2 统计块的
   min-content 会超出卡片、被 .widget-body 的 overflow-x:hidden 硬裁切
   （表现为“发…/中秋…/日赚 851.3”显示不全）。移动端（≤620px）卡片单列
   流式、宽度接近全屏，不会裁切，沿用默认字号（≤420px 另有小屏断点收敛）。
   以下规则仅作用于看板真实卡片（弹窗预览舞台不在 .widget-card 内，保持宽松
   的大字号预览）：左列按内容收缩、统计网格列允许收窄、字号整体降一档，
   保证标签 / 数字 / 单位完整可见。 */
@media (min-width: 621px) {
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd-main {
    gap: 8px;
}
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd-left {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
}
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd-label {
    font-size: 13px;
    letter-spacing: 0;
}
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd-time {
    font-size: 22px;
}
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd-mascot {
    width: 62px;
}
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd.is-rest .xbd-mascot {
    width: 64px;
}
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd-stats {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
}
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd-stat {
    padding: 2px 1px;
}
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd-stat-label {
    max-width: 100%;
    font-size: 12px;
    letter-spacing: 0;
}
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd-stat-value {
    max-width: 100%;
    white-space: nowrap;
}
.widget-card[data-widget="countdown"]:not(.xbd-style-mini):not(.xbd-style-bar) .xbd-stat-num {
    font-size: 16px;
}
}

/* ============================================================
   设置弹窗
   ============================================================ */
.xbd-mask {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    /* 无遮罩：背景透明、不模糊，弹窗直接覆盖在页面上；该层仍用于居中与点击外部关闭 */
    background: transparent;
}
.xbd-dialog {
    position: relative;
    width: 960px;
    max-width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 22px;
    padding: 26px 34px 30px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}
.xbd-close {
    position: absolute;
    top: 14px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: #9aa3b2;
    font-size: 26px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
}
.xbd-close:hover { color: #4b5563; background: #f2f4f8; }
.xbd-dialog-title {
    font-size: 22px;
    font-weight: 700;
    color: #2f3640;
    margin: 0 0 22px;
}
.xbd-dialog-body {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) 1.1fr;
    gap: 26px;
    align-items: start;
}

/* ---- 左侧：样式选择（三个形态纵向排列，点击选中，选中项打勾） ---- */
.xbd-preview {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.xbd-style-opt {
    position: relative;
    display: block;
    padding: 10px 12px 12px;
    border: 2px solid #e9ecf1;
    border-radius: 16px;
    background: #f6f7f9;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.xbd-style-opt:hover { border-color: #ffd9b0; }
.xbd-style-opt.active {
    border-color: #ff8c1a;
    background: #fff6ee;
    box-shadow: 0 6px 18px rgba(255, 140, 26, 0.16);
}
.xbd-style-name {
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #8a91a0;
    margin-bottom: 8px;
}
.xbd-style-opt.active .xbd-style-name { color: #ff8c1a; }
/* 选中打勾：橙色圆钉在选项右上角 */
.xbd-style-check {
    position: absolute;
    top: -10px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff8c1a;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 24px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(255, 140, 26, 0.4);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.15s ease, transform 0.15s var(--ease-out);
}
.xbd-style-opt.active .xbd-style-check { opacity: 1; transform: scale(1); }

/* 样式小舞台：白色卡片底（字体色/背景色由 --xbd-font / --xbd-bg 驱动） */
.xbd-style-stage {
    --xbd-bg: #ffffff;
    --xbd-font: #454a58;
    background: var(--xbd-bg);
    color: var(--xbd-font);
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(31, 45, 80, 0.12);
    overflow: hidden;
    padding: 12px 14px;
}
/* 完整版舞台：内容铺满（.xbd height:100%），不用 flex 居中 */
.xbd-style-stage-full {
    display: block;
    height: 132px;
}
/* 简版 / 横条舞台：内容在其中水平、垂直居中 */
.xbd-style-stage-mini,
.xbd-style-stage-bar {
    display: flex;
    align-items: center;
    justify-content: center;
}
.xbd-style-stage-mini { height: 128px; }
.xbd-style-stage-bar { height: 64px; padding: 0 14px; }

/* 完整版：预览内容整体放大一档（左列比例加宽，时钟/图片收敛） */
.xbd-style-stage-full .xbd-main { gap: 12px; }
.xbd-style-stage-full .xbd-left { width: 44%; min-width: 0; }
.xbd-style-stage-full .xbd-time { font-size: 28px; }
.xbd-style-stage-full .xbd-label { font-size: 16px; }
.xbd-style-stage-full .xbd-mascot { width: 72px; }
.xbd-style-stage-full .xbd.is-rest .xbd-mascot { width: 76px; }
.xbd-style-stage-full .xbd-stat-label { font-size: 14px; }
.xbd-style-stage-full .xbd-stat-num { font-size: 20px; }
.xbd-style-stage-full .xbd-stat-value { font-size: 12px; }

/* 简版：居中、尺寸收敛 */
.xbd-style-stage-mini .xbd-mini {
    width: 160px;
    height: 100%;
    margin: 0 auto;
}
.xbd-style-stage-mini .xbd-mini .xbd-label { font-size: 14px; }
.xbd-style-stage-mini .xbd-mini .xbd-time { font-size: 22px; }
.xbd-style-stage-mini .xbd-mini .xbd-mascot { width: 58px; }
.xbd-style-stage-mini .xbd-mini.is-rest .xbd-mascot { width: 62px; }

/* 横条：铺满舞台、左文字右吉祥物。
   flex:none 必须加——看板规则 .xbd.xbd-bar{flex:1 1 auto} 的 flex-grow:1
   会把横条横向拉满；此处舞台本身就是白卡，横条无需自带背景/阴影 */
.xbd-style-stage-bar .xbd-bar {
    flex: none;
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.xbd-style-stage-bar .xbd-bar .xbd-label { font-size: 13px; }
.xbd-style-stage-bar .xbd-bar .xbd-time { font-size: 20px; }
.xbd-style-stage-bar .xbd-bar-mascot { height: 44px; }
.xbd-style-stage-bar .xbd-bar.is-rest .xbd-bar-mascot { height: 46px; }

/* ---- 右侧表单 ---- */
.xbd-form {
    background: #f6f7f9;
    border-radius: 16px;
    padding: 8px 18px;
}
.xbd-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 6px;
    border-bottom: 1px solid #e9ecf1;
}
.xbd-row:last-child { border-bottom: none; }
.xbd-row-label {
    flex: none;
    width: 86px;
    font-size: 17px;
    font-weight: 600;
    color: #3f4653;
}

/* 工作日复选 */
.xbd-checks {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
}
.xbd-checks label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    cursor: pointer;
}
.xbd-checks input { width: 17px; height: 17px; accent-color: #3b8cf0; cursor: pointer; }
/* 未勾选为灰色、勾选为蓝色；:has() 需 Chrome 105+，改用 JS 同步的 .is-checked 类兼容旧浏览器 */
.xbd-checks label { color: #9aa3b2; }
.xbd-checks label.is-checked { color: #3b8cf0; }

/* 工作时间 */
.xbd-time-range {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}
.xbd-to { font-size: 16px; color: #3f4653; font-weight: 600; }
.xbd-finput {
    width: 120px;
    padding: 9px 12px;
    border: 1px solid #dce1e8;
    border-radius: 10px;
    background: #fff;
    color: #333a48;
    font-size: 15px;
    font-family: inherit;
    outline: none;
}
.xbd-finput:focus { border-color: #3b8cf0; }

/* 颜色色块 */
.xbd-swatches {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}
.xbd-swatch {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    cursor: pointer;
    padding: 0;
    position: relative;
}
.xbd-swatch.active {
    outline: 3px solid #8b94a6;
    outline-offset: 1px;
}
.xbd-swatch-transparent { background: #fff; }
.xbd-swatch-picker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}
.xbd-swatch-picker input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.xbd-swatch-picker svg { pointer-events: none; }
.xbd-swatch-picker.active { outline: 3px solid #8b94a6; outline-offset: 1px; }

/* 显示更多 开关 */
.xbd-toggles {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.xbd-toggle {
    border: 1.5px solid #3b8cf0;
    background: #fff;
    color: #3b8cf0;
    font-size: 15px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.xbd-toggle.off {
    border-color: #cfd5de;
    color: #9aa3b2;
    background: #fff;
}

/* 下拉 / 数字输入 */
.xbd-field-wrap {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}
.xbd-fselect,
.xbd-fnumber {
    width: 220px;
    padding: 9px 12px;
    border: 1px solid #dce1e8;
    border-radius: 10px;
    background: #fff;
    color: #333a48;
    font-size: 16px;
    font-family: inherit;
    outline: none;
}
.xbd-fselect:focus,
.xbd-fnumber:focus { border-color: #3b8cf0; }

/* 保存提示 Toast */
.xbd-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(30, 30, 40, 0.92);
    color: #fff;
    padding: 9px 20px;
    border-radius: 20px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9999;
}
.xbd-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   深色主题覆盖（跟随 <html data-theme="dark">）
   弹窗外壳/表单/输入改为深色；左侧预览舞台 .xbd-style-stage 保持白卡，
   其内是看板里白底倒计时组件的真实预览，不做反色。
   ============================================================ */
:root[data-theme="dark"] .xbd-dialog {
    background: var(--auth-card);
    border: 1px solid var(--auth-line);
    box-shadow: 0 24px 70px var(--auth-shadow);
}
:root[data-theme="dark"] .xbd-close { color: var(--auth-muted); }
:root[data-theme="dark"] .xbd-close:hover { color: var(--auth-text); background: var(--auth-card-2); }
:root[data-theme="dark"] .xbd-dialog-title { color: var(--auth-text); }

:root[data-theme="dark"] .xbd-style-opt {
    border-color: var(--auth-line);
    background: var(--auth-card-2);
}
:root[data-theme="dark"] .xbd-style-opt:hover { border-color: rgba(255, 140, 26, 0.5); }
:root[data-theme="dark"] .xbd-style-opt.active {
    border-color: #ff8c1a;
    background: rgba(255, 140, 26, 0.12);
    box-shadow: 0 6px 18px rgba(255, 140, 26, 0.18);
}
:root[data-theme="dark"] .xbd-style-name { color: var(--auth-muted); }
:root[data-theme="dark"] .xbd-style-opt.active .xbd-style-name { color: #ffa64a; }

:root[data-theme="dark"] .xbd-form { background: var(--auth-card-2); }
:root[data-theme="dark"] .xbd-row { border-bottom-color: var(--auth-line); }
:root[data-theme="dark"] .xbd-row-label { color: var(--auth-text); }
:root[data-theme="dark"] .xbd-to { color: var(--auth-text); }

:root[data-theme="dark"] .xbd-checks label { color: var(--auth-muted); }
:root[data-theme="dark"] .xbd-checks label.is-checked { color: #7cb0ff; }

:root[data-theme="dark"] .xbd-finput,
:root[data-theme="dark"] .xbd-fselect,
:root[data-theme="dark"] .xbd-fnumber {
    background: var(--auth-bg);
    border-color: var(--auth-line);
    color: var(--auth-text);
}
:root[data-theme="dark"] .xbd-finput:focus,
:root[data-theme="dark"] .xbd-fselect:focus,
:root[data-theme="dark"] .xbd-fnumber:focus { border-color: #3b8cf0; }

:root[data-theme="dark"] .xbd-toggle { background: var(--auth-card); color: #7cb0ff; border-color: #3b8cf0; }
:root[data-theme="dark"] .xbd-toggle.off {
    border-color: var(--auth-line);
    color: var(--auth-muted);
    background: var(--auth-card);
}
:root[data-theme="dark"] .xbd-swatch,
:root[data-theme="dark"] .xbd-swatch-picker { border-color: rgba(255, 255, 255, 0.18); }
:root[data-theme="dark"] .xbd-swatch-transparent { background: #fff; }
:root[data-theme="dark"] .xbd-swatch.active,
:root[data-theme="dark"] .xbd-swatch-picker.active { outline-color: #b8c4e0; }

/* ===== 小屏适配：卡片宽度随 --widget-w 自动收缩（span 4 ≈ 整行），仅收敛高度与字号 ===== */
@media (max-width: 420px) {
    .widget-card[data-widget="countdown"] {
        height: 150px;
        padding: 8px 12px 10px;
    }
    .xbd-left { min-width: 104px; }
    .xbd-time { font-size: 24px; }
    .xbd-label { font-size: 13px; }
    .xbd-mascot { width: 60px; }
    .xbd.is-rest .xbd-mascot { width: 66px; }
    .xbd-stats { gap: 6px; }
    .xbd-stat { border-radius: 10px; }
    .xbd-stat-label { font-size: 12px; letter-spacing: 0; }
    .xbd-stat-num { font-size: 16px; }
    .xbd-stat-value { font-size: 10px; }
}
@media (max-width: 760px) {
    .xbd-dialog-body { grid-template-columns: 1fr; }
    .xbd-row { flex-wrap: wrap; }
    .xbd-row-label { width: auto; }
}
