
/* ==========================================================================
   跟 EL9 主题（0.10.5）对齐的一套 token
   字号 11/13/15/17、圆角 12/16/20、动效 180ms cubic-bezier(.4,0,.2,1)
   ========================================================================== */

:root {
    --mn-text: #0f1419;
    --mn-text-2: #536471;
    --mn-text-3: #68727d;
    --mn-border: #eff3f4;
    --mn-border-strong: #cfd9de;
    --mn-bg-hover: rgba(15, 20, 25, .055);
    --mn-r-md: 12px;
    --mn-r-lg: 16px;
    --mn-r-xl: 20px;
    --mn-ease: cubic-bezier(.4, 0, .2, 1);
    --mn-dur: 180ms;
    --mn-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
    --mn-shadow-pop: 0 24px 60px rgba(16, 24, 40, .18);
}

:root[data-theme="dark"] {
    --mn-text: #e7ecf1;
    --mn-text-2: #a9b6c2;
    --mn-text-3: #8b98a5;
    --mn-border: #232a33;
    --mn-border-strong: #38414c;
    --mn-bg-hover: rgba(255, 255, 255, .06);
}

/* ==========================================================================
   NavTab · 仿 mTab 新标签页
   壁纸 + 大时钟 + 居中搜索 + 图标网格
   ========================================================================== */

:root {
    --accent: #4f6ef7;

    --text: #161a20;
    --text-2: rgba(22, 26, 32, .62);
    --text-3: rgba(22, 26, 32, .42);

    --glass: rgba(255, 255, 255, .72);
    --glass-strong: rgba(255, 255, 255, .93);
    --glass-border: rgba(255, 255, 255, .72);

    --tile: #ffffff;
    --tile-border: rgba(18, 24, 38, .06);

    --panel: #ffffff;
    --panel-line: rgba(18, 24, 38, .09);
    --panel-text: #161a20;
    --panel-text-2: #5b6472;
    --panel-text-3: #93a0af;

    /*
     * 壁纸上那层压暗的强度。默认 0 = 一点不压，亮度滑到 100% 时就是原图，
     * 往下调亮度才由 JS 一点一点补上来（白字得看得清）
     */
    --scrim-a: 0;
    /* 图标照 mtab 的比例：图标 / 格子 ≈ 0.78，挤一点才不散 */
    --icon: 72px;
    --icon-radius: 20px;
    /* 12 列 × 92 + 11 × 4 = 1148，加左右 24 内边距刚好铺满 */
    --max: 1200px;
}

/* ---------- 深色 ---------- */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --text: #f2f5fa;
        --text-2: rgba(242, 245, 250, .66);
        --text-3: rgba(242, 245, 250, .42);
        --glass: rgba(22, 26, 34, .56);
        --glass-strong: rgba(30, 35, 45, .9);
        --glass-border: rgba(255, 255, 255, .1);
        --tile-border: rgba(255, 255, 255, .16);
        --tile: #171b22;
        --panel: #171b22;
        --panel-line: rgba(255, 255, 255, .09);
        --panel-text: #eef1f6;
        --panel-text-2: #9aa4b2;
        --panel-text-3: #6b7484;
    }
}

:root[data-theme="dark"] {
    --text: #f2f5fa;
    --text-2: rgba(242, 245, 250, .66);
    --text-3: rgba(242, 245, 250, .42);
    --glass: rgba(22, 26, 34, .56);
    --glass-strong: rgba(30, 35, 45, .9);
    --glass-border: rgba(255, 255, 255, .1);
    --tile-border: rgba(255, 255, 255, .16);
    --tile: #171b22;
    --panel: #171b22;
    --panel-line: rgba(255, 255, 255, .09);
    --panel-text: #eef1f6;
    --panel-text-2: #9aa4b2;
    --panel-text-3: #6b7484;
}

/* ---------- 壁纸模式：文字转白，压在照片上 ---------- */

body.has-wallpaper {
    --text: #ffffff;
    --text-2: rgba(255, 255, 255, .8);
    --text-3: rgba(255, 255, 255, .64);
    --glass: rgba(255, 255, 255, .16);
    --glass-strong: rgba(255, 255, 255, .28);
    --glass-border: rgba(255, 255, 255, .34);
}

/*
 * 浮层自带浅底，文字不能跟着壁纸模式变白（白底白字就没了）。
 * 这里把它们拉回 mtab 那套菜单配色：
 * 底 #fff / 主字 #1f2329 / 次字 #4b5563 / 弱字 #8a929c
 */
.app-menu,
.engine-menu,
.drawer,
.sheet-box,
.note-box,
.card-modal-box {
    --text: #1f2329;
    --text-2: #4b5563;
    --text-3: #8a929c;
}

:root[data-theme="dark"] .app-menu,
:root[data-theme="dark"] .engine-menu,
:root[data-theme="dark"] .drawer,
:root[data-theme="dark"] .sheet-box,
:root[data-theme="dark"] .note-box,
:root[data-theme="dark"] .folder-modal-box,
:root[data-theme="dark"] .card-modal-box,
:root[data-theme="dark"] .toast {
    --text: #e7ecf1;
    --text-2: #a9b6c2;
    --text-3: #8b98a5;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    /* 导航页不显示滚动条（跟 mtab 一样）：照样能滚，只是不留一条灰边，
       顺便让滚动条不再挤压布局宽度 */
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-x: hidden;
}

html::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #eef1f7;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* ---------- 背景层 ---------- */

