/* =========================================================
   TG 图库 — iOS 风格界面
   8pt 网格 / 连续圆角 / 系统色 / 分组卡片 / 毛玻璃导航
   ========================================================= */

:root {
    /* 背景与卡片 */
    --bg:        #f2f2f7;
    --card:      #ffffff;
    --card-2:    #fbfbfd;
    --fill:      rgba(120, 120, 128, .12);
    --fill-2:    rgba(120, 120, 128, .08);
    --sep:       rgba(60, 60, 67, .10);
    --sep-strong:rgba(60, 60, 67, .18);

    /* 文字 */
    --text:      #1c1c1e;
    --text-2:    rgba(60, 60, 67, .60);
    --text-3:    rgba(60, 60, 67, .30);

    /* 系统色 */
    --blue:      #007aff;
    --blue-soft: rgba(0, 122, 255, .10);
    --green:     #34c759;
    --orange:    #ff9500;
    --red:       #ff3b30;
    --gray:      #8e8e93;

    /* 圆角 */
    --r-xs: 8px;
    --r-sm: 10px;
    --r:    14px;
    --r-lg: 18px;
    --r-xl: 22px;

    /* 阴影 */
    --sh-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .02);
    --sh-2: 0 2px 8px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --sh-3: 0 12px 32px -12px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .04);

    --nav-h: 44px;
    --spring: cubic-bezier(.32, .72, 0, 1);
    --ease: cubic-bezier(.4, 0, .2, 1);
}

/* 暗色：由页面上的 data-theme 决定（按时间段自动切换，也可手动切换） */
:root[data-theme="dark"] {
    --bg:        #000000;
    --card:      #1c1c1e;
    --card-2:    #2c2c2e;
    --fill:      rgba(120, 120, 128, .24);
    --fill-2:    rgba(120, 120, 128, .16);
    --sep:       rgba(84, 84, 88, .55);
    --sep-strong:rgba(84, 84, 88, .75);

    --text:      #ffffff;
    --text-2:    rgba(235, 235, 245, .60);
    --text-3:    rgba(235, 235, 245, .30);

    --blue:      #0a84ff;
    --blue-soft: rgba(10, 132, 255, .16);

    --sh-1: 0 1px 2px rgba(0, 0, 0, .5);
    --sh-2: 0 2px 8px rgba(0, 0, 0, .5);
    --sh-3: 0 12px 32px -12px rgba(0, 0, 0, .8);
    color-scheme: dark;
}

:root { color-scheme: light; }

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
                 "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p, dl, dd { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
svg { display: block; flex: none; }

.muted { color: var(--text-2); }

* { scrollbar-width: thin; scrollbar-color: var(--fill) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--fill); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }

/* ---------- 导航栏（毛玻璃） ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40;
    height: var(--nav-h);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: .5px solid transparent;
    transition: border-color .2s var(--ease);
}
.topbar.is-stuck { border-bottom-color: var(--sep); }

.topbar-inner {
    max-width: 1080px; height: 100%; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.tb-grid {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    max-width: 640px;
    margin: 0 auto;
    height: 100%;
    padding: 0 8px;
}

.tb-title {
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.tb-icon {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: var(--blue);
    justify-self: start;
    transition: background .15s var(--ease), transform .15s var(--spring);
}
.tb-icon:last-child { justify-self: end; }
.tb-icon:hover { background: var(--fill-2); }
.tb-icon:active { transform: scale(.92); }

/* ---------- 容器 ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 64px; }
.wrap:has(.moment-page) { max-width: 820px; padding: 0; }

/* ---------- 首页 ---------- */
body:has(.moment-page) .footer { display: none; }

.moment-page {
    padding: 0 16px 40px;
    min-height: 70vh;
}

/* 大标题 */
.site-head { padding: 8px 2px 18px; }
.site-head h1 {
    font-size: 32px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.028em;
    color: var(--text);
}
.site-head p {
    font-size: 15px;
    color: var(--text-2);
    margin-top: 3px;
    letter-spacing: -.01em;
}

/* 封面 */
.cover {
    position: relative;
    height: 208px;
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--fill);
    box-shadow: var(--sh-2);
    margin-bottom: 16px;
    transform: translateZ(0);
}

.cover-img {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
}

.cover-img::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .12) 0%, transparent 38%, rgba(0, 0, 0, .42) 100%);
}

.cover-user {
    position: absolute; left: 14px; right: 14px; bottom: 14px;
    display: flex; align-items: flex-end; justify-content: flex-end; gap: 11px;
    z-index: 2;
}

.cover-meta { text-align: right; padding-bottom: 4px; min-width: 0; }

.cover-name {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.25;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cover-sub {
    color: rgba(255, 255, 255, .82);
    font-size: 12.5px;
    margin-top: 2px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

.cover-avatar {
    width: 56px; height: 56px; flex: none;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .92);
    background: rgba(255, 255, 255, .95);
    color: var(--gray);
    display: grid; place-items: center;
    font-size: 19px; font-weight: 600;
    letter-spacing: -.02em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}

/* 搜索 */
.m-search {
    position: relative;
    margin-bottom: 10px;
}

.m-search .s-ico {
    position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
    color: var(--text-3); pointer-events: none;
}

.m-search input[type=search] {
    width: 100%; height: 36px;
    padding: 0 12px 0 34px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--fill);
    color: var(--text);
    font-size: 16px;
    letter-spacing: -.01em;
    outline: none;
    -webkit-appearance: none;
    transition: background .15s var(--ease);
}
.m-search input[type=search]::placeholder { color: var(--text-3); }
.m-search input[type=search]:focus { background: var(--fill); box-shadow: 0 0 0 3px var(--blue-soft); }

