/* ============================================================================
   xho —— Twitter/X 风格 Hexo 主题 (v1.1 refined)
   ========================================================================== */
:root {
  --bg: #ffffff;
  --bg-hover: rgba(15, 20, 25, 0.03);
  --bg-elev: #ffffff;
  --bg-input: #eff3f4;
  --card: #f7f9f9;
  --card-hover: rgba(15, 20, 25, 0.045);
  --text: #0f1419;
  --text2: #536471;
  --border: #eff3f4;
  --border-strong: #cfd9de;
  --accent: #1d9bf0;
  --accent-hover: #1a8cd8;
  --accent-soft: rgba(29, 155, 240, 0.1);
  --like: #f91880;
  --like-soft: rgba(249, 24, 128, 0.1);
  --rt: #00ba7c;
  --rt-soft: rgba(0, 186, 124, 0.1);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #15202b;
  --bg-hover: rgba(247, 249, 249, 0.06);
  --bg-elev: #1e2732;
  --bg-input: #273340;
  --card: #1e2732;
  --card-hover: rgba(247, 249, 249, 0.09);
  --text: #f7f9f9;
  --text2: #8b98a5;
  --border: #38444d;
  --border-strong: #536471;
  color-scheme: dark;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; color: inherit; cursor: pointer; }