.wallpaper {
    position: fixed;
    inset: 0;
    z-index: -3;
    background-color: #eef1f7;
    background-image:
        radial-gradient(1100px 620px at 6% -8%, #cfdcff 0%, rgba(207, 220, 255, 0) 62%),
        radial-gradient(900px 540px at 94% -2%, #efe0ff 0%, rgba(239, 224, 255, 0) 58%),
        radial-gradient(1000px 620px at 50% 108%, #e2f2fb 0%, rgba(226, 242, 251, 0) 60%),
        linear-gradient(180deg, #f8f9fd 0%, #eceff8 100%);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .wallpaper {
        background-color: #0a0c11;
        background-image:
            radial-gradient(1100px 620px at 8% -6%, #1b2a55 0%, rgba(27, 42, 85, 0) 62%),
            radial-gradient(900px 520px at 92% 0%, #2a1f4a 0%, rgba(42, 31, 74, 0) 58%),
            radial-gradient(1000px 620px at 50% 110%, #10283a 0%, rgba(16, 40, 58, 0) 60%),
            linear-gradient(180deg, #0b0e14 0%, #05070a 100%);
    }
}

:root[data-theme="dark"] .wallpaper {
    background-color: #0a0c11;
    background-image:
        radial-gradient(1100px 620px at 8% -6%, #1b2a55 0%, rgba(27, 42, 85, 0) 62%),
        radial-gradient(900px 520px at 92% 0%, #2a1f4a 0%, rgba(42, 31, 74, 0) 58%),
        radial-gradient(1000px 620px at 50% 110%, #10283a 0%, rgba(16, 40, 58, 0) 60%),
        linear-gradient(180deg, #0b0e14 0%, #05070a 100%);
}

/* 用户配了壁纸图：单独一层，压掉默认渐变 */
.wallpaper-photo {
    position: fixed;
    inset: 0;
    z-index: -3;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

body.has-wallpaper .wallpaper {
    display: none;
}

.scrim {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: rgba(8, 10, 16, var(--scrim-a, 0));
    pointer-events: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

/* ---------- 右上角工具 ---------- */

.toolbar {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
    display: flex;
    gap: 8px;
}

/* 照 mtab：只留一根线，不套方块底 */
.tool {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--text-2);
    background: none;
    border: 0;
    transition: color .18s ease, opacity .18s ease;
}

.tool:hover {
    color: var(--text);
}

/* ---------- 左上角：添加链接 ---------- */

/* 同 .tool：一根线，不套方块 */
.add-btn {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 20;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--text-2);
    background: none;
    border: 0;
    transition: color .18s ease, opacity .18s ease;
}

.add-btn:hover {
    color: var(--text);
}

.add-btn.is-on {
    color: var(--accent);
}

/* ---------- 右上角头像 ---------- */

/* 头像保留圆形底：圆的比裸线条好看，也压得住不同底色 */
.avatar {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--glass-strong);
    box-shadow: inset 0 0 0 1px var(--glass-border);
    color: var(--text-2);
    transition: color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.avatar:hover {
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px var(--glass-border), 0 6px 16px rgba(18, 24, 38, .18);
}

.avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar b {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
}

.avatar.has-img b {
    display: none;
}

/* 未登录：一个占位小人，点了去登录 */
.avatar svg {
    display: block;
}

.avatar.is-guest {
    color: var(--text-2);
}

/* 压壁纸的时候线条要有一点投影，不然压在亮部就飘了 */
body.has-wallpaper .tool,
body.has-wallpaper .add-btn {
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .42));
}

.avatar.is-guest:hover {
    color: var(--text);
}

/* ---------- 添加链接抽屉 ---------- */

.drawer-mask {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(10, 14, 20, .3);
    opacity: 0;
    transition: opacity .24s ease;
}

.drawer-mask.is-open {
    opacity: 1;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 41;
    width: min(600px, 100%);
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-right: 1px solid var(--panel-line);
    /* 收起时不能留阴影：translateX(-100%) 只是把它挪到屏幕外，
       阴影的模糊半径还会漏进屏幕左侧，看起来像一条深色竖带 */
    box-shadow: none;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.22, .7, .3, 1), box-shadow .26s ease;
}

.drawer.is-open {
    transform: translateX(0);
    box-shadow: 18px 0 48px rgba(10, 14, 20, .18);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
}

.drawer-head strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--panel-text);
}

.drawer-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-manage {
    font-size: 12.5px;
    color: var(--accent);
}

.drawer-close {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--panel-text-2);
}

.drawer-close:hover {
    background: rgba(128, 128, 128, .12);
    color: var(--panel-text);
}

.drawer-new {
    margin: 0 20px 10px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(128, 128, 128, .07);
}

.drawer-new-row {
    display: flex;
    gap: 8px;
}

.drawer-new-row input {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    background: var(--panel);
    font: inherit;
    font-size: 12.5px;
    color: var(--panel-text);
    outline: none;
}

.drawer-new-row input:focus {
    border-color: var(--accent);
}

.drawer-new-btn {
    flex: none;
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 12.5px;
    cursor: pointer;
}

.drawer-new-btn[disabled] {
    opacity: .6;
    cursor: default;
}

.drawer-new-tip {
    margin: 8px 0 0;
    font-size: 11.5px;
    color: var(--panel-text-3);
}

.drawer-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    margin: 0 20px 12px;
    padding: 0 12px;
    border-radius: 10px;
    background: rgba(128, 128, 128, .1);
    color: var(--panel-text-3);
}

.drawer-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    font: inherit;
    font-size: 13.5px;
    color: var(--panel-text);
}

.drawer-search input::placeholder {
    color: var(--panel-text-3);
}

.drawer-cats {
    display: flex;
    gap: 6px;
    padding: 0 20px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.drawer-cats::-webkit-scrollbar {
    display: none;
}

.drawer-cats.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.drawer-cats.is-dragging button {
    pointer-events: none;
}

.drawer-cats button {
    flex: none;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--panel-text-2);
    background: rgba(128, 128, 128, .1);
    transition: all .16s ease;
}

.drawer-cats button.is-active {
    color: #fff;
    background: var(--accent);
}

/*
 * 三个 tab 的内容区都靠 flex 撑满。
 * min-height: 0 不能省：flex 子项的默认 min-height 是 auto，
 * 列表内容一多就把抽屉撑破，overflow 也就不生效 —— 表现为「列表滚不动、翻不了页」。
 */
.drawer-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.drawer-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* 内层滚动条也藏掉，跟整页一致；翻页交给下面的分页条 */
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 20px 26px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
    gap: 10px;
    align-content: start;
}

/* 分页条：固定在列表下面，不跟着滚 */
.drawer-pager {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 20px 14px;
    border-top: 1px solid var(--panel-line);
}

.drawer-pager[hidden] {
    display: none;
}

.pager-btn {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--panel-line);
    background: transparent;
    color: var(--panel-text-2);
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.pager-btn:hover:not(:disabled) {
    background: rgba(15, 20, 25, .05);
    color: var(--panel-text);
}

.pager-btn:disabled {
    opacity: .34;
    cursor: default;
}

.pager-info {
    font-size: 12.5px;
    color: var(--panel-text-3);
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.drawer-list::-webkit-scrollbar {
    display: none;
    width: 0;
}

.drawer-tip {
    grid-column: 1 / -1;
    padding: 26px 0;
    text-align: center;
    font-size: 13px;
    color: var(--panel-text-3);
}

.li-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
        "ico body"
        "desc desc";
    align-items: start;
    gap: 9px 12px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(128, 128, 128, .08);
    transition: background .16s ease;
}

.li-card:hover {
    background: rgba(128, 128, 128, .13);
}

.li-body {
    grid-area: body;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.li-ico {
    grid-area: ico;
    position: relative;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--tile);
}

/* 已添加：图标右下角一个绿勾，跟参考图一致 */
.li-card.is-added .li-ico::after {
    content: '';
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #22c55e;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.4 4.4L19 7.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 9px 9px;
    box-shadow: 0 0 0 2px var(--panel);
}

.li-ico img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* 容器不裁切（要给绿勾留位置），这里自己收一下圆角 */
    border-radius: 11px;
}

.li-ico b {
    display: none;
    font-size: 14px;
    font-weight: 600;
    color: hsl(var(--hue) 56% 42%);
}

.li-ico.is-fallback {
    background: hsl(var(--hue) 68% 94%);
}

.li-ico.is-fallback b {
    display: block;
}

.li-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--panel-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.li-acts {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: -1px;
}

.li-act {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 12px;
    line-height: 1.5;
    color: var(--accent);
    white-space: nowrap;
}

.li-act svg {
    width: 13px;
    height: 13px;
    flex: none;
}

button.li-act {
    cursor: pointer;
}

button.li-act:hover,
a.li-act:hover {
    filter: brightness(1.08);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.li-act[disabled] {
    opacity: .5;
    cursor: default;
}

.li-act.is-done {
    color: var(--panel-text-3);
    cursor: default;
}

.li-act.is-done:hover {
    text-decoration: none;
    filter: none;
}

.li-desc {
    grid-area: desc;
    font-size: 12px;
    line-height: 1.6;
    color: var(--panel-text-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


body.drawer-open {
    overflow: hidden;
}

/* ---------- 页面骨架 ---------- */

.page {
    flex: 1;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
}

/* 页脚只有一句签名（主题的「名片签名」，没填就用站点描述） */
.foot {
    display: flex;
    justify-content: center;
    padding: 22px 24px 28px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-3);
    text-align: center;
    transition: color .2s ease, text-shadow .2s ease;
}

/* 压着壁纸的时候要亮一档加阴影，不然在亮部就看不清了 */
body.has-wallpaper .foot {
    color: rgba(255, 255, 255, .9);
    /* 贴字的细影就够，大模糊会糊成一团 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

.hero {
    /* 下面那 56px 是搜索框到第一行图标的距离 */
    padding: 84px 0 56px;
    text-align: center;
}

.clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.clock-time {
    font-size: clamp(44px, 6.2vw, 64px);
    font-weight: 500;
    line-height: 1.06;
    letter-spacing: -.015em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 12px rgba(12, 18, 32, .08);
}

.clock-date {
    font-size: 13px;
    color: var(--text-2);
    letter-spacing: .08em;
}

body.has-wallpaper .clock-time {
    text-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.greeting {
    margin: 14px 0 0;
    font-size: 13.5px;
    color: var(--text-2);
    letter-spacing: .02em;
}

/* ---------- 搜索（照主题 .el9-search 的一套） ---------- */

.search-wrap {
    position: relative;
    width: min(540px, 100%);
    margin: 22px auto 0;
}

/*
 * 跟主题搜索框一致：胶囊形、浅色软底、无边框无投影，
 * 聚焦时才变成「白底 + 主题色描边 + 主题色图标」。
 */
.search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 8px 0 12px;
    border: 1px solid rgba(15, 20, 25, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .62);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    color: var(--text-2);
    transition: background var(--mn-dur) var(--mn-ease),
        border-color var(--mn-dur) var(--mn-ease),
        box-shadow var(--mn-dur) var(--mn-ease),
        color var(--mn-dur) var(--mn-ease);
}

.search:focus-within {
    background: #fff;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 16%, transparent);
}

.search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 15px;
}

.search input::placeholder {
    color: var(--text-3);
}

.search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* 提交按钮：默认只是个图标，聚焦 / 悬停才染主题色，不再是蓝色实心圆 */
.search-go {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background var(--mn-dur) var(--mn-ease), color var(--mn-dur) var(--mn-ease),
        transform var(--mn-dur) var(--mn-ease);
}

.search-go:hover {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
}

.search-go:active {
    transform: scale(.94);
}

/* ---------- 搜索引擎切换 ---------- */

.engine {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: opacity var(--mn-dur) var(--mn-ease);
}

.engine:hover {
    opacity: .72;
}

/* 搜索引擎图标：抓得到 favicon 就用图片，抓不到显示首字 */
.engine-ico {
    display: none;
    width: 19px;
    height: 19px;
    border-radius: 5px;
    object-fit: contain;
}
.engine.has-ico .engine-ico {
    display: block;
}
.engine.has-ico .engine-fallback {
    display: none;
}
.engine-fallback {
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border-radius: 5px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
}
.engine-caret {
    flex: none;
    opacity: .5;
}

/* 清空按钮：有内容才出现 */
.search-clear {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    transition: background var(--mn-dur) var(--mn-ease), color var(--mn-dur) var(--mn-ease);
}
.search-clear[hidden] {
    display: none;
}
.search-clear:hover {
    background: color-mix(in srgb, var(--text) 8%, transparent);
    color: var(--text);
}

.engine-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    min-width: 132px;
    padding: 6px;
    border-radius: 12px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 14px 34px rgba(18, 24, 38, .16);
}

.engine-menu button {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    text-align: left;
    color: var(--text-2);
}

.engine-menu button:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--text) 8%, transparent);
}

