/* ============================================================
   ScholarHub · 水墨宣纸风（黑白）
   宣纸底色 · 墨色文字 · 书法标题 · 晕染装饰
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --paper: #f5f1e6;          /* 宣纸 */
  --paper-deep: #efe9da;     /* 宣纸暗部 */
  --ink: #1c1c1c;            /* 浓墨 */
  --ink-soft: #3d3d3d;       /* 中墨 */
  --ink-light: #6f6f6f;      /* 淡墨 */
  --ink-faint: #a8a49a;      /* 枯墨 */
  --line: #d8d2c2;           /* 纸纹线 */
  --radius: 6px;             /* 方角卡片，近碑刻 */
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 宣纸纹理（细颗粒噪点 + 横向纤维） */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.012) 3px 4px);
}

/* 水墨晕染背景 */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-orbs i {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(28,28,28,.14) 0%, rgba(28,28,28,.05) 45%, transparent 70%);
  filter: blur(40px); animation: float 22s ease-in-out infinite alternate;
}
.bg-orbs i:nth-child(1) { width: 520px; height: 520px; top: -140px; left: -100px; }
.bg-orbs i:nth-child(2) { width: 460px; height: 460px; bottom: -160px; right: -80px; animation-delay: -8s; opacity: .8; }
.bg-orbs i:nth-child(3) { width: 340px; height: 340px; top: 42%; left: 58%; animation-delay: -15s; opacity: .55; }
@keyframes float { from { transform: translate(0,0) scale(1); } to { transform: translate(46px, 34px) scale(1.12); } }

/* 纸面卡片：素白微凸 + 细墨线 */
.glass {
  background: rgba(255, 253, 248, .82);
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(28,28,28,.06), inset 0 0 40px rgba(28,28,28,.02);
  border-radius: var(--radius);
}

/* ===================== 顶栏（编辑部式细线栏） ===================== */
.topbar {
  display: flex; align-items: center; justify-content: flex-start;
  padding: 20px 4px 16px; margin: 0 auto; max-width: 1180px; width: calc(100% - 48px);
  position: sticky; top: 0; z-index: 50;
  background: transparent;  /* 无底色的色块，仅靠磨砂与页面融合 */
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none;
}
.topbar .tabs { margin-left: 28px; }  /* 桌面端：紧跟次数组件右侧，间距固定 */
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-decoration: none; color: inherit; }
.brand-logo { height: 42px; width: auto; display: block; }
.home-link { text-decoration: none; margin-left: 22px; align-self: center; }

/* -------- 余额模块 -------- */
.balance-bar {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto; margin-right: 0; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: 20px;
  background: rgba(245, 241, 230, .6);
  font-size: 13px;
}
@media (max-width: 860px) {
  .balance-bar { margin-left: auto; margin-right: 0; }
}
.balance-count { font-weight: 700; color: var(--ink); min-width: 20px; text-align: center; }
.balance-label { color: var(--ink-light); font-size: 11px; }
.balance-add {
  min-width: 62px; height: 24px; border-radius: 12px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font-size: 11px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0 9px;
}
.balance-add:hover { background: var(--paper); color: var(--ink); }

/* -------- 密钥输入 -------- */
.key-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  font-size: 14px; font-family: inherit;
}
.account-info {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 14px; background: rgba(255,255,255,.35);
}
.account-info p {
  display: flex; justify-content: space-between; gap: 16px;
  margin: 8px 0; color: var(--ink-light); font-size: 13px;
}
.account-info b { color: var(--ink); font-weight: 600; }
.key-input:focus { outline: none; border-color: var(--ink); }

/* -------- 次数不足弹窗 -------- */
#noQuotaModal .modal-box { text-align: center; }
#noQuotaModal .modal-head { justify-content: center; }
a.tab { text-decoration: none; }
.logo {
  position: relative;
  width: 48px; height: 46px;
  background: var(--ink); color: var(--paper);
  /* 不规则墨团边缘 */
  border-radius: 62% 38% 56% 44% / 46% 60% 40% 54%;
  transform: rotate(-5deg);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-size: 24px; line-height: 1;
  box-shadow: 3px 4px 9px rgba(28, 28, 28, .3);
}
.logo::before {  /* 墨团边缘的晕染层次 */
  content: ''; position: absolute; inset: 3px;
  border-radius: 55% 45% 60% 40% / 42% 55% 45% 58%;
  box-shadow: inset 0 0 8px rgba(245, 241, 230, .14);
}
.logo::after {   /* 溅落的小墨点 */
  content: ''; position: absolute; right: -3px; bottom: 1px;
  width: 9px; height: 8px; background: var(--ink);
  border-radius: 65% 35% 55% 45% / 50% 60% 40% 50%;
  box-shadow: -34px -40px 0 -3px var(--ink); /* 左上角远溅一点 */
}
.logo.small { width: 40px; height: 38px; font-size: 19px; }
.logo.small::after { width: 7px; height: 6px; }
.brand h1 {
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-size: 26px; font-weight: 400; letter-spacing: 4px;
}
.tagline { font-size: 11px; color: var(--ink-light); letter-spacing: 2.5px; }