/* 分段控件 */
.segmented {
    display: flex;
    gap: 2px;
    padding: 2px;
    border-radius: var(--r-sm);
    background: var(--fill);
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 16px;
}
.segmented::-webkit-scrollbar { display: none; }

.seg {
    flex: 1 0 auto;
    min-width: 72px;
    padding: 5px 12px;
    text-align: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -.01em;
    color: var(--text);
    white-space: nowrap;
    transition: background .18s var(--ease), box-shadow .18s var(--ease);
}
.seg:hover { color: var(--text); }
.seg.on {
    background: var(--card);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .10), 0 1px 1px rgba(0, 0, 0, .04);
}

/* 卡片列表 */
.moment-list { display: flex; flex-direction: column; gap: 12px; }

.moment {
    background: var(--card);
    border-radius: var(--r-lg);
    padding: 14px;
    box-shadow: var(--sh-1);
    display: flex;
    gap: 10px;
}

.m-avatar {
    width: 40px; height: 40px; flex: none;
    border-radius: 50%;
    overflow: hidden;
    display: grid; place-items: center;
    background: var(--fill);
    color: var(--text-2);
    font-size: 15px;
    font-weight: 500;
}
.m-avatar img { width: 100%; height: 100%; object-fit: cover; }

.m-body { flex: 1; min-width: 0; }

.m-name {
    display: inline-block;
    color: var(--blue);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    vertical-align: bottom;
}
.m-name:active { opacity: .6; }

.m-text {
    margin: 2px 0 0;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -.01em;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* 图片网格 */
.m-media {
    margin-top: 8px;
    display: grid;
    gap: 6px;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
}
.m-media.n2 { grid-template-columns: repeat(2, 1fr); width: 100%; }
.m-media.n4 { grid-template-columns: repeat(2, 1fr); }

.m-media .mi {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--r-xs);
    background: var(--fill);
    transform: translateZ(0);
}

/* 按原始宽高比完整展示，不裁切 */
.m-media .mi img {
    display: block;
    width: 100%;
    height: auto;
}

.m-media .mi:active { opacity: .85; }

.m-media .mi.more {
    aspect-ratio: 1 / 1;
    display: grid; place-items: center;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    backdrop-filter: blur(2px);
}

.m-media.n1 { width: auto; grid-template-columns: 1fr; }
.m-media.n1 .mi { background: none; }
.m-media.n1 .mi img {
    width: auto; height: auto;
    max-width: 100%;
    max-height: 480px;
    border-radius: var(--r);
}

/* 时间行 */
.m-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.m-time { font-size: 13px; color: var(--text-3); letter-spacing: -.01em; }

.m-more {
    margin-left: auto;
    width: 28px; height: 22px;
    border: 0;
    border-radius: 6px;
    background: var(--fill-2);
    color: var(--text-2);
    display: grid; place-items: center;
    cursor: pointer;
    transition: background .15s var(--ease), transform .15s var(--spring);
}
.m-more:hover { background: var(--fill); }
.m-more:active { transform: scale(.9); }

/* 展开菜单 */
.m-actions {
    display: none;
    margin-top: 8px;
    border-radius: var(--r-sm);
    background: var(--card-2);
    border: .5px solid var(--sep);
    overflow: hidden;
}
.m-actions.open { display: block; animation: menuIn .22s var(--spring); }