.engine-menu button.is-active {
    color: var(--accent);
    font-weight: 600;
}

/* ---------- 图标网格 ---------- */

.apps {
    position: relative;
}

.app-cell {
    position: absolute;
    left: 0;
    top: 0;
    width: 92px;
    touch-action: manipulation;
    /* 被挤开的图标滑到新格子，不要瞬移 */
    transition: left .18s cubic-bezier(.2, .7, .3, 1), top .18s cubic-bezier(.2, .7, .3, 1);
}

.app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    width: 100%;
    border-radius: 14px;
    transition: transform .18s cubic-bezier(.2, .7, .3, 1);
}

.app:hover {
    transform: translateY(-3px);
}


/* 右键菜单 */

/* 右键菜单：配色照 mtab（白底深字、浅灰 hover），保留一层轻毛玻璃 */
.app-menu {
    position: fixed;
    z-index: 60;
    min-width: 168px;
    padding: 6px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(15, 20, 25, .08);
    backdrop-filter: blur(28px) saturate(170%);
    -webkit-backdrop-filter: blur(28px) saturate(170%);
    box-shadow: 0 12px 32px rgba(15, 20, 25, .14), 0 1px 3px rgba(15, 20, 25, .06);
    color: var(--text);
}

.app-menu button,
.app-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.3;
    text-align: left;
    color: var(--text);
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--mn-dur) var(--mn-ease), color var(--mn-dur) var(--mn-ease);
}

.app-menu button svg,
.app-menu a svg {
    flex: none;
    opacity: .62;
}

.app-menu button:hover,
.app-menu a:hover {
    background: #f2f4f7;
}

/* 右侧的快捷小图标（换一张） */
.app-menu .menu-shortcut {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    opacity: .5;
    transition: background var(--mn-dur) var(--mn-ease), opacity var(--mn-dur) var(--mn-ease);
}

