/* ---------------------------------------------------------------- 主题 */
:root {
  --bg: #fff;
  --bg-blur: rgba(255, 255, 255, .85);
  --fg: #0f1419;
  --muted: #536471;
  --line: #eff3f4;
  --hover: rgba(15, 20, 25, .03);
  --card: #f7f9f9;
  --input: #eff3f4;
  --accent: #1d9bf0;
  --accent-soft: rgba(29, 155, 240, .1);
  --red: #f4212e;
  --red-soft: rgba(244, 33, 46, .1);
  --green: #00ba7c;
  --pink: #f91880;
  --orange: #f7931a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000; --bg-blur: rgba(0, 0, 0, .75); --fg: #e7e9ea; --muted: #71767b; --line: #2f3336;
    --hover: rgba(231, 233, 234, .03); --card: #16181c; --input: #202327; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000; --bg-blur: rgba(0, 0, 0, .75); --fg: #e7e9ea; --muted: #71767b; --line: #2f3336;
  --hover: rgba(231, 233, 234, .03); --card: #16181c; --input: #202327; color-scheme: dark;
}

/* ---------------------------------------------------------------- 基础 */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { background: var(--card); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- 表单与按钮 */
input[type="text"], input[type="password"], input[type="number"], input:not([type]), select, textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---------------------------------------------------------------- 三栏布局 */
.app { display: flex; justify-content: center; min-height: 100vh; }
.nav {
  width: 275px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; align-items: flex-start; padding: 4px 12px 16px 33px; gap: 2px;
}
.nav > * { width: 230px; }
.logo { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 4px; color: var(--fg); font-weight: 800; font-size: 19px; }
.logo:hover { text-decoration: none; }
.logo img { width: 34px; height: 34px; border-radius: 9px; }
.nav-item {
  display: flex; align-items: center; gap: 18px; padding: 12px; border-radius: 999px; width: max-content; max-width: 100%;
  color: var(--fg); font-size: 19px; background: none; border: 0; cursor: pointer; transition: background .15s;
}
.nav-item:hover { background: var(--hover); text-decoration: none; filter: brightness(.97); }
.nav-item .icon { width: 26px; height: 26px; }
.nav-item.active { font-weight: 800; }
.nav-item.active .icon { stroke-width: 2.4; }
.nav-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-bottom .nav-item { font-size: 15px; color: var(--muted); }
.nav-bottom .nav-item .icon { width: 20px; height: 20px; }
.nav-bottom form { margin: 0; }

.column { width: 600px; max-width: 100%; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100vh; }
.app.no-side .column { width: 950px; }
.side { width: 350px; flex-shrink: 0; padding: 8px 0 24px 28px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none; }

/* ---------------------------------------------------------------- 栏目标题 + 标签 */
.col-head { position: sticky; top: 0; z-index: 10; background: var(--bg-blur); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.col-title { display: flex; align-items: center; gap: 24px; padding: 8px 16px; min-height: 53px; }
.col-title h1 { font-size: 20px; margin: 0; font-weight: 800; line-height: 1.2; }
.col-title .sub { color: var(--muted); font-size: 13px; }
.back { display: inline-flex; padding: 8px; margin: -8px; border-radius: 50%; color: var(--fg); }
.back:hover { background: var(--hover); }
.tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.tabs a { flex: 1; text-align: center; padding: 16px 12px; color: var(--muted); font-weight: 500; position: relative; white-space: nowrap; }
.tabs a:hover { background: var(--hover); text-decoration: none; }
.tabs a.active { color: var(--fg); font-weight: 700; }
.tabs a.active::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 56px; height: 4px; border-radius: 4px; background: var(--accent); }
.profile-tabs { border-bottom: 1px solid var(--line); }
.sort-bar { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sort-bar a { padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg); font-size: 14px; }
.sort-bar a.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.sort-bar a:hover { text-decoration: none; }

/* ---------------------------------------------------------------- 推文卡片 */
.tweet { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.tweet:hover { background: var(--hover); }
.tweet.is-deleted { box-shadow: inset 3px 0 0 var(--red); }
.context { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 700; margin: -4px 0 4px; }
.context .icon { width: 16px; height: 16px; margin-left: 24px; }
.context a { color: var(--muted); }
.tweet-row { display: flex; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--card); }
.avatar.xs { width: 20px; height: 20px; }
.avatar.sm { width: 40px; height: 40px; }
.avatar.xl { width: 134px; height: 134px; border: 4px solid var(--bg); }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-weight: 700; }
.avatar.xl.avatar-fallback { font-size: 48px; }
.avatar.xs.avatar-fallback { font-size: 11px; }
.avatar-link { flex-shrink: 0; }
.tweet-main { flex: 1; min-width: 0; }
.tweet-head { display: flex; align-items: center; gap: 4px; white-space: nowrap; min-width: 0; }
.tweet-head .name, .quote-head .name { font-weight: 700; color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.handle, .dot, .time { color: var(--muted); }
.tweet-head .handle { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.time { flex-shrink: 0; }
.verified { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; display: inline-block; vertical-align: -3px; }
.badge { font-size: 12px; line-height: 18px; padding: 0 6px; border-radius: 4px; background: var(--card); color: var(--muted); margin-left: 4px; flex-shrink: 0; font-weight: 500; }
.badge.deleted { background: var(--red-soft); color: var(--red); }
.reply-to { color: var(--muted); font-size: 14px; margin-top: 2px; }
.tweet-text { margin-top: 2px; overflow-wrap: anywhere; line-height: 1.45; }
.tweet-text.big { font-size: 17px; line-height: 1.5; margin: 12px 0; }

/* ---------------------------------------------------------------- 图片/视频 */
.media-grid { position: relative; display: grid; gap: 2px; margin-top: 12px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.media { position: relative; display: block; overflow: hidden; background: var(--card); min-height: 0; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
/* 单张图：宽度固定占满，高度按比例、最高 510px（不写 width 时浏览器会按比例把宽度也缩小，右边空出一块） */
.n-1 .media { width: 100%; max-height: 510px; }
.n-1 .media.photo img { max-height: 510px; }
.n-1 .media.video, .n-1 .media.gif { background: #000; }
.n-1 .media.video video, .n-1 .media.gif video { object-fit: contain; max-height: 510px; }
.n-1 .media:not([style]) { aspect-ratio: 16 / 9; }
.n-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.n-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.n-3 .media:first-child { grid-row: span 2; }
.n-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-grid.compact { border-radius: 12px; margin-top: 8px; }
.media .play, .wall-tile .play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: rgba(29, 155, 240, .9); color: #fff; stroke: none; }
.duration, .gif-badge { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 4px; pointer-events: none; }
.media-note { position: absolute; top: 8px; left: 8px; right: 8px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; }
.media-grid.sensitive .media { filter: blur(28px); }
.reveal { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; padding: 8px 16px; border-radius: 999px; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-weight: 700; cursor: pointer; }
.media-grid:not(.sensitive) .reveal { display: none; }

/* ---------------------------------------------------------------- 引用 */
.quote { display: block; margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 12px; color: var(--fg); transition: background .15s; }
.quote:hover { background: var(--hover); text-decoration: none; }
.quote.missing { color: var(--muted); background: var(--card); font-size: 14px; }
.quote-head { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; font-size: 14px; }
.quote-head .avatar { margin-right: 2px; }
.quote-text { margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------------------------------------------------------- 互动数 */
.actions { display: flex; justify-content: space-between; max-width: 425px; margin-top: 10px; color: var(--muted); }
.act { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; min-width: 52px; }
.act .icon { width: 18px; height: 18px; }
.act.x-link { color: var(--muted); min-width: 0; padding: 4px; margin: -4px; border-radius: 50%; }
.act.x-link:hover { color: var(--accent); background: var(--accent-soft); }
.tweet:hover .act.reply { color: var(--accent); }
.tweet:hover .act.retweet { color: var(--green); }
.tweet:hover .act.heart { color: var(--pink); }

/* ---------------------------------------------------------------- 详情页 */
.tweet.detail { cursor: default; padding: 12px 16px 0; }
.tweet.detail:hover { background: none; }
.detail-head { display: flex; gap: 12px; align-items: center; }
.detail-head .name { font-weight: 700; color: var(--fg); }
.detail-time { color: var(--muted); padding: 16px 0; border-bottom: 1px solid var(--line); }
.detail-stats { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.detail-stats:empty { display: none; }
.detail-stats b { color: var(--fg); }
.archive-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 14px 0; color: var(--muted); font-size: 13px; }
.archive-info a { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.archive-info .icon { width: 16px; height: 16px; }
.deleted-banner { display: flex; gap: 12px; align-items: flex-start; background: var(--red-soft); color: var(--fg); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.deleted-banner .icon { color: var(--red); width: 24px; height: 24px; }
.thread-parent .tweet { border-bottom: 0; }
.thread-missing { padding: 12px 16px; color: var(--muted); font-size: 14px; border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------- 文章 */
.article-card { display: block; margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; color: var(--fg); transition: background .15s; }
.article-card:hover { background: var(--hover); text-decoration: none; }
.article-cover { width: 100%; aspect-ratio: 5 / 2; object-fit: cover; background: var(--card); }
.article-card-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.article-card-body b { font-size: 16px; line-height: 1.35; }
.article-card-body p { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.article-tag .icon { width: 15px; height: 15px; }
.article-card.pending { background: var(--card); }
.reader { padding: 0 0 24px; }
.reader-cover { width: 100%; aspect-ratio: 5 / 2; object-fit: cover; background: var(--card); }
.reader-title { font-size: 28px; line-height: 1.3; font-weight: 800; margin: 20px 20px 14px; overflow-wrap: anywhere; }
.reader .deleted-banner { margin: 16px 20px 0; }
.reader-author { display: flex; gap: 12px; align-items: center; padding: 0 20px 16px; border-bottom: 1px solid var(--line); }
.reader-author .name { font-weight: 700; color: var(--fg); }
.reader-body { padding: 8px 20px; font-size: 17px; line-height: 1.8; overflow-wrap: anywhere; }
.reader-body p { margin: 0 0 1em; }
.reader-body h2 { font-size: 23px; line-height: 1.4; margin: 1.4em 0 .6em; }
.reader-body h3 { font-size: 20px; line-height: 1.4; margin: 1.2em 0 .5em; }
.reader-body h4 { font-size: 18px; margin: 1em 0 .5em; }
.reader-body ul, .reader-body ol { margin: 0 0 1em; padding-left: 1.5em; }
.reader-body blockquote { margin: 0 0 1em; padding: 2px 0 2px 14px; border-left: 3px solid var(--line); color: var(--muted); }
.reader-body figure { margin: 1.2em 0; }
.reader-body figure img, .reader-body figure video { width: 100%; height: auto; border-radius: 12px; background: var(--card); }
.reader-body figure.missing { color: var(--muted); font-size: 14px; text-align: center; padding: 20px; background: var(--card); border-radius: 12px; }
.reader-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.reader-code { background: var(--card); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font: 14px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.reader-embed { margin: 1.2em 0; }
.reader-embed .quote { font-size: 15px; line-height: 1.45; }
.reader-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 8px 20px 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.reader-foot span { display: inline-flex; align-items: center; gap: 4px; }
.reader-foot .icon { width: 16px; height: 16px; }
.reader-foot form { margin: 0 0 0 auto; }
.reader-empty { padding: 40px 24px; text-align: center; color: var(--muted); line-height: 1.8; }
.reader-empty form { margin: 12px 0; }

/* ---------------------------------------------------------------- 评论区 */
.page-flash { padding: 12px 16px 0; }
#comments { scroll-margin-top: 54px; }
.page-flash .flash { margin-bottom: 0; }
.comments-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.comments-head h3 { margin: 0 0 2px; font-size: 17px; }
.comments-head form { margin: 0; }
.comments-note { margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.thread { border-bottom: 1px solid var(--line); }
.thread > .tweet { border-bottom: 0; }
.thread-children { margin: 0 0 8px 35px; border-left: 2px solid var(--line); }
.thread-children .tweet { border-bottom: 0; padding: 8px 16px 8px 12px; }
.thread-children .avatar { width: 32px; height: 32px; }

/* ---------------------------------------------------------------- 用户主页 */
.banner { aspect-ratio: 3 / 1; background: var(--card); overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.profile-top { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 16px; margin-top: -15%; }
.profile-top .avatar.xl { width: 25%; height: auto; aspect-ratio: 1; max-width: 134px; min-width: 72px; }
.profile-body { padding: 4px 16px 12px; }
.profile-name { font-size: 20px; font-weight: 800; margin: 8px 0 0; display: flex; align-items: center; gap: 4px; }
.bio { margin-top: 12px; overflow-wrap: anywhere; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; color: var(--muted); }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-meta .icon { width: 18px; height: 18px; }
.profile-counts { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.profile-counts b { color: var(--fg); }
.profile-counts .archived b { color: var(--accent); }
.profile-status { margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: var(--card); color: var(--muted); font-size: 14px; }
.profile-status.warn { background: var(--red-soft); color: var(--fg); }

.media-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; }
.wall-tile { position: relative; aspect-ratio: 1; background: var(--card); overflow: hidden; }
.wall-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.wall-tile:hover img { transform: scale(1.04); }
.media-wall .load-more { grid-column: 1 / -1; }

.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.hist-meta { display: flex; gap: 8px; align-items: baseline; color: var(--muted); font-size: 13px; }
.hist-meta b { color: var(--fg); font-size: 15px; }
.hist-change { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.hist-change del { color: var(--muted); }
.hist-change ins { text-decoration: none; }
.hist-change .arrow { color: var(--muted); }
.hist-img { width: 120px; border-radius: 8px; }
.hist-img.round { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }

/* ---------------------------------------------------------------- 列表通用 */
.load-more { display: block; text-align: center; padding: 18px; color: var(--accent); border-bottom: 1px solid var(--line); }
.load-more:hover { background: var(--hover); text-decoration: none; }
.empty { padding: 48px 32px; text-align: center; color: var(--muted); line-height: 1.7; }

/* ---------------------------------------------------------------- 右侧栏 */
.side-search { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding: 10px 16px; border-radius: 999px; background: var(--input); color: var(--muted); border: 1px solid transparent; box-shadow: 0 -8px 0 var(--bg); }
.side-search:focus-within { border-color: var(--accent); background: var(--bg); color: var(--accent); }
.side-search input, .side-search input:focus { flex: 1; border: 0; background: none; outline: none; box-shadow: none; padding: 0; color: var(--fg); min-width: 0; }
.card { border: 1px solid var(--line); border-radius: 16px; margin-top: 16px; overflow: hidden; }
.card h2 { font-size: 20px; font-weight: 800; margin: 0; padding: 12px 16px; }
.card > p { margin: 0; padding: 0 16px 14px; }
.side-user { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--fg); transition: background .15s; }
.side-user:hover { background: var(--hover); text-decoration: none; }
.side-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.side-user-text .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text .handle { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { color: var(--muted); font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 8px 8px; text-align: center; }
.stat-grid > div, .stat-grid a { display: flex; flex-direction: column; padding: 6px; border-radius: 12px; color: var(--fg); }
.stat-grid a:hover { background: var(--hover); text-decoration: none; }
.stat-grid b { font-size: 20px; }
.stat-grid span { color: var(--muted); font-size: 13px; }
.run-info { border-top: 1px solid var(--line); padding: 10px 16px 12px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.run-live { color: var(--accent); display: flex; align-items: center; gap: 8px; }
.card.warn { border-color: var(--red); padding-bottom: 12px; }
.card.warn b { display: block; padding: 12px 16px 4px; color: var(--red); }
.card.warn a { padding: 0 16px; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; flex-shrink: 0; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(29, 155, 240, .6); } 100% { box-shadow: 0 0 0 10px rgba(29, 155, 240, 0); } }

/* ---------------------------------------------------------------- 搜索页 */
.search-form { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.search-form input { flex: 1; min-width: 0; }
mark { background: rgba(255, 212, 0, .45); color: inherit; border-radius: 2px; }

/* ---------------------------------------------------------------- 按钮 */
textarea { width: 100%; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 999px; border: 1px solid transparent; background: var(--fg); color: var(--bg); font-weight: 700; cursor: pointer; white-space: nowrap; transition: filter .15s, background .15s; }
.btn:hover { filter: brightness(.9); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.outline { background: none; color: var(--fg); border-color: var(--line); }
.btn.outline .icon { width: 16px; height: 16px; }
.btn.ghost { background: none; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { background: var(--hover); filter: none; }
.btn.danger { background: none; color: var(--red); border-color: var(--red-soft); }
.btn.danger:hover { background: var(--red-soft); filter: none; }
.btn.small { padding: 4px 12px; font-size: 13px; }

/* ---------------------------------------------------------------- 管理页 */
.admin { padding: 16px; }
.panel { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.panel h2 { font-size: 18px; margin: 0 0 12px; }
.panel p { margin: 8px 0; }
.flash { padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: rgba(0, 186, 124, .12); color: var(--green); }
.flash.error { background: var(--red-soft); color: var(--red); }
.run-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run-buttons { display: flex; gap: 8px; margin-top: 12px; }
.run-buttons form { margin: 0; }
.live-log { margin: 12px 0 0; max-height: 320px; overflow: auto; background: var(--card); border-radius: 10px; padding: 10px 12px; font: 12px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.add-user { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.add-user input[name="username"] { flex: 1 1 240px; }
.inline-check, .inline-num { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.inline-num input { width: 80px; padding: 6px 8px; }
.table-wrap { overflow-x: auto; margin: 12px -16px -16px; }
.users-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.users-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.users-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.users-table tr:last-child td { border-bottom: 0; }
.users-table td.num { font-variant-numeric: tabular-nums; }
.users-table td .small { margin-top: 4px; max-width: 220px; }
.user-cell { display: flex; gap: 10px; align-items: center; color: var(--fg); line-height: 1.3; }
.user-cell:hover { text-decoration: none; }
.toggles, .row-actions { white-space: nowrap; }
.toggles form, .row-actions form { display: inline-block; margin: 0 2px 4px 0; }
.chip { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--muted); cursor: pointer; }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 700; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card); color: var(--muted); }
.pill.ok { background: rgba(0, 186, 124, .12); color: var(--green); }
.pill.error, .pill.failed { background: var(--red-soft); color: var(--red); }
.pill.unavailable, .pill.partial, .pill.aborted, .pill.stopped { background: rgba(247, 147, 26, .14); color: var(--orange); }
.pill.running { background: var(--accent-soft); color: var(--accent); }
.help { margin: 8px 0 12px; font-size: 14px; }
.help summary { cursor: pointer; color: var(--accent); }
.help ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.8; }
.cookie-form .row { margin: 8px 0; }
.coll-progress { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 12px; font-size: 14px; color: var(--muted); }
.coll-progress b { color: var(--fg); margin-right: 6px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.settings-grid .row { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.field small { color: var(--muted); font-size: 12px; }
.field.check { flex-direction: row; align-items: flex-start; gap: 8px; }
.field.check input { margin-top: 3px; }
.field.check span { display: flex; flex-direction: column; gap: 2px; }
details.run { border-top: 1px solid var(--line); padding: 8px 0; font-size: 14px; }
details.run:first-of-type { border-top: 0; }
details.run summary { cursor: pointer; }
details.run pre { max-height: 360px; overflow: auto; background: var(--card); border-radius: 10px; padding: 10px; font: 12px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }

/* ---------------------------------------------------------------- 登录页 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login-logo { width: 64px; height: 64px; margin: 0 auto; border-radius: 16px; }
.login h1 { margin: 4px 0 0; font-size: 28px; font-weight: 800; }
.login p { margin: 0 0 8px; }
.login input { padding: 14px; font-size: 16px; }
.login .btn { justify-content: center; padding: 12px; font-size: 16px; }
.form-error { color: var(--red); font-size: 14px; }

/* ---------------------------------------------------------------- 看大图 */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; }
.lightbox button { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 28px; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .24); }
.lb-close { top: 14px; left: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-open { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; background: rgba(255, 255, 255, .12); padding: 6px 14px; border-radius: 999px; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1280px) {
  .nav { width: 88px; align-items: center; padding-left: 12px; }
  .nav > * { width: auto; }
  .nav-item span, .logo span { display: none; }
  .logo { padding: 10px; }
}
@media (max-width: 1020px) {
  .side { display: none; }
}
@media (max-width: 700px) {
  .app { display: block; }
  .column { border: 0; padding-bottom: 60px; width: 100%; }
  .nav {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; height: auto; z-index: 30;
    flex-direction: row; justify-content: space-around; align-items: center; padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    background: var(--bg-blur); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .logo, .nav-bottom { display: none; }
  .nav-item { padding: 10px; }
  .settings-grid { grid-template-columns: 1fr; }
  .tweet { padding: 10px 12px; }
  .search-form { flex-wrap: wrap; }
}
