/* xmoe · 仿 X（Twitter）
 * 设计令牌取自 x.com styles.css（2026-11）：
 *   bg #fff / #000，fg #000 / #fff，secondary #666 / #999，brand #1d9bf0，
 *   border rgba(0,0,0,.15) / rgba(255,255,255,.15)，divider rgba(0,0,0,.06) / rgba(255,255,255,.2)，
 *   hover rgba(0,0,0,.04) / rgba(255,255,255,.08)，like #f91880，repost #00ba7c
 * 布局：容器 max 1280；左栏 72px（≥1280 展开 +184 = 256px）；中栏 max 600 + 左右 1px 边；右栏 380px（≥1024 显示）
 */
:root {
    --bg: #fff;
    --bg-2: #f2f2f2;
    --bg-3: #ebebeb;
    --bg-input: rgba(0, 0, 0, .04);
    --bg-blur: rgba(255, 255, 255, .8);
    --fg: #000;
    --fg-2: #666;
    --fg-3: #b2b2b2;
    --brand: #1d9bf0;
    --like: #f91880;
    --repost: #00ba7c;
    --line: rgba(0, 0, 0, .15);
    --divider: rgba(0, 0, 0, .06);
    --hover: rgba(0, 0, 0, .04);
    --hover-2: rgba(0, 0, 0, .03);
    --btn: #000;
    --btn-fg: #fff;
    --btn-hover: rgba(0, 0, 0, .8);
    --shadow: 0 0 15px rgba(0, 0, 0, .12), 0 0 3px 1px rgba(0, 0, 0, .06);
    --font: TwitterChirp, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    color-scheme: light;
}
[data-theme=dark] {
    --bg: #000;
    --bg-2: #141414;
    --bg-3: #262626;
    --bg-input: rgba(255, 255, 255, .08);
    --bg-blur: rgba(0, 0, 0, .8);
    --fg: #fff;
    --fg-2: #999;
    --fg-3: #4d4d4d;
    --line: rgba(255, 255, 255, .15);
    --divider: rgba(255, 255, 255, .2);
    --hover: rgba(255, 255, 255, .08);
    --hover-2: rgba(255, 255, 255, .03);
    --btn: #fff;
    --btn-fg: #000;
    --btn-hover: rgba(255, 255, 255, .8);
    --shadow: 0 0 15px rgba(255, 255, 255, .2), 0 0 3px 1px rgba(255, 255, 255, .15);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; overflow-y: scroll; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/20px var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.xm-skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--btn); color: var(--btn-fg); padding: 8px 16px; border-radius: 9999px; }
.xm-skip:focus { left: 8px; }
.xm-i { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; display: block; }
.xm-badge { width: 18.75px; height: 18.75px; margin-left: 2px; }