.app-menu .menu-shortcut:hover {
    background: rgba(15, 20, 25, .08);
    opacity: .9;
}

/* 移除 / 删除：红色，跟前面几项拉开距离 */
.app-menu .is-danger {
    margin-top: 4px;
    color: #ff3b30;
}

.app-menu .is-danger svg {
    opacity: .75;
}

.app-menu .is-danger:hover {
    background: rgba(255, 59, 48, .1);
    color: #e0281d;
}

:root[data-theme="dark"] .app-menu {
    background: rgba(32, 36, 44, .96);
    border-color: rgba(255, 255, 255, .14);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .46);
}
:root[data-theme="dark"] .app-menu button:hover,
:root[data-theme="dark"] .app-menu a:hover {
    background: rgba(255, 255, 255, .1);
}
:root[data-theme="dark"] .app-menu .is-danger {
    color: #ff7b74;
}
:root[data-theme="dark"] .app-menu .is-danger:hover {
    background: rgba(255, 123, 116, .14);
    color: #ff9b95;
}

/* 拖拽排序 */

body.is-sorting .app-cell {
    cursor: grab;
}

body.is-sorting .app-cell .app {
    pointer-events: none;
}

.app-cell.is-dragging {
    z-index: 6;
    cursor: grabbing;
    /* 跟手的时候不要过渡，否则会拖尾 */
    transition: none;
}

.app-cell.is-dragging .app-icon {
    box-shadow: 0 16px 32px rgba(18, 24, 38, .22);
    transform: scale(1.06);
}

.app-cell.is-dragging .app-name {
    opacity: .85;
}

body[data-can-edit="1"] .app-cell {
    cursor: grab;
}

body[data-can-edit="1"] .app-cell .app {
    cursor: grab;
}



body.is-sorting .app-cell.is-over {
    transform: translateX(2px);
}

/* 轻提示 */

.toast {
    position: fixed;
    left: 50%;
    bottom: 42px;
    transform: translateX(-50%) translateY(8px);
    z-index: 80;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    color: #fff;
    background: rgba(20, 24, 32, .86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
}

.toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.app-icon {
    position: relative;
    width: var(--icon);
    height: var(--icon);
    border-radius: var(--icon-radius);
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--tile);
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-icon b {
    display: none;
    font-size: 21px;
    font-weight: 600;
    color: hsl(var(--hue) 56% 40%);
}

.app-icon.is-fallback {
    background: hsl(var(--hue) 68% 94%);
    box-shadow: inset 0 0 0 1px hsl(var(--hue) 52% 86%);
}

.app-icon.is-fallback b {
    display: block;
}

.app-name {
    width: 100%;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.has-wallpaper .app-name {
    text-shadow: 0 1px 2px rgba(0, 0, 0, .32);
}

/* 深色下把首字母色块压暗，别在一片深色里发光 */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .app-icon.is-fallback {
        background: hsl(var(--hue) 34% 24%);
        border-color: hsl(var(--hue) 30% 34%);
    }

    :root:not([data-theme="light"]) .app-icon.is-fallback b {
        color: hsl(var(--hue) 70% 78%);
    }
}

:root[data-theme="dark"] .app-icon.is-fallback {
    background: hsl(var(--hue) 34% 24%);
    border-color: hsl(var(--hue) 30% 34%);
}

:root[data-theme="dark"] .app-icon.is-fallback b {
    color: hsl(var(--hue) 70% 78%);
}

/* 筛选时用 hidden 属性隐藏（必须显式声明，否则 display:flex 会盖掉 UA 样式） */

.app[hidden],
.group[hidden] {
    display: none !important;
}

/* ---------- 状态 ---------- */

.no-result,
.empty {
    padding: 64px 0;
    text-align: center;
    color: var(--text-3);
    font-size: 14px;
}

.empty-link {
    display: inline-block;
    margin-top: 10px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: none;
    font: inherit;
    font-size: 13.5px;
    color: var(--accent);
    cursor: pointer;
}

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
    :root {
        --icon: 62px;
        --icon-radius: 18px;
    }

    .page {
        padding: 0 16px;
    }

    .toolbar {
        top: 12px;
        right: 12px;
    }

    .add-btn {
        top: 12px;
        left: 12px;
    }

    .drawer-list {
        grid-template-columns: 1fr;
        padding: 0 14px 22px;
    }

    .drawer-pager {
        padding: 10px 14px max(12px, env(safe-area-inset-bottom));
    }

    .drawer-head,
    .drawer-search,
    .drawer-cats {
        padding-left: 14px;
        padding-right: 14px;
    }

    .drawer-search {
        margin-left: 14px;
        margin-right: 14px;
        padding-left: 12px;
        padding-right: 12px;
    }

    /* 手机上整体比桌面松一档：跟 mtab 手机端一个比例 */
    .hero {
        padding: 92px 0 34px;
    }

    .clock-time {
        font-size: clamp(46px, 12vw, 58px);
    }

    .clock {
        gap: 7px;
    }

    .clock-date {
        font-size: 12.5px;
    }

    .search {
        height: 50px;
        margin-top: 20px;
    }




    /*
     * 手机端固定 4 列，格子宽度按容器均分（跟 mtab 手机端一样）。
     * 这里必须用 % 而不是 100vw —— 出了垂直滚动条时 100vw 比可用宽度多 15px，
     * 一整行会顶出屏幕，右边那几个图标被裁掉。
     * 12 = 3 个 4px 间隙。
     */
    .app-cell {
        width: calc((100% - 12px) / 4);
    }

    .app-icon b {
        font-size: 18px;
    }

    .app-name {
        font-size: 12px;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

/* ---------- 文件夹 ---------- */

.app-folder .folder {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 2px 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    border-radius: 14px;
    transition: transform .18s cubic-bezier(.2, .7, .3, 1);
}
.app-folder .folder:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.folder-inner {
    width: var(--icon);
    height: var(--icon);
    border-radius: var(--icon-radius);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 3px;
    padding: 7px;
    background: color-mix(in srgb, var(--tile) 78%, transparent);
    box-shadow: inset 0 0 0 1px var(--tile-border), 0 6px 18px rgba(18, 24, 38, .10);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    transition: box-shadow .18s ease, transform .18s ease;
}

.folder-mini {
    border-radius: 6px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--tile) 92%, transparent);
}
.folder-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.folder-mini b {
    font-size: 10px;
    font-weight: 600;
    color: hsl(var(--hue) 56% 40%);
}
.folder-mini.is-empty {
    background: rgba(146, 160, 176, .16);
}

.app-folder.is-drop .folder-inner {
    box-shadow: 0 0 0 3px var(--accent), 0 14px 28px rgba(18, 24, 38, .18);
    transform: scale(1.05);
}

/* 弹层 */

