/* ============ HubHub 基础 ============ */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --danger: #ef4444;
  --like: #f43f5e;
  --text: #1f2432;
  --text-2: #646b7d;
  --text-3: #9aa1b2;
  --bg: #f4f6fb;
  --card: #ffffff;
  --border: #e7eaf1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
body.no-auth .sidebar, body.no-auth .topbar, body.no-auth .tabbar { display: none !important; }
body.no-auth #main { max-width: none; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
::selection { background: #c7d2fe; }

#app { display: flex; min-height: 100vh; }
.layout-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 20px 16px 90px; }

/* ============ 侧边栏 ============ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky; top: 0;
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(99, 102, 241, .35);
}
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.brand-name small { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-size: 15px; font-weight: 500;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #f2f4f9; color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger); color: #fff; border-radius: 9px;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav-divider { height: 1px; background: var(--border); margin: 10px 6px; }

.me-card {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.me-card:hover { background: #f6f8fc; text-decoration: none; }
.me-card .meta { min-width: 0; flex: 1; }
.me-card .meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .meta span { display: block; font-size: 12px; color: var(--text-3); }
.icon-btn {
  border: none; background: none; color: var(--text-3); cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: #f2f4f9; color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ============ 头像 ============ */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 17px; flex-shrink: 0;
  user-select: none; overflow: hidden;
}
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar.lg { width: 72px; height: 72px; font-size: 30px; }
.avatar.clickable { cursor: pointer; }

/* ============ 顶栏（移动端） ============ */
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px; align-items: center; gap: 10px;
}
.topbar .title { font-size: 17px; font-weight: 700; flex: 1; }

/* ============ 卡片与通用 ============ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.page-head { display: flex; align-items: center; gap: 10px; margin: 4px 2px 14px; }
.page-head h1 { font-size: 20px; margin: 0; flex: 1; }
.page-head .sub { color: var(--text-3); font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 999px; padding: 8px 18px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--primary); color: #fff;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--primary-soft); color: var(--primary); }
.btn.ghost:hover { background: #e0e7ff; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #dc2626; }
.btn.lg { padding: 11px 26px; font-size: 15px; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.link { background: none; color: var(--primary); padding: 4px 8px; }

.input, textarea.input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  background: #fbfcfe; color: var(--text); outline: none;
  transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); background: #fff; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.6; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.empty {
  text-align: center; color: var(--text-3); padding: 48px 20px;
}
.empty .big { font-size: 40px; margin-bottom: 10px; }
.empty p { margin: 4px 0 14px; }

.spinner {
  width: 26px; height: 26px; margin: 24px auto; display: block;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 发布框 ============ */
.composer { display: flex; gap: 12px; }
.composer .body { flex: 1; min-width: 0; }
.composer textarea {
  width: 100%; border: none; outline: none; resize: none;
  font-size: 16px; font-family: inherit; background: transparent;
  min-height: 52px; max-height: 220px; color: var(--text); line-height: 1.6;
}
.composer .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.char-count { font-size: 12px; color: var(--text-3); }
.char-count.warn { color: var(--danger); font-weight: 700; }

/* ============ 动态卡片 ============ */
.post { padding: 14px 18px 8px; }
.post .head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.post .head .who { min-width: 0; flex: 1; line-height: 1.3; }
.post .head .who b { font-size: 14.5px; cursor: pointer; }
.post .head .who:hover b { color: var(--primary); }
.post .head .who .sub { font-size: 12px; color: var(--text-3); }
.post .content { white-space: pre-wrap; word-break: break-word; font-size: 15px; padding: 2px 0 4px; }
.post .del { color: var(--text-3); }
.post .del:hover { color: var(--danger); background: #fef2f2; }

/* ============ 右侧分屏详情面板 ============ */
.detail-pane {
  width: 0; flex-shrink: 0;
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow: hidden;
  position: sticky; top: 0; height: 100vh;
  transition: width .25s ease;
}
body.detail-open .detail-pane { width: 460px; }
@media (min-width: 1500px) { body.detail-open .detail-pane { width: 540px; } }
.detail-inner {
  width: 460px; max-width: 100%; height: 100%; overflow-y: auto;
  padding: 14px 18px 48px; margin: 0 auto;
}
@media (min-width: 1500px) { .detail-inner { width: 540px; } }
.detail-top {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border);
}
.detail-top .d-title { font-size: 16px; font-weight: 800; }
.detail-top .icon-btn { border-radius: 50%; }

.post { cursor: pointer; transition: box-shadow .15s; }
.post:hover { box-shadow: 0 3px 14px rgba(16, 24, 40, .10); }
.post.in-detail { cursor: default; }
.post.in-detail:hover { box-shadow: var(--shadow); }