/* ---------- 三栏骨架 ---------- */
.xm-app { display: flex; justify-content: center; max-width: 1280px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.xm-side { flex: 0 0 72px; position: relative; }
.xm-side-in { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 0 4px; overflow-y: auto; scrollbar-width: none; }
.xm-body { flex: 0 1 auto; display: grid; grid-template-columns: minmax(0, 602px); min-width: 0; }
.xm-app { justify-content: center; }
.xm-col { width: 100%; max-width: 602px; min-width: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100vh; padding-bottom: 64px; }
.xm-aside { display: none; }
.xm-aside-in { position: sticky; top: 0; padding: 12px 24px 64px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- 左侧导航 ---------- */
.xm-logo { width: 50px; height: 50px; margin: 2px 0; display: grid; place-items: center; border-radius: 9999px; transition: background-color .2s; }
.xm-logo:hover { background: var(--hover); }
.xm-logo img { width: 30px; height: 30px; border-radius: 9999px; object-fit: cover; }
.xm-nav { display: flex; flex-direction: column; align-items: center; margin-bottom: 4px; width: 100%; }
.xm-nav-group { position: relative; width: 100%; display: flex; justify-content: center; }
.xm-nav-item { display: flex; justify-content: center; padding: 4px 0; width: 100%; }
.xm-nav-pill { display: inline-flex; align-items: center; padding: 12px; border-radius: 9999px; font-size: 20px; line-height: 24px; transition: background-color .2s; }
.xm-nav-item:hover .xm-nav-pill { background: var(--hover); }
.xm-nav-pill .xm-i { width: 26.25px; height: 26.25px; }
.xm-nav-txt { display: none; margin: 0 16px 0 20px; white-space: nowrap; }
.xm-nav-item.is-on .xm-nav-txt { font-weight: 700; }
.xm-post-btn { width: 50px; height: 50px; margin: 16px 0; border-radius: 9999px; background: var(--btn); color: var(--btn-fg); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; box-shadow: 0 8px 28px -6px rgba(0, 0, 0, .2); transition: background-color .2s; flex-shrink: 0; }
.xm-post-btn:hover { background: var(--btn-hover); }
.xm-post-btn .xm-i { width: 26px; height: 26px; }
.xm-post-txt { display: none; }
/* 左下账号块：头像 + 昵称 + 「…」合成一块，整块可点开菜单 */
.xm-me-group { margin-top: auto; width: 100%; display: flex; align-items: center; padding-bottom: 12px; position: relative; justify-content: center; }
.xm-me { padding: 12px; border-radius: 9999px; display: flex; align-items: center; gap: 12px; transition: background-color .2s; min-width: 0; width: auto; max-width: 100%; text-align: left; }
.xm-me:hover { background: var(--hover); }
.xm-me img { width: 40px; height: 40px; border-radius: 9999px; object-fit: cover; flex-shrink: 0; }
.xm-me-txt { display: none; flex: 1; min-width: 0; flex-direction: column; line-height: 20px; }
.xm-me-txt b, .xm-me-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xm-me-txt span { color: var(--fg-2); }
.xm-me-more { display: none; flex-shrink: 0; color: var(--fg-2); }
.xm-me-more .xm-i { width: 18.75px; height: 18.75px; }
.xm-me-group.is-open .xm-me { background: var(--hover); }
/* 账号菜单比通用下拉更宽、每行是「图标 + 文字」的水平排布，特异性要压过 .xm-pop / .xm-pop a */
.xm-pop.xm-me-pop { bottom: calc(100% - 4px); top: auto; left: 0; transform: none; min-width: 300px; padding: 8px; }
.xm-pop.xm-me-pop > a, .xm-pop.xm-me-pop > button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 8px; font-weight: 700; font-size: 15px; line-height: 20px; text-align: left; color: var(--fg); white-space: nowrap; }
.xm-pop.xm-me-pop .xm-i { width: 18.75px; height: 18.75px; color: var(--fg-2); flex-shrink: 0; }
.xm-pop.xm-me-pop > a:hover, .xm-pop.xm-me-pop > button:hover { background: var(--hover); }
.xm-pop-sep { display: block; height: 1px; margin: 6px 4px; background: var(--divider); }

.xm-pop { position: absolute; z-index: 50; min-width: 200px; background: var(--bg); border-radius: 16px; box-shadow: var(--shadow); padding: 0; overflow: hidden; display: none; }
.xm-pop a { display: block; padding: 12px 16px; font-weight: 700; font-size: 15px; transition: background-color .2s; }
.xm-pop a:hover { background: var(--hover-2); }
.xm-nav-group.is-open .xm-pop { display: block; }
.xm-nav-pop { left: 50%; top: 100%; transform: translateX(-50%); }
/* 账号菜单的文字块：图标与文字各占一格，不会被拆成两行 */
.xm-me-pop span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 顶部吸顶栏 ---------- */
.xm-topbar { position: sticky; top: 0; z-index: 30; height: 53px; display: flex; align-items: center; gap: 24px; padding: 0 16px; background: var(--bg-blur); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.xm-topbar-back { width: 34px; height: 34px; margin-left: -8px; margin-right: -8px; border-radius: 9999px; display: grid; place-items: center; transition: background-color .2s; }
.xm-topbar-back:hover { background: var(--hover); }
.xm-topbar-back .xm-i { width: 20px; height: 20px; }
.xm-topbar-txt { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.xm-topbar-txt .xm-topbar-h { font-size: 20px; line-height: 24px; font-weight: 800; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.xm-topbar-txt .xm-topbar-h .xm-badge { width: 20px; height: 20px; }
.xm-topbar-txt span { font-size: 13px; line-height: 16px; color: var(--fg-2); }

/* ---------- 主页资料头 ---------- */
.xm-banner { aspect-ratio: 3 / 1; background: var(--bg-3); overflow: hidden; }
.xm-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xm-prof { container-type: inline-size; padding: 12px 16px 0; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; --ava: clamp(48px, 25cqw, 136px); }
.xm-prof-top { position: relative; display: flex; justify-content: flex-end; align-items: flex-start; min-height: calc(var(--ava) / 2); }
.xm-prof-ava { position: absolute; left: 0; top: 0; width: var(--ava); height: var(--ava); transform: translateY(calc(-50% - 12px)); border-radius: 9999px; border: 4px solid var(--bg); background: var(--bg); overflow: hidden; isolation: isolate; }
.xm-prof-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xm-prof-name h1 { font-size: 20px; line-height: 24px; font-weight: 800; display: flex; align-items: center; }
.xm-prof-name h1 .xm-badge { width: 20px; height: 20px; }
.xm-prof-name span { color: var(--fg-2); }
.xm-prof-bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.xm-prof-meta { display: flex; flex-wrap: wrap; column-gap: 12px; row-gap: 4px; color: var(--fg-2); }
.xm-prof-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.xm-prof-meta .xm-i { width: 18.75px; height: 18.75px; }
.xm-prof-meta a { color: var(--brand); }
.xm-prof-meta a:hover { text-decoration: underline; }
.xm-prof-count { display: flex; flex-wrap: wrap; column-gap: 20px; font-size: 14px; line-height: 16px; color: var(--fg-2); }
.xm-prof-count b { color: var(--fg); font-weight: 700; }
.xm-prof-count a:hover { text-decoration: underline; }

/* ---------- 按钮 ---------- */
.xm-btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 16px; border-radius: 9999px; font-weight: 700; font-size: 15px; white-space: nowrap; background: var(--btn); color: var(--btn-fg); transition: background-color .2s; }
.xm-btn:hover { background: var(--btn-hover); }
.xm-btn-dark { background: var(--btn); color: var(--btn-fg); }
.xm-btn-dark:disabled { opacity: .5; cursor: default; }
.xm-btn-line { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.xm-btn-line:hover { background: var(--hover); }
.xm-btn-sm { height: 32px; padding: 0 16px; font-size: 14px; }
.xm-btn-brand { background: var(--brand); color: #fff; height: 52px; padding: 0 32px; font-size: 17px; }
.xm-btn-brand:hover { background: #1a8cd8; }
.xm-prof-top .xm-btn { height: 36px; }

/* ---------- 标签页：52px 高，选中 3px 圆角下划线 ---------- */
.xm-tabs { position: sticky; top: 53px; z-index: 20; display: flex; background: var(--bg-blur); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: .5px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.xm-tab { flex: 1; min-width: 56px; position: relative; padding: 0 16px; height: 52px; display: flex; justify-content: center; align-items: center; color: var(--fg-2); font-weight: 500; white-space: nowrap; transition: background-color .2s, color .15s; }
.xm-tab:hover { background: var(--hover); color: var(--fg); }
.xm-tab.is-on { color: var(--fg); font-weight: 700; }
.xm-tab span { display: inline-flex; height: 52px; align-items: center; gap: 4px; }
.xm-tab small { font-size: 13px; line-height: 16px; font-weight: 400; color: var(--fg-2); }
.xm-tab.is-on small { color: var(--fg); }
.xm-tab.is-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 9999px; background: var(--fg); }
/* 首页没有吸顶栏，标签页自己贴顶；手机上仍有 .xm-mtop，所以保持 53px */
.xm-tabs.is-flush { top: 0; }

/* hidden 必须压住 .xm-cell 的 display:block，否则隐藏的内容照样占高度 */
[hidden] { display: none !important; }

/* ---------- 帖子单元格：padding 12/16，头像 40 方圆角 10%，gap 8 ---------- */
.xm-cell { display: block; padding: 12px 16px; border-bottom: 1px solid var(--divider); transition: background-color .2s; }
.xm-cell[data-href] { cursor: pointer; }
.xm-cell:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.xm-cell:hover { background: var(--hover-2); }
.xm-cell-ctx { display: flex; align-items: center; gap: 12px; margin: -4px 0 4px 20px; font-size: 13px; line-height: 16px; font-weight: 700; color: var(--fg-2); }
.xm-cell-ctx .xm-i { width: 16px; height: 16px; }
.xm-cell-row { display: flex; gap: 8px; }
.xm-cell-ava { flex: 0 0 40px; width: 40px; height: 40px; }
.xm-cell-ava img, .xm-cell-ava .xm-ava { width: 40px; height: 40px; border-radius: 9999px; object-fit: cover; display: block; transition: filter .2s; }
.xm-cell-ava a:hover img, a.xm-cell-ava:hover img { filter: brightness(.9); }
.xm-cell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.xm-cell-head { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--fg-2); white-space: nowrap; }
.xm-name { display: inline-flex; align-items: center; min-width: 0; color: var(--fg); }
.xm-name b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.xm-name:hover b { text-decoration: underline; }
.xm-handle { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.xm-time:hover { text-decoration: underline; }
.xm-dot { padding: 0 0; }
.xm-cell-more { margin: -8px -5px -8px auto; width: 32px; height: 32px; border-radius: 9999px; display: grid; place-items: center; color: var(--fg-2); flex-shrink: 0; transition: background-color .2s, color .2s; }
.xm-cell-more .xm-i { width: 18.75px; height: 18.75px; }
.xm-cell-more:hover { color: var(--brand); background: rgba(29, 155, 240, .1); }

.xm-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); line-height: 20px; }
.xm-text p { white-space: normal; }
.xm-text a { color: var(--brand); }
.xm-text a:hover { text-decoration: underline; }
.xm-text-title { display: block; font-weight: 700; color: var(--fg) !important; white-space: normal; }
.xm-hash { display: inline-block; margin-top: 2px; }
.xm-tw-text { white-space: normal; }
.xm-face { width: 1.4em; height: 1.4em; vertical-align: -.35em; }

/* 媒体：16px 圆角，1px 描边，2px 间隙 */
.xm-tw-media, .xm-card { margin-top: 10px; }
.xm-media { display: grid; gap: 2px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.xm-media figure { margin: 0; position: relative; overflow: hidden; background: var(--bg-3); min-height: 0; }
.xm-media img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.xm-media.n1 figure { max-height: 510px; }
.xm-media.n1 img { height: auto; max-height: 510px; }
.xm-media.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.xm-media.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.xm-media.n3 figure:first-child { grid-row: span 2; }
.xm-media.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.xm-media-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #fff; font-size: 23px; font-weight: 700; pointer-events: none; }
.xm-tw-media .xm-video { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); margin-top: 0; }
.xm-tw-media > * + * { margin-top: 10px; }
.xm-card { display: block; position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.xm-card-img { display: block; aspect-ratio: 1.91 / 1; background: var(--bg-3); }
.xm-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .2s; }
.xm-card:hover img { filter: brightness(.95); }
.xm-card-tag { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 0 4px; border-radius: 4px; background: rgba(0, 0, 0, .77); color: #fff; font-size: 13px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 操作栏：高 20，按钮热区 36 圆形，图标 18.75，数字 13px */
.xm-acts { display: flex; align-items: center; justify-content: space-between; height: 20px; margin: 12px -8px 0; color: var(--fg-2); }
.xm-act { display: inline-flex; align-items: center; position: relative; height: 20px; color: var(--fg-2); font-size: 13px; line-height: 16px; flex: 1; transition: color .2s; }
.xm-act-ico { position: relative; display: grid; place-items: center; width: 36px; height: 36px; margin: -8px 0; border-radius: 9999px; transition: background-color .2s; }
.xm-act-ico .xm-i { width: 18.75px; height: 18.75px; }
.xm-act-n { padding: 0 4px 0 0; margin-left: -6px; font-variant-numeric: tabular-nums; min-width: 1em; }
.xm-act-n:empty { display: none; }
.xm-act-reply:hover, .xm-act-views:hover, .xm-act-mark:hover, .xm-act-share:hover { color: var(--brand); }
.xm-act-reply:hover .xm-act-ico, .xm-act-views:hover .xm-act-ico, .xm-act-mark:hover .xm-act-ico, .xm-act-share:hover .xm-act-ico { background: rgba(29, 155, 240, .1); }
.xm-act-repost:hover { color: var(--repost); }
.xm-act-repost:hover .xm-act-ico { background: rgba(0, 186, 124, .1); }
.xm-act-like:hover, .xm-act-like.is-on { color: var(--like); }
.xm-act-like:hover .xm-act-ico { background: rgba(249, 24, 128, .1); }
.xm-act-like .is-fill { display: none; }
.xm-act-like.is-on .is-fill { display: block; }
.xm-act-like.is-on .is-line { display: none; }
.xm-act-like.is-pop .xm-act-ico .xm-i { animation: xm-pop .35s ease-out; }
@keyframes xm-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.xm-act-mark.is-on { color: var(--brand); }
.xm-act-views { cursor: default; }
.xm-act-end { display: flex; flex: 0 0 auto; }
.xm-act-end .xm-act { flex: 0 0 auto; }
.xm-acts-sm { justify-content: flex-start; margin-top: 8px; }
.xm-acts-sm .xm-act { flex: 0 0 auto; }
.xm-acts-sm .xm-act-n { margin-left: -4px; }

/* ---------- 帖子详情 ---------- */
.xm-detail { padding: 12px 16px 0; border-bottom: 1px solid var(--divider); }
.xm-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.xm-detail-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 20px; }
.xm-detail-who .xm-handle { color: var(--fg-2); }
.xm-detail-title { font-size: 23px; line-height: 28px; font-weight: 800; margin-bottom: 12px; overflow-wrap: anywhere; }
.xm-detail-cover { margin: 0 0 12px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.xm-detail-cover img { width: 100%; display: block; }
.xm-detail-time { margin: 16px 0; color: var(--fg-2); display: flex; flex-wrap: wrap; gap: 0 4px; }
.xm-detail-time b { color: var(--fg); font-weight: 700; }
.xm-detail-time a:hover { text-decoration: underline; }
.xm-detail-acts { border-top: 1px solid var(--divider); padding: 4px 4px; height: 48px; display: flex; align-items: center; }
.xm-detail-acts .xm-acts { margin-top: 0; flex: 1; }
.xm-detail-acts .xm-act-ico .xm-i { width: 22.5px; height: 22.5px; }
.xm-detail-page { padding-top: 16px; padding-bottom: 16px; }
.xm-neighbor { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--divider); margin: 0 -16px; }
.xm-neighbor a { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; transition: background-color .2s; }
.xm-neighbor a + a { border-left: 1px solid var(--divider); text-align: right; }
.xm-neighbor a:only-child { grid-column: span 2; }
.xm-neighbor a:hover { background: var(--hover-2); }
.xm-neighbor small { color: var(--fg-2); font-size: 13px; }
.xm-neighbor b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 正文：17px / 24px（X 长文正文字号） */
.xm-prose { font-size: 17px; line-height: 24px; overflow-wrap: anywhere; }
.xm-prose > * { margin: 0 0 16px; }
.xm-prose h1, .xm-prose h2 { font-size: 23px; line-height: 28px; font-weight: 800; margin: 28px 0 12px; }
.xm-prose h3, .xm-prose h4 { font-size: 20px; line-height: 24px; font-weight: 800; margin: 24px 0 8px; }
.xm-prose a { color: var(--brand); }
.xm-prose a:hover { text-decoration: underline; }
.xm-prose img { border-radius: 16px; height: auto; display: block; margin: 0 auto; cursor: zoom-in; }
.xm-prose img.xm-face { display: inline; border-radius: 0; margin: 0; cursor: default; }
.xm-prose blockquote { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 4px solid var(--line); color: var(--fg-2); }
.xm-prose ul, .xm-prose ol { padding-left: 24px; }
.xm-prose li + li { margin-top: 4px; }
.xm-prose hr { border: 0; border-top: 1px solid var(--divider); margin: 24px 0; }
.xm-prose code { font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--bg-input); padding: 2px 4px; border-radius: 4px; }
.xm-prose pre { background: var(--bg-2); border-radius: 16px; padding: 16px; overflow: auto; font-size: 14px; line-height: 1.6; }
.xm-prose pre code { background: none; padding: 0; }
.xm-table { overflow-x: auto; margin-bottom: 16px; }
.xm-prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.xm-prose th, .xm-prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.xm-prose th { background: var(--bg-2); }
.xm-video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.xm-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.xm-music { margin: 8px 0; }
.xm-urlcard { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--fg) !important; text-decoration: none !important; transition: background-color .2s; }
.xm-urlcard:hover { background: var(--hover-2); }
.xm-urlcard-tip, .xm-urlcard small, .xm-urlcard span { color: var(--fg-2); font-size: 15px; }
.xm-urlcard img { border-radius: 8px; max-height: 200px; object-fit: cover; margin-bottom: 8px; }
.xm-hidden { padding: 16px; border-radius: 16px; background: var(--bg-input); color: var(--fg-2); text-align: center; }
.xm-userinfo { color: var(--fg-2); }

/* ---------- 发帖框 / 回复框 ---------- */
.xm-composer { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--divider); }
.xm-composer-main { flex: 1; min-width: 0; }
.xm-compose-edit { display: block; width: 100%; min-height: 52px; padding: 12px 0; outline: 0; font-size: 20px; line-height: 24px; overflow-wrap: anywhere; white-space: pre-wrap; }
.xm-compose-edit.is-empty::before { content: attr(data-placeholder); color: var(--fg-2); pointer-events: none; }
.xm-compose-edit .xm-face { width: 24px; height: 24px; vertical-align: -5px; margin: 0 1px; }
.xm-composer textarea::placeholder { color: var(--fg-2); }
.xm-reply-form textarea { font-size: 17px; }
.xm-composer-who { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.xm-composer-who input { flex: 1 1 140px; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; outline: 0; }
.xm-composer-who input:focus { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.xm-composer-bar { display: flex; align-items: center; gap: 4px; padding-top: 8px; border-top: 1px solid var(--divider); margin-top: 4px; }
.xm-composer-bar .xm-ring { margin-left: auto; }
.xm-composer-bar .xm-tip-space { flex: 1; min-width: 0; }
.xm-tool { width: 34px; height: 34px; border-radius: 9999px; display: grid; place-items: center; color: var(--brand); cursor: pointer; transition: background-color .2s; }
.xm-tool:hover { background: rgba(29, 155, 240, .1); }
.xm-tool .xm-i { width: 20px; height: 20px; }
.xm-compose-tip { font-size: 13px; color: var(--fg-2); margin-left: 4px; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xm-compose-tip.is-err { color: #f4212e; }
.xm-compose-count { font-size: 13px; color: var(--fg-2); }
.xm-ring { --p: 0; width: 26px; height: 26px; border-radius: 9999px; display: grid; place-items: center; font-size: 11px; color: var(--fg-2); background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--bg-3) 0); position: relative; }
.xm-ring::before { content: ""; position: absolute; inset: 3px; border-radius: 9999px; background: var(--bg); }
.xm-ring > * { position: relative; }
.xm-ring.is-warn { color: #f4212e; background: conic-gradient(#f4212e calc(var(--p) * 1%), var(--bg-3) 0); }
.xm-compose-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.xm-compose-imgs figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--bg-3); }
.xm-compose-imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xm-compose-imgs figure.is-up img { opacity: .5; }
.xm-compose-imgs button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 9999px; background: rgba(15, 20, 25, .75); color: #fff; font-size: 18px; line-height: 28px; }
.xm-compose-face { display: grid; grid-template-columns: repeat(auto-fill, 36px); gap: 4px; padding: 8px; margin-bottom: 8px; border-radius: 16px; box-shadow: var(--shadow); max-height: 200px; overflow-y: auto; }
.xm-compose-face button { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; }
.xm-compose-face button:hover { background: var(--hover); }
.xm-compose-face img { width: 24px; height: 24px; }
.xm-composer.is-drag { background: rgba(29, 155, 240, .06); }

/* ---------- 发帖弹窗（X 点「发帖」弹出的那个） ---------- */
.xm-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 68px 16px 24px; overflow-y: auto; }
.xm-modal[hidden] { display: none; }
.xm-modal-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: xm-fade .18s ease-out; }
.xm-modal-card { position: relative; width: 100%; max-width: 600px; background: var(--bg); border-radius: 16px; box-shadow: 0 0 15px rgba(0, 0, 0, .2), 0 0 3px 1px rgba(0, 0, 0, .1); overflow: hidden; animation: xm-rise .2s cubic-bezier(.2, .8, .3, 1); }
.xm-modal-card:focus { outline: 0; }
.xm-modal-head { display: flex; align-items: center; padding: 8px 8px 0; }
.xm-modal-x { width: 34px; height: 34px; border-radius: 9999px; display: grid; place-items: center; color: var(--fg); transition: background-color .2s; }
.xm-modal-x:hover { background: var(--hover); }
.xm-modal-x .xm-i { width: 20px; height: 20px; }
.xm-composer-modal { border-bottom: 0; padding: 4px 16px 12px; }
.xm-composer-modal .xm-compose-edit { min-height: 108px; padding-top: 8px; }
body.is-modal { overflow: hidden; }
@keyframes xm-fade { from { opacity: 0; } }
@keyframes xm-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .xm-modal-mask, .xm-modal-card { animation: none; } }
@media (max-width: 511px) { .xm-modal { padding: 0; } .xm-modal-card { max-width: none; border-radius: 0; min-height: 100vh; min-height: 100dvh; } .xm-modal-close, .xm-modal-x { margin-top: env(safe-area-inset-top); } }
/* 访客态：占位链接代替输入框，点一下去登录 */
.xm-composer-guest .xm-guest-ph { display: block; padding: 12px 0 16px; font-size: 20px; line-height: 24px; color: var(--fg-2); }
.xm-composer-guest .xm-guest-ph:hover { color: var(--brand); }
.xm-composer-guest .xm-composer-bar { border-top: 1px solid var(--divider); }
.xm-composer-guest .xm-compose-tip { margin-left: 0; }
.xm-replying { font-size: 15px; color: var(--fg-2); padding-top: 4px; }
.xm-replying b { color: var(--brand); font-weight: 400; }
.xm-replying button { color: var(--brand); margin-left: 8px; }
.xm-code { display: inline-flex; align-items: center; gap: 8px; }
.xm-replyform-tip { padding: 8px 0 0; color: #f4212e; font-size: 13px; }
.xm-code img { width: auto; height: 22px; border-radius: 4px; vertical-align: middle; cursor: pointer; }
.xm-code input { width: 80px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: transparent; }

/* ---------- 标签胶囊（对应 nullpro 文章底部 badge，做了色相固定与位移特效） ---------- */
.xm-tagpills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.xm-pill { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 12px 0 10px; border-radius: 9999px; font-size: 14px; font-weight: 700; color: hsl(var(--h) 70% 36%); background: hsl(var(--h) 85% 94%); transition: transform .18s cubic-bezier(.2,.8,.3,1), background-color .18s, box-shadow .18s, color .18s; overflow: hidden; }
[data-theme=dark] .xm-pill { color: hsl(var(--h) 80% 74%); background: hsl(var(--h) 45% 18%); }
.xm-pill:hover { transform: translateY(-2px); background: hsl(var(--h) 85% 88%); box-shadow: 0 6px 16px -6px hsl(var(--h) 70% 45% / .55); }
[data-theme=dark] .xm-pill:hover { background: hsl(var(--h) 45% 26%); }
.xm-pill-hash { opacity: .55; margin-right: 1px; }
.xm-pill-go { width: 14px; height: 14px; margin-left: 2px; opacity: 0; transform: translateX(-4px); transition: opacity .18s, transform .18s; }
.xm-pill:hover .xm-pill-go { opacity: .9; transform: none; }
.xm-pill-sort { --h: 215; }
.xm-pill:active { transform: scale(.97); }

/* 正文内标签锚点：照 nullpro 的 a.md-a 动效 —— 1px 下划线由中间向两边展开，hover 常驻
   颜色是同色相(204°)的品牌蓝，但明度压到 l=41% 取 #0d7ac4：
   直接用 --brand(#1d9bf0) 在白底上对比度只有 3.00，低于 WCAG AA 对正文的 4.5 要求；
   这个值正好 4.57，是保持同一色相前提下最亮的达标色，看起来仍是那个蓝。
   特异性要压过 .xm-prose a（0,1,1），否则颜色会被正文链接的蓝色覆盖
   transform-origin 必须是 50% 50%（nullpro 未声明即默认居中），写成 0 50% 会变成从左到右 */
.xm-prose a.xm-taglink { position: relative; display: inline-block; vertical-align: top; color: #0d7ac4; text-decoration: none; overflow: hidden; outline: 0; transition: color .2s; }
.xm-prose a.xm-taglink::before { content: " "; position: absolute; top: auto; bottom: 1px; left: 0; width: 100%; height: 1px; background-color: currentColor; transform: scaleX(0); transform-origin: 50% 50%; backface-visibility: hidden; transition: transform .22s cubic-bezier(.2, .8, .3, 1); }
.xm-prose a.xm-taglink:hover, .xm-prose a.xm-taglink:focus-visible { color: #0a68a8; text-decoration: none; }
.xm-prose a.xm-taglink:hover::before, .xm-prose a.xm-taglink:focus-visible::before { transform: scaleX(1); }
.xm-prose a.xm-taglink:focus-visible { border-radius: 2px; box-shadow: 0 0 0 2px rgba(29, 155, 240, .4); }
/* 深色底上 #1d9bf0 偏暗，提亮一档；#4db5f5 在纯黑上对比度 9.24，充足 */
[data-theme=dark] .xm-prose a.xm-taglink { color: #4db5f5; }
[data-theme=dark] .xm-prose a.xm-taglink:hover { color: #6cc4f7; }
@media (prefers-reduced-motion: reduce) { .xm-prose a.xm-taglink::before { transition: none; } }

/* ---------- 会话：回复列表（X 的 thread 视图） ---------- */
.xm-thread { border-top: 1px solid var(--divider); }
.xm-thread-head { display: flex; align-items: baseline; gap: 8px; padding: 16px; border-bottom: 1px solid var(--divider); }
.xm-thread-head h2 { font-size: 20px; line-height: 24px; font-weight: 800; }
.xm-thread-head span { font-size: 13px; color: var(--fg-2); }
.xm-reply { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 12px 16px 4px; }
.xm-reply-ava { flex: 0 0 40px; width: 40px; }
.xm-reply-ava img, .xm-reply-ava .xm-ava { width: 40px; height: 40px; border-radius: 9999px; object-fit: cover; display: block; flex-shrink: 0; }
/* 会话连线：从父头像正下方一直串到最后一个子回复的底部（X 的 2px 竖线） */
.xm-reply-line { position: absolute; left: 35px; top: 60px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; pointer-events: none; }
.xm-reply-kids .xm-reply { --line-x: 31px; }
.xm-reply-kids .xm-reply-line { left: 27px; top: 52px; }
.xm-reply-body { flex: 1; min-width: 0; }
.xm-reply-main { padding-bottom: 8px; }
.xm-reply-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; font-size: 15px; line-height: 20px; }
.xm-reply-name { font-weight: 700; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
a.xm-reply-name:hover { text-decoration: underline; }
.xm-reply-badge { padding: 0 4px; border-radius: 4px; background: var(--fg); color: var(--bg); font-size: 11px; line-height: 16px; font-weight: 700; }
.xm-reply-dot, .xm-reply-time { color: var(--fg-2); }
.xm-reply-time:hover { text-decoration: underline; }
.xm-reply-text { margin-top: 2px; color: var(--fg); overflow-wrap: anywhere; }
.xm-reply-text a { color: var(--brand); }
.xm-reply-text a:hover { text-decoration: underline; }
.xm-reply-acts { display: flex; align-items: center; gap: 8px; margin: 6px 0 0 -8px; }
.xm-reply-act { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 9999px; color: var(--fg-2); font-size: 13px; font-weight: 500; transition: color .2s, background-color .2s; }
.xm-reply-act .xm-i { width: 17px; height: 17px; flex-shrink: 0; }
.xm-reply-act:hover { color: var(--brand); background: rgba(29, 155, 240, .1); }
.xm-reply-like:hover, .xm-reply-like.is-on { color: var(--like); }
.xm-reply-like:hover { background: rgba(249, 24, 128, .1); }
.xm-reply-like .is-fill { display: none; }
.xm-reply-like.is-on .is-fill { display: block; }
.xm-reply-like.is-on .is-line { display: none; }
/* 子回复：第一层缩到头像列右侧，之后各层保持同一列（X 的会话不做无限缩进） */
.xm-reply-kids { padding-top: 2px; }
.xm-reply-kids .xm-reply { padding: 10px 0 0; }
/* 第二层起把父级追加的 32px（子头像列 + gap）抵掉，回到首个子回复那一列 */
.xm-reply-kids .xm-reply-kids { margin-left: -40px; }
.xm-reply-kids .xm-reply-kids .xm-reply-kids { margin-left: -40px; }
.xm-reply-kids .xm-reply-ava, .xm-reply-kids .xm-reply-ava img, .xm-reply-kids .xm-reply-ava .xm-ava { width: 32px; height: 32px; flex-basis: 32px; }
.xm-reply-kids .xm-reply-name { font-size: 14px; }
.xm-reply-kids .xm-reply-text { font-size: 14px; }
.xm-reply-kids .xm-reply-act { height: 28px; font-size: 12px; }
.xm-reply:last-child, .xm-reply-kids .xm-reply:last-child { padding-bottom: 8px; }

/* ---------- 回复框 ---------- */
.xm-replyform { display: flex; gap: 8px; padding: 12px 16px 16px; border-bottom: 1px solid var(--divider); transition: background-color .2s; }
.xm-replyform.is-replying { background: rgba(29, 155, 240, .04); }
.xm-replyform-ava { flex: 0 0 40px; }
.xm-replyform-ava img, .xm-replyform-ava .xm-ava { width: 40px; height: 40px; border-radius: 9999px; object-fit: cover; display: block; }
.xm-replyform-main { flex: 1; min-width: 0; }
.xm-replyform textarea { display: block; width: 100%; min-height: 52px; padding: 8px 0; border: 0; outline: 0; resize: none; background: transparent; font-size: 17px; line-height: 24px; overflow: hidden; }
.xm-replyform textarea::placeholder { color: var(--fg-2); }
.xm-replyform-who { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.xm-replyform-who input { flex: 1 1 140px; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9999px; background: transparent; outline: 0; font-size: 14px; }
.xm-replyform-who input:focus { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.xm-replyform-bar { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--divider); }
.xm-replyform-bar .xm-btn { margin-left: auto; height: 34px; padding: 0 18px; }
.xm-code { display: inline-flex; align-items: center; gap: 8px; }
.xm-replyform-tip { padding: 8px 0 0; color: #f4212e; font-size: 13px; }
.xm-code img { width: auto; height: 22px; border-radius: 4px; vertical-align: middle; cursor: pointer; }
.xm-code input { width: 72px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9999px; background: transparent; font-size: 14px; outline: 0; }
.xm-code input:focus { border-color: var(--brand); }
.xm-replying { display: flex; align-items: center; gap: 4px; padding: 2px 0 6px; font-size: 14px; color: var(--fg-2); }
.xm-replying b { color: var(--brand); font-weight: 400; }
.xm-replying button { margin-left: 4px; color: var(--brand); font-weight: 700; }
.xm-ava { display: inline-block; border-radius: 9999px; object-fit: cover; }
/* 文字头像：特异性要压过 .xm-reply-ava .xm-ava 的 display:block，否则字母跑到左上角 */
.xm-ava.xm-ava-txt { display: flex; align-items: center; justify-content: center; line-height: 1; text-align: center; background: hsl(var(--h), 55%, 52%); color: #fff; font-weight: 700; font-size: 17px; overflow: hidden; }
.xm-replyform-ava .xm-ava.xm-ava-txt, .xm-reply-ava .xm-ava.xm-ava-txt { font-size: 16px; }
.xm-reply-kids .xm-ava.xm-ava-txt { font-size: 14px; }
.xm-empty-sm { padding: 32px 16px; text-align: center; color: var(--fg-2); }

/* ---------- 列表 / 空状态 / 分页 ---------- */
.xm-feed-end { height: 40vh; }
.xm-sec { padding: 12px 16px; font-size: 20px; line-height: 24px; font-weight: 800; border-bottom: 1px solid var(--divider); }
.xm-sec small { font-size: 15px; font-weight: 400; color: var(--fg-2); margin-left: 4px; }
.xm-empty { padding: 32px; max-width: 400px; margin: 32px auto; display: flex; flex-direction: column; gap: 8px; }
.xm-empty h2 { font-size: 31px; line-height: 36px; font-weight: 800; }
.xm-empty p { color: var(--fg-2); margin-bottom: 20px; }
.xm-empty .xm-btn { align-self: flex-start; margin-top: 8px; }
.xm-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 16px; border-bottom: 1px solid var(--divider); }
.xm-pager a, .xm-pager span { min-width: 36px; height: 36px; padding: 0 12px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; transition: background-color .2s; }
.xm-pager a:hover { background: var(--hover); }
.xm-pager span { background: var(--btn); color: var(--btn-fg); font-weight: 700; }
.xm-media-grid:not([hidden]) { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; }
.xm-media-grid a { aspect-ratio: 1; overflow: hidden; background: var(--bg-3); }
.xm-media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .2s; }
.xm-media-grid a:hover img { filter: brightness(.9); }
.xm-list-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px 12px 32px; border-bottom: 1px solid var(--divider); transition: background-color .2s; }
.xm-list-row:hover { background: var(--hover-2); }
.xm-list-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xm-list-row time { color: var(--fg-2); flex-shrink: 0; }

/* ---------- 右栏 ---------- */
.xm-search { position: relative; display: flex; align-items: center; height: 42px; border-radius: 9999px; border: 1px solid var(--line); background: var(--bg); }
.xm-aside .xm-search { position: sticky; top: 0; z-index: 2; margin: -12px -24px 0; padding: 0; border-radius: 0; border: 0; height: 53px; background: var(--bg); }
.xm-aside .xm-search input { border: 1px solid var(--line); border-radius: 9999px; height: 42px; padding-left: 44px; }
.xm-aside .xm-search .xm-i { left: 16px; }
.xm-search .xm-i { position: absolute; left: 16px; width: 16px; height: 16px; color: var(--fg-2); pointer-events: none; }
.xm-search input { width: 100%; height: 100%; padding: 0 16px 0 44px; border: 0; border-radius: 9999px; background: transparent; outline: 0; font-size: 15px; }
.xm-search input::placeholder { color: var(--fg-2); }
.xm-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.xm-search:focus-within .xm-i { color: var(--brand); }
.xm-search-inline { margin: 12px 16px; }
.xm-search-inline input:focus { border: 0; }
.xm-search-inline:focus-within { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.xm-box { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.xm-box-title { padding: 12px 16px; font-size: 20px; line-height: 24px; font-weight: 800; }
.xm-box-txt { padding: 0 16px 12px; color: var(--fg-2); }
.xm-box-stats { display: flex; gap: 16px; padding: 0 16px 16px; color: var(--fg-2); font-size: 14px; }
.xm-box-stats b { color: var(--fg); }
.xm-box-more { display: block; padding: 16px; color: var(--brand); transition: background-color .2s; }
.xm-box-more:hover { background: var(--hover-2); }
.xm-trend { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; transition: background-color .2s; }
.xm-trend:hover { background: var(--hover-2); }
.xm-trend b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.xm-trend-meta { font-size: 13px; line-height: 16px; color: var(--fg-2); }
.xm-trend-row { border-bottom: 1px solid var(--divider); }

/* ---------- 标签云：多列 chip 网格（一屏能看到几十个，不再是竖着一条一条） ---------- */
.xm-tagwall { padding: 4px 16px 24px; }
.xm-tagwall-sec + .xm-tagwall-sec { margin-top: 20px; }
.xm-tagwall-h { display: flex; align-items: center; gap: 8px; padding: 12px 0 10px; font-size: 17px; line-height: 22px; font-weight: 800; }
.xm-tagwall-h span { padding: 0 6px; border-radius: 9999px; background: var(--bg-3); color: var(--fg-2); font-size: 12px; line-height: 18px; font-weight: 700; }
.xm-tagwall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.xm-tagchip { display: flex; flex-direction: column; gap: 4px; min-height: 74px; padding: 10px 12px; border-radius: 14px; border: 1px solid hsl(var(--h) 60% 55% / .22); background: hsl(var(--h) 72% 96%); transition: transform .16s, box-shadow .16s, background-color .16s, border-color .16s; }
.xm-tagchip:hover { transform: translateY(-2px); background: hsl(var(--h) 78% 92%); border-color: hsl(var(--h) 60% 50% / .42); box-shadow: 0 8px 20px -10px hsl(var(--h) 65% 40% / .6); }
.xm-tagchip:active { transform: scale(.985); }
.xm-tagchip-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 15px; line-height: 20px; font-weight: 700; color: hsl(var(--h) 55% 26%); }
.xm-tagchip-name span { opacity: .5; margin-right: 1px; }
.xm-tagchip small { margin-top: auto; font-size: 12px; line-height: 16px; color: hsl(var(--h) 40% 42%); }
[data-theme=dark] .xm-tagchip { border-color: hsl(var(--h) 55% 60% / .2); background: hsl(var(--h) 45% 13%); }
[data-theme=dark] .xm-tagchip:hover { background: hsl(var(--h) 48% 19%); border-color: hsl(var(--h) 55% 60% / .4); box-shadow: 0 8px 22px -12px #000; }
[data-theme=dark] .xm-tagchip-name { color: hsl(var(--h) 78% 82%); }
[data-theme=dark] .xm-tagchip small { color: hsl(var(--h) 30% 62%); }
.xm-who { display: flex; align-items: center; gap: 12px; padding: 12px 16px; transition: background-color .2s; }
.xm-who:hover { background: var(--hover-2); }
.xm-who > img, .xm-who > .xm-ava { width: 40px; height: 40px; border-radius: 9999px; object-fit: cover; flex-shrink: 0; }
.xm-who-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xm-who-txt b, .xm-who-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xm-who-txt b:hover { text-decoration: underline; }
.xm-who-txt span { color: var(--fg-2); }
.xm-who-txt p { margin-top: 4px; }
.xm-who-lg { border-bottom: 1px solid var(--divider); align-items: flex-start; }
.xm-who-lg .xm-btn { margin-top: 4px; }

.xm-legal { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 0 16px; font-size: 13px; line-height: 16px; color: var(--fg-2); }
.xm-legal a:hover { text-decoration: underline; }
.xm-legal-info { width: 100%; }
.xm-legal-info a { color: inherit; }
.xm-legal-info img { max-height: 16px; vertical-align: middle; }

/* ---------- 底部 tab 栏 / 悬浮发帖 / toast / 灯箱 ---------- */
.xm-tabbar { display: none; }
.xm-fab { display: none; }
.xm-toast { position: fixed; left: 50%; bottom: 32px; z-index: 90; transform: translate(-50%, 20px); padding: 12px 16px; border-radius: 4px; background: var(--brand); color: #fff; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.xm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.xm-zoom { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .9); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.xm-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }
.xm-zoom-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 9999px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 24px; line-height: 34px; }
.xm-zoom-nav:hover { background: rgba(39, 44, 48, .75); }
.xm-zoom-prev { left: 12px; }
.xm-zoom-next { right: 12px; }
.xm-zoom-x { position: absolute; left: 12px; top: 12px; width: 36px; height: 36px; border-radius: 9999px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 20px; }
.xm-zoom-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; }


/* ---------- 外观菜单（X 的「显示」弹层） ---------- */
.xm-theme-pop { min-width: 220px; padding: 8px; }
.xm-pop-title { display: block; padding: 4px 12px 8px; font-size: 20px; line-height: 24px; font-weight: 800; }
.xm-theme-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 8px; font-weight: 700; font-size: 15px; text-align: left; transition: background-color .2s; }
.xm-theme-opt:hover { background: var(--hover); }
.xm-swatch { width: 20px; height: 20px; border-radius: 9999px; border: 1px solid var(--line); flex-shrink: 0; }
.xm-swatch-light { background: #fff; }
.xm-swatch-dark { background: #15202b; }
.xm-swatch-auto { background: linear-gradient(135deg, #fff 0 50%, #15202b 50% 100%); }
.xm-check { width: 18.75px; height: 18.75px; margin-left: auto; color: var(--brand); opacity: 0; }
.xm-theme-opt.is-on .xm-check { opacity: 1; }
.xm-theme-opt.is-on { font-weight: 800; }

/* ---------- 帖子「…」菜单 ---------- */
.xm-menu { position: fixed; z-index: 70; min-width: 220px; padding: 8px 0; border-radius: 16px; background: var(--bg); box-shadow: var(--shadow); }
.xm-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; font-weight: 700; font-size: 15px; text-align: left; color: var(--fg); transition: background-color .2s; }
.xm-menu button:hover { background: var(--hover); }
.xm-menu .xm-i { width: 18.75px; height: 18.75px; color: var(--fg-2); }

/* ---------- 阅读进度条（文章页） ---------- */
.xm-progress { position: fixed; top: 0; left: 0; z-index: 120; width: 100%; height: 3px; background: var(--brand); transform: scaleX(0); transform-origin: 0 50%; opacity: 0; transition: opacity .2s, transform .06s linear; pointer-events: none; box-shadow: 0 0 8px rgba(29, 155, 240, .6); }
.xm-progress.is-on { opacity: 1; }
/* 手机端顶部栏更高，进度条贴在它下沿，避免被 logo 挡住 */
@media (max-width: 511px) { .xm-progress { top: 53px; } }

/* ---------- 手机顶部栏（<512 显示，X 的 logo + 站名） ---------- */
.xm-mtop { display: none; }

/* ---------- 滚动加载 ---------- */
.xm-loading { display: flex; justify-content: center; padding: 20px; }
.xm-spinner { width: 26px; height: 26px; border-radius: 9999px; border: 2.5px solid rgba(29, 155, 240, .25); border-top-color: var(--brand); animation: xm-spin .8s linear infinite; }
@keyframes xm-spin { to { transform: rotate(360deg); } }
.xm-sentinel { height: 1px; }
.xm-sentinel.is-end::after { content: "你已经看完了"; display: block; padding: 32px 0 48px; text-align: center; color: var(--fg-2); font-size: 15px; }

/* ---------- 图片 ALT 角标 ---------- */
.xm-media figure, .xm-detail-cover { position: relative; }
.xm-alt { position: absolute; left: 8px; bottom: 8px; padding: 0 4px; border-radius: 4px; background: rgba(0, 0, 0, .77); color: #fff; font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .02em; }

/* 插件兜底：sitemap 插件塞到 body 末尾的裸链接 */
body > a[href*="sitemap"] { display: none; }

/* ---------- 响应式（断点与 x.com 一致：512 / 1024 / 1280） ---------- */
@media (min-width: 1024px) {
    .xm-body { grid-template-columns: minmax(0, 602px) 380px; }
    .xm-aside { display: block; }
}
@media (min-width: 1280px) {
    .xm-side { flex-basis: 256px; }
    .xm-side-in { align-items: flex-start; padding: 0 8px; }
    .xm-logo { margin-left: 0; }
    .xm-nav { align-items: flex-start; }
    .xm-nav-group { justify-content: flex-start; }
    .xm-nav-item { justify-content: flex-start; }
    .xm-nav-txt { display: inline; }
    .xm-nav-pop { left: 0; transform: none; }
    .xm-post-btn { width: 232px; height: 52px; }
    .xm-post-btn .xm-i { display: none; }
    .xm-post-txt { display: inline; }
    .xm-me-group { justify-content: flex-start; }
    .xm-me { width: 100%; }
    .xm-me-txt { display: flex; }
    .xm-me-more { display: block; }
}
@media (min-width: 1024px) and (max-width: 1099px) {
    .xm-body { grid-template-columns: minmax(0, 602px) 350px; }
    .xm-aside-in { padding: 12px 16px 64px; }
    .xm-aside .xm-search { margin: -12px -16px 0; }
}

@media (max-width: 511px) {
    .xm-side { display: none; }
    .xm-mtop { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 35; height: 53px; padding: 0 16px; background: var(--bg-blur); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
    .xm-mtop-btn { margin-left: auto; width: 34px; height: 34px; border-radius: 9999px; display: grid; place-items: center; color: var(--fg); transition: background-color .2s; }
    .xm-mtop-btn:hover { background: var(--hover); }
    .xm-mtop-btn .xm-i { width: 22px; height: 22px; }
    .xm-mtop-logo img { width: 28px; height: 28px; border-radius: 9999px; display: block; }
    .xm-mtop-title { font-size: 17px; line-height: 20px; font-weight: 800; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
    .xm-mtop.is-brand .xm-mtop-title { opacity: 1; transform: none; }
    .xm-topbar { top: 53px; }
    .xm-tabs.is-flush { top: 53px; }
    .xm-body { flex: 1; grid-template-columns: minmax(0, 1fr); }
    .xm-col { border: 0; padding-bottom: 72px; }
    .xm-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(53px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg-blur); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--divider); }
    .xm-tabbar a { flex: 1; display: grid; place-items: center; color: var(--fg); }
    .xm-tabbar .xm-i { width: 26.25px; height: 26.25px; }
    .xm-fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(73px + env(safe-area-inset-bottom)); z-index: 41; width: 56px; height: 56px; border-radius: 9999px; background: var(--brand); color: #fff; box-shadow: 0 8px 28px -6px rgba(0, 0, 0, .3); }
    .xm-fab .xm-i { width: 24px; height: 24px; }
    .xm-detail-title { font-size: 20px; line-height: 24px; }
    .xm-empty h2 { font-size: 23px; line-height: 28px; }
    .xm-toast { bottom: 80px; }
}
@media (hover: none) {
    .xm-cell:hover { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