.folder-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}
.folder-modal[hidden] {
    display: none;
}
.folder-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(14, 18, 26, .34);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.folder-modal-box {
    position: relative;
    width: min(660px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.folder-modal-title {
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: .2px;
    color: #fff;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}
.folder-modal-panel {
    width: 100%;
    min-height: 168px;
    max-height: min(64vh, 520px);
    overflow: auto;
    padding: 24px 26px 26px;
    border-radius: var(--mn-r-xl);
    background: rgba(255, 255, 255, .28);
    box-shadow: 0 28px 70px rgba(10, 14, 22, .26), inset 0 0 0 1px rgba(255, 255, 255, .28);
    backdrop-filter: blur(26px) saturate(160%);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
}
.folder-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 18px 6px;
    justify-items: center;
}
.folder-modal-grid .app-name {
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}
.folder-modal-empty {
    margin: 22px 0 6px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, .82);
}

:root[data-theme="dark"] .folder-modal-panel {
    background: rgba(22, 26, 34, .45);
}

.folder-app {
    width: 92px;
}
.folder-app .app-icon {
    width: 64px;
    height: 64px;
}

.folder-modal-rename {
    width: 220px;
    padding: 6px 10px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 15px;
    text-align: center;
    color: #fff;
    background: rgba(255, 255, 255, .22);
    outline: 1px solid rgba(255, 255, 255, .4);
}

.folder-app.is-dragging {
    z-index: 6;
    cursor: grabbing;
    filter: drop-shadow(0 16px 30px rgba(10, 14, 22, .30));
    transition: none;
}
.folder-app.is-dragging.is-out {
    opacity: .82;
}

/* Sortable 拖拽（文件夹内排序） */
.folder-app--ghost {
    opacity: .28;
}
.folder-app--chosen {
    cursor: grabbing;
}
.folder-app--drag {
    opacity: .96;
}

/* ---------- 通用弹窗（确认 / 输入 / 备忘录） ---------- */

.sheet {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}
.sheet[hidden] {
    display: none;
}
.sheet-mask {
    position: absolute;
    inset: 0;
    background: rgba(14, 18, 26, .34);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.sheet-box {
    position: relative;
    width: min(420px, 100%);
    padding: 20px 22px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 18px 48px rgba(10, 14, 22, .22), inset 0 0 0 1px rgba(15, 20, 25, .06);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    color: var(--text);
}
.sheet-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.sheet-text {
    margin: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-2);
}
.sheet-text:empty {
    display: none;
}
.sheet-box input,
.sheet-box textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(120, 140, 160, .28);
    border-radius: 10px;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text);
    background: #fff;
    outline: none;
    resize: vertical;
}
.sheet-box textarea {
    min-height: 118px;
}
.sheet-box input:focus,
.sheet-box textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.sheet-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}
.sheet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 18px;
    border-radius: 9px;
    border: 0;
    background: #f2f4f7;
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    transition: background var(--mn-dur) var(--mn-ease),
        border-color var(--mn-dur) var(--mn-ease),
        transform var(--mn-dur) var(--mn-ease);
}
.sheet-btn:hover {
    background: #e9edf2;
}
.sheet-btn:active {
    transform: scale(.98);
}
.sheet-btn.is-primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}
.sheet-btn.is-primary:hover {
    filter: brightness(1.05);
}

:root[data-theme="dark"] .sheet-box {
    background: rgba(28, 32, 40, .96);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
:root[data-theme="dark"] .sheet-text {
    color: var(--text-2);
}
:root[data-theme="dark"] .sheet-box input,
:root[data-theme="dark"] .sheet-box textarea {
    background: rgba(18, 22, 28, .8);
    border-color: rgba(255, 255, 255, .14);
    color: var(--text);
}
:root[data-theme="dark"] .sheet-btn {
    background: rgba(255, 255, 255, .08);
    color: var(--text-2);
}
/* ---------- 备忘录弹窗（标题 / 编辑 / 操作 三段） ---------- */

.note-box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-height: min(88vh, 640px);
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 20, 25, .22), inset 0 0 0 1px var(--mn-border);
}

.note-head {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 44px;
    background: #f3f4f6;
    border-bottom: 1px solid var(--mn-border);
}
.note-title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--mn-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.note-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f04438;
    color: #fff;
    cursor: pointer;
    transition: filter var(--mn-dur) var(--mn-ease);
}
.note-close:hover {
    filter: brightness(1.06);
}
.note-close:active {
    transform: translateY(-50%) scale(.94);
}

.note-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 18px 20px 16px;
    overflow: auto;
}
.note-body textarea {
    flex: 1;
    min-height: 190px;
    padding: 13px 14px;
    border: 1px solid #e4e8ec;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    line-height: 1.7;
    color: var(--mn-text);
    outline: none;
    resize: none;
    transition: border-color var(--mn-dur) var(--mn-ease),
        box-shadow var(--mn-dur) var(--mn-ease);
}
.note-body textarea::placeholder {
    color: var(--mn-text-3);
}
.note-body textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.note-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--mn-text-3);
}
.note-count {
    flex: none;
    font-variant-numeric: tabular-nums;
}

.note-actions {
    flex: none;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    background: #f3f4f6;
    border-top: 1px solid var(--mn-border);
}
.note-btn {
    height: 36px;
    min-width: 74px;
    padding: 0 16px;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    background: #e9ebee;
    font: inherit;
    font-size: 14px;
    color: #47535f;
    cursor: pointer;
    transition: filter var(--mn-dur) var(--mn-ease);
}
.note-btn:hover {
    filter: brightness(.97);
}
.note-btn.is-primary {
    border-color: transparent;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.note-btn.is-primary:hover {
    filter: brightness(1.06);
}

:root[data-theme="dark"] .note-box {
    background: #1b1f26;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .07);
}
:root[data-theme="dark"] .note-head,
:root[data-theme="dark"] .note-actions {
    background: #23272f;
    border-color: rgba(255, 255, 255, .07);
}
:root[data-theme="dark"] .note-body textarea {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .12);
    color: var(--mn-text);
}
:root[data-theme="dark"] .note-btn {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .12);
    color: #dfe7ee;
}
:root[data-theme="dark"] .note-btn.is-primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
}

:root[data-theme="dark"] .sheet-btn {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .14);
    color: #e6edf4;
}

/* 有备忘录的图标：右上角一个小圆点 */
.app-cell.has-note::after {
    content: '';
    position: absolute;
    top: 5px;
    left: calc(50% + 24px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .92);
    pointer-events: none;
}
:root[data-theme="dark"] .app-cell.has-note::after {
    box-shadow: 0 0 0 2px rgba(23, 27, 34, .9);
}

/* ---------- 纪念日：编辑面板 ---------- */

.card-modal {
    position: fixed;
    inset: 0;
    z-index: 72;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}