@keyframes menuIn {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.m-act {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    background: none;
    text-align: left;
    font-size: 14px;
    color: var(--blue);
    cursor: pointer;
}
.m-act:hover { background: var(--fill-2); }
.m-act:active { background: var(--fill); }
.m-act + .m-act { border-top: .5px solid var(--sep); }
.m-act svg { opacity: .7; }

/* 空状态 */
.moment-empty {
    background: var(--card);
    border-radius: var(--r-lg);
    padding: 56px 24px;
    text-align: center;
    box-shadow: var(--sh-1);
}
.moment-empty h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.moment-empty p { font-size: 14px; color: var(--text-2); }
.moment-empty .btn { margin-top: 18px; }

.moment-end {
    display: block;
    text-align: center;
    padding: 18px 0 8px;
    font-size: 13px;
    color: var(--text-3);
}

/* 图片：直接可见，避免 JS 未执行时空白 */
img[data-fade] { opacity: 1; }

/* ---------- 按钮（iOS 风格） ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 14px;
    border: 0;
    border-radius: var(--r-sm);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -.01em;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s var(--ease), transform .15s var(--spring), opacity .15s;
    -webkit-appearance: none;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue); opacity: .88; color: #fff; }

.btn-ghost { background: var(--fill); color: var(--text); }
.btn-ghost:hover { background: var(--fill); opacity: .8; color: var(--text); }

.btn-quiet { background: transparent; color: var(--blue); }
.btn-quiet:hover { background: var(--fill-2); color: var(--blue); }

.btn-danger { background: var(--fill); color: var(--red); }
.btn-danger:hover { background: rgba(255, 59, 48, .12); color: var(--red); }

.btn-sm { height: 28px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 16px; border-radius: var(--r); }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 4px; }

/* ---------- 提示 ---------- */
.flash {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 11px 14px;
    border-radius: var(--r-sm);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.flash svg { margin-top: 2px; }
.flash.ok   { background: rgba(52, 199, 89, .12);  color: #248a3d; }
.flash.err  { background: rgba(255, 59, 48, .10);  color: #d70015; }
.flash.warn { background: rgba(255, 149, 0, .12);  color: #b25000; }
[data-theme="dark"] .flash.ok   { color: #4cd964; }
[data-theme="dark"] .flash.err  { color: #ff6961; }
[data-theme="dark"] .flash.warn { color: #ffb340; }

/* ---------- 面包屑 ---------- */
.crumbs {
    display: flex; align-items: center; gap: 5px;
    font-size: 13px; color: var(--text-3);
    margin-bottom: 14px; flex-wrap: wrap;
}
.crumbs a { color: var(--text-2); }
.crumbs svg { opacity: .4; }

/* ---------- 详情 ---------- */
.post {
    background: var(--card);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--sh-1);
}

.post-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 14px 16px;
}

.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.who b { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 13px; color: var(--text-2); }

.post-media { background: var(--fill-2); }
.post-media img, .post-media video {
    width: 100%; max-height: 76vh; object-fit: contain; margin: 0 auto;
}
.zoomable { cursor: zoom-in; display: block; }

.post-caption {
    padding: 14px 16px;
    font-size: 16px;
    line-height: 1.55;
    letter-spacing: -.01em;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
    padding: 12px 16px 14px;
    font-size: 13px;
    color: var(--text-2);
}
.post-meta .meta-item { display: inline-flex; align-items: center; gap: 4px; }
.post-meta .btn { margin-left: auto; }

.siblings { padding: 12px 16px 16px; border-top: .5px solid var(--sep); }
.siblings h3 { font-size: 12px; font-weight: 500; color: var(--text-3); margin-bottom: 9px; }
.thumbs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; }
.thumb {
    flex: none; width: 64px; height: 64px;
    border-radius: var(--r-xs);
    overflow: hidden;
    border: 2px solid transparent;
    opacity: .65;
    transition: opacity .15s, border-color .15s;
}
.thumb:hover { opacity: 1; }
.thumb.on { border-color: var(--blue); opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 相册 ---------- */
.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; background: var(--fill-2); }
.album-item { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--fill); }
.album-item img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 页脚 ---------- */
.footer { padding: 24px 16px 40px; }
.footer-inner {
    max-width: 760px; margin: 0 auto;
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
    color: var(--text-3); font-size: 12.5px;
}
.footer-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); opacity: .5; }
.footer a { color: var(--text-2); }

/* =========================================================
   后台
   ========================================================= */

.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px; flex: none;
    background: var(--card);
    border-right: .5px solid var(--sep);
    padding: 16px 12px;
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 2px;
    overflow-y: auto;
}

.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }

.brand-mark {
    width: 30px; height: 30px; flex: none;
    border-radius: 9px;
    background: linear-gradient(160deg, #5ac8fa, #007aff);
    color: #fff;
    display: grid; place-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    box-shadow: 0 2px 8px rgba(0, 122, 255, .28);
}

.side-brand b { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.side-brand small { display: block; font-size: 12px; color: var(--text-2); font-weight: 400; }

.side-label {
    padding: 14px 10px 5px;
    font-size: 12px;
    color: var(--text-3);
    letter-spacing: -.01em;
}

.side-link {
    display: flex; align-items: center; gap: 10px;
    height: 36px; padding: 0 10px;
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14.5px;
    transition: background .15s var(--ease);
}
.side-link svg { color: var(--text-2); }
.side-link:hover { background: var(--fill-2); color: var(--text); }
.side-link.on { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.side-link.on svg { color: var(--blue); }

.side-foot { margin-top: auto; padding: 14px 4px 0; }
.side-tip {
    padding: 11px 12px;
    border-radius: var(--r-sm);
    background: var(--fill-2);
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-2);
}
.side-tip b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

.admin-main { flex: 1; min-width: 0; padding: 24px 28px 60px; }

.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.025em; }
.page-head .sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }

/* 面板 */
.panel {
    background: var(--card);
    border-radius: var(--r-lg);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--sh-1);
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
    border-bottom: .5px solid var(--sep);
}
.panel-head .hint { font-size: 12.5px; font-weight: 400; color: var(--text-2); }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }

/* 统计 */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.stat {
    background: var(--card);
    border-radius: var(--r);
    padding: 14px 16px;
    box-shadow: var(--sh-1);
}
.stat b {
    display: block;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}
.stat span { font-size: 12.5px; color: var(--text-2); }
.stat .stat-ico { display: none; }

/* 表单 */
.field {
    display: flex; gap: 20px;
    padding: 14px 0;
    border-top: .5px solid var(--sep);
    align-items: flex-start;
}
.field:first-child { border-top: 0; padding-top: 0; }