.tabs { display: flex; gap: 34px; }
.tab {
  position: relative; padding: 6px 2px 10px;
  border: none; background: transparent;
  color: var(--ink-light);
  font-size: 15px; font-family: inherit; letter-spacing: 4px;
  cursor: pointer; transition: color .25s;
}
.tab::after {  /* 墨线下划 */
  content: ''; position: absolute; left: 0; bottom: 2px;
  width: 0; height: 2.5px; border-radius: 50%;
  background: var(--ink); filter: blur(.3px);
  transition: width .35s cubic-bezier(.22, 1, .36, 1);
}
.tab:hover { color: var(--ink); }
.tab:hover::after { width: 45%; opacity: .4; }
.tab.active { color: var(--ink); }
.tab.active::after { width: 100%; opacity: 1; }

/* ===================== 主区 ===================== */
main { max-width: 1180px; width: calc(100% - 48px); margin: 0 auto; padding: 10px 0 60px; }
.panel { display: none; animation: fadeUp .45s ease; }
.panel.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.hero { text-align: center; margin: 74px 0 46px; position: relative; }
.hero.small { margin: 40px 0 30px; }
/* 超大淡墨水印字 */
.hero::before {
  content: '文'; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -54%);
  font-family: 'Ma Shan Zheng', serif; font-size: 300px; line-height: 1;
  color: rgba(28, 28, 28, .038); z-index: -1; pointer-events: none;
}
/* 竖排装饰句 */
.hero-vertical {
  position: absolute; right: 2%; top: -6px;
  writing-mode: vertical-rl;
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-size: 17px; letter-spacing: 9px; color: var(--ink-faint);
  padding-right: 8px; border-right: 1px solid var(--line);
  opacity: .8;
}
.hero-title {
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-size: 60px; font-weight: 400; letter-spacing: 10px; color: var(--ink);
}
.hero.small .hero-title { font-size: 38px; }
/* 标题保持纯黑，不使用渐变 */
.grad { color: var(--ink); }

/* 黑白兜底：任何残留的彩色符号一律灰度渲染 */
.card-meta, .btn-ghost, .status-bar, .chip, .cat-tag { filter: grayscale(1); }
.hero-sub { margin-top: 18px; color: var(--ink-light); font-size: 14px; letter-spacing: 4px; }
.hero::after {  /* 笔触分隔线 */
  content: ''; display: block; width: 220px; height: 3px; margin: 26px auto 0;
  background: linear-gradient(90deg, transparent, var(--ink) 30%, var(--ink) 60%, transparent);
  border-radius: 50%; opacity: .65;
  filter: blur(.4px);
}
.hero.small::after { width: 160px; }

/* ===================== 搜索（无边框 + 书写动效） ===================== */
.search-box { padding: 6px 2px; background: transparent; border: none; box-shadow: none; }
.search-row { position: relative; display: flex; align-items: center; gap: 14px; padding-bottom: 4px; }
.search-row::before {  /* 淡墨基线 */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line);
}
.search-row::after {   /* 聚焦时浓墨从左写到右 */
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--ink); border-radius: 2px;
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}
.search-row:focus-within::after { width: 100%; }
.search-icon { width: 22px; height: 22px; fill: var(--ink-light); flex-shrink: 0; }
#searchInput {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--ink); font-size: 19px; font-family: inherit; padding: 12px 2px;
}
#searchInput::placeholder { color: var(--ink-faint); letter-spacing: 1px; font-size: 16px; }