.card-modal[hidden] {
    display: none;
}
.card-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(14, 18, 26, .34);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.card-modal-box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(880px, 100%);
    max-height: min(88vh, 700px);
    overflow: hidden;
    border-radius: var(--mn-r-xl);
    background: #fff;
    box-shadow: var(--mn-shadow-pop), inset 0 0 0 1px var(--mn-border);
}

/* 顶栏：标题居中，关闭在右 */
.cm-head {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    border-bottom: 1px solid var(--mn-border);
}
.cm-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--mn-text);
}
.cm-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mn-text-2);
    cursor: pointer;
    transition: background var(--mn-dur) var(--mn-ease), color var(--mn-dur) var(--mn-ease);
}
.cm-close:hover {
    background: var(--mn-bg-hover);
    color: var(--mn-text);
}

.cm-body {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    min-height: 0;
}

/* 左栏表单 */
.cm-form {
    display: flex;
    flex-direction: column;
    gap: 17px;
    min-width: 0;
    padding: 20px 22px 22px;
    overflow: auto;
}
.cm-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cm-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--mn-text);
}
.cm-form input[type="text"],
.cm-form input[type="date"] {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--mn-border-strong);
    border-radius: var(--mn-r-md);
    background: #fff;
    font: inherit;
    font-size: 14px;
    color: var(--mn-text);
    outline: none;
    transition: border-color var(--mn-dur) var(--mn-ease), box-shadow var(--mn-dur) var(--mn-ease);
}
.cm-form input::placeholder {
    color: var(--mn-text-3);
}
.cm-form input[type="text"]:focus,
.cm-form input[type="date"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 16%, transparent);
}

/* 字体颜色 / 背景色板 */
.cm-colors,
.cm-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.cm-swatches {
    display: grid;
    grid-template-columns: repeat(9, 28px);
    gap: 9px;
}
.cm-dot,
.cm-swatch {
    position: relative;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(15, 20, 25, .12);
    border-radius: 7px;
    cursor: pointer;
    box-shadow: none;
    transition: transform var(--mn-dur) var(--mn-ease);
}
.cm-dot:hover,
.cm-swatch:hover {
    transform: scale(1.08);
}
.cm-dot.is-active,
.cm-swatch.is-active {
    box-shadow: 0 0 0 2px var(--accent);
}
/* 浅色块上也看得见勾 */
.cm-dot.is-active::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 5px;
    width: 6px;
    height: 11px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(42deg);
}
.cm-dot.is-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: conic-gradient(#f87171, #fbbf24, #34d399, #60a5fa, #a78bfa, #f87171);
    color: #fff;
}
.cm-dot.is-custom::after {
    content: '+';
    font-size: 15px;
    line-height: 1;
    font-weight: 600;
}
.cm-dot.is-custom.is-active::after {
    content: '+' !important;
    position: static;
    width: auto;
    height: auto;
    border: 0;
    transform: none;
}
.cm-dot.is-custom input,
.cm-swatch.is-custom input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
/* 自定义背景色块：彩色渐变 + 加号，原生取色器盖在上面但看不见 */
.cm-swatch.is-custom {
    background-image: conic-gradient(#f87171, #fbbf24, #34d399, #60a5fa, #a78bfa, #f87171);
}
.cm-swatch.is-custom::after {
    content: '+';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

/* 背景：图片 / 颜色 分段 */
.cm-seg {
    display: flex;
    padding: 3px;
    border-radius: 10px;
    background: #f0f3f6;
}
.cm-seg button {
    flex: 1;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--mn-text-2);
    cursor: pointer;
    transition: background var(--mn-dur) var(--mn-ease), color var(--mn-dur) var(--mn-ease);
}
.cm-seg button.is-active {
    background: #fff;
    color: var(--mn-text);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 20, 25, .1);
}
.cm-bgimg[hidden],
.cm-swatches[hidden] {
    display: none;
}

/* 背景遮罩滑块 */
.cm-range {
    width: 100%;
    height: 22px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}
.cm-range::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: #e3e8ee;
}
.cm-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 20, 25, .28), 0 0 0 1px rgba(15, 20, 25, .12);
}
.cm-range::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: #e3e8ee;
}
.cm-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 20, 25, .28);
}

.cm-done {
    width: 100%;
    height: 44px;
    margin-top: auto;
    border: 0;
    border-radius: var(--mn-r-md);
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: filter var(--mn-dur) var(--mn-ease), transform var(--mn-dur) var(--mn-ease);
}
.cm-done:hover {
    filter: brightness(1.05);
}
.cm-done:active {
    transform: scale(.99);
}

/* 右栏预览 */
.cm-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px 20px;
    border-left: 1px solid var(--mn-border);
    background: #f7f9fb;
}
.cm-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 150px;
    height: 150px;
    border-radius: 24px;
    overflow: hidden;
    color: #fff;
    background: #2f6bff;
    box-shadow: 0 16px 34px rgba(15, 20, 25, .18);
}
.cm-tile-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(8, 12, 20, .26), rgba(8, 12, 20, .04) 44%, rgba(8, 12, 20, .34));
}
.cm-tile-days {
    position: relative;
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .32);
}
.cm-tile-unit {
    position: relative;
    font-size: 11px;
    opacity: .9;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .34);
}
.cm-name {
    width: 100%;
    max-width: 240px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(15, 20, 25, .06);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: var(--mn-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cm-date {
    margin: 0;
    font-size: 12.5px;
    color: var(--mn-text-2);
    text-align: center;
}

/* 深色 */
:root[data-theme="dark"] .card-modal-box {
    background: #1b1f26;
    box-shadow: var(--mn-shadow-pop), inset 0 0 0 1px rgba(255, 255, 255, .07);
}
:root[data-theme="dark"] .cm-form input[type="text"],
:root[data-theme="dark"] .cm-form input[type="date"] {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .14);
    color: var(--mn-text);
}
:root[data-theme="dark"] .cm-seg {
    background: rgba(255, 255, 255, .06);
}
:root[data-theme="dark"] .cm-seg button.is-active {
    background: rgba(255, 255, 255, .14);
    color: var(--mn-text);
    box-shadow: none;
}
:root[data-theme="dark"] .cm-preview {
    background: #14171c;
    border-left-color: rgba(255, 255, 255, .07);
}
:root[data-theme="dark"] .cm-name {
    background: rgba(255, 255, 255, .08);
}
:root[data-theme="dark"] .cm-range::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, .16);
}
:root[data-theme="dark"] .cm-range::-moz-range-track {
    background: rgba(255, 255, 255, .16);
}
:root[data-theme="dark"] .cm-dot,
:root[data-theme="dark"] .cm-swatch {
    border-color: rgba(255, 255, 255, .16);
}

/* 抽屉里小组件卡片的缩略图 */
.li-ico {
    position: relative;
}
.li-widget-mark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.5px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