.field > label {
    flex: 0 0 158px;
    padding-top: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
.field .ctrl { flex: 1; min-width: 0; }
.field .hint { font-size: 12.5px; color: var(--text-2); margin-top: 7px; line-height: 1.55; }
.field .hint b { color: var(--text); font-weight: 600; }

input[type=text], input[type=password], input[type=url], input[type=number],
input[type=search], input[type=email], select, textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: .5px solid var(--sep-strong);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    letter-spacing: -.01em;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}
textarea { height: auto; min-height: 92px; padding: 9px 12px; line-height: 1.55; resize: vertical; font-size: 14px; }
input:focus, select:focus, textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3.5px var(--blue-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[readonly] { background: var(--fill-2); color: var(--text-2); }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 32px;
}

input[type=checkbox] {
    width: 20px; height: 20px; margin: 0;
    accent-color: var(--blue);
    cursor: pointer;
}
.check-row { display: flex; align-items: center; gap: 9px; font-size: 15px; color: var(--text); cursor: pointer; }
.check-row + .check-row { margin-top: 9px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
    padding: 10px 16px;
    text-align: left;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    border-bottom: .5px solid var(--sep);
}
table.data td {
    padding: 11px 16px;
    border-bottom: .5px solid var(--sep);
    vertical-align: middle;
    white-space: nowrap;
}
table.data td.wrap-cell { white-space: normal; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:active { background: var(--fill-2); }
table.data .cell-main { max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
table.data .cell-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; white-space: nowrap; }
table.data td.ellip { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

/* 徽章 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}
.badge.ok   { background: rgba(52, 199, 89, .14);  color: #248a3d; }
.badge.warn { background: rgba(255, 149, 0, .16);  color: #b25000; }
.badge.err  { background: rgba(255, 59, 48, .12);  color: #d70015; }
.badge.mute { background: var(--fill); color: var(--text-2); }
[data-theme="dark"] .badge.ok   { color: #4cd964; }
[data-theme="dark"] .badge.warn { color: #ffb340; }
[data-theme="dark"] .badge.err  { color: #ff6961; }

.code {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--fill-2);
    color: var(--text-2);
    word-break: break-all;
}

.thumb-mini {
    width: 44px; height: 44px;
    max-width: none;
    border-radius: 10px;
    object-fit: cover;
    background: var(--fill);
}

/* 日志 */
.logbox {
    background: #0b0b0d;
    color: #c7ccd4;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.7;
    padding: 14px 16px;
    border-radius: var(--r-sm);
    max-height: 62vh;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 键值 */
.kv { display: grid; grid-template-columns: 136px 1fr; gap: 10px 18px; font-size: 14px; align-items: baseline; }
.kv dt { color: var(--text-2); font-size: 13.5px; }
.kv dd { margin: 0; word-break: break-word; }

/* 快捷块 */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.tile {
    display: flex; gap: 11px;
    padding: 14px 15px;
    background: var(--card);
    border-radius: var(--r);
    box-shadow: var(--sh-1);
    transition: transform .15s var(--spring);
}
.tile:active { transform: scale(.98); }
.tile-ico {
    width: 32px; height: 32px; flex: none;
    border-radius: 9px;
    display: grid; place-items: center;
    background: var(--blue-soft);
    color: var(--blue);
}
.tile b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 1px; }
.tile span { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }

/* 后台 chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none;
    height: 32px; padding: 0 14px;
    display: inline-flex; align-items: center;
    border-radius: 999px;
    background: var(--fill);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
}
.chip.on { background: var(--blue); color: #fff; }

/* =========================================================
   登录 / 安装
   ========================================================= */

.auth-page {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 24px 16px;
    background: var(--bg);
}

.auth-card {
    width: 100%; max-width: 400px;
    background: var(--card);
    border-radius: var(--r-xl);
    padding: 32px 28px;
    box-shadow: var(--sh-3);
}

.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .brand-mark { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px; font-size: 16px; }
.auth-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.auth-head p { color: var(--text-2); font-size: 14px; margin-top: 3px; }

.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.auth-card .btn { width: 100%; height: 46px; font-size: 16px; border-radius: var(--r); }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-2); }

/* 安装 */
.install-page {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 28px 16px;
    background: var(--bg);
}

.install-card {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 320px 1fr;
    background: var(--card);
    border-radius: 24px;
    box-shadow: var(--sh-3);
    overflow: hidden;
}

.install-aside {
    background: #f7f7fb;
    padding: 30px 26px;
    display: flex; flex-direction: column; gap: 24px;
    border-right: .5px solid var(--sep);
}
[data-theme="dark"] .install-aside { background: #141416; }

.install-logo { display: flex; align-items: center; gap: 10px; }
.install-logo .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.install-logo b { font-size: 15px; font-weight: 600; }
.install-logo small { display: block; font-size: 12px; color: var(--text-2); }

.install-aside h2 { font-size: 20px; line-height: 1.4; font-weight: 700; letter-spacing: -.025em; color: var(--text); }
.install-aside .lede { font-size: 13px; line-height: 1.6; color: var(--text-2); }

.install-steps { display: flex; flex-direction: column; gap: 2px; }

.istep { display: flex; gap: 11px; align-items: flex-start; padding: 8px 0; }

.istep-dot {
    width: 22px; height: 22px; flex: none;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--fill);
    color: var(--text-2);
}
.istep-body b { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); }
.istep-body span { font-size: 12px; color: var(--text-3); }