.btn-primary {
  padding: 11px 30px; border: none; border-radius: 2px;
  background: var(--ink); color: var(--paper);
  font-weight: 400; font-size: 14.5px; font-family: inherit; letter-spacing: 5px; text-indent: 5px;
  cursor: pointer; transition: all .3s; white-space: nowrap;
}
.btn-primary:hover { background: #000; box-shadow: 0 6px 18px rgba(28,28,28,.25); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

.search-filters { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
select {
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px; font-size: 13px; font-family: inherit; outline: none; cursor: pointer;
}
select:focus { border-color: var(--ink); }
select option { background: var(--paper); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 15px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-light); font-size: 12.5px; font-family: inherit; letter-spacing: 1px; transition: all .2s;
}
.chip:hover { color: var(--paper); background: var(--ink); border-color: var(--ink); }

.status-bar { margin: 22px 4px 14px; color: var(--ink-light); font-size: 13.5px; min-height: 20px; letter-spacing: .5px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.status-bar b { color: var(--ink); border-bottom: 1.5px solid var(--ink); padding-bottom: 1px; }
.source-warn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  font-size: 11px; cursor: pointer; line-height: 1;
  padding-bottom: 1px;  /* 视觉居中微调 */
}
.warn-item { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.warn-item:last-child { border-bottom: none; }

/* ===================== 结果卡片（笺纸 + 汉字序号） ===================== */
.results { display: flex; flex-direction: column; gap: 18px; counter-reset: item; }
.card {
  position: relative; padding: 26px 30px 20px; border-radius: 2px;
  min-width: 0; overflow-wrap: anywhere;
  background: rgba(255, 253, 248, .72);
  border: none; border-bottom: 1px solid var(--line);
  box-shadow: none;
  transition: all .35s; animation: fadeUp .5s ease backwards;
  counter-increment: item;
}
.card::before {  /* 左侧墨条，悬停晕染加粗 */
  content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2.5px;
  background: linear-gradient(180deg, var(--ink), transparent);
  opacity: .3; border-radius: 2px; transition: all .35s;
}
.card::after {   /* 汉字序号水印 */
  content: counter(item, cjk-ideographic);
  position: absolute; top: 14px; right: 24px;
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-size: 34px; line-height: 1; color: rgba(28, 28, 28, .1);
  pointer-events: none;
}
.card:hover { background: rgba(255, 253, 248, .95); box-shadow: 0 10px 30px rgba(28,28,28,.09); transform: translateY(-2px); }
.card:hover::before { width: 5px; opacity: .75; }
.card-title { font-size: 17.5px; font-weight: 700; line-height: 1.55; letter-spacing: .5px; overflow-wrap: anywhere; padding-right: 48px; }
.results, .feed-content, .add-feed { min-width: 0; }
.card-title a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; transition: all .2s; }
.card-title a:hover { border-bottom-color: var(--ink); }
.card-meta { display: flex; align-items: center; gap: 14px; margin: 10px 0; font-size: 12.5px; color: var(--ink-light); flex-wrap: wrap; }
.card-meta .date { color: var(--ink-soft); font-weight: 700; }
.card-authors { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-summary {
  color: var(--ink-soft); font-size: 13.8px; line-height: 1.9;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-summary.open { -webkit-line-clamp: unset; }
.card-cats { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; }
.cat-tag {
  font-size: 11px; padding: 3px 11px; border-radius: 999px;
  background: transparent; color: var(--ink-light); border: 1px solid var(--line); letter-spacing: 1px;
}
.card-actions { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; padding-top: 14px; border-top: 1px dashed var(--line); }
.btn-ghost {
  padding: 7px 15px; border-radius: var(--radius); cursor: pointer; font-size: 12.5px;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-soft); font-family: inherit; letter-spacing: 1px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px; transition: all .2s;
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); box-shadow: 1.5px 2px 0 rgba(28,28,28,.15); }
.btn-ghost.ai { border-color: var(--ink-soft); color: var(--ink); background: rgba(28,28,28,.05); }
.btn-ghost.ai:hover { background: var(--ink); color: var(--paper); }
.btn-ghost.fav.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ===================== 分页 ===================== */
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }
.pagination button {
  padding: 10px 22px; border-radius: var(--radius); cursor: pointer;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-soft); font-family: inherit; font-size: 13.5px; letter-spacing: 1px; transition: all .2s;
}
.pagination button:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); box-shadow: 1.5px 2px 0 rgba(28,28,28,.15); }
.pagination button:disabled { opacity: .35; cursor: not-allowed; }