.detail-comments { margin-top: 14px; }
.dc-title { font-size: 14px; font-weight: 700; color: var(--text-2); margin: 4px 2px 10px; }
.dc-title span { color: var(--text-3); font-weight: 600; margin-left: 4px; }
.dc-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 22px 0; }

@media (max-width: 1099px) {
  .detail-pane {
    position: fixed; right: 0; top: 0; bottom: 0; z-index: 60;
    width: 100% !important; transform: translateX(100%);
    transition: transform .25s ease;
    box-shadow: -8px 0 30px rgba(0, 0, 0, .18);
  }
  body.detail-open .detail-pane { transform: translateX(0); }
  .detail-inner { width: 100%; padding-top: 12px; }
}

/* ============ 事项相关 ============ */
.item-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  background: var(--primary-soft); border-radius: 8px; padding: 3px 10px;
  font-size: 12.5px; color: var(--primary); text-decoration: none;
  border: 1px solid #dfe4ff; overflow: hidden;
}
.item-chip:hover { background: #e0e7ff; text-decoration: none; }
.item-chip b { white-space: nowrap; font-weight: 700; }
.item-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }

.kind-tag {
  display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 6px;
  padding: 2px 8px; white-space: nowrap; flex-shrink: 0;
}
.kind-progress { background: #e0f2fe; color: #0369a1; }
.kind-milestone { background: #fef3c7; color: #b45309; }
.kind-data { background: #f3e8ff; color: #7e22ce; }
.kind-notice { background: #fee2e2; color: #b91c1c; }
.mod-negative { background: #7f1d1d; color: #fff; }

.item-status {
  display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 6px;
  padding: 2px 8px; white-space: nowrap;
}
.st-plan { background: #f1f5f9; color: #475569; }
.st-ready { background: #e0f2fe; color: #075985; }
.st-doing { background: #fef3c7; color: #92400e; }
.st-done { background: #dcfce7; color: #15803d; }
.st-hold { background: #fee2e2; color: #b91c1c; }

.item-card { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s, transform .15s; }
.item-card:hover { box-shadow: 0 4px 20px rgba(16, 24, 40, .09); }
.item-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 1000px) {
  #app { }
  .item-grid { grid-template-columns: 1fr 1fr; }
}
.item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800; font-size: 15px; color: var(--primary); letter-spacing: .5px;
  text-decoration: none;
}
.item-code:hover { text-decoration: underline; }
.item-code.lg { font-size: 20px; }
.item-cat { font-size: 12px; color: var(--text-3); background: #f1f5f9; border-radius: 6px; padding: 2px 8px; }
.item-name { font-size: 15.5px; font-weight: 700; color: var(--text); text-decoration: none; line-height: 1.45; }
.item-name:hover { color: var(--primary); text-decoration: none; }
.item-desc {
  font-size: 13.5px; color: var(--text-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }
.item-last {
  display: flex; gap: 8px; align-items: flex-start;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
}
.item-last .t { min-width: 0; flex: 1; }
.item-last .t-content { font-size: 13px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-last .t-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.item-foot { display: flex; gap: 8px; margin-top: 2px; }
.item-foot .btn:last-child { margin-left: auto; }

.filter-bar { padding: 12px 16px; margin-bottom: 14px; }
.filter-row { display: flex; gap: 10px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.filter-chips .chip { font-size: 12px; padding: 4px 12px; }

.composer-card { padding: 14px 18px; }
.composer-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.composer-row .field-label { font-size: 13px; font-weight: 600; color: var(--text-3); flex-shrink: 0; }
.composer-card textarea.input { margin-top: 2px; }
.composer-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

.item-select { position: relative; flex: 1; min-width: 220px; }
.item-select-drop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16,24,40,.12); overflow: hidden; max-height: 260px; overflow-y: auto;
}
.drop-option { padding: 9px 12px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.drop-option:hover { background: var(--primary-soft); }
.drop-option b { font-family: ui-monospace, Menlo, monospace; color: var(--primary); white-space: nowrap; }
.drop-option span { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-option i { margin-left: auto; color: var(--text-3); font-style: normal; font-size: 12px; white-space: nowrap; }
.drop-empty { padding: 12px; text-align: center; color: var(--text-3); font-size: 13px; }

.kind-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.kind-chip { padding: 4px 10px; }
.kind-chip.active { background: var(--text); border-color: var(--text); }
.kind-chip.active .kind-tag { background: rgba(255,255,255,.18); color: #fff; }

.item-detail-head h2 { margin: 10px 0 6px; font-size: 19px; }
.dh-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dh-top span:last-of-type, .dh-top .btn { }

.page-hint { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 8px 0 2px; }

.actions { display: flex; justify-content: space-between; margin: 4px -10px 2px; }
.act {
  border: none; background: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-3); font-size: 13px; padding: 6px 14px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.act svg { width: 17px; height: 17px; }
.act:hover { background: #f2f4f9; color: var(--primary); }
.act.liked { color: var(--like); font-weight: 600; }
.act.liked svg { fill: var(--like); }
.act .n { min-width: 12px; text-align: left; }

/* ============ 评论区 ============ */
.comments { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; }
.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { font-size: 13px; color: var(--text-3); }
.comment .c-head b { color: var(--text); font-size: 13.5px; margin-right: 6px; cursor: pointer; }
.comment .c-content { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.comment .c-del { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.comment .c-del:hover { color: var(--danger); background: #fef2f2; }
.comment-form { display: flex; gap: 10px; padding: 10px 0 6px; align-items: flex-start; }

/* ============ 列表页 ============ */
.feed-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  border-radius: 999px; padding: 6px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: #c7d2fe; color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.load-more { width: 100%; text-align: center; padding: 10px; }

/* ============ 消息 ============ */
.notif { display: flex; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; align-items: flex-start; }
.notif:last-child { border-bottom: none; }
.notif:hover { background: #f7f8fc; }
.notif.unread { background: #f0f4ff; }
.notif.unread:hover { background: #e8eeff; }
.notif .n-icon {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.notif .n-body { flex: 1; min-width: 0; }
.notif .n-text { font-size: 14px; }
.notif .n-text b { cursor: pointer; }
.notif .n-text b:hover { color: var(--primary); }
.notif .n-snippet { font-size: 13px; color: var(--text-2); background: #f2f4f9; border-radius: 8px; padding: 6px 10px; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif .n-time { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.notif .dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; margin-top: 8px; flex-shrink: 0; }

/* ============ 个人主页 ============ */
.profile-head { display: flex; gap: 16px; align-items: flex-start; }
.profile-head .info { flex: 1; min-width: 0; }
.profile-head h2 { margin: 6px 0 2px; font-size: 20px; }
.profile-head .handle { color: var(--text-3); font-size: 13px; }
.profile-head .bio { margin: 8px 0; font-size: 14px; color: var(--text-2); }
.stat-row { display: flex; gap: 22px; margin-top: 10px; }
.stat-row .st b { font-size: 17px; }
.stat-row .st span { font-size: 12.5px; color: var(--text-3); margin-left: 4px; }
.banned-tag { display: inline-block; background: #fef2f2; color: var(--danger); font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; }

/* ============ 设置 ============ */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: transform .1s; }
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: var(--text); }
.emoji-row { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-pick { font-size: 20px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: #fbfcfe; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.emoji-pick.active { border-color: var(--primary); background: var(--primary-soft); }

/* ============ 登录页 ============ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 45%, #f5f3ff 100%); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(31, 41, 92, .10); padding: 30px 28px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-tabs { display: flex; background: #f2f4f9; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; border: none; background: none; padding: 8px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.auth-tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.demo-accounts { margin-top: 16px; background: #f8fafc; border: 1px dashed var(--border); border-radius: 12px; padding: 12px; font-size: 12.5px; color: var(--text-2); }
.demo-accounts .row { display: flex; gap: 8px; margin-top: 8px; }
.demo-accounts .row button { flex: 1; }

/* ============ 管理后台 ============ */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat-card b { display: block; font-size: 24px; line-height: 1.2; }
.stat-card span { font-size: 12.5px; color: var(--text-3); }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th { text-align: left; color: var(--text-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.grid td { padding: 9px 10px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid .content-cell { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 1px 7px; }
.tag.admin { background: #fef3c7; color: #b45309; }
.tag.user { background: #e0f2fe; color: #0369a1; }
.tag.banned { background: #fee2e2; color: #b91c1c; }
.tag.active { background: #dcfce7; color: #15803d; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn { border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 3px 9px; font-size: 12px; cursor: pointer; color: var(--text-2); white-space: nowrap; }
.mini-btn:hover { border-color: #c7d2fe; color: var(--primary); background: var(--primary-soft); }
.mini-btn.danger:hover { border-color: #fecaca; color: var(--danger); background: #fef2f2; }
.mini-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0 2px; font-size: 13px; color: var(--text-2); }

/* ============ 弹窗 / Toast ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.toast-wrap { position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #111827; color: #fff; font-size: 13.5px; border-radius: 999px;
  padding: 9px 20px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: toast-in .25s ease; max-width: 86vw;
}
.toast.err { background: #b91c1c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============ 移动端底部标签栏 ============ */
.tabbar { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar { display: flex; }
  #main { padding: 12px 12px 76px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(255,255,255,.95); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  }
  .tab-item {
    flex: 1; border: none; background: none; color: var(--text-3);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10.5px; padding: 6px 0 3px; cursor: pointer; position: relative;
  }
  .tab-item svg { width: 22px; height: 22px; }
  .tab-item.active { color: var(--primary); }
  .tab-item .badge {
    position: absolute; top: 2px; left: calc(50% + 6px);
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  }
  .toast-wrap { bottom: 84px; }
}
