/* =====================================================================
   魔方办公 · 主样式（布局 / 顶栏 / 导航 / 磁贴）
   ===================================================================== */

:root {
    /* 卡片底色透明度：0.1 ~ 1，设置面板可调 */
    --card-alpha: .55;
    --card: rgba(255, 255, 255, var(--card-alpha));
    --card-solid: #ffffff;
    --line: rgba(0, 0, 0, .07);
    --text: #20242c;
    --muted: #8d96a5;
    --accent: #4a7cf7;
    --radius: 13px;
    --shadow: 0 3px 12px rgba(16, 24, 40, .09);
    --shadow-lg: 0 18px 48px rgba(16, 24, 40, .22);
    /* 布局基准由 JS 按视口实时计算（对齐原站缩放逻辑）：--cols 为半列数，--cell 为半列宽=行高 */
    --ui-scale: 1;
    --cols: 12;
    --cell: 51px;
    --col-gap: 22px;
    /* 行间距留出卡片下方标题的位置（标题浮在卡片外的那道缝里） */
    --row-gap: 22px;
    --gap: 20px;
    --icon: 44px;
}

/* 密度档位只缩放系数，实际列数/卡尺寸由 JS 统一计算，保证恒正方的自适应布局 */
body.density-compact  { --ui-scale: .9; }
body.density-standard { --ui-scale: 1; }
body.density-loose    { --ui-scale: 1.12; }

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0; min-height: 100%;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
body { background: #10151f; overflow-x: hidden; }

/* 背景 */
.bg-layer {
    position: fixed; inset: 0; z-index: -2;
    background-size: cover; background-position: center;
    transition: background .5s ease;
}
.bg-blur {
    position: fixed; inset: 0; z-index: -1;
    background: rgba(6, 10, 20, .16); pointer-events: none;
}
/* 简约模式规则统一放在文件末尾（见「简约模式：浅灰底 + 纯白卡片」一节），此处不重复定义 */

/* 顶栏：时钟 / 搜索框 / 功能按钮 三栏，搜索框严格居中 */
.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 680px) minmax(0, 1fr);
    align-items: center; column-gap: 16px;
    position: relative; z-index: 20;
    max-width: min(100%, 1440px); margin: 0 auto;
    /* 搜索框上边距页面顶部 40px（三栏同行，.tb-mid 顶部对齐，padding-top 即为该距离） */
    padding: 40px 68px 8px;
}
/* 页头信息栏：仅备案号（友情链接已移到页脚，后台「友情链接」「站点设置 → 页头与页脚」控制） */
.head-links {
    position: relative; z-index: 12;
    max-width: min(100%, 1440px); margin: 2px auto 0;
    padding: 0 68px;
}
.head-links .hl-in {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    min-height: 22px; padding: 1px 2px;
    color: rgba(255, 255, 255, .76); font-size: 12px; line-height: 1.6;
    text-shadow: 0 1px 2px rgba(8, 18, 34, .35);
}
.head-links .hl-left {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
    min-width: 0; overflow: hidden;
}
.head-links .hl-label { color: rgba(255, 255, 255, .52); font-size: 11.5px; letter-spacing: .02em; }
.head-links a {
    color: rgba(255, 255, 255, .82); text-decoration: none; white-space: nowrap;
    transition: color .15s;
}
.head-links a:hover { color: #fff; text-decoration: underline; }
/* 备案号始终贴右：没有友情链接时也不会孤零零落在左边 */
.head-links .hl-icp { flex: none; margin-left: auto; color: rgba(255, 255, 255, .72); font-size: 11.5px; }
/* 有信息栏时压缩第一行卡片上方的留白，保持整体高度不变 */
body.has-headlinks .grid { margin-top: 32px; }

.tb-left {
    grid-column: 1; justify-self: start; align-self: start;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    gap: 13px;
    /* 与“搜索框 48 + 间距 15 + 热榜 26”对齐，共 89 */
    height: 89px; white-space: nowrap; min-width: 0; padding-top: 0;
}
.clock {
    font-size: 56px; font-weight: 700; letter-spacing: .5px;
    line-height: 1; color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .28);
    font-variant-numeric: tabular-nums;
}
.dateline {
    margin-top: 0; font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, .88);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .26);
}
body.simple .clock { color: #1f2937; text-shadow: none; }
body.simple .dateline { color: #4b5563; text-shadow: none; }

.tb-mid {
    grid-column: 2; position: relative;
    width: 100%; min-width: 0;
}
/* 搜索框与时钟同一行，去掉原来的上边距 */
.tb-mid .searchwrap { margin-top: 0; }

/* 顶栏放不下三栏时（窄屏）改为两行：上排时钟+按钮，下排搜索框 */
@media (max-width: 1360px) {
    .topbar {
        display: flex; flex-wrap: wrap; align-items: center;
        padding: 14px 16px 4px; gap: 8px;
        grid-template-columns: none;
    }
    .tb-left { position: static; transform: none; flex: 0 1 auto; gap: 4px; height: auto; }
    .clock { font-size: 27px; }
    .dateline { font-size: 11px; line-height: 1.3; }
    .tb-right { position: static; transform: none; margin-left: auto; flex: 0 0 auto; gap: 6px; }
    .tb-mid { order: 3; flex: 1 1 100%; width: auto; max-width: none; }
    .head-links { padding: 0 16px; }
}

@media (max-width: 560px) {
    .head-links { padding: 0 10px; }
    .head-links .hl-in { padding: 3px 10px; border-radius: 8px; font-size: 11.5px; gap: 8px; }
    .head-links .hl-left { gap: 3px 9px; max-height: 42px; }
    .head-links .hl-icp { font-size: 11px; }
}

/* 热榜展开：附着在搜索框下方的下拉面板（不用弹窗） */
.hot-board {
    position: absolute; left: 0; right: 0; top: 56px; z-index: 60;
    max-height: 58vh; overflow-y: auto;
    padding: 10px 12px 6px; background: rgba(255, 255, 255, .985);
    border-radius: 16px;
    box-shadow: 0 20px 54px rgba(9, 16, 30, .26), 0 2px 10px rgba(9, 16, 30, .10);
    display: none;
}
.hot-board.on { display: block; animation: hbDrop .16s ease-out; }
@keyframes hbDrop {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}
.hot-board .hb-srcrow { padding-bottom: 8px; }
.hot-board .hb-board { max-height: none; overflow: visible; }
.hot-board .hbb-row { padding: 8px 4px; }
.hot-board .hbb-row:hover { background: rgba(74, 124, 247, .06); border-radius: 8px; }
.qr-more svg { transition: transform .18s; }
.qr-more.open { background: #fff; }
.qr-more.open svg { transform: rotate(180deg); }
.searchwrap {
    position: relative; display: flex; align-items: center;
    height: 48px; background: rgba(255, 255, 255, .96);
    border-radius: 999px; box-shadow: 0 8px 26px rgba(9, 16, 30, .18);
    padding: 0 6px 0 4px; max-width: 760px; width: 100%;
}
.engine {
    display: flex; align-items: center; gap: 4px;
    padding: 0 12px 0 16px; height: 38px;
    border-right: 1px solid rgba(0, 0, 0, .07);
    font-size: 14px; color: #374151; cursor: pointer;
    user-select: none; border-radius: 999px; flex: 0 0 auto;
}
.engine:hover { background: rgba(74, 124, 247, .08); }
.engine-list {
    display: none; position: absolute; top: 50px; left: 6px;
    min-width: 148px; background: #fff; border-radius: 12px;
    box-shadow: var(--shadow-lg); padding: 6px; z-index: 40;
}
.engine-list.on { display: block; }
.engine-list div {
    padding: 9px 12px; border-radius: 8px; font-size: 13px;
    cursor: pointer; color: #374151;
}
.engine-list div:hover { background: #f1f5fb; }
.engine-list div.sel { color: var(--accent); font-weight: 600; }

.kw {
    flex: 1 1 auto; min-width: 0; border: 0; outline: 0;
    font-size: 15px; padding: 0 12px; background: transparent; color: #1f2937;
    transition: color .2s;
}
.kw.ph-out { color: transparent; }
.kw::placeholder { color: #9aa3af; }
.btn-search {
    flex: 0 0 auto; height: 38px; padding: 0 24px; border: 0;
    border-radius: 999px; background: var(--accent); color: #fff;
    font-size: 14px; font-weight: 600; cursor: pointer; transition: .18s;
}
.btn-search:hover { background: #3a6ae0; }
.btn-search:active { transform: scale(.97); }

.sug {
    display: none; position: absolute; top: 54px; left: 0; right: 0;
    background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
    overflow: hidden; z-index: 40;
}
.sug.on { display: block; }
.sug div {
    padding: 8px 16px; font-size: 12.5px; color: #4b5563;
    cursor: pointer; display: flex; gap: 8px; align-items: center;
}
.sug div:hover { background: #f4f7fd; }
.sug div b { font-weight: 600; color: #111827; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; max-width: 560px; }

/* 搜索框下方：按来源滚动的热榜条 */
.hotbar {
    display: flex; align-items: center; gap: 6px;
    margin-top: 8px; max-width: 520px; height: 28px;
    padding: 0 6px 0 5px; border-radius: 999px;
    background: rgba(10, 18, 34, .30);
    border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: #fff; overflow: hidden;
}
.hb-src {
    display: flex; align-items: center; flex: 0 0 auto;
    padding-right: 6px; border-right: 1px solid rgba(255, 255, 255, .18);
}
.hb-cur {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11.5px; font-weight: 600; color: #fff; white-space: nowrap;
    padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .18); cursor: pointer; transition: .15s;
}
.hb-cur i { font-style: normal; font-size: 9px; opacity: .85; }
.hb-cur:hover { background: rgba(255, 255, 255, .32); }
.hb-tab {
    font-size: 11px; padding: 3px 8px; border-radius: 999px; cursor: pointer;
    color: rgba(255, 255, 255, .74); white-space: nowrap; transition: .15s; user-select: none;
}
.hb-tab:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.hb-tab.on { background: rgba(255, 255, 255, .94); color: #1f2937; font-weight: 600; }
.hb-mask {
    flex: 1 1 auto; min-width: 0; overflow: hidden; position: relative;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 34px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 34px), transparent 100%);
}
.hb-track { white-space: nowrap; }
.hb-run {
    display: inline-flex; align-items: center; gap: 16px;
    animation: hbScroll linear infinite; will-change: transform;
}
@keyframes hbScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
.hb-item {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; color: rgba(255, 255, 255, .9); text-decoration: none; white-space: nowrap;
}
.hb-item:hover { color: #fff; }
.hb-item:hover .hb-title { text-decoration: underline; }
.hb-rank {
    flex: 0 0 auto; width: 15px; height: 15px; line-height: 15px; text-align: center;
    border-radius: 4px; font-size: 10px; font-weight: 700;
    background: rgba(255, 255, 255, .2); color: #fff;
}
.hb-rank.r1 { background: #ff4d4f; }
.hb-rank.r2 { background: #ff7a45; }
.hb-rank.r3 { background: #ffa940; }
.hb-more {
    flex: 0 0 auto; font-size: 11px; font-weight: 600; padding: 4px 10px; border: 0;
    border-radius: 999px; background: rgba(255, 255, 255, .92); color: #1f2937; cursor: pointer; transition: .15s;
}
.hb-more:hover { background: #fff; }
.hb-loading { font-size: 11.5px; color: rgba(255, 255, 255, .7); line-height: 28px; }

/* 搜索框下方：3 个固定链接 + 3 条热榜短标题（源站同款布局） */
.quickrow {
    display: flex; align-items: center; gap: 6px;
    margin-top: 15px; width: max-content; max-width: calc(100vw - 48px); min-height: 26px;
}
.qr-links { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.qr-link {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 9px 0 3px; border-radius: 999px;
    background: rgba(255, 255, 255, .94); color: #374151;
    font-size: 11.5px; font-weight: 600; text-decoration: none;
    box-shadow: 0 1px 4px rgba(9, 16, 30, .16);
    transition: background .16s, transform .16s;
}
.qr-link:hover { background: #fff; transform: translateY(-1px); }
.qr-ic {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 5px; overflow: hidden;
    background: rgba(74, 124, 247, .12); color: #4a7cf7; font-style: normal;
}
.qr-ic b { font-size: 10px; font-weight: 700; line-height: 1; }
.qr-ic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.qr-hot { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; min-width: 0; }
.qr-hot-item {
    display: inline-block; flex: 0 0 auto; max-width: 150px;
    height: 22px; line-height: 22px;
    padding: 0 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .78); color: #4b5563;
    font-size: 11.5px; text-decoration: none; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    transition: background .16s, color .16s;
}
.qr-hot-item:hover { background: #fff; color: #111827; }
.qr-ph { font-size: 11.5px; color: rgba(255, 255, 255, .82); }
/* 热榜取不到数据时的可点重试 */
.qr-reload {
    border: 1px dashed rgba(255, 255, 255, .5); border-radius: 999px;
    padding: 2px 10px; background: transparent; color: rgba(255, 255, 255, .92);
    font: inherit; font-size: 11.5px; cursor: pointer;
    transition: background .16s, border-color .16s;
}
.qr-reload:hover { background: rgba(255, 255, 255, .16); border-color: #fff; }
body.simple .qr-reload { border-color: #cfd6e0; color: #4b5563; }
body.simple .qr-reload:hover { background: rgba(0, 0, 0, .06); }
.qr-more {
    flex: 0 0 auto; width: 22px; height: 22px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .8); color: #4b5563; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .16s, transform .16s;
}
.qr-more:hover { background: #fff; }
.qr-more:active { transform: scale(.94); }
body.simple .qr-link { box-shadow: 0 1px 3px rgba(16, 24, 40, .10); }
body.simple .qr-hot-item { background: rgba(0, 0, 0, .06); color: #4b5563; }
body.simple .qr-hot-item:hover { background: rgba(0, 0, 0, .10); color: #111827; }
body.simple .qr-ph { color: #6b7280; }
body.simple .qr-more { background: #fff; color: #4b5563; box-shadow: 0 1px 3px rgba(16, 24, 40, .10); }

/* 窄屏：固定链接与热榜胶囊分两行，避免互相挤压 */
@media (max-width: 980px) {
    .quickrow { flex-wrap: wrap; height: auto; row-gap: 6px; width: auto; max-width: 100%; }
    .qr-hot { flex: 1 1 calc(100% - 28px); flex-wrap: wrap; }
    .qr-hot-item { flex: 0 1 auto; max-width: 150px; }
}

/* 热榜展开面板 */
.hb-srcrow {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 0 0 10px; margin-bottom: 4px; border-bottom: 1px solid rgba(15, 23, 42, .06);
}
.hbb-tab {
    font-size: 12px; padding: 4px 12px; border-radius: 999px; cursor: pointer;
    background: rgba(15, 23, 42, .06); color: #4b5563; transition: .15s; user-select: none;
}
.hbb-tab:hover { background: rgba(15, 23, 42, .12); }
.hbb-tab.on { background: var(--accent); color: #fff; font-weight: 600; }
.hb-tip { font-size: 11px; color: #a7b0bd; margin-left: auto; }
.hb-loading2 { padding: 18px 2px; font-size: 12px; color: #98a0ad; }
.hb-board { display: flex; flex-direction: column; gap: 2px; max-height: 62vh; overflow-y: auto; }
.hbb-row {
    display: flex; align-items: center; gap: 10px; padding: 9px 4px;
    border-bottom: 1px solid rgba(15, 23, 42, .06); text-decoration: none; color: #1f2937;
}
.hbb-row:hover { background: rgba(74, 124, 247, .06); }
.hbb-title { flex: 1 1 auto; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-heat { flex: 0 0 auto; font-size: 11.5px; color: #94a3b8; }
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    height: 24px; padding: 0 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .22); color: #fff;
    font-size: 11.5px; text-decoration: none;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .16);
    max-width: 210px; overflow: hidden; white-space: nowrap;
    text-overflow: ellipsis; transition: .16s;
}
.chip:hover { background: rgba(255, 255, 255, .34); }
.chip .tag {
    font-size: 9.5px; padding: 1px 4px; border-radius: 4px;
    background: rgba(255, 255, 255, .3); color: #fff; flex: 0 0 auto;
}
body.simple .chip { background: rgba(0, 0, 0, .05); color: #374151; border-color: rgba(0, 0, 0, .07); }
body.simple .chip .tag { background: rgba(0, 0, 0, .08); color: #6b7280; }

.tb-right {
    grid-column: 3; justify-self: end; align-self: start;
    display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
    height: 48px; padding-top: 0;
}
.tb-btn {
    display: inline-flex; align-items: center; gap: 5px;
    flex: 0 0 auto; white-space: nowrap;
    height: 30px; padding: 0 11px; border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .18); color: #fff; font-size: 12px;
    cursor: pointer; backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); transition: .16s;
}
.tb-btn:hover { background: rgba(255, 255, 255, .3); }
body.simple .tb-btn { color: #374151; border-color: rgba(0, 0, 0, .1); background: rgba(255, 255, 255, .7); }

/* 顶栏编辑锁：默认锁定，解锁后才允许拖动 / 删除 / 添加 */
.tb-lock { padding: 0 9px; }
.tb-lock .lk-off { display: none; }
.tb-lock.locked { color: rgba(255, 255, 255, .72); }
.tb-lock.unlocked { color: #bfe0ff; border-color: rgba(120, 180, 255, .55); background: rgba(96, 165, 250, .3); }
.tb-lock.unlocked .lk-on { display: none; }
.tb-lock.unlocked .lk-off { display: block; }
body.simple .tb-lock.locked { color: #6b7280; }
body.simple .tb-lock.unlocked { color: #1d63c8; border-color: rgba(29, 99, 200, .35); background: rgba(29, 99, 200, .12); }
.tb-lock.shake { animation: lk-shake .46s ease-in-out 3; border-color: rgba(255, 155, 70, .8); background: rgba(255, 138, 60, .34); color: #fff; }
@keyframes lk-shake {
    0%, 100% { transform: translateX(0); }
    22% { transform: translateX(-3px); }
    46% { transform: translateX(3px); }
    72% { transform: translateX(-2px); }
}
/* 锁定时不显示卡片右下角的缩放手柄，避免误拖 */
body.edit-locked .tile-resize { display: none !important; }

/* 右侧导航：贴边窄条 */
.side-nav {
    position: fixed; right: 0; top: 50%; transform: translateY(-50%);
    z-index: 30; width: 54px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 3px; border-radius: 14px 0 0 14px;
    background: rgba(22, 28, 40, .34);
    backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, .14); border-right: 0;
    box-shadow: -6px 0 24px rgba(0, 0, 0, .12);
    transition: width .22s ease, background .22s ease;
}
.side-nav:hover { width: 62px; background: rgba(22, 28, 40, .52); }
body.simple .side-nav { background: rgba(255, 255, 255, .82); border-color: rgba(0, 0, 0, .06); box-shadow: -6px 0 24px rgba(0, 0, 0, .06); }
.sn-item {
    width: 44px; height: 48px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    border: 0; background: transparent; color: rgba(255, 255, 255, .82);
    font-size: 10.5px; border-radius: 10px; cursor: pointer; transition: .16s;
}
.sn-item:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.sn-item.active { background: rgba(255, 255, 255, .24); color: #fff; box-shadow: inset 2px 0 0 rgba(255, 255, 255, .8); }
body.simple .sn-item { color: #5b6270; }
body.simple .sn-item:hover { background: rgba(0, 0, 0, .04); color: #111827; }
body.simple .sn-item.active { background: rgba(74, 124, 247, .12); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.sn-gap { height: 1px; width: 26px; margin: 4px 0; background: rgba(255, 255, 255, .18); }
body.simple .sn-gap { background: rgba(0, 0, 0, .08); }

/* 窄屏（笔记本小窗 / 平板 / 手机）：收窄内边距，保证网格不被挤压（顶栏换行规则见上方 1100px 断点） */
@media (max-width: 900px) {
    .grid { padding: 0 16px calc(80px + 40px * var(--dock-scale, 1)); }
    .dock { bottom: 10px; max-width: calc(100% - 24px); }
}
@media (max-width: 560px) {
    .grid { padding: 0 10px calc(76px + 36px * var(--dock-scale, 1)); }
    .topbar { padding: 14px 10px 4px; }
    /* 卡片被压到极小（手机窄栏）只保留城市 + 温度 + 天气，避免文字被裁 */
    .t-weather .w-hl, .t-weather .w-fcast { display: none; }
}

/* 网格：列数/列宽/行距全部由 JS（layoutGrid）按视口实时计算 → 缩放窗口时卡片与图标等比缩放、恒为正方 */
.grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), var(--cell));
    grid-auto-rows: var(--cell);
    grid-auto-flow: row dense;
    gap: var(--row-gap) var(--col-gap);
    justify-content: center;
    max-width: none;
    /* 第一行卡片与上方搜索/热榜之间留出呼吸间距（100 → 60：搜索框下移后间距减 40） */
    margin: 60px auto 0;
    padding: 0 68px calc(70px + 44px * var(--dock-scale, 1));
    position: relative; z-index: 10;
}

.tile {
    position: relative; border-radius: var(--radius);
    background: rgba(255, 255, 255, var(--card-alpha)); box-shadow: var(--shadow);
    overflow: visible; transition: transform .18s cubic-bezier(.34, 1.3, .64, 1), box-shadow .18s ease, opacity .16s ease;
    border: 1px solid rgba(255, 255, 255, calc(var(--card-alpha) * .8));
    cursor: grab;
    /* 字号按源站：卡片放大时文字不再跟着无限变大，封顶 15px；小卡最低 10.5px */
    font-size: clamp(10.5px, calc(var(--cell) * .26), 15px);
}
/* 彩色卡片也要跟随透明度滑块：最低只压到 .62 亮度，避免文字看不清 */
.t-dish, .t-tarot, .t-ai, .t-sentence, .t-checkin {
    opacity: calc(.62 + var(--card-alpha) * .38);
}
/* 天气卡 / 番茄钟按新样式保持明亮，透明度滑块只做轻微影响 */
.t-weather, .t-pomodoro {
    opacity: calc(.94 + var(--card-alpha) * .06);
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16, 24, 40, .18); }

/* 右下角缩放手柄：悬停磁贴时出现，按住拖动按网格改尺寸（双击恢复默认） */
.tile-resize {
    position: absolute; right: 2px; bottom: 2px; width: 20px; height: 20px;
    cursor: se-resize; z-index: 9; opacity: 0; touch-action: none;
    transition: opacity .16s ease;
}
.tile-resize::before {
    content: ''; position: absolute; right: 4px; bottom: 4px; width: 10px; height: 10px;
    border-right: 2px solid rgba(24, 30, 42, .38);
    border-bottom: 2px solid rgba(24, 30, 42, .38);
    border-bottom-right-radius: 4px;
    background: linear-gradient(135deg, transparent 58%, rgba(24, 30, 42, .2) 58%);
}
.tile:hover .tile-resize,
.tile.resizing .tile-resize { opacity: 1; }
.tile.resizing {
    z-index: 30; pointer-events: none; box-shadow: 0 16px 40px rgba(16, 24, 40, .28);
    outline: 2px dashed rgba(31, 123, 245, .55); outline-offset: 2px;
}
.tile.resizing .tile-resize { opacity: 1; pointer-events: auto; }
body.tile-resizing-on, body.tile-resizing-on * { user-select: none !important; cursor: se-resize !important; }

/* 图标跳跃：鼠标经过图标时上跳 + 回弹 + 落地微缩，营造原版的灵动感 */
@keyframes icoJump {
    0%   { transform: translateY(0) scale(1); }
    26%  { transform: translateY(-9px) scale(1.08); }
    48%  { transform: translateY(0) scale(.96); }
    66%  { transform: translateY(-4px) scale(1.04); }
    84%  { transform: translateY(0) scale(.99); }
    100% { transform: translateY(0) scale(1); }
}
@keyframes icoLift {
    from { transform: translateY(0); }
    to   { transform: translateY(-2px); }
}
.tile .site-icon,
.tile .dock-item,
.tile .ai-avatar { will-change: transform; }
.tile .site-icon:hover { animation: icoJump .52s cubic-bezier(.34, 1.56, .64, 1) both; }
.tile:hover .folder-grid { animation: icoLift .22s ease both; }

/* 用户自建磁贴（单站卡片） */
.t-site {
    background: rgba(255, 255, 255, var(--card-alpha));
    display: flex; align-items: center; justify-content: center;
    position: relative; cursor: pointer;
}
.site-single {
    width: var(--icon); height: var(--icon); border-radius: var(--icon-radius, 12px); background: transparent;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    transition: transform .18s cubic-bezier(.34, 1.3, .64, 1);
}
.site-single:hover { animation: icoJump .52s cubic-bezier(.34, 1.56, .64, 1) both; }
.site-single img { width: 92%; height: 92%; object-fit: contain; border-radius: var(--icon-radius, 12px); }
.site-single .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #fff; border-radius: var(--icon-radius, 12px); }
.del-mine {
    position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; padding: 0;
    border: 0; border-radius: 50%; background: rgba(17, 24, 39, .55); color: #fff;
    font-size: 13px; line-height: 18px; cursor: pointer; opacity: 0; z-index: 9;
    transition: opacity .16s ease, background .16s ease;
}
.tile:hover .del-mine,
.del-mine:focus-visible { opacity: 1; }
.del-mine:hover { background: #ef4444; opacity: 1; }
/* 触屏设备没有 hover：淡显，保证入口可见可点 */
@media (hover: none) { .del-mine { opacity: .6; } }

/* 添加磁贴弹窗表单 */
.at-form .at-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.at-form label { flex: 0 0 36px; font-size: 13px; color: #6b7280; }
.at-form input {
    flex: 1; height: 36px; padding: 0 10px; font-size: 13px; color: #111827;
    border: 1px solid #e5e7eb; border-radius: 8px; outline: none; background: #fff;
}
.at-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 124, 247, .12); }
.at-form .at-tip { font-size: 12px; color: #9aa1ad; line-height: 1.7; margin-top: 2px; }

/* 标题与原版一致：位于卡片下方外侧，浮在行间距里 */
.tile-label {
    position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%);
    max-width: calc(100% + 16px); text-align: center;
    font-size: min(.86em, 13px); line-height: 1.2; font-weight: 500;
    color: rgba(255, 255, 255, .97);
    background: rgba(12, 22, 38, .26);
    border-radius: 6px; padding: 1px 6px 2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .40);
    pointer-events: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    /* 卡片名浮在卡片外侧，要压住下一行磁贴，避免被盖住 */
    z-index: 28;
    transition: transform .18s ease, background .18s ease;
}
.tile:hover .tile-label { transform: translate(-50%, 2px); }
/* 彩色卡片上的文字保持白色 */
.t-weather .tile-label, .t-pomodoro .tile-label, .t-dish .tile-label,
.t-tarot .tile-label, .t-ai .tile-label, .t-sentence .tile-label {
    color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
/* 简约模式下磁贴名称也统一白字 + 深色胶囊，避免浅底灰字看不清 */
body.simple .tile-label {
    color: #fff; background: rgba(12, 22, 38, .55);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

/* 天气（新版：蓝渐变 + 右上云朵 + 白色圆角预报卡） */
.t-weather {
    grid-column: span 2; grid-row: span 2; position: relative;
    background: linear-gradient(165deg, #4799f6 0%, #58a7f8 55%, #74b8fb 100%);
    color: #fff; padding: 9px 10px 9px; cursor: pointer;
    display: flex; flex-direction: column; overflow: visible;
    box-shadow: 0 10px 24px rgba(52, 112, 205, .34);
}
/* 右上角云朵装饰：裁剪在卡片内，不遮挡下方标题 */
.t-weather .w-clouds {
    position: absolute; inset: 0; overflow: hidden; border-radius: inherit;
    z-index: 1; pointer-events: none;
}
.t-weather .w-clouds svg {
    position: absolute; right: -6%; top: -10%; width: 78%; height: 64%; display: block;
}
/* 城市：定位图标 + 白字（不再套白胶囊） */
.t-weather .w-head {
    display: flex; align-items: center; gap: .3em;
    font-size: 1.04em; font-weight: 600; position: relative; z-index: 2;
    text-shadow: 0 1px 5px rgba(20, 60, 130, .28);
}
.t-weather .w-pin-ic { width: .86em; height: .86em; flex: 0 0 auto; color: #fff; opacity: .96; }
.t-weather .w-city { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 大温度 + 天气文案同一排 */
.t-weather .w-body {
    display: flex; align-items: flex-end; gap: .42em;
    margin-top: .24em; position: relative; z-index: 2;
}
.t-weather .w-deg {
    flex: 0 0 auto; font-size: 2.45em; font-weight: 800; line-height: .88;
    letter-spacing: -.5px; text-shadow: 0 3px 10px rgba(20, 60, 130, .30);
}
.t-weather .w-deg sup { font-size: .38em; font-weight: 700; vertical-align: super; margin-left: 0; }
.t-weather .w-text {
    font-size: .92em; font-weight: 600; padding-bottom: .28em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(20, 60, 130, .26);
}
.t-weather .w-text.is-rain { color: #fff; }
.t-weather .w-hl {
    font-size: .84em; line-height: 1.4; margin-top: .34em;
    display: flex; gap: .7em; white-space: nowrap;
    position: relative; z-index: 2; opacity: .99;
    text-shadow: 0 1px 4px rgba(20, 60, 130, .34);
}
/* 白色圆角预报卡：明天 / 后天 */
.t-weather .w-fcast {
    margin-top: auto; position: relative; z-index: 2;
    background: #fff; border-radius: 16px; padding: .5em .62em;
    box-shadow: 0 8px 20px rgba(24, 62, 128, .20);
    display: flex; flex-direction: column; gap: .12em;
}
.t-weather .wf-row {
    display: flex; align-items: center; gap: .34em;
    font-size: .72em; line-height: 1.8; color: #96a0af;
}
.t-weather .wf-ic { width: 1em; height: 1em; flex: 0 0 auto; display: flex; align-items: center; }
.t-weather .wf-ic svg { width: 100%; height: 100%; display: block; }
.t-weather .wf-day { flex: 0 0 auto; }
.t-weather .wf-deg { margin-left: auto; color: #48525f; font-weight: 700; }
/* 旧字段保留兜底 */
.w-city { display: flex; align-items: center; gap: 3px; font-size: .78em; opacity: .95; }
.w-temp { font-size: 1.65em; font-weight: 700; line-height: 1.08; margin-top: 2px; display: flex; align-items: baseline; gap: 4px; }
.w-temp small { font-size: .62em; font-weight: 400; opacity: .92; }
.w-desc { font-size: .72em; opacity: .92; margin-top: 0; }
.w-range { font-size: 9.5px; opacity: .88; margin-top: 1px; }
.w-next {
    margin-top: auto; background: rgba(255, 255, 255, .2); border-radius: 6px;
    padding: 3px 5px; display: flex; justify-content: space-between; gap: 3px; font-size: .66em;
}
.w-next div { text-align: center; flex: 1; white-space: nowrap; }
.w-next span { display: block; opacity: .85; margin-bottom: 1px; }

/* 番茄钟（参考浅色面板：三档模式胶囊 + 大圆盘 + 大数字 + 三键控制 + 今日完成） */
.t-pomodoro {
    /* 标签在卡片外侧下方，不能裁切内容，故不设 overflow:hidden；z-index 让标签浮在下一行磁贴之上 */
    grid-column: span 3; grid-row: span 3; position: relative; z-index: 3;
    color: #1a1a1a;
    padding: clamp(6px, calc(var(--cell) * .14), 12px) clamp(8px, calc(var(--cell) * .16), 14px) clamp(6px, calc(var(--cell) * .12), 11px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: clamp(3px, calc(var(--cell) * .07), 7px);
    box-shadow: 0 8px 20px rgba(60, 40, 50, .16);
    transition: background .32s ease, box-shadow .32s ease;
    background: linear-gradient(160deg, #f0e7e7 0%, #e6d9d9 100%);
    --pomo: #ef4b4b;
    --pomo-dark: #dc3c3c;
}
.t-pomodoro.mode-focus { background: linear-gradient(160deg, #f0e7e7 0%, #e5d7d7 100%); --pomo: #ef4b4b; --pomo-dark: #dc3c3c; }
.t-pomodoro.mode-short { background: linear-gradient(160deg, #e8f2ec 0%, #dbe9e2 100%); --pomo: #46c07a; --pomo-dark: #35a866; }
.t-pomodoro.mode-long  { background: linear-gradient(160deg, #eaedf5 0%, #dde3ef 100%); --pomo: #3b82f6; --pomo-dark: #2b71e4; }

/* 番茄钟名称：按其他磁贴一致的样式浮在卡片下方；卡片自身抬高层级，避免被下一行磁贴盖住 */
.t-pomodoro .tile-label {
    position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%);
    order: unset; flex: 0 0 auto; max-width: calc(100% + 16px); margin: 0;
    background: rgba(12, 22, 38, .3); padding: 1px 7px 2px; border-radius: 6px;
    color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
    font-size: 11px; line-height: 1.25; z-index: 30; pointer-events: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile:hover .t-pomodoro .tile-label { transform: translate(-50%, 2px); }
body.simple .t-pomodoro .tile-label { background: rgba(12, 22, 38, .55); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }

/* 模式切换胶囊 */
.pomo-tabs {
    position: relative; z-index: 3; flex: 0 0 auto;
    display: flex; align-items: center; gap: 2px;
    padding: 2px; border-radius: 999px;
    background: rgba(255, 255, 255, .58);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
}
.pomo-tabs button {
    border: 0; background: transparent; cursor: pointer;
    font: inherit; font-size: clamp(11px, calc(var(--cell) * .19), 17px); line-height: 1;
    padding: clamp(2px, calc(var(--cell) * .04), 4px) clamp(6px, calc(var(--cell) * .115), 12px); border-radius: 999px;
    color: #6d6d6d; transition: background .18s, color .18s, box-shadow .18s;
    white-space: nowrap;
}
.pomo-tabs button.on {
    background: #fff; color: #1b1b1b; font-weight: 700;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .10);
}
.pomo-tabs button:hover { color: #333; }

/* 圆盘 */
.pomo-dial {
    position: relative; flex: 0 0 auto;
    width: clamp(40px, calc(var(--cell) * 1.5), 132px); height: clamp(40px, calc(var(--cell) * 1.5), 132px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
}
.pomo-dial svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pomo-dial .ring-bg { fill: rgba(255, 255, 255, .3); stroke: rgba(255, 255, 255, .92); stroke-width: 2.6; }
.pomo-dial .ring-fg {
    fill: none; stroke: var(--pomo); stroke-width: 2.3; stroke-linecap: round;
    opacity: 0; transition: opacity .25s ease;
}
.t-pomodoro.running .pomo-dial .ring-fg,
.t-pomodoro.paused .pomo-dial .ring-fg { opacity: 1; }
.pomo-dial .ring-in { fill: rgba(255, 255, 255, .46); }
.pomo-clock { position: relative; z-index: 3; text-align: center; }
.pomo-time {
    font-size: clamp(12px, calc(var(--cell) * .33), 34px); font-weight: 800; line-height: 1;
    letter-spacing: -.02em; color: #141414;
    font-variant-numeric: tabular-nums;
}
.pomo-idx { margin-top: clamp(2px, calc(var(--cell) * .045), 6px); font-size: clamp(9px, calc(var(--cell) * .15), 15px); color: #6c6c6c; letter-spacing: .04em; }

/* 控制键：重置 / 开始暂停 / 跳过 */
.pomo-ctrl {
    position: relative; z-index: 3; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; gap: clamp(6px, calc(var(--cell) * .16), 14px);
}
.pomo-ctrl .pc-btn {
    border: 0; background: transparent; cursor: pointer; padding: 0;
    color: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center;
    width: clamp(16px, calc(var(--cell) * .34), 27px); height: clamp(16px, calc(var(--cell) * .34), 27px); border-radius: 50%;
    transition: color .16s, transform .12s;
}
.pomo-ctrl .pc-btn:hover { color: rgba(0, 0, 0, .72); }
.pomo-ctrl .pc-btn:active { transform: scale(.92); }
.pomo-ctrl .pc-btn svg { width: clamp(10px, calc(var(--cell) * .215), 17px); height: clamp(10px, calc(var(--cell) * .215), 17px); display: block; }
.pomo-ctrl .pc-main {
    width: clamp(22px, calc(var(--cell) * .5), 44px); height: clamp(22px, calc(var(--cell) * .5), 44px); border-radius: 50%;
    background: var(--pomo); color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
    transition: background .2s, transform .12s, box-shadow .2s;
}
.pomo-ctrl .pc-main:hover { background: var(--pomo-dark); color: #fff; }
.pomo-ctrl .pc-main svg { width: clamp(12px, calc(var(--cell) * .255), 22px); height: clamp(12px, calc(var(--cell) * .255), 22px); }

/* 今日完成 */
.pomo-stat {
    position: relative; z-index: 3; flex: 0 0 auto;
    font-size: clamp(9px, calc(var(--cell) * .17), 14px); color: #4a4a4a; line-height: 1; white-space: nowrap; margin-right: clamp(8px, calc(var(--cell) * .3), 24px);
}
.pomo-stat b { font-weight: 800; color: #141414; font-size: calc(var(--cell) * .155); }

/* 历史报表入口 */
.pomo-hist {
    position: absolute; right: clamp(4px, calc(var(--cell) * .1), 9px); bottom: clamp(4px, calc(var(--cell) * .1), 9px); z-index: 4;
    width: clamp(16px, calc(var(--cell) * .28), 26px); height: clamp(16px, calc(var(--cell) * .28), 26px); border: 0; padding: 0; cursor: pointer;
    border-radius: clamp(3px, calc(var(--cell) * .085), 7px); background: rgba(255, 255, 255, .55);
    color: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center;
    transition: background .16s, color .16s;
}
.pomo-hist:hover { background: rgba(255, 255, 255, .85); color: #222; }
.pomo-hist svg { width: clamp(9px, calc(var(--cell) * .17), 15px); height: clamp(9px, calc(var(--cell) * .17), 15px); }

/* 窄屏（卡片被压得很小）时只保留圆盘与主键，并保留报表入口小图标 */
@media (max-width: 820px) {
    .t-pomodoro .pomo-tabs, .t-pomodoro .pomo-stat, .t-pomodoro .pomo-idx { display: none; }
    .t-pomodoro .pomo-ctrl .pc-btn:not(.pc-main) { display: none; }
    .t-pomodoro .pomo-hist {
        display: flex; width: 18px; height: 18px; right: 3px; top: 3px; bottom: auto;
        background: rgba(255, 255, 255, .66);
    }
    .t-pomodoro .pomo-hist svg { width: 11px; height: 11px; }
}
/* 卡片很小（窄屏多列）时只保留圆盘与主键，报表入口保留 */
.t-pomodoro.compact .pomo-tabs,
.t-pomodoro.compact .pomo-stat { display: none; }
.t-pomodoro.compact .pomo-hist {
    display: flex; width: 16px; height: 16px; right: 2px; top: 2px; bottom: auto;
    background: rgba(255, 255, 255, .7); border-radius: 4px;
}
.t-pomodoro.compact .pomo-hist svg { width: 10px; height: 10px; }
.t-pomodoro.compact .pomo-dial { width: calc(var(--cell) * 1.2); height: calc(var(--cell) * 1.2); }
.t-pomodoro.compact .pomo-time { font-size: calc(var(--cell) * .4); }
.t-pomodoro.compact .pomo-idx { display: none; }
.t-pomodoro.compact .pomo-ctrl { gap: calc(var(--cell) * .1); }
.t-pomodoro.compact .pomo-ctrl .pc-btn:not(.pc-main) { display: none; }

/* ---------------- 番茄钟放大弹窗（点击卡片打开） ---------------- */
.pomo-mask {
    position: fixed; inset: 0; z-index: 180;
    background: rgba(10, 14, 20, .5);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.pomo-mask.in { opacity: 1; }
.pomo-panel {
    position: relative;
    width: min(92vw, 340px);
    max-height: 92vh;
    overflow: auto;
    padding: 30px 22px 20px;
    border-radius: 26px;
    gap: 13px;
    box-shadow: 0 26px 60px rgba(0, 0, 0, .3);
    animation: pomoPanelIn .2s cubic-bezier(.2, .9, .3, 1.1) both;
}
@keyframes pomoPanelIn { from { transform: scale(.94) } to { transform: scale(1) } }
.pomo-mask.in .pomo-panel { transform: scale(1); }
.pomo-x {
    position: absolute; right: 10px; top: 10px; z-index: 6;
    width: 26px; height: 26px; border: 0; padding: 0; cursor: pointer;
    border-radius: 8px; font-size: 14px; line-height: 1;
    background: rgba(255, 255, 255, .55); color: rgba(0, 0, 0, .5);
    transition: background .16s, color .16s;
}
.pomo-x:hover { background: #fff; color: #222; }
/* 弹窗底部「历史记录与报表」入口 */
.pomo-report {
    position: relative; z-index: 4;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; height: 38px; margin-top: 1px; padding: 0 12px;
    border: 1px solid rgba(0, 0, 0, .08); border-radius: 12px; cursor: pointer;
    background: rgba(255, 255, 255, .6); color: #374151;
    font-size: 13px; font-weight: 600; letter-spacing: .3px;
    transition: background .16s, color .16s, border-color .16s;
}
.pomo-report:hover { background: #fff; color: #111827; border-color: rgba(0, 0, 0, .16); }
.pomo-report svg { width: 15px; height: 15px; flex: 0 0 auto; }
/* 弹窗内一律显示完整内容（覆盖窄屏 media 与精简规则），并放大关键元素 */
.t-pomodoro:not(.pomo-panel) { cursor: pointer; } /* 卡片可点击放大 */
.pomo-panel .pomo-tabs { display: flex !important; }
.pomo-panel .pomo-stat { display: block !important; }
.pomo-panel .pomo-idx { display: block !important; }
.pomo-panel .pomo-ctrl .pc-btn { display: flex !important; }
.pomo-panel .pomo-tabs button { font-size: 14px; padding: 5px 14px; }
.pomo-panel .pomo-dial { width: 200px; height: 200px; }
.pomo-panel .pomo-time { font-size: 42px; }
.pomo-panel .pomo-idx { font-size: 14px; margin-top: 6px; }
.pomo-panel .pomo-ctrl { gap: 18px; }
.pomo-panel .pomo-ctrl .pc-btn { width: 34px; height: 34px; }
.pomo-panel .pomo-ctrl .pc-btn svg { width: 20px; height: 20px; }
.pomo-panel .pomo-ctrl .pc-main { width: 58px; height: 58px; }
.pomo-panel .pomo-ctrl .pc-main svg { width: 26px; height: 26px; }
.pomo-panel .pomo-stat {
    font-size: 14px; margin-right: 0; cursor: pointer;
    padding: 3px 6px; border-radius: 8px;
}
.pomo-panel .pomo-stat:hover { background: rgba(255, 255, 255, .5); }
.pomo-panel .pomo-stat b { font-size: 17px; }
/* 报表入口在弹窗里改为点击「今日完成」，小图标隐藏避免与文字重复 */
.pomo-panel .pomo-hist { display: none !important; }

/* 打卡卡（翻转）：4×2，正面倒计时 + 喝水 / 休息 */
.t-punch {
    grid-column: span 4; grid-row: span 2;
    background: transparent; box-shadow: none; border: 0; overflow: visible;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
.t-punch:hover { transform: none; box-shadow: none; }
/* 正反两面用交叉淡入切换（不用 3D，避免背面内容透出来叠字） */
.flip-inner { position: relative; width: 100%; height: 100%; }
.flip-face {
    position: absolute; inset: 0; border-radius: var(--radius);
    background: linear-gradient(118deg, #f1fcf6 0%, #e7f8f4 46%, #e3f4fb 100%);
    box-shadow: var(--shadow);
    padding: 9px 12px 11px; display: flex; flex-direction: column;
    transition: opacity .28s ease, transform .28s ease;
}
.flip-front { z-index: 2; }
.flip-back { background: #fff; opacity: 0; transform: scale(.96); pointer-events: none; z-index: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #cbd5e6 transparent; }
.flip-back::-webkit-scrollbar { width: 6px; }
.flip-back::-webkit-scrollbar-thumb { background: #cbd5e6; border-radius: 3px; }
.flip-back::-webkit-scrollbar-track { background: transparent; }
.flip-front { overflow: hidden; }
.t-punch.flipped .flip-back { opacity: 1; transform: none; pointer-events: auto; z-index: 3; }
.t-punch.flipped .flip-front { opacity: 0; pointer-events: none; z-index: 1; }

.punch-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.punch-top > div:first-child {
    flex: 1 1 auto; min-width: 0;
    display: flex; flex-direction: column; align-items: center;
}
.punch-countdown {
    font-size: clamp(24px, 2.05em, 34px); font-weight: 800; font-variant-numeric: tabular-nums;
    letter-spacing: .6px; color: #101828; line-height: 1.06;
}
.punch-sub {
    align-self: flex-start; font-size: clamp(11px, .8em, 13px); color: #7d8b9c;
    margin: 2px 0 0 2px; letter-spacing: .4px;
}
.punch-gear {
    width: 21px; height: 21px; border: 0; background: rgba(20, 40, 60, .05);
    border-radius: 7px; cursor: pointer; color: #8a97a6;
    display: flex; align-items: center; justify-content: center;
}
.punch-gear:hover { background: rgba(74, 124, 247, .1); color: var(--accent); }

.punch-cards { display: flex; gap: clamp(8px, calc(var(--cell) * .2), 16px); margin-top: 9px; flex: 1; min-height: 0; }
/* 对齐源站：白色圆角小卡，标题青绿渐变、次数红色，插画在右下角，加减号半嵌在左右边缘 */
.punch-card {
    --pc-btn: clamp(25px, calc(var(--cell) * .4), 40px); /* 加减圆钮直径：随卡片缩放，上限不超卡片 */
    position: relative; flex: 1; border-radius: 16px;
    padding: 10px calc(var(--pc-btn) + 4px) 12px;
    background: #fff;
    display: flex; flex-direction: column; cursor: pointer; transition: .14s;
    box-shadow: 0 2px 9px rgba(20, 60, 80, .06);
    overflow: visible;
}
.punch-card:hover { box-shadow: 0 4px 14px rgba(20, 60, 80, .10); }
.punch-card .pc-top { display: flex; align-items: center; }
.punch-card .pc-label {
    font-size: clamp(12px, .98em, 15px); font-weight: 800; letter-spacing: .3px;
    white-space: nowrap;
    background: linear-gradient(92deg, #15bf7c 0%, #10a9b6 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.punch-card .pc-num {
    font-size: clamp(14px, 1.15em, 19px); font-weight: 800; color: #ff5d7d;
    font-variant-numeric: tabular-nums; line-height: 1.3; margin-top: 3px;
}
.punch-card .pc-num i { font-size: clamp(11px, .8em, 14px); font-weight: 700; color: #ff5d7d; font-style: normal; }
.punch-card .pc-art {
    position: absolute; right: calc(var(--pc-btn) + 12px); bottom: 3px; width: 52%; height: 54%;
    line-height: 1; opacity: .97; pointer-events: none;
    display: flex; align-items: flex-end; justify-content: flex-end;
}
.punch-card .pc-art svg { width: 100%; height: 100%; display: block; }
/* 加减号：白色圆钮完整落在卡片内（不贴边、不越界），符号按卡片尺寸放大 */
.punch-card .pc-minus,
.punch-card .pc-plus {
    position: absolute; top: 50%; z-index: 3;
    width: clamp(26px, calc(var(--cell) * .36), 38px);
    height: clamp(26px, calc(var(--cell) * .36), 38px);
    margin-top: calc(clamp(26px, calc(var(--cell) * .36), 38px) * -.5);
    padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    line-height: 1; cursor: pointer;
    background: #fff; border: 1px solid #e3e7f0;
    box-shadow: 0 1px 5px rgba(16, 24, 40, .16);
    transition: transform .12s, box-shadow .12s, background .12s;
    overflow: hidden; /* 符号再大也被圆钮裁住，不会探出边框 */
}
.punch-card .pc-minus svg,
.punch-card .pc-plus svg {
    width: 72%; height: 72%; display: block; pointer-events: none;
    overflow: hidden;
}
.punch-card .pc-minus { left: 8px; color: #ff6d8b; border-color: #ffd2de; }
.punch-card .pc-plus { right: 8px; color: #22a6ca; border-color: #c5eafa; }
.punch-card .pc-minus:hover { background: #fff5f8; }
.punch-card .pc-plus:hover { background: #f4f6ff; }
.punch-card .pc-minus:active,
.punch-card .pc-plus:active { transform: scale(.92); }
.punch-card .pc-bar i { display: block; height: 100%; width: 0; background: #4a7cf7; border-radius: 3px; transition: width .3s; }

.punch-form { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.pf-title { font-size: .9em; color: #6b7280; margin-bottom: 2px; display: flex; justify-content: space-between; align-items: center; }
.pf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9em; color: #374151; }
.pf-row .pf-k { flex: 0 0 52px; color: #6b7280; }
.wd-list { display: flex; gap: 4px; flex-wrap: wrap; }
.wd-item {
    padding: 2px 7px; border-radius: 6px; font-size: .82em; cursor: pointer;
    background: #f1f4f9; color: #6b7280; border: 1px solid transparent;
}
.wd-item.on { background: #e6efff; color: var(--accent); border-color: #c9dbff; font-weight: 600; }
.pf-input {
    width: 62px; height: 26px; border: 1px solid #e3e8f0; border-radius: 7px;
    padding: 0 8px; font-size: .9em; color: #111827; background: #fff; outline: 0;
}
.pf-input:focus { border-color: var(--accent); }
.pf-actions { display: flex; gap: 8px; margin-top: auto; position: sticky; bottom: -1px; padding: 6px 0 2px; background: #fff; }
.pf-btn { flex: 1; height: 28px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: .9em; cursor: pointer; }
.pf-btn.ghost { background: #f1f4f9; color: #6b7280; }
.pf-btn:hover { opacity: .9; }
.habit-mini { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.habit-mini span { font-size: .82em; padding: 2px 7px; border-radius: 6px; background: #f1f4f9; color: #6b7280; cursor: pointer; }
.habit-mini span.on { background: #e8f7ee; color: #1a9d5b; }

/* 今天吃什么（源站同款：蓝色渐变波点底 + 复古机身 + 深蓝屏框 + 横线纸 + 青绿抽按钮） */
/* overflow 用 visible：卡片名称是浮在卡片下方的绝对定位元素，hidden 会把它裁掉 */
.t-dish {
    grid-column: span 2; grid-row: span 2; position: relative; overflow: visible;
    background:
        radial-gradient(rgba(255, 255, 255, .15) 1px, transparent 1.4px) 0 0 / 9px 9px,
        radial-gradient(120% 90% at 18% 4%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 55%),
        linear-gradient(168deg, #5ccaf6 0%, #2f95e6 52%, #1d63c9 100%);
    color: #fff; padding: 7px 6px 6px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    box-shadow: 0 8px 20px rgba(20, 90, 190, .34);
}
.t-dish .dish-tag {
    flex: 0 0 auto;
    background: linear-gradient(180deg, #74d6fb 0%, #2aa4e9 100%);
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 999px; padding: .1em .78em; font-size: .8em; font-weight: 800; letter-spacing: .08em;
    box-shadow: 0 .14em .34em rgba(16, 92, 180, .40), inset 0 1px 0 rgba(255, 255, 255, .65);
    white-space: nowrap; text-shadow: 0 1px 2px rgba(10, 70, 150, .40);
}
/* 复古机身：浅蓝外壳 + 两枚侧钮 */
.dish-pc {
    position: relative; flex: 1 1 auto; width: 93%; min-height: 0;
    border-radius: .58em; padding: .28em;
    background: linear-gradient(180deg, #b3e5fb 0%, #74bff0 42%, #3f97e4 100%);
    box-shadow: 0 .18em .5em rgba(12, 62, 140, .38), inset 0 .06em 0 rgba(255, 255, 255, .8), inset 0 -.1em .3em rgba(20, 100, 190, .28);
    display: flex; flex-direction: column;
}
.dish-pc::before, .dish-pc::after {
    content: ''; position: absolute; top: 50%; width: .34em; height: .34em; margin-top: -.17em;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #fff, #cfe9fa 48%, #8fc3e6 100%);
    box-shadow: 0 .04em .12em rgba(10, 60, 130, .45);
}
.dish-pc::before { left: .04em; }
.dish-pc::after { right: .04em; }
/* 深蓝屏幕边框 */
.dish-bezel {
    flex: 1; min-height: 0; border-radius: .38em; padding: .16em;
    background: linear-gradient(180deg, #3a4ea8 0%, #22348f 100%);
    box-shadow: inset 0 .1em .3em rgba(0, 0, 0, .45), inset 0 -.05em 0 rgba(255, 255, 255, .10);
    display: flex;
}
/* 屏幕：米白横线纸 */
.dish-screen {
    flex: 1; min-height: 0; border-radius: .2em;
    background: repeating-linear-gradient(180deg, #fffbee 0 .40em, #f1ead6 .40em .46em);
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 .4em rgba(120, 92, 46, .28);
}
.dish-txt {
    color: #e5362c; font-weight: 800; font-size: 1.02em; line-height: 1.2;
    text-align: center; letter-spacing: .02em; text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
/* 键盘托盘 + 青绿抽按钮 */
.dish-tray {
    flex: 0 0 auto; width: 96%; height: 1.95em; border-radius: .34em;
    background: linear-gradient(180deg, #d8f1fd 0%, #8ac6ef 60%, #6bb3e8 100%);
    box-shadow: 0 .14em .4em rgba(12, 62, 140, .34), inset 0 1px 0 rgba(255, 255, 255, .85);
    display: flex; align-items: center; justify-content: center;
}
.dish-btn {
    border: 1px solid #0aa294; background: linear-gradient(180deg, #3adbcd 0%, #10b19f 100%); color: #fff;
    height: 1.3em; min-width: 3.7em; padding: 0 1em; border-radius: 999px; font-size: .86em; font-weight: 800;
    letter-spacing: .12em; cursor: pointer;
    box-shadow: 0 .1em 0 #0a9a8b, 0 .2em .4em rgba(8, 120, 108, .38), inset 0 1px 0 rgba(255, 255, 255, .55);
    text-shadow: 0 1px 1px rgba(0, 100, 90, .55);
    transition: .14s;
}
.dish-btn:hover { filter: brightness(1.06); }
.dish-btn:active { transform: translateY(.06em); box-shadow: 0 .05em 0 #0a9a8b, 0 .1em .24em rgba(8, 120, 108, .35); }
.dish-emoji { font-size: 1.6em; }

/* 塔罗（源站同款：紫渐变 + 金框扇形牌 + 金色描边胶囊） */
.t-tarot {
    grid-column: span 2; grid-row: span 2; position: relative; overflow: visible;
    background:
        radial-gradient(120% 80% at 50% 104%, rgba(255, 216, 130, .18), rgba(255, 216, 130, 0) 62%),
        linear-gradient(160deg, #5e3391 0%, #7b45b4 45%, #a273d2 100%);
    color: #fff; padding: 9px 7px 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    cursor: pointer; box-shadow: 0 8px 20px rgba(78, 40, 128, .32);
}
.tarot-fan { position: relative; width: 100%; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.tarot-fan .tc {
    position: absolute; width: 2.15em; height: 3.35em; border-radius: 6px;
    background: linear-gradient(165deg, #4f2a7c, #8551b3);
    border: 1.5px solid #efc65f; box-shadow: 0 4px 10px rgba(36, 10, 64, .35);
}
.tarot-fan .tc::after { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(239, 198, 95, .50); border-radius: 3px; }
/* 牌面纹样：内联 SVG 绘制金色牌背（外框/内线/菱形徽记/顶部徽章），贴近源站塔罗牌背 */
.tarot-fan .tc-face { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tarot-fan .tc:nth-child(1) { transform: translateX(-1.42em) rotate(-13deg); }
.tarot-fan .tc:nth-child(2) { transform: translateY(-.24em); z-index: 2; background: linear-gradient(165deg, #6a3798, #9a63c9); }
.tarot-fan .tc:nth-child(3) { transform: translateX(1.42em) rotate(13deg); }
.tarot-btn {
    border: 1px solid #efc65f; background: rgba(255, 255, 255, .16); color: #ffeec2;
    height: 1.8em; padding: 0 1.4em; border-radius: 999px; font-size: .84em; font-weight: 700;
    cursor: pointer; transition: .15s; backdrop-filter: blur(2px);
    text-shadow: 0 1px 2px rgba(60, 20, 100, .5);
}
.tarot-btn:hover { background: rgba(255, 255, 255, .26); }
.tarot-art {
    width: 4.5em; height: 6em; border-radius: 8px;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 3px, transparent 3px 6px),
                linear-gradient(160deg, #4c2c78, #7a4da8);
    border: 1px solid rgba(255, 255, 255, .3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6em; box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}

/* AI（源站同款：白到淡紫渐变 + 右上笑脸 + 白卡文案 + 底部输入框） */
.t-ai {
    grid-column: span 2; grid-row: span 2; position: relative; overflow: visible;
    background: linear-gradient(158deg, #ffffff 0%, #f6f3ff 44%, #e6dcfd 100%);
    color: #8f8aa8; padding: 9px 10px 9px;
    display: flex; flex-direction: column; gap: 6px; cursor: pointer;
    box-shadow: 0 8px 20px rgba(139, 120, 216, .22);
}
.ai-badge {
    position: absolute; right: 8px; top: 8px; width: 1.55em; height: 1.55em; border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #fff, #e8e2ff);
    display: flex; align-items: center; justify-content: center;
    color: #8a78e0; font-size: .92em; box-shadow: 0 2px 7px rgba(90, 70, 180, .22);
}
.ai-card {
    background: rgba(255, 255, 255, .96); border-radius: 9px; padding: .5em .55em;
    color: #9b95b4; font-size: .78em; line-height: 1.5; flex: 1; min-height: 0;
    overflow: hidden; box-shadow: 0 5px 14px rgba(120, 100, 200, .12);
    margin-top: 1px;
}
/* 底部输入框（视觉还原，点击整卡打开弹窗） */
.t-ai .ai-ask {
    margin-top: auto; display: flex; align-items: center;
    height: 1.95em; padding: 0 .55em; border-radius: .55em;
    background: #fff; border: 1px solid #ddd3f7;
    color: #a9a3c0; font-size: .76em;
    box-shadow: 0 2px 6px rgba(120, 100, 200, .10);
    white-space: nowrap; overflow: hidden;
}
.t-ai .ai-ask span { overflow: hidden; text-overflow: ellipsis; }
.t-ai:hover .ai-ask { border-color: #bda9f0; }
.ai-go-btn {
    margin-top: auto; text-align: center; background: rgba(255, 255, 255, .46); color: #5b4fc0;
    border-radius: 999px; height: 1.9em; line-height: 1.9em; font-size: .82em; font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.t-ai:hover .ai-go-btn { background: rgba(255, 255, 255, .68); }
.ai-head { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .95; }
.ai-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    background: radial-gradient(circle at 30% 28%, #fff, #cfc6ff);
    display: flex; align-items: center; justify-content: center; font-size: 12px; color: #6a5ae0;
}
.ai-text { font-size: 12px; line-height: 1.5; opacity: .96; flex: 1; }
.ai-go {
    font-size: 11.5px; background: rgba(255, 255, 255, .26); border-radius: 8px;
    padding: 6px 8px; text-align: center; transition: background .16s ease;
}
.t-ai:hover .ai-go { background: rgba(255, 255, 255, .4); }

/* AI 弹窗 */
.ai-pop { padding: 2px 0 4px; }
.ai-pop-desc { font-size: 12.5px; color: #6b7280; margin-bottom: 12px; line-height: 1.6; }
.ai-pop-engines { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.ai-eng {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
    border: 1px solid #e2e7f0; border-radius: 9px; font-size: 12.5px; color: #4b5563;
    cursor: pointer; transition: border-color .15s ease, background .15s ease;
    background: #fff;
}
.ai-eng:hover { border-color: #c9d7ff; background: #f7faff; }
.ai-eng.on { border-color: var(--accent); background: #eff4ff; color: #2b5cd9; font-weight: 600; }
.ai-eng-ic {
    width: 17px; height: 17px; border-radius: 5px; background: #eef2fb; color: #4a7cf7;
    display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
}
.ai-eng.on .ai-eng-ic { background: #4a7cf7; color: #fff; }
.ai-input {
    width: 100%; border: 1px solid #e2e7f0; border-radius: 10px; padding: 10px 12px;
    font-size: 13px; line-height: 1.6; color: var(--text); resize: vertical; outline: 0;
    min-height: 78px; font-family: inherit; background: #fff;
}
.ai-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 124, 247, .12); }
.ai-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ai-qc {
    font-size: 11.5px; color: #5b6472; background: #f3f5fa; border-radius: 20px;
    padding: 5px 10px; cursor: pointer; transition: .15s;
}
.ai-qc:hover { background: #e8eeff; color: #2b5cd9; }
.ai-tip { font-size: 11px; color: #98a0ad; margin-top: 10px; line-height: 1.6; }

/* AI 弹窗内嵌对话：全部在这个窗口里完成，不新开页面 */
.ai-eng-tag {
    font-size: 9.5px; color: #98a0ad; background: #f1f3f8;
    border-radius: 4px; padding: 0 4px; margin-left: 1px; font-weight: 400;
}
.ai-frame-wrap {
    position: relative; height: 56vh; min-height: 320px;
    border: 1px solid #e2e7f0; border-radius: 12px; overflow: hidden;
    background: #f7f9fd;
}
.ai-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.ai-frame-tip {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px; padding: 24px;
    text-align: center; font-size: 13px; color: #6b7280; line-height: 1.7;
    background: #f7f9fd;
}

/* 文件夹：与天气、番茄等小卡同尺寸（2×2 格），内部 4×4 微网格 —— 前 3 个图标占 2×2（大），
   其余 1×1（小），和参考布局一致，一卡最多 3 大 + 4 小 = 7 个图标 */
.t-folder {
    grid-column: span 2; grid-row: span 2;
    background: rgba(255, 255, 255, var(--card-alpha));
    padding: 5px; cursor: pointer;
    display: flex; flex-direction: column;
}
.folder-grid {
    flex: 1; display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
}
.site-icon {
    position: relative; border-radius: min(var(--icon-radius, 12px), 22%); background: transparent;
    display: flex; align-items: center; justify-content: center;
    min-width: 0; min-height: 0;
    overflow: hidden; box-shadow: none; transition: transform .18s cubic-bezier(.34, 1.3, .64, 1);
}
.site-icon.big { grid-column: span 2; grid-row: span 2; }
.site-icon.small { grid-column: span 1; grid-row: span 1; }
.site-icon.empty {
    grid-column: 1 / 5; grid-row: 1 / 5;
    background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.site-icon:hover { box-shadow: none; }
/* 和源站一样：图标直贴，不加白底白边；--icon-pct 由「设置-图标大小」控制（默认满格） */
.site-icon img { width: var(--icon-pct, 100%); height: var(--icon-pct, 100%); max-width: 100%; max-height: 100%; object-fit: contain; border-radius: min(var(--icon-radius, 12px), 22%); }
.site-icon .ph { width: var(--icon-pct, 100%); height: var(--icon-pct, 100%); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #fff; border-radius: min(var(--icon-radius, 12px), 22%); }
.site-icon.small .ph { font-size: 9px; }
.site-icon.big .ph { font-size: 15px; }
/* 图标拖拽换位：拖起源半透明、落点高亮 */
.site-icon { touch-action: none; }
.site-icon[draggable="true"] { cursor: grab; }
.site-icon.icon-dragging { opacity: .35; cursor: grabbing; }
body.icon-dragging-on, body.icon-dragging-on * { cursor: grabbing !important; user-select: none !important; }
.site-icon.icon-drop {
    box-shadow: 0 0 0 2px var(--accent), 0 6px 14px rgba(74, 124, 247, .28);
    transform: translateY(-2px) scale(1.04);
}
/* 图标拖到卡片之外：网格描一圈虚线，提示松手会变成页面上的独立图标 */
#grid.detach-hover {
    outline: 2px dashed rgba(255, 255, 255, .45);
    outline-offset: -8px;
}
/* 拖到别的胶囊（文件夹卡）身上时的整卡落点提示 */
.tile.card-drop {
    outline: 2px dashed rgba(74, 124, 247, .85);
    outline-offset: -3px;
    background: rgba(74, 124, 247, .12);
}

/* =====================================================================
   1.1.0 改版：拖拽排序 / 设置抽屉 / 密度适配 / 简约模式
   ===================================================================== */

/* ---- 拖拽 ---- */
.tile.dragging {
    opacity: .38; transform: scale(.97);
    box-shadow: 0 12px 28px rgba(16, 24, 40, .2);
    cursor: grabbing;
}
.tile.drop-before::before,
.tile.drop-after::after {
    content: ''; position: absolute; top: 6px; bottom: 6px; width: 4px; z-index: 3;
    border-radius: 3px; background: var(--accent);
    box-shadow: 0 0 0 4px rgba(74, 124, 247, .18);
}
.tile.drop-before::before { left: 0; }
.tile.drop-after::after { right: 0; }

/* ---- 底部删除投放区（源站样式：全宽半透明条贴住页面最底部，文字浮在推荐条上方） ---- */
.dropzone {
    position: fixed; left: 0; right: 0; bottom: 0; height: 78px;
    background: rgba(12, 14, 20, .46);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .18);
    z-index: 24; opacity: 0; pointer-events: none;
    transform: translateY(100%);
    transition: opacity .18s ease, transform .24s cubic-bezier(.22, 1, .36, 1), background .18s ease, border-color .18s ease;
}
/* 未悬停时压在推荐条后面（推荐条保持清晰）；拖到其上时整条置顶并变红 */
.dropzone.over { z-index: 40; }
body.tile-dragging-on .dropzone,
body.icon-dragging-on .dropzone { z-index: 45; }
.dropzone.over {
    background: linear-gradient(90deg, #ff3b30 0%, #ff5a3c 38%, #ff7a45 68%, #ff9500 100%);
    border-top-color: rgba(255, 255, 255, .55);
    box-shadow: 0 -10px 34px rgba(255, 69, 40, .35);
}
.dropzone-tip {
    position: fixed; left: 0; right: 0; bottom: 0; height: 78px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px; letter-spacing: 1px; font-weight: 500;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
    z-index: 60; opacity: 0; pointer-events: none;
    transform: translateY(100%);
    transition: opacity .18s ease, transform .24s cubic-bezier(.22, 1, .36, 1);
}
.dropzone-tip em { font-style: normal; }
body.tile-dragging-on .dropzone,
body.icon-dragging-on .dropzone {
    opacity: 1; transform: none; pointer-events: auto;
}
body.tile-dragging-on .dropzone-tip,
body.icon-dragging-on .dropzone-tip { opacity: 1; transform: none; }
/* 拖动期间推荐条不接指针，落到它上面也算投进删除区 */
body.tile-dragging-on .dock,
body.icon-dragging-on .dock { pointer-events: none; }
.dropzone.over ~ .dropzone-tip em { font-weight: 700; letter-spacing: 2px; }
body.tile-dragging-on .dropzone.pop,
body.icon-dragging-on .dropzone.pop { animation: dzPop .3s ease; }
@keyframes dzPop {
    0% { transform: translateY(6px); }
    60% { transform: translateY(-2px); }
    100% { transform: none; }
}
.grid.sorting .tile { cursor: grabbing; }
.grid.sorting .tile:hover { transform: none; box-shadow: var(--shadow); }

/* ---- 设置抽屉（从右侧滑出） ---- */
.drawer-mask {
    position: fixed; inset: 0; z-index: 110; background: rgba(10, 14, 22, .42);
    opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s;
}
.drawer-mask.on { opacity: 1; visibility: visible; }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: 392px; max-width: 92vw; z-index: 120;
    background: #fff; box-shadow: -16px 0 46px rgba(12, 18, 30, .22);
    transform: translateX(102%); transition: transform .26s cubic-bezier(.25, .9, .3, 1);
    display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 14px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.drawer-title { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.drawer-close {
    border: 0; background: rgba(0, 0, 0, .04); width: 30px; height: 30px;
    border-radius: 9px; cursor: pointer; color: #6b7280; font-size: 16px; line-height: 1;
}
.drawer-close:hover { background: rgba(0, 0, 0, .08); }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px 24px; }
.drawer-foot { flex: 0 0 auto; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.set-group { margin: 4px 0 14px; }
.set-group-title { font-size: 11.5px; color: #98a0ad; letter-spacing: .5px; padding: 6px 10px 6px; }
.density-row { display: flex; gap: 8px; padding: 4px 10px 2px; }
.density-opt {
    flex: 1; border: 1px solid #e8ebf0; border-radius: 10px; background: #fff;
    padding: 9px 6px 8px; cursor: pointer; text-align: center; transition: .16s;
}
.density-opt:hover { border-color: #c9d7ff; background: #f7faff; }
.density-opt.on { border-color: var(--accent); background: #eff4ff; }
.density-opt b { display: block; font-size: 12.5px; color: #2b3441; font-weight: 600; }
.density-opt span { display: block; font-size: 10.5px; color: #98a0ad; margin-top: 2px; }
.density-opt .d-mini { display: block; margin: 6px auto 4px; }
.density-opt .d-mini i {
    display: inline-block; background: #cdd8ea; border-radius: 2px; margin: 0 1px; vertical-align: bottom;
}

/* ---- 外观微调滑块 ---- */
.apa-wrap { padding: 4px 12px 10px; }
.apa-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.apa-k { flex: 0 0 68px; font-size: 12px; color: #5b6472; }
.apa-v { flex: 0 0 44px; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.apa {
    flex: 1; -webkit-appearance: none; appearance: none;
    height: 4px; border-radius: 3px; background: #e3e8f2; outline: 0;
}
.apa::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 15px; height: 15px; border-radius: 50%; background: #fff;
    border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(74, 124, 247, .35);
    cursor: pointer;
}
.apa::-moz-range-thumb {
    width: 13px; height: 13px; border-radius: 50%; background: #fff;
    border: 2px solid var(--accent); cursor: pointer;
}
.apa-reset {
    margin-top: 6px; width: 100%; height: 32px; font-size: 12.5px; border-radius: 8px;
}
.apa-save-wrap { padding: 3px 12px 4px; }
.apa-save-tip { margin-top: 6px; font-size: 11.5px; line-height: 1.6; color: #98a0ad; }

/* ---- 简约模式：按源站 —— 只留搜索与推荐条，壁纸调亮降饱和，卡片区收起 ---- */
body.simple { background: #eef1f6; }
body.simple .grid { display: none; }
body.simple .bg-layer { filter: brightness(1.55) saturate(.5); }
body.simple .bg-blur { background: rgba(248, 250, 252, .84); }
body.simple .tile {
    background: rgba(255, 255, 255, max(var(--card-alpha, .55), .72));
    border-color: rgba(255, 255, 255, .42);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 22px rgba(16, 24, 40, .06);
}
body.simple .tile:hover { box-shadow: 0 4px 10px rgba(16, 24, 40, .1), 0 14px 30px rgba(16, 24, 40, .08); }
body.simple .t-add { background: rgba(255, 255, 255, .86); border-color: #d8dee8; color: #6b7280; }
body.simple .t-add .plus { background: #eff4ff; color: var(--accent); box-shadow: none; }
body.simple .t-folder { background: rgba(255, 255, 255, .86); }

/* 简约模式版式：按源站 —— 时钟居中居上、搜索框放大并放在页面正中、胶囊紧随其下 */
body.simple .topbar {
    display: block; max-width: none; padding: 0;
    height: calc(100vh - 88px); min-height: 460px;
}
body.simple .tb-left {
    display: block;
    position: absolute; top: 54px; left: 0; right: 0;
    text-align: center; flex: none; padding: 0;
    width: 100%;
}
body.simple .clock { font-size: 60px; line-height: 1.02; letter-spacing: 1.5px; }
body.simple .dateline { margin-top: 10px; font-size: 13.5px; }
body.simple .tb-right { position: absolute; top: 18px; right: 58px; padding-top: 0; }
body.simple .tb-mid {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 120px));
    display: flex; flex-direction: column; align-items: center;
}
body.simple .searchwrap {
    width: 100%; max-width: none; height: 64px;
    border-radius: 18px; padding: 0 8px 0 6px;
    box-shadow: 0 12px 34px rgba(16, 24, 40, .13), 0 1px 0 rgba(255, 255, 255, .8) inset;
}
body.simple .engine { height: 46px; font-size: 15px; padding: 0 14px 0 18px; }
body.simple .kw { font-size: 18px; padding: 0 14px; }
body.simple .btn-search { height: 46px; padding: 0 30px; font-size: 15.5px; border-radius: 12px; }
body.simple .engine-list { top: 72px; }
body.simple .sug { top: 74px; border-radius: 14px; }
body.simple .quickrow {
    width: max-content; max-width: 100%; flex-wrap: wrap;
    justify-content: flex-start; margin-top: 25px;
}
body.simple .chips { justify-content: center; max-width: none; margin-top: 10px; }
body.simple .hot-board { top: 104px; }

/* ---- 卡片内紧凑适配：全部用 em，随卡片尺寸（--cell）等比缩放 ---- */
.tarot-art { width: 2.4em; height: 3.2em; font-size: 1.05em; }
.dish-box { font-size: .82em; min-height: 2.1em; padding: 4px; line-height: 1.2; }
.dish-emoji { font-size: 1.1em; }

.t-folder { padding: 5px; }
.folder-grid { gap: 2px; }
.site-icon { border-radius: min(var(--icon-radius, 10px), 22%); }
.site-icon .ph { font-size: 1em; }

.pomo-meta {
    font-size: .64em; opacity: .9; max-width: 100%; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; text-align: center;
}

.flip-face { background: linear-gradient(118deg, #f1fcf6 0%, #e7f8f4 46%, #e3f4fb 100%); }
.flip-back { background: rgba(255, 255, 255, var(--card-alpha)); }

/* 打卡背面设置面板：字号改为固定像素，不再随磁贴尺寸缩到看不清 */
.pf-title { font-size: 14.5px; }
.pf-row { font-size: 14.5px; }
.pf-row .pf-k { flex: 0 0 60px; font-size: 14.5px; color: #6b7280; }
.wd-item { font-size: 13.5px; padding: 3px 8px; }
.pf-input { width: 72px; height: 32px; font-size: 14.5px; }
.pf-btn { height: 32px; font-size: 14.5px; }
.habit-mini span { font-size: 13px; padding: 2.5px 7px; }
/* 上下班时间：改成点开滚轮弹层，不再用原生 input[type=time]（首页滚轮切分区会把时间值顶乱） */
.pf-time {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 80px; height: 32px; padding: 0 8px;
    border: 1px solid #e3e8f0; border-radius: 8px; background: #fff;
    font: 700 15.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums; letter-spacing: .5px;
    color: #111827; cursor: pointer;
    transition: border-color .16s, background .16s;
}
.pf-time:hover { border-color: var(--accent); background: #f7faff; }
.pf-tilde { color: #98a0ad; font-size: 14.5px; }

/* 时间滚轮弹层（首页通用） */
.tpick-mask {
    position: fixed; inset: 0; z-index: 8000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(12, 20, 32, .42);
    opacity: 0; pointer-events: none; transition: opacity .16s ease;
}
.tpick-mask.on { opacity: 1; pointer-events: auto; }
.tpick {
    width: 292px; background: #fff; border-radius: 16px; padding: 14px 14px 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .28);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    transform: translateY(6px) scale(.98); transition: transform .16s ease;
}
.tpick-mask.on .tpick { transform: none; }
.tpick-hd { text-align: center; font-size: 14.5px; font-weight: 700; color: #1f2937; }
.tpick-tip { text-align: center; font-size: 12.5px; color: #98a0ad; margin: 3px 0 6px; }
.tpick-wheels { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; height: 150px; }
.tpick-band {
    position: absolute; left: 8px; right: 8px; top: 50px; height: 50px;
    border-radius: 10px; background: #f2f7ff; border: 1px solid #dbe8ff;
    pointer-events: none; z-index: 0;
}
.tpick-col {
    position: relative; z-index: 1;
    width: 68px; height: 150px; overflow-y: auto;
    scroll-snap-type: y mandatory; overscroll-behavior: contain;
    scrollbar-width: none; padding: 50px 0;
    -webkit-mask-image: linear-gradient(#0000, #000 22%, #000 78%, #0000);
    mask-image: linear-gradient(#0000, #000 22%, #000 78%, #0000);
}
.tpick-col::-webkit-scrollbar { display: none; }
.tpick-item {
    height: 50px; line-height: 50px; text-align: center;
    font-size: 19px; color: #b6bec9; cursor: pointer;
    scroll-snap-align: center; font-variant-numeric: tabular-nums;
    transition: color .12s, font-size .12s;
}
.tpick-item.on { color: #111827; font-weight: 700; font-size: 21px; }
.tpick-sep { font-size: 20px; font-weight: 700; color: #94a3b8; z-index: 1; }
.tpick-acts { display: flex; gap: 10px; margin-top: 10px; }
.tpick-acts button {
    flex: 1; height: 38px; border-radius: 10px; font-size: 14.5px;
    cursor: pointer; font-family: inherit;
}
.tpick-cancel { border: 1px solid #dfe5ef; background: #fff; color: #374151; }
.tpick-ok { border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; }

.t-sentence { padding: 10px 11px 30px; gap: 2px; }
.sent-mark { font-size: 2.8em; }
.sent-text { font-size: .8em; line-height: 1.42; -webkit-line-clamp: 3; }

.t-ai { padding: 9px 10px 8px; gap: 4px; }
.ai-head { font-size: .82em; }
.ai-avatar { width: 1.35em; height: 1.35em; font-size: .75em; }
.ai-text {
    font-size: .78em; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ai-go { font-size: .78em; padding: 4px 6px; border-radius: 6px; }

.t-add { gap: 0; font-size: 1em; }
.t-add .add-icon { width: 4em; height: 4em; font-size: 1em; border-radius: .95em; }

/* ---- 窄屏（卡片较小）时彩色磁贴再压一档，保证文字不被裁掉 ---- */
@media (max-width: 900px) {
    .t-weather { padding: 7px 8px 6px; }
    .t-weather .w-head { font-size: .70em; }
    .t-weather .w-deg { font-size: 1.90em; }
    .t-weather .w-text { font-size: .74em; }
    .t-weather .w-hl { font-size: .60em; line-height: 1.3; }
    .t-weather .w-body { gap: 4px; }
    .t-weather .w-fcast { border-radius: 10px; padding: .3em .4em; }
    .t-weather .wf-row { font-size: .58em; gap: 2px; }

    .punch-countdown { font-size: 1.18em; }
    .punch-sub { font-size: .60em; }
    .punch-card .pc-label { font-size: .70em; }
    .punch-card .pc-num { font-size: .88em; }
    /* 窄屏卡片变窄，加减圆钮同步收一档，仍完整落在卡片内 */
    .punch-card { padding: 9px 28px 11px; }
    .punch-card .pc-minus,
    .punch-card .pc-plus { width: 22px; height: 22px; margin-top: -11px; }
    .punch-card .pc-minus svg,
    .punch-card .pc-plus svg { width: 16px; height: 16px; }
    .punch-card .pc-minus { left: 4px; }
    .punch-card .pc-plus { right: 4px; }
    .punch-card .pc-art { right: 26px; width: 52%; height: 52%; }

    .t-dish .dish-tag { font-size: .64em; padding: 1px 9px; }
    .dish-txt { font-size: .80em; }
    .dish-btn { height: 1.6em; padding: 0 1.2em; font-size: .72em; }
    .dish-box { height: 2.7em; }

    .tarot-fan .tc { width: 1.6em; height: 2.7em; }
    .tarot-btn { height: 1.6em; padding: 0 1.1em; font-size: .70em; }

    .ai-badge { width: 1.25em; height: 1.25em; font-size: .72em; right: 6px; top: 6px; }
    .ai-card { font-size: .66em; padding: .42em .5em; }
    .ai-go-btn { font-size: .68em; height: 1.65em; line-height: 1.65em; }
}

/* ---------------- 首页页脚 ---------------- */
.home-foot {
    position: relative; z-index: 10;
    max-width: min(100%, 1440px);
    /* 底部 dock 是 fixed 悬浮条：用 padding-bottom 留出它的高度 + 间距（margin 在滚动容器末尾会被折叠，压不住） */
    margin: -50px auto 0;
    padding: 0 68px calc(124px + 34px * var(--dock-scale, 1));
}
.hf-in {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, .16);
    font-size: 12.5px; color: rgba(255, 255, 255, .68);
}
.hf-brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; }
.hf-logo {
    width: 22px; height: 22px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4a7cf7, #9b6bff);
    font-size: 12px; color: #fff; font-weight: 700;
}
.hf-brand i { font-style: normal; font-weight: 400; font-size: 12px; color: rgba(255, 255, 255, .6); }
.hf-links { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hf-links a { color: rgba(255, 255, 255, .8); text-decoration: none; }
.hf-links a:hover { color: #fff; }
.hf-copy { margin-left: auto; color: rgba(255, 255, 255, .55); }
.hf-copy a { color: inherit; text-decoration: none; }
.hf-copy a:hover { color: rgba(255, 255, 255, .85); text-decoration: underline; }

/* 页脚友情链接：整行占满，帽檐小字 */
.hf-friend {
    flex: 0 0 100%;
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px;
    margin-top: 10px;
    font-size: 12px; color: rgba(255, 255, 255, .6);
}
.hf-friend-label { color: rgba(255, 255, 255, .46); font-size: 11.5px; letter-spacing: .02em; }
.hf-friend a { color: rgba(255, 255, 255, .74); text-decoration: none; white-space: nowrap; transition: color .15s; }
.hf-friend a:hover { color: #fff; text-decoration: underline; }

body.simple .hf-friend { color: #6b7280; }
body.simple .hf-friend-label { color: #9ca3af; }
body.simple .hf-friend a { color: #4b5563; }
body.simple .hf-friend a:hover { color: #111827; }

body.simple .hf-in { border-top-color: rgba(15, 23, 42, .12); color: #4b5563; }
body.simple .hf-brand { color: #111827; }
body.simple .hf-links a { color: #4b5563; }
body.simple .hf-links a:hover { color: #111827; }
body.simple .hf-copy { color: #6b7280; }

@media (max-width: 900px) {
    .home-foot { padding: 0 16px calc(116px + 34px * var(--dock-scale, 1)); margin-top: -34px; }
    .hf-in { gap: 10px; }
    .hf-copy { margin-left: 0; width: 100%; }
}
/* 成分：简约模式下的页头信息栏配色（浅底白卡，文字转深色） */
body.simple .head-links .hl-in {
    background: transparent; border: 0; color: #6b7280; text-shadow: none;
    box-shadow: none;
}
body.simple .head-links a { color: #374151; }
body.simple .head-links a:hover { color: #111827; }
body.simple .head-links .hl-label,
body.simple .head-links .hl-icp { color: #9ca3af; }