/* ===================== 订阅源 ===================== */
.feeds-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.feed-content { min-width: 0; }
.feed-list { padding: 14px; position: sticky; top: 100px; }
.feed-item-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 12px 14px; margin-bottom: 5px; border-radius: var(--radius);
  background: transparent; border: 1px solid transparent; border-bottom: 1px solid var(--line);
  color: var(--ink-light); font-size: 13.5px; font-family: inherit; letter-spacing: .5px;
  cursor: pointer; text-align: left; transition: all .2s;
}
.feed-item-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.feed-item-btn.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
  box-shadow: 2px 3px 0 rgba(28,28,28,.18);
}
.feed-del { background: none; border: none; color: inherit; cursor: pointer; font-size: 13px; padding: 2px 6px; opacity: .55; }
.feed-del:hover { opacity: 1; }
.add-feed { display: flex; gap: 10px; padding: 16px; margin-bottom: 6px; }
.add-feed input {
  flex: 1; background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 14px; color: var(--ink);
  font-size: 13px; font-family: inherit; outline: none; min-width: 0;
}
.add-feed input:focus { border-color: var(--ink); }
.feed-time { font-size: 11px; color: var(--ink-light); margin-top: 8px; }

/* ===================== AI 聊天 ===================== */
.chat-wrap { max-width: 860px; margin: 44px auto 0; display: flex; flex-direction: column; height: 72vh; }
.chat-header { display: flex; align-items: center; gap: 13px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.chat-header h3 { font-size: 17px; font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif; letter-spacing: 3px; font-weight: 400; }
.chat-messages { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble {
  max-width: 78%; padding: 13px 18px; border-radius: var(--radius);
  font-size: 14px; line-height: 1.9; word-break: break-word;
}
.msg.ai .bubble { background: rgba(28,28,28,.045); border: 1px solid var(--line); }
.msg.user .bubble { background: var(--ink); color: var(--paper); box-shadow: 2px 3px 0 rgba(28,28,28,.15); white-space: pre-wrap; }

/* -------- 对话框内论文推荐卡片 -------- */
.paper-recs { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.rec-label { font-size: 12px; color: var(--ink-light); letter-spacing: 3px; margin-bottom: 8px; }
.rec-card {
  display: block; padding: 10px 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255, 253, 248, .7);
  text-decoration: none; color: var(--ink);
  transition: all .2s;
}
.rec-card:hover { border-color: var(--ink); background: rgba(255, 253, 248, .95); }
.rec-title { font-size: 13.5px; font-weight: 700; line-height: 1.5; margin-bottom: 4px; }
.rec-meta { font-size: 11.5px; color: var(--ink-light); }

/* -------- Markdown 排版（水墨风） -------- */
.md-p { margin: 2px 0; line-height: 1.7; }
.md-p + .md-p { margin-top: 8px; }
.md-tag { color: var(--ink); font-weight: 700; }
.md-h1, .md-h2, .md-h3, .md-h4 { font-weight: 700; color: var(--ink); margin: 14px 0 6px; }
.md-h1 { font-size: 17px; }
.md-h2 { font-size: 16px; }
.md-h3 { font-size: 15px; }
.md-h4 { font-size: 14px; }
.md-h1:first-child, .md-h2:first-child, .md-h3:first-child, .md-h4:first-child { margin-top: 2px; }
.md-ul, .md-ol { margin: 6px 0; padding-left: 22px; }
.md-ul li, .md-ol li { margin: 4px 0; line-height: 1.8; }
.md-ul li::marker { color: var(--ink-faint); }
.md-ol li::marker { color: var(--ink-light); font-weight: 700; }
.bubble strong, .modal-body strong { color: var(--ink); font-weight: 700; }
.md-code {
  font-family: 'Consolas', 'Courier New', monospace; font-size: 12.5px;
  background: rgba(28,28,28,.08); border: 1px solid var(--line);
  padding: 1.5px 6px; border-radius: 4px;
}
.md-pre {
  margin: 10px 0; padding: 14px 16px; border-radius: 4px;
  background: var(--ink); color: var(--paper);
  overflow-x: auto; font-size: 12.5px; line-height: 1.7;
}
.md-pre code { font-family: 'Consolas', 'Courier New', monospace; white-space: pre; }
.bubble a, .modal-body a { color: var(--ink); border-bottom: 1px solid var(--ink-faint); text-decoration: none; }
.bubble a:hover, .modal-body a:hover { border-bottom-color: var(--ink); }
.chat-input { display: flex; gap: 10px; padding: 16px 18px; border-top: 1px solid var(--line); }
#chatInput {
  flex: 1; resize: none; background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 15px;
  color: var(--ink); font-size: 14px; font-family: inherit; outline: none;
  max-height: 120px; line-height: 1.6;
}
#chatInput:focus { border-color: var(--ink); }

/* ===================== 弹窗 ===================== */
.modal { position: fixed; inset: 0; background: rgba(28,28,28,.35); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal.open { display: flex; animation: fadeUp .3s ease; }
.modal-box { max-width: 640px; width: 100%; padding: 28px 30px; max-height: 80vh; overflow-y: auto; box-shadow: 0 12px 44px rgba(28,28,28,.25); background: #fdfbf6; backdrop-filter: none; -webkit-backdrop-filter: none; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { font-size: 18px; font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif; letter-spacing: 4px; font-weight: 400; }
.modal-close { background: none; border: none; color: var(--ink-light); font-size: 18px; cursor: pointer; }
.modal-close:hover { color: var(--ink); }
.modal-title { font-size: 15.5px; line-height: 1.6; margin-bottom: 14px; color: var(--ink); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.modal-body { font-size: 14px; line-height: 1.9; color: var(--ink-soft); }

/* ===================== 加载 ===================== */
.spinner {
  width: 34px; height: 34px; margin: 30px auto;
  border: 2.5px solid var(--line); border-top-color: var(--ink);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.error-box { padding: 16px 20px; border-radius: var(--radius); background: rgba(28,28,28,.05); border: 1px solid var(--ink-faint); color: var(--ink-soft); font-size: 13.5px; }

.footer { text-align: center; padding: 28px; color: var(--ink-faint); font-size: 12px; letter-spacing: 3px; }

/* 滚动条（墨条） */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--paper-deep); }
::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-light); }

@media (max-width: 860px) {
  .topbar, main { width: calc(100% - 28px); }

  /* 顶栏：第一行 商标+HOME，第二行导航整行均分 */
  .topbar { flex-wrap: wrap; row-gap: 12px; padding: 14px 2px 12px; }
  .brand-logo { height: 34px; }
  .brand .tagline { display: none; }
  .topbar .tabs {
    margin-left: 0; width: 100%;
    display: flex; justify-content: space-between; gap: 0;
  }
  .tab { font-size: 14px; letter-spacing: 2px; padding: 6px 2px 8px; }

  /* Hero：紧凑不溢出 */
  .hero { margin: 38px 0 26px; }
  .hero.small { margin: 28px 0 20px; }
  .hero-title { font-size: 30px; letter-spacing: 4px; }
  .hero.small .hero-title { font-size: 26px; }
  .hero-sub { font-size: 12.5px; letter-spacing: 2px; line-height: 1.8; }
  .hero::before { font-size: 170px; }
  .hero::after { width: 140px; margin-top: 18px; }
  .hero-vertical { display: none; }

  /* 搜索：输入可收缩，按钮不被挤出 */
  .search-row { gap: 8px; }
  #searchInput { font-size: 16px; min-width: 0; }
  #searchInput::placeholder { font-size: 13px; }
  .search-icon { width: 18px; height: 18px; }
  .btn-primary { padding: 11px 16px; letter-spacing: 2px; text-indent: 2px; font-size: 13.5px; }
  .search-filters { gap: 8px; }
  .search-filters select { flex: 1; min-width: 130px; }

  /* 卡片：小屏减重 */
  .card { padding: 20px 18px 16px; }
  .card-title { font-size: 15.5px; padding-right: 34px; }
  .card::after { font-size: 24px; top: 12px; right: 16px; }
  .card-summary { font-size: 13px; line-height: 1.8; }
  .card-actions { gap: 7px; }
  .btn-ghost { padding: 6px 11px; font-size: 12px; }

  /* 订阅/聊天/弹窗 */
  .feeds-layout { grid-template-columns: 1fr; }
  .feed-list { position: static; }
  .add-feed { flex-direction: column; }
  .chat-wrap { height: 68vh; margin-top: 24px; }
  .msg .bubble { max-width: 88%; font-size: 13.5px; }
  .modal { padding: 14px; }
  .modal-box { padding: 20px 18px; }
  .pagination button { padding: 9px 16px; font-size: 12.5px; }
  .footer { letter-spacing: 1px; font-size: 11px; }
}