/* 拖动图标时把面板滚动关掉：transform 的位移也算 scrollable overflow，
   不关的话面板会冒出一条根本不是内容撑出来的滚动条 */
.folder-modal-panel.is-dragging-item {
    overflow: hidden;
}

/* 抽屉三段式 tab：胶囊分段，选中用主题色 */
.drawer-tabs {
    display: flex;
    gap: 4px;
    margin: 4px 16px 10px;
    padding: 4px;
    border-radius: var(--el9-r-full, 999px);
    background: rgba(15, 20, 25, .045);
}
.drawer-tabs button {
    flex: 1;
    height: 34px;
    border: 0;
    border-radius: var(--el9-r-full, 999px);
    background: transparent;
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--mn-text-2);
    cursor: pointer;
    transition: background var(--mn-dur) var(--mn-ease), color var(--mn-dur) var(--mn-ease);
}
.drawer-tabs button.is-active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
:root[data-theme="dark"] .drawer-tabs {
    background: rgba(255, 255, 255, .06);
}
.drawer-pane[hidden] {
    display: none;
}

/* ---------- 抽屉「手动添加」表单 ---------- */

.mn-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 16px 24px;
    overflow: auto;
    height: 100%;
}
.mn-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.mn-label {
    font-size: 12.5px;
    color: var(--mn-text-2);
}
.mn-field input {
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--mn-border-strong);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    color: var(--mn-text);
    outline: none;
    transition: border-color var(--mn-dur) var(--mn-ease), box-shadow var(--mn-dur) var(--mn-ease);
}
.mn-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 16%, transparent);
}
.mn-input-row {
    display: flex;
    gap: 8px;
}
.mn-input-row input {
    flex: 1;
    min-width: 0;
}
.mn-fetch {
    flex: none;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--mn-border-strong);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    color: var(--mn-text);
    cursor: pointer;
    white-space: nowrap;
}
.mn-fetch:hover {
    background: var(--mn-bg-hover);
}
.mn-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mn-color {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.mn-color.is-none {
    background:
        linear-gradient(45deg, #fff 45%, #d9dee4 45%, #d9dee4 55%, #fff 55%);
}
.mn-color.is-active {
    border-color: var(--accent);
}
.mn-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.mn-save {
    flex: 1;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: filter var(--mn-dur) var(--mn-ease);
}
.mn-save:hover {
    filter: brightness(1.05);
}
.mn-save[disabled] {
    opacity: .6;
    cursor: default;
}
.mn-save-next {
    flex: none;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--mn-border-strong);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 13.5px;
    color: var(--mn-text);
    cursor: pointer;
    white-space: nowrap;
}
.mn-save-next:hover {
    background: var(--mn-bg-hover);
}
:root[data-theme="dark"] .mn-field input {
    background: rgba(18, 22, 28, .8);
    border-color: rgba(255, 255, 255, .12);
    color: inherit;
}

/* 压着壁纸时描边要用白的，不然看不见 */
body.has-wallpaper .search {
    border-color: rgba(255, 255, 255, .28);
}

/* 深色下的搜索框：软底换成半透明白，聚焦提亮一档 */
:root[data-theme="dark"] .search {
    background: rgba(255, 255, 255, .08);
}
:root[data-theme="dark"] .search:focus-within {
    background: rgba(255, 255, 255, .13);
}

/* ---------- 壁纸选择面板 ---------- */

.wp-box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(720px, 100%);
    max-height: min(86vh, 600px);
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 20, 25, .22), inset 0 0 0 1px var(--mn-border);
}

.wp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
    gap: 12px;
    padding: 18px 20px 20px;
    overflow: auto;
}

/*
 * 缩略图用 padding-top 撑 16:10（button 上 aspect-ratio 不稳，
 * 高度会由内容决定，格子互相叠在一起）
 */
.wp-item {
    position: relative;
    width: 100%;
    height: 0;
    padding: 62.5% 0 0;
    border: 0;
    border-radius: 10px;
    background: #eef1f5 center / cover no-repeat;
    box-shadow: inset 0 0 0 1px rgba(15, 20, 25, .08);
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--mn-dur) var(--mn-ease), box-shadow var(--mn-dur) var(--mn-ease);
}
.wp-item:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(15, 20, 25, .08), 0 8px 18px rgba(15, 20, 25, .14);
}
.wp-item.is-active {
    box-shadow: 0 0 0 2px var(--accent), 0 8px 18px rgba(15, 20, 25, .14);
}
.wp-item.is-active::after {
    content: '';
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
    box-shadow: 0 1px 4px rgba(15, 20, 25, .3);
}

/* 「无壁纸」那一格 */
.wp-item.is-none {
    display: block;
    font: inherit;
    font-size: 13px;
    line-height: 0;
    color: var(--mn-text-2);
    background-image: repeating-linear-gradient(45deg, #f3f5f8 0 8px, #eaeef3 8px 16px);
}
.wp-item.is-none span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

:root[data-theme="dark"] .wp-box {
    background: #1b1f26;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .07);
}
:root[data-theme="dark"] .wp-item {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
:root[data-theme="dark"] .wp-item.is-none {
    background-image: repeating-linear-gradient(45deg, #22262d 0 8px, #1a1e24 8px 16px);
}

/* ---------- 简介模式：只留时钟和搜索 ---------- */

body.is-minimal .apps,
body.is-minimal .add-btn {
    display: none;
}

/*
 * 不放在正中间：底部垫一块空白把整组往上顶，
 * 跟 mtab 那样落在视口上三分之一附近，看着才舒展
 */
body.is-minimal .page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 24px 40vh;
}

/* 手机上再往上收太多就挤了，留一点 */
@media (max-width: 640px) {
    body.is-minimal .page {
        padding: 0 20px 26vh;
    }
}

body.is-minimal .hero {
    padding: 0;
}

/* 页脚贴底，不占位，时钟才真的在屏幕正中 */
body.is-minimal .foot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 24px 20px;
}

/* 简介模式按钮的选中态 */
.tool.is-on {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ---------- 亮度 / 模糊面板 ---------- */

.look-box {
    position: relative;
    width: min(520px, 100%);
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 20, 25, .22), inset 0 0 0 1px var(--mn-border);
}

.look-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 22px 22px 26px;
}

.look-field {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.look-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mn-text);
}

.look-label b {
    font-size: 13px;
    font-weight: 500;
    color: var(--mn-text-2);
    font-variant-numeric: tabular-nums;
}

/* 滑块：蓝色轨道 + 白底蓝边圆点（跟 mtab 那个一致） */
.look-range {
    width: 100%;
    height: 20px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}