svg { fill: currentColor; flex-shrink: 0; }
img { display: block; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 三栏骨架 ---------- */
.app { display: flex; max-width: 1265px; margin: 0 auto; }
.center {
  width: 600px; flex-shrink: 0;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  min-height: 100vh;
}

/* ---------- 左侧导航 ---------- */
.leftbar { width: 275px; flex-shrink: 0; }
.leftbar-inner {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; padding: 4px 12px;
}
.logo {
  display: inline-flex; width: 52px; height: 52px; border-radius: 50%;
  align-items: center; justify-content: center; transition: background .2s;
  margin: 2px 0 4px;
}
.logo:hover { background: var(--accent-soft); }
.logo-img { width: 34px; height: 34px; border-radius: 50%; }
.main-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 20px; padding: 11px 12px;
  font-size: 20px; color: var(--text); border-radius: 999px;
  transition: background .15s; width: fit-content;
  letter-spacing: -0.01em;
}
.nav-link:hover { background: var(--bg-hover); }
.nav-link.active { font-weight: 700; }
.nav-icon svg { width: 26px; height: 26px; display: block; }
.post-btn {
  margin-top: 20px; width: 90%; padding: 15px 0;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 700;
  border-radius: 999px; transition: background .15s, box-shadow .15s, transform .1s;
}
.post-btn:hover { background: var(--accent-hover); box-shadow: 0 6px 20px rgba(29,155,240,.28); }
.post-btn:active { transform: scale(0.98); }
.theme-toggle {
  margin-top: 14px; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: background .15s, color .15s;
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text); }
.theme-toggle svg { width: 20px; height: 20px; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun, :root:not([data-theme="dark"]) .icon-sun { display: none; }
.mini-profile {
  margin-top: auto; margin-bottom: 12px; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 999px; transition: background .15s;
}
.mini-profile:hover { background: var(--bg-hover); }
.mini-avatar { width: 40px; height: 40px; border-radius: 50%; }
.mini-info { display: flex; flex-direction: column; min-width: 0; }
.mini-name { font-weight: 700; font-size: 15px; }
.mini-handle { color: var(--text2); font-size: 14px; }
.mini-more { width: 18px; height: 18px; margin-left: auto; color: var(--text2); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px; height: 53px; font-size: 20px; font-weight: 800;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.topbar-sub { font-size: 13px; font-weight: 400; color: var(--text2); }
.topbar-back {
  width: 34px; height: 34px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; transition: background .15s;
}
.topbar-back:hover { background: var(--bg-hover); }
.topbar-back svg { width: 20px; height: 20px; }

/* ---------- 发帖框 ---------- */
.composer {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.composer-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.composer-right { flex: 1; min-width: 0; }
.composer-input {
  padding: 11px 0; font-size: 20px; color: var(--text2); cursor: text;
  letter-spacing: -0.01em;
}
.composer-area {
  width: 100%; border: none; outline: none; resize: vertical;
  font: inherit; font-size: 17px; color: var(--text); background: transparent;
  padding: 8px 0;
}
.composer-tools {
  display: flex; gap: 4px; padding: 10px 0 4px;
  border-top: 1px solid var(--border); color: var(--accent);
}
.composer-tools svg { width: 19px; height: 19px; opacity: .85; }
.composer-foot { display: flex; align-items: center; gap: 10px; padding-top: 8px; }
.composer-hint { font-size: 12.5px; color: var(--text2); flex: 1; }
.composer-send {
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
  padding: 8px 20px; border-radius: 999px; transition: background .15s, transform .1s;
}
.composer-send:hover { background: var(--accent-hover); }
.composer-send:active { transform: scale(0.97); }

/* ---------- 推文卡片 ---------- */
.timeline .tweet { animation: tweet-in .4s cubic-bezier(.2,.8,.3,1) both; }
.timeline .tweet:nth-child(1) { animation-delay: .02s; }
.timeline .tweet:nth-child(2) { animation-delay: .06s; }
.timeline .tweet:nth-child(3) { animation-delay: .1s; }
.timeline .tweet:nth-child(4) { animation-delay: .14s; }
.timeline .tweet:nth-child(5) { animation-delay: .18s; }
.timeline .tweet:nth-child(n+6) { animation-delay: .22s; }
@keyframes tweet-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.tweet {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); transition: background .15s;
  cursor: pointer;
}
.tweet:hover { background: var(--bg-hover); }
.t-avatar img {
  width: 40px; height: 40px; border-radius: 50%;
  transition: box-shadow .15s;
}
.t-avatar:hover img { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--border-strong); }
.t-avatar { flex-shrink: 0; }
.t-body { flex: 1; min-width: 0; }
.t-head { display: flex; align-items: center; gap: 4px; min-width: 0; }
.t-name { font-weight: 700; font-size: 15px; white-space: nowrap; letter-spacing: -0.01em; }
.t-name:hover { text-decoration: underline; }
.t-verified { display: inline-flex; }
.t-verified svg { width: 17px; height: 17px; display: block; }
.t-meta { color: var(--text2); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-time { color: var(--text2); }
.t-time:hover { text-decoration: underline; }
.t-title {
  display: block; font-size: 15px; font-weight: 600; line-height: 1.45;
  margin: 1px 0; color: var(--text); letter-spacing: -0.005em;
}
.t-title:hover { color: var(--accent); }
.t-text { font-size: 15px; line-height: 1.55; color: var(--text); }
.t-tags { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 7px; }
.t-tags a { color: var(--accent); font-size: 14.5px; }
.t-tags a:hover { text-decoration: underline; }

/* 操作栏:X 标志性的彩色圆形 hover 底 */
.t-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin: 10px -8px -4px 0; max-width: 425px;
}
.t-act {
  display: inline-flex; align-items: center; gap: 2px;
  color: var(--text2); font-size: 13px;
  position: relative; padding: 0 6px;
  transition: color .18s;
}
.t-act::before {
  content: ''; position: absolute; left: -2px; top: 50%;
  width: 34px; height: 34px; border-radius: 50%;
  transform: translateY(-50%) scale(0.6); opacity: 0;
  transition: transform .18s cubic-bezier(.2,.8,.3,1), opacity .18s;
}
.t-act svg { width: 18.5px; height: 18.5px; position: relative; z-index: 1; }
.t-num { font-variant-numeric: tabular-nums; position: relative; z-index: 1; padding-left: 4px; }
.act-reply:hover { color: var(--accent); }
.act-reply:hover::before { background: var(--accent-soft); transform: translateY(-50%) scale(1); opacity: 1; }
.act-rt:hover { color: var(--rt); }
.act-rt:hover::before { background: var(--rt-soft); transform: translateY(-50%) scale(1); opacity: 1; }
.act-rt.done { color: var(--rt); }
.act-like:hover { color: var(--like); }
.act-like:hover::before { background: var(--like-soft); transform: translateY(-50%) scale(1); opacity: 1; }
.act-like.liked { color: var(--like); }
.act-like.liked svg { animation: like-pop .45s cubic-bezier(.2,2.2,.4,1); }
@keyframes like-pop {
  0% { transform: scale(1); } 40% { transform: scale(1.35); }
  70% { transform: scale(0.92); } 100% { transform: scale(1); }
}
.act-share:hover { color: var(--accent); }
.act-share:hover::before { background: var(--accent-soft); transform: translateY(-50%) scale(1); opacity: 1; }

/* ---------- 推文详情 ---------- */
.tweet-full { cursor: default; flex-direction: column; }
.tweet-full:hover { background: transparent; }
.t-head-row { display: flex; gap: 12px; align-items: center; }
.t-full-title { font-size: 23px; font-weight: 800; margin: 14px 0 4px; line-height: 1.35; letter-spacing: -0.015em; }
.t-full-content { font-size: 16px; line-height: 1.8; }
.t-full-content h2, .t-full-content h3, .t-full-content h4 { margin: 24px 0 10px; line-height: 1.4; letter-spacing: -0.01em; }
.t-full-content p { margin: 12px 0; }
.t-full-content a { color: var(--accent); }
.t-full-content a:hover { text-decoration: underline; }
.t-full-content img { max-width: 100%; border-radius: 16px; margin: 12px 0; }
.t-full-content blockquote {
  border-left: 3px solid var(--accent); padding: 6px 16px;
  color: var(--text2); margin: 14px 0; background: var(--accent-soft); border-radius: 0 12px 12px 0;
}
.t-full-content code {
  background: var(--bg-input); padding: 2px 7px; border-radius: 6px;
  font-family: "SF Mono", Consolas, "JetBrains Mono", monospace; font-size: .88em;
}
.t-full-content pre {
  background: #0d1117; color: #e6edf3; padding: 16px; border-radius: 14px;
  overflow-x: auto; font-size: 13px; line-height: 1.65; margin: 14px 0;
}
.t-full-content pre code { background: none; padding: 0; }
.t-full-content ul, .t-full-content ol { padding-left: 26px; margin: 12px 0; }
.t-full-content li { margin: 5px 0; }
.t-full-content hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.t-full-content table { border-collapse: collapse; margin: 14px 0; font-size: 14px; width: 100%; }
.t-full-content th, .t-full-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.t-full-content th { background: var(--card); font-weight: 700; }
.t-full-time { color: var(--text2); font-size: 15px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.t-tags-full { margin-top: 12px; }
.t-stats {
  display: flex; gap: 22px; padding: 15px 0;
  border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text2);
}
.t-stats b { color: var(--text); font-weight: 700; }
.t-actions-full { border-bottom: 1px solid var(--border); padding: 6px 0; margin-top: 0; max-width: none; justify-content: space-around; }
.reply-box {
  display: flex; gap: 12px; padding: 16px; align-items: center;
  border-bottom: 1px solid var(--border);
}
.reply-hint { color: var(--text2); font-size: 14.5px; }
.reply-hint a { color: var(--accent); }
.prevnext { display: flex; border-bottom: 1px solid var(--border); }
.pn-item {
  flex: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
  transition: background .15s; min-width: 0;
}
.pn-item:hover { background: var(--bg-hover); }
.pn-next { text-align: right; }
.pn-label { font-size: 13px; color: var(--text2); }
.pn-title { font-size: 14.5px; font-weight: 600; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 归档 ---------- */
.archive-list { padding-bottom: 24px; }
.archive-year {
  padding: 18px 16px 8px; font-size: 20px; font-weight: 800;
  position: sticky; top: 53px; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  letter-spacing: -0.01em;
}
.archive-row {
  display: flex; gap: 14px; padding: 11px 16px; align-items: baseline;
  border-bottom: 1px solid var(--border); transition: background .15s;
}
.archive-row:hover { background: var(--bg-hover); }
.archive-date { color: var(--text2); font-size: 13px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.archive-title { font-size: 15px; font-weight: 500; }

/* ---------- 右栏 ---------- */
.rightbar { flex: 1; min-width: 0; }
.rightbar-inner {
  position: sticky; top: 0; padding: 6px 24px 24px;
  display: flex; flex-direction: column; gap: 16px; max-width: 350px;
}
.search-box {
  position: relative; display: flex; align-items: center;
  background: var(--bg-input); border-radius: 999px; padding: 0 16px;
  border: 1px solid transparent; transition: border-color .15s, background .15s;
}
.search-box:focus-within { background: var(--bg); border-color: var(--accent); }
.search-box:focus-within .search-icon { color: var(--accent); }
.search-icon { width: 16px; height: 16px; color: var(--text2); flex-shrink: 0; transition: color .15s; }
#searchInput {
  flex: 1; border: none; outline: none; background: transparent;
  font: inherit; color: var(--text); padding: 12px 0 12px 12px; font-size: 15px;
}
#searchInput::placeholder { color: var(--text2); }
#searchInput::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-elev); border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 16px rgba(0,0,0,0.12), 0 8px 30px rgba(0,0,0,0.12); display: none; z-index: 60;
  border: 1px solid var(--border); max-height: 60vh; overflow-y: auto;
}
.search-results.show { display: block; }
.sr-item { display: block; padding: 12px 16px; transition: background .15s; }
.sr-item:hover { background: var(--bg-hover); }
.sr-title { font-size: 14.5px; font-weight: 600; }
.sr-date { font-size: 12.5px; color: var(--text2); margin-top: 2px; }
.sr-empty { padding: 18px 16px; text-align: center; color: var(--text2); font-size: 13.5px; }

.side-card { background: var(--card); border-radius: 16px; overflow: hidden; }
.side-card-title { font-size: 20px; font-weight: 800; padding: 12px 16px 4px; letter-spacing: -0.01em; }
.about-mini { display: flex; gap: 10px; align-items: center; padding: 8px 16px 0; }
.about-avatar { width: 44px; height: 44px; border-radius: 50%; }
.about-name { font-weight: 700; font-size: 15px; }
.about-handle { color: var(--text2); font-size: 13.5px; }
.about-bio { padding: 10px 16px; font-size: 14px; color: var(--text); line-height: 1.55; }
.about-stats { display: flex; gap: 16px; padding: 0 16px 14px; font-size: 13px; color: var(--text2); }
.about-stats b { color: var(--text); }

.trend-item { display: flex; flex-direction: column; gap: 2px; padding: 11px 16px; transition: background .15s; }
.trend-item:hover { background: var(--card-hover); }
.trend-item:last-child { border-radius: 0 0 16px 16px; }
.trend-rank { font-size: 12.5px; color: var(--text2); }
.trend-name { font-size: 15px; font-weight: 700; letter-spacing: -0.005em; }
.trend-count { font-size: 12.5px; color: var(--text2); }
.side-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text2); padding: 0 10px; }
.side-foot a:hover { text-decoration: underline; }