.istep.on .istep-dot { background: var(--blue); color: #fff; }
.istep.on .istep-body b { color: var(--text); font-weight: 600; }
.istep.on .istep-body span { color: var(--text-2); }

.istep.done .istep-dot { background: rgba(52, 199, 89, .16); color: #248a3d; }
.istep.done .istep-body b { color: var(--text); }

.install-aside .aside-foot { margin-top: auto; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.install-aside code { font-size: 11.5px; background: var(--fill); padding: 1px 5px; border-radius: 4px; color: var(--text-2); }

.install-main { padding: 34px 36px 28px; min-width: 0; }

.install-kicker { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.install-title { font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.install-desc { color: var(--text-2); font-size: 13.5px; margin-top: 6px; line-height: 1.55; }

.install-body { margin-top: 20px; }

.install-actions {
    display: flex; align-items: center; gap: 10px;
    margin-top: 26px; padding-top: 20px;
    border-top: .5px solid var(--sep);
}
.install-actions .spacer { flex: 1; }

/* 检查清单 */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px;
    background: var(--card-2);
    border-radius: var(--r-sm);
    font-size: 13.5px;
}
.check-item .ci-ico {
    width: 20px; height: 20px; flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
}
.check-item .ci-ico.ok   { background: rgba(52, 199, 89, .16); color: #248a3d; }
.check-item .ci-ico.warn { background: rgba(255, 149, 0, .18); color: #b25000; }
.check-item .ci-ico.err  { background: rgba(255, 59, 48, .14); color: #d70015; }
.check-item .ci-ico svg { stroke-width: 2.8; }
.check-item .ci-body { flex: 1; min-width: 0; }
.check-item b { font-weight: 500; font-size: 13.5px; }
.check-item small { display: block; color: var(--text-2); font-size: 12px; margin-top: 1px; word-break: break-all; }
.check-item .ci-note { font-size: 12px; color: var(--text-2); max-width: 46%; text-align: right; word-break: break-all; }

/* 选项卡 */
.opt-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.opt-card {
    position: relative;
    display: block;
    padding: 14px;
    border-radius: var(--r);
    background: var(--card-2);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--sep);
    transition: box-shadow .15s var(--ease);
}
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card b { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.opt-card b svg { color: var(--text-2); }
.opt-card small { display: block; color: var(--text-2); font-size: 12px; margin-top: 3px; padding-left: 22px; }
.opt-card.on { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.opt-card.on b svg { color: var(--blue); }

.hint-code { font-size: 12.5px; color: var(--text-2); margin-top: 6px; line-height: 1.55; }
.hint-code a { color: var(--blue); }

.install-note {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 11px 13px;
    margin-top: 18px;
    border-radius: var(--r-sm);
    background: var(--blue-soft);
    color: var(--text);
    font-size: 13px;
    line-height: 1.55;
}
.install-note svg { color: var(--blue); margin-top: 1px; flex: none; }
.install-note b { font-weight: 600; }
.install-note .code { background: rgba(120, 120, 128, .16); }

/* 完成页 */
.done-hero { text-align: center; padding: 12px 0 4px; }
.done-ico {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(52, 199, 89, .14);
    color: #248a3d;
}
[data-theme="dark"] .done-ico { color: #4cd964; }
.done-hero h2 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.done-hero p { color: var(--text-2); font-size: 14px; margin-top: 4px; }

.done-list { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.done-row {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px;
    background: var(--card-2);
    border-radius: var(--r-sm);
    font-size: 13.5px;
}
.done-row .label { color: var(--text-2); flex: none; min-width: 78px; font-size: 13px; }
.done-row .value { flex: 1; min-width: 0; word-break: break-all; }
.copy-btn {
    flex: none;
    width: 30px; height: 30px;
    border: 0;
    border-radius: 8px;
    display: grid; place-items: center;
    background: var(--fill);
    color: var(--text-2);
    cursor: pointer;
}
.copy-btn:active { transform: scale(.92); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .install-card { grid-template-columns: 1fr; }
    .install-aside { padding: 20px 22px; border-right: 0; border-bottom: .5px solid var(--sep); }
    .install-aside h2, .install-aside .lede, .install-aside .aside-foot { display: none; }
    .install-steps { flex-direction: row; gap: 8px; }
    .istep { flex: 1; padding: 0; }
    .istep .istep-body { display: none; }
    .install-main { padding: 24px 20px; }

    .admin-shell { flex-direction: column; }
    .sidebar {
        width: 100%; height: auto; position: static;
        flex-direction: row; flex-wrap: wrap; align-items: center;
        gap: 3px; padding: 8px 12px;
        border-right: 0; border-bottom: .5px solid var(--sep);
        overflow-x: auto;
    }
    .side-brand { padding: 0 10px 0 2px; }
    .side-label, .side-foot { display: none; }
    .side-link { height: 32px; padding: 0 11px; }
    .admin-main { padding: 18px 16px 48px; }

    .field { flex-direction: column; gap: 6px; padding: 12px 0; }
    .field > label { flex: none; padding-top: 0; }
    .kv { grid-template-columns: 1fr; gap: 3px 0; }
    .kv dd { margin-bottom: 8px; }
}

@media (max-width: 620px) {
    .moment-page { padding: 0 12px 32px; }
    .cover { height: 168px; border-radius: var(--r-lg); }
    .cover-avatar { width: 48px; height: 48px; font-size: 17px; }
    .site-head h1 { font-size: 28px; }
    .album { grid-template-columns: repeat(2, 1fr); }
    .auth-card { padding: 26px 22px; }
    .post-meta .btn { margin-left: 0; }
}

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

/* 首页：大标题存在时，导航栏标题滚动后才出现（iOS 行为） */
body:has(.moment-page) .tb-title { opacity: 0; transition: opacity .2s var(--ease); }
body:has(.moment-page) .topbar.is-stuck .tb-title { opacity: 1; }

/* =========================================================
   图片灯箱（点击放大）
   ========================================================= */
.lightbox {
    position: fixed; inset: 0; z-index: 999;
    display: flex; flex-direction: column;
    background: rgba(0, 0, 0, .96);
    opacity: 0; visibility: hidden;
    transition: opacity .22s var(--ease), visibility .22s;
    -webkit-tap-highlight-color: transparent;
}
.lightbox.open { opacity: 1; visibility: visible; }

.lb-bar {
    flex: none;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    min-height: 52px;
    color: #fff;
}
.lb-count { font-size: 14px; font-variant-numeric: tabular-nums; opacity: .82; }

.lb-close {
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .14); color: #fff;
    display: grid; place-items: center; cursor: pointer;
    transition: transform .15s var(--spring), background .15s;
}
.lb-close:active { transform: scale(.9); background: rgba(255, 255, 255, .24); }

.lb-stage {
    flex: 1; min-height: 0;
    display: grid; place-items: center;
    padding: 0 12px;
    overflow: hidden;
}

.lb-img {
    max-width: 100%; max-height: 100%;
    width: auto; height: auto;
    object-fit: contain;
    border-radius: 6px;
    transition: opacity .18s var(--ease);
}
.lb-img.is-loading { opacity: .3; }

.lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 42px; height: 42px; border-radius: 50%;
    border: 0; background: rgba(255, 255, 255, .13); color: #fff;
    display: grid; place-items: center; cursor: pointer;
    transition: transform .15s var(--spring), background .15s;
}
.lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-nav:active { transform: translateY(-50%) scale(.9); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

.lb-foot {
    flex: none;
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
    text-align: center;
}
.lb-detail {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    transition: transform .15s var(--spring), background .15s;
}
.lb-detail:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.lb-detail:active { transform: scale(.97); }

/* 可放大的图片 */
.m-media .mi,
.album-item,
.zoomable { cursor: zoom-in; }

/* =========================================================
   移动端适配
   ========================================================= */
@media (max-width: 860px) {
    .admin-main { padding: 16px 14px 48px; }
    .page-head h1 { font-size: 22px; }
    .panel-body { padding: 14px; }
    .kv { grid-template-columns: 118px 1fr; }
}

@media (max-width: 620px) {
    /* 触摸目标加大 */
    .btn { height: 38px; padding: 0 14px; }
    .btn-sm { height: 32px; padding: 0 11px; }
    .btn-lg { height: 46px; }
    .m-more { width: 32px; height: 26px; }

    /* 灯箱：手机上用滑动，隐藏箭头 */
    .lb-nav { display: none !important; }
    .lb-stage { padding: 0 8px; }
    .lb-bar { min-height: 48px; }

    /* 首页 */
    .moment-page { padding: 0 10px 28px; }
    .site-head { padding: 4px 2px 14px; }
    .site-head h1 { font-size: 26px; }
    .site-head p { font-size: 13.5px; }
    .cover { height: 160px; border-radius: var(--r-lg); margin-bottom: 12px; }
    .cover-avatar { width: 46px; height: 46px; font-size: 16px; border-width: 2.5px; }
    .cover-name { font-size: 15px; }
    .cover-sub { font-size: 11.5px; }
    .m-search input[type=search] { height: 34px; font-size: 15px; }
    .seg { min-width: 64px; font-size: 12.5px; padding: 4px 10px; }
    .moment { padding: 12px; gap: 9px; }
    .m-avatar { width: 36px; height: 36px; }
    .m-text { font-size: 15.5px; }
    .m-media { width: min(270px, 100%); }
    .m-media.n2 { width: min(230px, 100%); }
    .m-media.n1 .mi img { max-height: 420px; }

    /* 详情 */
    .post { border-radius: var(--r-lg); }
    .post-head { padding: 12px 14px; }
    .post-caption { padding: 12px 14px; font-size: 15.5px; }
    .post-meta { padding: 10px 14px 12px; gap: 5px 12px; }
    .post-meta .btn { margin-left: 0; width: 100%; margin-top: 4px; }
    .siblings { padding: 10px 14px 14px; }
    .thumbs { gap: 6px; }
    .thumb { width: 56px; height: 56px; }

    /* 后台：侧栏横向滚动 */
    .sidebar { padding: 8px 10px; gap: 2px; }
    .side-link { height: 34px; font-size: 13.5px; padding: 0 10px; }
    .side-link svg { width: 15px; height: 15px; }
    .page-head { margin-bottom: 14px; }
    .page-head h1 { font-size: 20px; }
    .page-head .actions { width: 100%; }
    .grid-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat b { font-size: 22px; }
    .field { gap: 6px; }
    .field > label { font-size: 13.5px; }
    .panel-head { padding: 12px 14px; font-size: 14px; flex-wrap: wrap; }
    table.data { font-size: 13px; }
    table.data th, table.data td { padding: 9px 10px; }
    .logbox { font-size: 11px; }
    .tile-grid { grid-template-columns: 1fr; }
    .chips { padding-bottom: 12px; }

    /* 登录 / 安装 */
    .auth-card { border-radius: var(--r-lg); padding: 24px 20px; }
    .install-card { border-radius: var(--r-lg); }
    .install-main { padding: 20px 16px; }
    .install-title { font-size: 21px; }
    .opt-cards { grid-template-columns: 1fr; }
    .check-item { flex-wrap: wrap; }
    .check-item .ci-note { max-width: 100%; text-align: left; padding-left: 25px; }
    .done-row { flex-wrap: wrap; }
    .done-row .label { min-width: 68px; }
}

@media (max-width: 400px) {
    .site-head h1 { font-size: 23px; }
    .cover { height: 140px; }
    .m-media { width: 100%; }
    .m-media.n2 { width: 100%; }
    .grid-stats { grid-template-columns: 1fr; }
    .side-link { font-size: 13px; padding: 0 9px; }
}

/* 防止图片撑破网格（min-content 溢出） */
.m-media { min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.m-media.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.m-media.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.m-media.n1 { grid-template-columns: minmax(0, 1fr); }
.m-media .mi { min-width: 0; max-width: 100%; }
.m-media.n1 .mi img { max-width: 100%; }
.m-body { min-width: 0; }
.moment { min-width: 0; }

/* 灯箱背景改为纯黑，避免透出底层内容 */
.lightbox { background: #000; }
.lb-stage { padding: 0 16px; }

/* 手机端后台：侧栏单行横向滚动 */
@media (max-width: 860px) {
    .sidebar {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
        padding: 8px 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sidebar::-webkit-scrollbar { display: none; }
    .side-brand { flex: none; padding: 0 10px 0 0; }
    .side-brand small { display: none; }
    .side-link { flex: none; white-space: nowrap; }
}

/* 桌面：顶栏与内容对齐，网格撑满卡片 */
body:has(.moment-page) .topbar-inner { max-width: 820px; padding: 0 10px; }
body:has(.moment-page) .tb-grid { max-width: none; }
.m-media { width: 100%; }
.m-media.n2 { width: 100%; }
@media (max-width: 620px) {
    .m-media { width: 100%; }
    .m-media.n2 { width: 100%; }
}

/* ---------- 分类 ---------- */
.m-cat {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 5px;
    background: var(--fill-2);
    color: var(--text-2);
    font-size: 11.5px;
    line-height: 1.6;
}

.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px;
    background: var(--card-2);
    border-radius: var(--r-sm);
}
.cat-main b { display: block; font-size: 14px; font-weight: 600; }
.cat-main span { font-size: 12.5px; color: var(--text-2); }

/* =========================================================
   使用手册
   ========================================================= */
.doc { display: flex; gap: 26px; align-items: flex-start; }

.doc-nav {
    position: sticky; top: 24px;
    width: 158px; flex: none;
    display: flex; flex-direction: column; gap: 1px;
}
.doc-nav a {
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 13px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.doc-nav a:hover { background: var(--fill-2); color: var(--text); }

.doc-body {
    flex: 1; min-width: 0;
    background: var(--card);
    border-radius: var(--r-lg);
    padding: 28px 32px 30px;
    box-shadow: var(--sh-1);
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text);
}

.doc-body section + section {
    margin-top: 6px;
    padding-top: 6px;
    border-top: .5px solid var(--sep);
}

.doc-body h2 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 26px 0 10px;
    scroll-margin-top: 64px;
}
.doc-body section:first-child h2 { margin-top: 0; }

.doc-body h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 6px;
}

.doc-body p { margin: 8px 0; }
.doc-body ul, .doc-body ol { margin: 8px 0; padding-left: 22px; }
.doc-body li { margin: 4px 0; }
.doc-body b { font-weight: 600; }

.doc-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    padding: 1.5px 6px;
    border-radius: 5px;
    background: var(--fill-2);
    color: var(--text);
    word-break: break-word;
}

.doc-body pre {
    margin: 10px 0;
    padding: 12px 14px;
    background: var(--fill-2);
    border-radius: var(--r-sm);
    overflow-x: auto;
}
.doc-body pre code { background: none; padding: 0; }

.doc-body table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13.5px; }
.doc-body th, .doc-body td {
    padding: 8px 12px;
    border-bottom: .5px solid var(--sep);
    text-align: left;
    vertical-align: top;
}
.doc-body th {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-2);
    background: var(--fill-2);
}
.doc-body tr:last-child td { border-bottom: 0; }
.doc-body td .badge { vertical-align: middle; }

.doc-note {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin: 14px 0;
    padding: 11px 14px;
    border-radius: var(--r-sm);
    background: var(--blue-soft);
    font-size: 13.5px;
    line-height: 1.65;
}
.doc-note b { color: var(--blue); }

.doc-foot {
    margin-top: 26px;
    padding-top: 16px;
    border-top: .5px solid var(--sep);
    font-size: 13px;
    color: var(--text-2);
}

@media (max-width: 860px) {
    .doc { flex-direction: column; gap: 12px; }
    .doc-nav {
        position: static; width: 100%;
        flex-direction: row; flex-wrap: nowrap;
        overflow-x: auto; gap: 6px;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .doc-nav::-webkit-scrollbar { display: none; }
    .doc-nav a {
        flex: none;
        background: var(--fill-2);
        padding: 6px 12px;
        border-radius: 999px;
    }
    .doc-body { padding: 20px 18px; font-size: 14px; }
    .doc-body h2 { font-size: 17px; }
    .doc-body table { font-size: 12.5px; }
    .doc-body th, .doc-body td { padding: 7px 8px; }
}

/* =========================================================
   手册插图
   ========================================================= */
.shot {
    margin: 14px 0 6px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--sep);
    background: var(--card);
}
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption {
    padding: 8px 12px;
    font-size: 12.5px;
    color: var(--text-2);
    border-top: .5px solid var(--sep);
    background: var(--card-2);
}

/* 界面示意图 */
.demo-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 18px 0 6px;
    flex-wrap: wrap;
}
.demo-phone {
    width: 192px;
    padding: 8px;
    background: var(--card);
    border: 1px solid var(--sep);
    border-radius: 16px;
    box-shadow: var(--sh-1);
}
.demo-head {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-2);
    padding: 3px 0 8px;
    border-bottom: .5px solid var(--sep);
}
.demo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 8px;
    font-size: 12.5px;
    border-bottom: .5px solid var(--sep);
}
.demo-row:last-child { border-bottom: 0; }
.demo-row.hl {
    background: var(--blue-soft);
    color: var(--blue);
    border-radius: 7px;
    font-weight: 600;
    border-bottom-color: transparent;
}
.demo-row b { font-weight: 600; }
.demo-name { font-size: 12px; color: var(--blue); }

.demo-switch {
    position: relative;
    width: 34px; height: 20px;
    border-radius: 10px;
    background: var(--green);
    flex: none;
}
.demo-switch::after {
    content: "";
    position: absolute;
    right: 2px; top: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.demo-arrow { color: var(--text-3); font-size: 18px; }

.demo-cap {
    text-align: center;
    font-size: 12.5px;
    color: var(--text-2);
    margin: 0 0 14px;
}

@media (max-width: 620px) {
    .demo-steps { gap: 8px; }
    .demo-phone { width: 152px; padding: 6px; }
    .demo-row { font-size: 11.5px; padding: 7px 6px; }
    .shot figcaption { font-size: 12px; padding: 7px 10px; }
}

.demo-arrow { font-size: 20px; color: var(--text-3); }

.shot img { cursor: zoom-in; }

/* ---------- 品牌图（封面 / 头像）后台预览 ---------- */
.brand-preview {
    display: inline-block;
    overflow: hidden;
    background: var(--fill);
    border: 1px solid var(--sep);
    margin-bottom: 4px;
}
.brand-preview.wide {
    width: 240px; height: 120px;
    border-radius: 10px;
}
.brand-preview.round {
    width: 72px; height: 72px;
    border-radius: 50%;
}
.brand-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 首页封面头像支持图片 */
.cover-avatar { overflow: hidden; }
.cover-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* 后台上传控件稍微收窄 */
input[type=file] {
    width: 100%;
    font-size: 13px;
    color: var(--text-2);
}
input[type=file]::file-selector-button {
    height: 30px;
    padding: 0 12px;
    margin-right: 10px;
    border: 0;
    border-radius: 7px;
    background: var(--fill);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--fill-2); }

/* ---------- 主题切换按钮 ---------- */
button.tb-icon.theme-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.theme-toggle > span {
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle .tt-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-sun { display: flex; }
:root[data-theme="dark"] .theme-toggle .tt-moon { display: none; }

/* ---------- 头像统一圆形（含图片） ---------- */
.cover-avatar,
.m-avatar {
    border-radius: 50% !important;
    overflow: hidden;
}
.cover-avatar img,
.m-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* 主题按钮交互反馈 */
.theme-toggle:active { transform: scale(.9); }
.theme-toggle svg { pointer-events: none; }

/* ---------- 右侧悬浮快捷栏 ---------- */
.side-dock {
    position: fixed;
    right: max(22px, calc((100vw - 820px) / 2 - 78px));
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 40;
}
.sd-btn {
    width: 54px;
    padding: 9px 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: .5px solid var(--sep);
    border-radius: 15px;
    background: var(--card);
    box-shadow: var(--sh-2);
    color: var(--text-2);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: -.01em;
    cursor: pointer;
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    transition: transform .16s var(--spring), color .15s var(--ease), box-shadow .15s;
}
.sd-btn:hover { color: var(--text); transform: translateY(-1px); box-shadow: var(--sh-3); }
.sd-btn:active { transform: scale(.94); }
.sd-ico { line-height: 0; color: var(--blue); }

@media (max-width: 1180px) {
    .side-dock { display: none; }
}

/* ---------- 图片管理：批量操作栏 ---------- */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: var(--card);
    border-radius: var(--r-md, 12px);
    box-shadow: var(--sh-1);
}
.bulk-bar .spacer { flex: 1; }
.bulk-bar .check-row { font-size: 13px; }
.row-check { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }

/* ---------- 按日期删除 ---------- */
.date-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}
.date-form input[type=date] {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--sep);
    border-radius: 8px;
    background: var(--card-2);
    color: var(--text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.date-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--fill);
    font-size: 13.5px;
}
.date-result.empty { background: var(--fill-2); }