.look-range::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(to right,
        var(--accent) var(--look-fill, 0%),
        #e6ecf3 var(--look-fill, 0%));
}
.look-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    margin-top: -6.5px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 20, 25, .16);
}
.look-range::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(to right,
        var(--accent) var(--look-fill, 0%),
        #e6ecf3 var(--look-fill, 0%));
}
.look-range::-moz-range-progress {
    height: 4px;
    border-radius: 999px;
    background: var(--accent);
}
.look-range::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: #fff;
}

/* 壁纸层：模糊时向外多铺一点，别露白边 */
.wallpaper-photo {
    inset: calc(-1 * var(--wp-spread, 0%));
    transition: filter .12s linear;
}

/* 矮屏（手机横屏）：时钟和搜索收一收，别把图标挤没 */
@media (max-height: 520px) {
    .hero {
        padding: 54px 0 16px;
    }

    .clock-time {
        font-size: clamp(34px, 5vw, 46px);
    }

    .search-wrap {
        margin-top: 14px;
    }

    .search {
        height: 42px;
    }
}

/* 超窄屏（320 那种）4 列太挤，退回 3 列 */
@media (max-width: 340px) {
    .app-cell {
        width: calc((100% - 8px) / 3);
    }
}

/* 拖拽时跟着手走的那个 clone（forceFallback 生成的） */
.folder-app.sortable-fallback {
    opacity: .96;
    cursor: grabbing;
    filter: drop-shadow(0 16px 30px rgba(10, 14, 22, .32));
    z-index: 9999 !important;
}

/* ---------- 卡片右键小菜单 ---------- */

.card-menu {
    position: fixed;
    z-index: 60;
    min-width: 176px;
    padding: 6px;
    border-radius: 12px;
    background: var(--panel);
    color: var(--panel-text);
    border: 1px solid var(--panel-line);
    box-shadow: 0 14px 36px rgba(18, 24, 38, .16), 0 2px 6px rgba(18, 24, 38, .08);
}

.cm-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 8px;
}

.cm-label {
    font-size: 12px;
    color: var(--panel-text-3);
}

.cm-chip {
    flex: 1;
    padding: 5px 0;
    border: 1px solid var(--panel-line);
    border-radius: 8px;
    background: transparent;
    font-size: 12px;
    color: var(--panel-text-2);
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.cm-chip:hover {
    background: rgba(15, 20, 25, .05);
}

.cm-chip.is-on {
    border-color: #2f6bff;
    background: rgba(47, 107, 255, .10);
    color: #2f6bff;
    font-weight: 600;
}

.cm-del {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 13px;
    text-align: left;
    color: #e5484d;
    cursor: pointer;
}

.cm-del:hover {
    background: rgba(229, 72, 77, .10);
}

/* ---------- 日历弹窗 ---------- */

.cal-sheet {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cal-sheet[hidden] {
    display: none;
}

.cs-mask {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 20, .42);
    backdrop-filter: blur(3px);
}

.cs-panel {
    position: relative;
    display: flex;
    width: min(1000px, 100%);
    max-height: min(640px, 100%);
    border-radius: 18px;
    background: #fff;
    color: #1f2329;
    box-shadow: 0 32px 80px rgba(10, 16, 28, .28);
    overflow: hidden;
}

.cs-x {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 20, 25, .05);
    color: #5b6472;
    cursor: pointer;
}

.cs-x:hover {
    background: rgba(15, 20, 25, .10);
}

.cs-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 18px;
}

.cs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.cs-year,
.cs-month {
    height: 30px;
    padding: 0 8px;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #1f2329;
}

.cs-year {
    width: 84px;
}

.cs-step {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    background: #fff;
    color: #5b6472;
    cursor: pointer;
}

.cs-step:hover {
    background: #f4f6f8;
}

.cs-today {
    margin-left: auto;
    height: 30px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: #2f6bff;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
}

.cs-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding-bottom: 6px;
    font-size: 12px;
    color: #97a0ab;
    text-align: center;
}

.cs-week span:first-child,
.cs-week span:last-child {
    color: #e5484d;
}

.cs-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    gap: 4px;
    overflow-y: auto;
    scrollbar-width: none;
}

.cs-grid::-webkit-scrollbar {
    display: none;
}

.cs-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 62px;
    padding: 6px 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: background .14s ease;
}

.cs-cell:hover {
    background: #f4f6f8;
}

.cs-cell.is-pad {
    cursor: default;
}

.cs-cell.is-pad:hover {
    background: transparent;
}

.cs-num {
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #1f2329;
}

.cs-sub {
    font-size: 11px;
    line-height: 1.2;
    color: #97a0ab;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cs-cell.is-weekend .cs-num {
    color: #e5484d;
}

.cs-sub.is-term {
    color: #e5484d;
}

.cs-sub.is-fest {
    color: #2f6bff;
}

/* 今天：蓝底白字，跟 mtab 一样 */
.cs-cell.is-today {
    background: #2f6bff;
}

.cs-cell.is-today .cs-num,
.cs-cell.is-today .cs-sub {
    color: #fff;
}

.cs-cell.is-on {
    box-shadow: inset 0 0 0 1.5px #2f6bff;
}

.cs-cell.is-today.is-on {
    box-shadow: none;
}

.cs-loading {
    grid-column: 1 / -1;
    padding: 30px 0;
    font-size: 13px;
    color: #97a0ab;
    text-align: center;
}

/* 右侧当天详情 */
.cs-side {
    flex: none;
    width: 292px;
    padding: 22px 24px;
    border-left: 1px solid #eef0f3;
    background: #fafbfc;
    overflow-y: auto;
    scrollbar-width: none;
}

.cs-side::-webkit-scrollbar {
    display: none;
}

.cs-date {
    font-size: 13px;
    color: #5b6472;
    text-align: center;
}

.cs-chip {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    margin: 14px auto 12px;
    border-radius: 16px;
    background: #2f6bff;
    font-size: 40px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.cs-lunar {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.6;
    color: #1f2329;
    text-align: center;
}

.cs-gz {
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #1f2329;
    text-align: center;
}

.cs-meta {
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid #eef0f3;
    font-size: 12.5px;
    color: #7b8494;
    text-align: center;
}

@media (max-width: 820px) {
    .cal-sheet {
        padding: 0;
    }

    .cs-panel {
        flex-direction: column;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .cs-main {
        padding: 16px 14px 10px;
    }

    .cs-side {
        width: 100%;
        border-left: 0;
        border-top: 1px solid #eef0f3;
        padding: 14px 16px 20px;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 4px 14px;
        align-items: center;
    }

    .cs-chip {
        grid-row: span 3;
        margin: 0;
        width: 64px;
        height: 64px;
        font-size: 30px;
        border-radius: 14px;
    }

    .cs-date,
    .cs-lunar,
    .cs-gz,
    .cs-meta {
        text-align: left;
    }

    .cs-meta {
        border-top: 0;
        padding-top: 0;
    }

    .cs-cell {
        min-height: 54px;
    }
}