/* ---------- 趋势卡片网格(探索页) ---------- */
.trend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.trend-card {
  background: var(--card); border-radius: 16px; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 4px;
  transition: background .15s, transform .15s;
}
.trend-card:hover { background: var(--card-hover); transform: translateY(-1px); }
.trend-card .trend-rank { font-size: 22px; font-weight: 800; color: var(--accent); }

/* ---------- 个人主页(关于页) ---------- */
.profile-banner {
  height: 180px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(255,255,255,.25), transparent),
    linear-gradient(120deg, #1d9bf0 0%, #7856ff 45%, #ec4899 100%);
}
.profile-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 16px; }
.profile-avatar {
  width: 128px; height: 128px; border-radius: 50%;
  border: 4px solid var(--bg); margin-top: -64px;
  transition: filter .2s;
}
.profile-avatar:hover { filter: brightness(0.94); }
.profile-btn {
  margin-top: 12px; border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 8px 18px; font-weight: 700; font-size: 14.5px; transition: background .15s;
}
.profile-btn:hover { background: var(--bg-hover); }
.profile-info { padding: 8px 16px 0; }
.profile-name { font-size: 21px; font-weight: 800; display: flex; align-items: center; gap: 5px; letter-spacing: -0.01em; }
.profile-bio { margin-top: 10px; font-size: 15px; line-height: 1.6; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 11px; color: var(--text2); font-size: 14.5px; }
.profile-meta svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.profile-meta a { color: var(--accent); }
.profile-meta a:hover { text-decoration: underline; }
.profile-stats { display: flex; gap: 20px; margin-top: 13px; font-size: 14px; color: var(--text2); }
.profile-stats span { transition: text-decoration .1s; }
.profile-stats span:hover { text-decoration: underline; }
.profile-stats b { color: var(--text); }
.profile-tabs { display: flex; border-bottom: 1px solid var(--border); margin-top: 10px; }
.ptab { padding: 15px 22px; font-weight: 700; font-size: 15px; position: relative; color: var(--text2); }
.ptab.active { color: var(--text); }
.ptab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 22px; right: 22px;
  height: 4px; border-radius: 4px 4px 0 0; background: var(--accent);
}
.page-content { padding: 20px 16px; font-size: 15px; line-height: 1.8; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.pager-btn { color: var(--accent); font-weight: 600; font-size: 14.5px; padding: 8px 16px; border-radius: 999px; transition: background .15s; }
.pager-btn:hover { background: var(--accent-soft); }
.pager-info { color: var(--text2); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--accent); color: #fff; padding: 10px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: all .25s cubic-bezier(.2,.8,.4,1); z-index: 999; box-shadow: 0 8px 30px rgba(0,0,0,.22);
  letter-spacing: -0.005em;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 移动端底部栏 ---------- */
.bottombar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
  justify-content: space-around; align-items: center;
}
.bottombar a, .bottombar .theme-toggle-b {
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 50%; color: var(--text);
  transition: background .15s;
}
.bottombar a:active { background: var(--bg-hover); }
.bottombar svg { width: 25px; height: 25px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .leftbar { width: 88px; }
  .nav-link { gap: 0; padding: 14px; }
  .nav-name, .post-btn { display: none; }
  .mini-info, .mini-more { display: none; }
  .leftbar-inner { align-items: center; }
}
@media (max-width: 988px) {
  .rightbar { display: none; }
  .center { flex: 1; }
}
@media (max-width: 688px) {
  .leftbar { display: none; }
  .center { width: 100%; border: none; padding-bottom: 70px; }
  .bottombar { display: flex; }
  .topbar { font-size: 18px; }
  .composer { padding: 10px 14px; }
  .composer-input { font-size: 17px; }
  .profile-banner { height: 120px; }
  .profile-avatar { width: 90px; height: 90px; margin-top: -45px; }
  .trend-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0s !important; }
}
