﻿/* LEARN 1.0 · 设计语言（与 RCJ Exam Hub 同族：克制 / 有机 / 单色蓝） */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --primary-deep: #1e40af;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  /* contain 而非 none：阻止滚动链穿透到祖先，同时保留浏览器原生下拉刷新（none 会禁用它） */
  overscroll-behavior: contain;
}

/* ===== 顶栏 ===== */
.ln-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.ln-actions { display: flex; gap: 8px; }
.ln-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: .85rem; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.ln-btn:hover { border-color: var(--primary); color: var(--primary); }
.ln-btn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.ln-btn.home-top { color: var(--primary); border-color: #c7d7f5; }
/* ===== 主区域 ===== */
/* 默认（牌堆/瀑布流）：不锁高度，交给 body 原生滚动 —— 手机端跟手、惯性、丝滑。
   仅「我的」视图用 .ln-stage--my 锁定内部滚动，避免 <details> 展开后溢出无法滚动。 */
.ln-stage {
  max-width: 480px; margin: 0 auto; padding: 28px 16px 110px;
  /* 撑过一屏：页面必须可滚动，手机原生下拉刷新才会触发（此前 min-height 只到 100dvh-120px，
     加上顶栏刚好卡在视口内  页面不可滚动  下拉刷新彻底失效） */
  min-height: calc(100dvh - 20px);
}
/* 「我的」视图：内部滚动容器，锁定高度防溢出；牌堆/瀑布流不进这里 */
.ln-stage--my {
  height: calc(100dvh - 120px);
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;   /* 内部滚，但不触发整页下拉刷新 */
  -webkit-overflow-scrolling: touch;
}
/* <details> 展开时浏览器有时不重新计算父高度，加 min-height:0 兜底 */
.ln-stage--my details > * { min-height: 0; }
.ln-count { text-align: center; font-size: .72rem; color: var(--muted); letter-spacing: .08em; margin-bottom: 10px; }
.ln-progress-wrap { margin: 0 auto 12px; max-width: 280px; }
.ln-progress-bar { height: 4px; background: rgba(0,0,0,.08); border-radius: 999px; overflow: hidden; }
.ln-progress-fill { height: 100%; background: linear-gradient(90deg, #6d28d9, #2563eb); border-radius: 999px; transition: width .4s ease; width: 0%; }
.ln-progress-text { text-align: center; font-size: .7rem; color: var(--muted); margin-top: 5px; letter-spacing: .05em; }

/* ===== 牌堆 ===== */
#deck {
  position: relative; margin-top: 4px;
  /* 不锁高度、不 overflow：顶层卡自然高度撑起 deck，整页 body 原生滚动 + 手机下拉刷新。
     depth-1/-2 绝对定位卡由 JS 同步顶层卡高度 + 自身 overflow:hidden 自裁，
     所以不需要 #deck 再包一层 overflow 裁切，避免 WebKit 创建滚动协调层导致下拉刷新失效 */
}
.card {
  position: absolute; top: 0; left: 0; right: 0;   /* 默认叠放，由 depth 类控制层级/偏移 */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px 18px 18px;
  user-select: none;
}
.card.top {
  position: relative; z-index: 5;
  /* 内容长就撑高整页 body 滚动（像看小说），不设卡内滚动/锁定高度，恢复下拉刷新 */
}       /* 顶层卡片：内容过长时用整页 body 原生滚动，跟手、丝滑 */
.card.depth-1 { z-index: 4; transform: translateY(-9px) scale(.975); opacity: .82; pointer-events: none; height: auto; overflow: hidden; }
.card.depth-2 { z-index: 3; transform: translateY(-18px) scale(.95); opacity: .6; pointer-events: none; height: auto; overflow: hidden; }
.card.drag { transition: none; will-change: transform, opacity; }
/* 顶层卡片及其内部任意元素：纵向交给浏览器原生滚动（跟手/惯性），横向留给 JS 手势识别；
   之前 #deck * { touch-action:none } 一刀切禁掉了容器内所有触摸，是手机上下滑卡死的根因，已删除 */
#deck .card.top, #deck .card.top * { touch-action: pan-y; }
.card.settle { transition: transform .42s cubic-bezier(.22,.61,.36,1), opacity .42s; }
.card.out-up { transform: translateY(-120%) rotate(-4deg); opacity: 0; }
.card.out-down { transform: translateY(120%) rotate(4deg); opacity: 0; }
.card.out-left { transform: translateX(-120%) rotate(-6deg); opacity: 0; }
.card.out-right { transform: translateX(120%) rotate(6deg); opacity: 0; }
.card.become-top { animation: becomeTop .42s cubic-bezier(.22,.61,.36,1); }
.card.undo-in { animation: undoIn .42s cubic-bezier(.22,.61,.36,1); }
@keyframes becomeTop {
  from { transform: translateY(-9px) scale(.975); opacity: .82; }
  to   { transform: none; opacity: 1; }
}
@keyframes undoIn {
  from { transform: translateX(46px) scale(.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }

.tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  color: var(--primary); background: var(--primary-soft);
  padding: 3px 9px; border-radius: 999px;
}
.card-src { font-size: .66rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
.card-src .badge {
  font-size: .6rem; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  background: #eef2f7; color: #475569;
}
.card-src .badge.official { background: #e0f2fe; color: #0369a1; }
.card-src .badge.reference { background: #fef3c7; color: #b45309; }
.card-src .badge.media { background: #ede9fe; color: #6d28d9; }

.card-hook { font-size: 1.28rem; font-weight: 800; line-height: 1.34; margin: 0 0 10px; letter-spacing: -.4px; }
.card-mis {
  font-size: .82rem; color: var(--muted); background: #f8fafc; border-left: 3px solid var(--border);
  padding: 7px 10px; border-radius: 0 8px 8px 0; margin: 0 0 14px;
}
/* 实料块：一张卡一个硬事实（数字/案例），让内容不虚 */
.card-fact {
  font-size: .86rem; line-height: 1.55; color: #0f172a;
  background: #fefce8; border: 1px solid #fde68a; border-radius: 10px;
  padding: 10px 12px; margin: 0 0 14px;
}
.card-fact .cf-label {
  display: inline-block; font-size: .62rem; font-weight: 800; letter-spacing: .06em;
  color: #b45309; background: #fef3c7; border-radius: 6px; padding: 1px 7px; margin-right: 7px;
  vertical-align: 1px;
}

/* ===== 知识树 SVG ===== */
.tree-wrap { width: 100%; margin: 6px 0 16px; }
.tree-wrap svg { width: 100%; height: 100%; display: block; }
.node-box { fill: #fff; stroke: var(--primary); stroke-width: 1.4; }
.node-box.root { fill: var(--primary-soft); }
.node-text { fill: var(--text); font-size: 11px; font-weight: 600; font-family: inherit; }
@media(max-width:400px){ .node-text{font-size:10px} }
.edge { stroke: #94a3b8; stroke-width: 1.4; fill: none; }
.node-g { cursor: pointer; }
.node-g:hover .node-box { fill: #dbeafe; }
.pop { animation: pop .5s cubic-bezier(.22,.61,.36,1) backwards; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }

.card-concept {
  font-size: .9rem; font-weight: 600; color: var(--primary-deep);
  background: var(--primary-soft); border-radius: 12px; padding: 11px 13px; margin: 0 0 12px;
}
.card-related { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.card-related .rlabel { font-size: .72rem; color: var(--muted); margin-right: 2px; }
.rel-chip {
  font-size: .76rem; font-weight: 600; color: var(--text);
  border: 1px solid var(--border); background: #fff; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.rel-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ===== 底部操作条 ===== */
.ln-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; gap: 10px; justify-content: center; align-items: center;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(248,250,252,0) 0%, var(--bg) 38%);
}
.act {
  flex: 1; max-width: 150px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 6px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow); transition: transform .08s, border-color .2s, background .2s;
  font-weight: 700; font-size: .9rem;
}
.act small { font-size: .62rem; font-weight: 600; color: var(--muted); }
.act:active { transform: scale(.95); }
/* 三键淡色区分（克制：只给浅色底 + 浅色边框） */
.act.prev { background: #f8fafc; border-color: #e2e8f0; }
.act.prev:hover { border-color: #94a3b8; }
.act.prev[disabled] { opacity: .42; cursor: not-allowed; }
.act.seen { background: #eff6ff; border-color: #bfdbfe; }
.act.seen:hover { border-color: var(--primary); }
.act.fav {
  /* 底部收藏键：复用 Uiverse(LilaRest) 心形按钮动效——圆胶囊+流动边框+弹性缩放+心跳 */
  background: #fff;
  border: 3px solid #fce4e4;                 /* 浅粉边，贴近 Uiverse */
  border-radius: 999px;                      /* 胶囊/圆 */
  box-shadow: rgba(10,37,64,.16) 0 -2px 6px 0 inset;   /* 内阴影立体感 */
  padding: 11px; gap: 0;
  cursor: pointer;
  transition: transform .4s cubic-bezier(.68,-.55,.27,2.5), border-color .4s ease, background .3s ease, box-shadow .3s ease;
}
.act.fav:hover { transform: scale(1.06); animation: favMovingBorders 3s infinite; }
.act.fav:active { transform: scale(.94); }
.act.fav .heart-ico { width: 30px; height: 30px; transition: transform .4s cubic-bezier(.68,-.55,.27,2.5); }
.act.fav.on { background: #fff5f7; border-color: #ffd1dc; }
.act.fav.on:hover { animation: favMovingBorders 3s infinite; }

/* Uiverse 风格动效（适配收藏 toggle 语义：已收藏=持续心跳，hover=放大+边框流动） */
@keyframes favMovingBorders {
  0%   { border-color: #fce4e4; }
  50%  { border-color: #ffd1dc; }
  90%  { border-color: #fce4e4; }
}
@keyframes favBeatingHeart {
  0%   { transform: scale(1); }
  15%  { transform: scale(1.18); }
  30%  { transform: scale(1); }
  45%  { transform: scale(1.18); }
  60%  { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .act.fav, .act.fav .heart-ico { animation: none !important; transition: none !important; }
}

/* ---------- 心形收藏图标（统一：SVG .heart-ico，颜色已硬编码在 SVG 属性里）---------- */
/* 未收藏=灰空心(#cbd5e1) / 已收藏=红实心(#ff2442)，对比强烈，状态变化肉眼可辨 */
.heart-ico {
  width: 22px; height: 22px; display: block;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
/* 瀑布流卡内纯图标按钮的心形 */
.feed-card-star .heart-ico { width: 21px; height: 21px; }
.feed-card-star:hover .heart-ico { transform: scale(1.1); }
/* 点亮（已收藏）：弹跳脉冲，强调状态切换 */
.ln-btn-fav.on .heart-ico,
.feed-card-star.on .heart-ico {
  animation: heart-pop .4s cubic-bezier(.34,1.56,.64,1);
}
/* 底部收藏键：已收藏态持续心跳（Uiverse 风格），而非一次性弹跳 */
.act.fav.on .heart-ico { animation: favBeatingHeart 1.2s infinite; }
@keyframes heart-pop {
  0%   { transform: scale(.85); }
  45%  { transform: scale(1.18); }
  70%  { transform: scale(.96); }
  100% { transform: scale(1); }
}
/* 底部 / 详情 容器型按钮的图标尺寸 */
.act .act-ico { display: inline-flex; }
.act .act-ico .heart-ico { width: 18px; height: 18px; }
.ln-btn-fav .ln-btn-ico .heart-ico { width: 18px; height: 18px; }
.ln-btn-fav.on { background: #fff1f2; border-color: #fecdd3; color: #fb7185; }

/* ===== 我的知识 ===== */
.my-head { font-size: 1.1rem; font-weight: 800; margin: 4px 0 4px; }
.my-sub { font-size: .8rem; color: var(--muted); margin: 0 0 16px; }
.interest-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.interest-row .tag { background: #f1f5f9; color: #475569; }
.my-list { display: flex; flex-direction: column; gap: 10px; }
.my-item {
  border: 1px solid var(--border); background: var(--surface); border-radius: 14px;
  padding: 13px 15px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: border-color .2s, transform .08s;
}
.my-item:hover { border-color: var(--primary); }
.my-item:active { transform: scale(.99); }
.my-item .t { font-weight: 700; font-size: .95rem; }
.my-item .meta { font-size: .7rem; color: var(--muted); }
.my-item-body { flex: 1; min-width: 0; }
.my-remove {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  font-size: 1.1rem; line-height: 1; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .2s, border-color .2s, background .2s;
}
.my-remove:hover { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.my-empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: .9rem; }
.back-btn { margin-bottom: 14px; }
/* 进度统计四格 */
.my-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 12px 0 6px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 4px; text-align: center; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 1.15rem; font-weight: 800; color: var(--primary); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: .66rem; color: var(--muted); }
/* 小节标题（收藏 / 所有题目折叠头） */
.my-sec-title { font-size: .82rem; font-weight: 800; letter-spacing: .03em; margin: 16px 0 10px; }
/* 收藏折叠容器 */
.my-favs {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow); margin-top: 8px; overflow: hidden;
}
.my-favs > summary { list-style: none; cursor: pointer; padding: 13px 15px; margin: 0; display: flex; align-items: center; gap: 8px; }
.my-favs > summary::-webkit-details-marker { display: none; }
.my-favs > summary:hover { background: #f8fafc; }
.my-favs[open] > summary { border-bottom: 1px solid var(--border); }
.my-favs .my-list { padding: 10px; gap: 8px; }
.my-favs .my-item { box-shadow: none; }
.my-favs .fc { margin-left: auto; font-size: .68rem; font-weight: 700; color: var(--muted); background: #fef3c7; border-radius: 999px; padding: 1px 8px; }
/* 自定义 AI 模型设置（模仿 my-favs / my-all 的圆角卡片 + summary 头） */
.my-ai {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow); margin-top: 14px; overflow: hidden;
}
.my-ai > summary {
  list-style: none; cursor: pointer; padding: 13px 15px; margin: 0;
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 700;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  border-bottom: 1px solid transparent;
}
.my-ai > summary::-webkit-details-marker { display: none; }
.my-ai > summary:hover { background: #eef5ff; }
.my-ai[open] > summary { border-bottom: 1px solid #dbeafe; }
.my-ai-badge {
  margin-left: auto; font-size: .66rem; font-weight: 700;
  color: #1e40af; background: #dbeafe; border-radius: 999px; padding: 1px 9px;
}
.my-ai-inner { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 11px; }
.my-ai-tip { font-size: .74rem; color: var(--muted); margin: 0; line-height: 1.55; }
.my-ai-tip-sub { margin-top: 8px; padding: 8px 10px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; color: #92400e; }
.my-ai-tip-sub code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: .7rem; background: #fef3c7; padding: 1px 4px; border-radius: 4px; color: #b45309; word-break: break-all; }
.my-ai-field { display: flex; flex-direction: column; gap: 4px; }
.my-ai-field > span { font-size: .72rem; font-weight: 600; color: #475569; }
.my-ai-field > input {
  width: 100%; box-sizing: border-box;
  font-size: .84rem; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; background: #fff;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.my-ai-field > input:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.my-ai-field > input[type="password"] { font-family: "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; }
.my-ai-row { display: flex; gap: 8px; flex-wrap: wrap; }
.my-ai-use { background: var(--primary); color: #fff; border-color: var(--primary); }
.my-ai-use.on { background: #1e40af; }
.my-ai-reset { color: var(--muted); }
.my-ai-reset:hover { color: #dc2626; border-color: #fca5a5; }
.my-ai-err { font-size: .76rem; color: #b91c1c; min-height: 0; }
.my-ai-test { color: var(--muted); border-color: var(--border); }
.my-ai-test:hover { color: var(--primary); border-color: var(--primary); }
.my-ai-test:disabled { opacity: .55; cursor: default; }
.my-ai-probe { font-size: .76rem; line-height: 1.5; margin-top: 8px; padding: 8px 10px; border-radius: 8px; word-break: break-all; }
.my-ai-probe.ok { color: #065f46; background: #ecfdf5; border: 1px solid #a7f3d0; }
.my-ai-probe.fail { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
.my-ai-probe.testing { color: var(--muted); background: #f8fafc; border: 1px solid var(--border); }
.my-ai-src { margin: 16px 0 4px; }
.my-ai-src-list { display: flex; flex-direction: column; gap: 8px; }
.my-ai-src-opt { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: .8rem; cursor: pointer; transition: border-color .15s, background .15s; }
.my-ai-src-opt:hover { border-color: #93c5fd; background: #f5f9ff; }
.my-ai-src-opt.on { border-color: var(--primary); background: #eef5ff; font-weight: 700; }
.my-ai-src-opt input { width: 16px; height: 16px; accent-color: var(--primary); }
.my-ai-probe .probe-url { display: block; margin-top: 4px; font-size: .72rem; color: var(--muted); opacity: .85; }
/* 所有题目（默认折叠）：外层容器 */
.my-all {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow); margin-top: 14px; overflow: hidden;
}
.my-all > summary { list-style: none; cursor: pointer; padding: 13px 15px; margin: 0; }
.my-all > summary::-webkit-details-marker { display: none; }
.my-all > summary:hover { background: #f8fafc; }
.my-all[open] > summary { border-bottom: 1px solid var(--border); }
.my-all-inner {
  padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 10px;
  max-height: 62vh; overflow-y: auto;
}
/* 主题分组（内层 details） */
.my-group { border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.my-group > summary {
  list-style: none; cursor: pointer; padding: 10px 12px;
  font-size: .82rem; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.my-group > summary::-webkit-details-marker { display: none; }
.my-group > summary:hover { background: #f8fafc; }
.my-group > summary .gc {
  margin-left: auto; font-size: .68rem; font-weight: 700; color: var(--muted);
  background: #f1f5f9; border-radius: 999px; padding: 1px 8px;
}
.my-group[open] > summary { border-bottom: 1px solid var(--border); }
.my-group .my-list { padding: 10px; gap: 8px; }
.my-group .my-item { box-shadow: none; padding: 11px 13px; }

/* ===== 瀑布流视图（像刷小红书一样纵向刷）===== */
.feed-stage {
  /* 布局不变（column-count 双列 / max-width 520px），仅改为页面原生滚动：
     去掉内部滚动容器（height+overflow），让 body 滚动  手机下拉刷新恢复 */
  max-width: 520px; margin: 0 auto;
  padding: 8px 16px 40px;
  min-height: calc(100dvh - 20px);
}
.feed-filter {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px 4px 12px; margin: -8px -4px 12px;
  background: rgba(248,250,252,.92);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  backdrop-filter: saturate(160%) blur(8px);
  scrollbar-width: none;
}
/* 状态行 / 主题行各自横向滚动 */
.feed-filter .ff-group {
  display: flex; gap: 7px; overflow-x: auto; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.feed-filter .ff-group::-webkit-scrollbar { display: none; }
.feed-filter .ff-sep { flex: 0 0 auto; height: 1px; background: var(--border); opacity: .55; margin: 1px 2px; }
.feed-chip {
  flex: 0 0 auto;
  font-size: .78rem; font-weight: 600;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.feed-chip:hover { border-color: #94a3b8; color: var(--text); }
.feed-chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.feed-chip .cnt {
  font-size: .65rem; opacity: .7; margin-left: 4px;
  font-variant-numeric: tabular-nums;
}
/* 主题行：浅底区分于状态行 */
.feed-chip.theme { background: #f8fafc; }
.feed-chip.theme.on { background: var(--primary); color: #fff; border-color: var(--primary); }
/* 清除主题筛选：红色调出口 */
.feed-chip.clear { color: #dc2626; border-color: #fca5a5; background: #fef2f2; }
.feed-chip.clear:hover { background: #fee2e2; color: #dc2626; }
/* 可点击 tag：主题映射入口（卡片/详情/牌堆统一） */
.tag-link { cursor: pointer; transition: box-shadow .18s, transform .12s; }
.tag-link:hover { box-shadow: 0 0 0 2px rgba(37,99,235,.20); transform: translateY(-1px); }
.tag-link:active { transform: scale(.94); }

.feed-grid {
  /* 真瀑布流：双列,卡片按内容高度自然填充 */
  column-count: 2;
  column-gap: 10px;
}
@media (max-width: 360px) { .feed-grid { column-gap: 8px; } }

.feed-card {
  /* 避免被列分割：让一整张卡保持在同一列 */
  break-inside: avoid;
  display: block; width: 100%;
  margin: 0 0 10px;
  padding: 14px 13px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  position: relative;
  transition: transform .12s, border-color .15s, box-shadow .15s, opacity .15s;
}
.feed-card:hover { transform: translateY(-2px); border-color: #bfdbfe; box-shadow: 0 8px 20px rgba(15,23,42,.10); }
.feed-card:active { transform: scale(.99); }

/* 看过的卡：轻微淡化,留"刷过痕迹" */
.feed-card.seen { opacity: .72; }
/* 已收藏的卡：边框微微染金,显眼 */
.feed-card.faved { border-color: #fcd34d; background: linear-gradient(135deg, #fff 0%, #fffbeb 100%); }

.feed-card-top {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 9px; min-height: 18px;
}
.feed-card-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.feed-card-tag {
  font-size: .62rem; font-weight: 700; letter-spacing: .03em;
  color: var(--primary); background: var(--primary-soft);
  padding: 2px 7px; border-radius: 999px;
}
/* NEW 红点：放在 top 右侧,未看过才有 */
.feed-new {
  margin-left: auto;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.18);
  animation: newPulse 2.2s ease-in-out infinite;
}
@keyframes newPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
  50%      { box-shadow: 0 0 0 5px rgba(239,68,68,.08); }
}
@media (prefers-reduced-motion: reduce) { .feed-new { animation: none; } }

.feed-card-hook {
  font-size: 1.18rem; font-weight: 800; line-height: 1.32;
  letter-spacing: -.4px; color: var(--text);
  margin: 0 0 12px;
  /* 不同字数  不同卡片高度  真瀑布流的视觉差异 */
}
.feed-card-bot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.feed-card-src {
  font-size: .64rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: 5px; min-width: 0;
}
.feed-card-src .badge {
  font-size: .56rem; font-weight: 700; padding: 1px 5px; border-radius: 5px;
  background: #eef2f7; color: #475569; flex: 0 0 auto;
}
.feed-card-src .badge.official { background: #e0f2fe; color: #0369a1; }
.feed-card-src .badge.reference { background: #fef3c7; color: #b45309; }
.feed-card-src .badge.media { background: #ede9fe; color: #6d28d9; }
.feed-card-src .src-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 瀑布流卡里的实料行：小字灰，一眼看到硬数据 */
.feed-fact {
  font-size: .7rem; line-height: 1.5; color: #78716c;
  background: #fafaf9; border-left: 2px solid #e7e5e4; border-radius: 0 6px 6px 0;
  padding: 5px 8px; margin: 8px 0 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.feed-card-star {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; margin: -4px -2px;
  border: none; background: transparent; cursor: pointer; border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}

/* ===== 4 种卡型:视觉不统一,瀑布流高度自然错落 ===== */

/* ——  大字报卡(poster):短 hook(金句)  居中 + 大字 + 柔和彩色底 —— */
.feed-card.feed-type-poster {
  padding: 26px 17px 18px;
  border-radius: 18px;
  /* 背景色由 inline style 的 HSL 柔和色决定,覆盖默认 var(--surface) */
}
.feed-card.feed-type-poster .feed-card-top { margin-bottom: 10px; }
.feed-card.feed-type-poster .feed-card-hook {
  font-size: 1.52rem; line-height: 1.42; text-align: center;
  font-weight: 800; letter-spacing: -.3px; margin: 6px 0 14px;
  word-break: break-word;
}
.feed-card.feed-type-poster .feed-tags-center {
  justify-content: center; margin: 0 0 14px;
}

/* ——  反差辟谣卡(mis):有 misconception  "你以为…其实…"两段式 —— */
.feed-card.feed-type-mis {
  padding: 15px 13px 11px;
  border-radius: 16px;
  background: #f8fafc; /* 冷灰白底色,与其他卡形成色差 */
}
.feed-mis-block {
  position: relative;
  padding: 10px 11px 10px 11px;
  margin: 0 0 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  border-left: 3px solid #f97316;
}
.feed-mis-label {
  display: inline-block;
  font-size: .58rem; font-weight: 800; letter-spacing: .06em;
  color: #fff; background: linear-gradient(135deg,#f97316,#ef4444);
  padding: 2px 7px; border-radius: 5px;
  margin: 0 0 6px;
}
.feed-mis-text {
  margin: 0;
  font-size: .84rem; line-height: 1.5; color: #475569; font-weight: 500;
}
.feed-hook-mis {
  font-size: 1.22rem; font-weight: 800; line-height: 1.34;
  margin: 0 0 12px;
}
.feed-hook-mis::before {
  content: "其实 "; display: inline-block;
  background: linear-gradient(135deg,#0f172a,#1e40af);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 900;
}

/* ——  标签长卡(rich):tags≥3 + hook≥50字  圆润大边 + 高留白 + 全标签 —— */
.feed-card.feed-type-rich {
  padding: 18px 14px 13px;
  border-radius: 22px;
  background: linear-gradient(180deg,#ffffff 0%,#fafbff 100%);
  border-color: #e0e7ff;
}
.feed-card.feed-type-rich .feed-card-top { margin-bottom: 11px; }
.feed-card.feed-type-rich .feed-card-hook {
  font-size: 1.22rem; line-height: 1.36; margin: 0 0 14px;
}
.feed-card.feed-type-rich .feed-card-tag {
  font-size: .66rem; padding: 3px 8px; font-weight: 700;
}
.feed-card.feed-type-rich .feed-card-bot { padding-top: 2px; }

/* ——  标准卡(base):其余,~30% 走 tight(更紧凑)制造高低差 —— */
.feed-card.feed-type-base {
  padding: 14px 13px 11px;
  border-radius: 14px;
}
.feed-card.feed-type-base-tight {
  padding: 10px 11px 9px;
  border-radius: 13px;
  background: #fcfcfd;
}
.feed-card.feed-type-base-tight .feed-card-top { margin-bottom: 6px; }
.feed-card.feed-type-base-tight .feed-card-hook {
  font-size: 1.04rem; line-height: 1.30; margin: 0 0 8px;
  font-weight: 750; letter-spacing: -.2px;
}
.feed-card.feed-type-base-tight .feed-card-tag {
  font-size: .58rem; padding: 1px 6px;
}

.feed-end {
  text-align: center; padding: 22px 16px 10px;
  font-size: .76rem; color: var(--muted);
}
.feed-empty {
  text-align: center; padding: 40px 20px; color: var(--muted); font-size: .88rem;
}
/* 哨兵元素：懒加载触发器,占 1px 高度让 IntersectionObserver 能感知 */
.feed-sentinel { width: 100%; height: 1px; margin: 0; }

/* ===== 详情 modal（瀑布流卡片点开后展开完整知识图谱）===== */
#detailModal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
#detailModal.hidden { display: none !important; }
.detail-overlay {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.45);
  animation: overlayIn .22s ease-out;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.detail-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 40px rgba(15,23,42,.18);
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  animation: panelIn .28s cubic-bezier(.22,.61,.36,1);
}
@keyframes panelIn { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .detail-overlay, .detail-panel { animation: none; }
}
.detail-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 1.4rem; line-height: 1; padding: 0;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.detail-close:hover { color: var(--text); border-color: #94a3b8; }

/* 详情右上角常驻胶囊「 AI 关联」：与关闭按钮并排，靠内侧"一点点"，克制不抢眼 */
.detail-ai {
  position: absolute; top: 10px; right: 52px; z-index: 3;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .76rem; font-weight: 700; line-height: 1;
  color: var(--primary); background: var(--primary-soft);
  border: 1px solid #bfdbfe; border-radius: 999px;
  padding: 7px 12px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(37,99,235,.12);
  transition: background .15s, border-color .15s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.detail-ai:hover { background: #dbeafe; border-color: #93c5fd; }
.detail-ai:active { transform: scale(.96); }
.detail-ai.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.detail-ai.loading { opacity: .6; pointer-events: none; }

/* 详情面板内的卡片复用 .card 基础样式,但去掉牌堆的绝对定位与 depth 类 */
#detailBody .card {
  position: relative; top: auto; left: auto; right: auto;
  transform: none !important; opacity: 1 !important;
  margin-top: 4px;
  border-radius: 16px;
}
#detailBody .card .card-top-tags { padding-right: 36px; }   /* 给关闭/胶囊让位 */
#detailBody .card .card-top-meta { padding-right: 36px; }
.detail-foot {
  display: flex; gap: 10px; margin-top: 14px;
  position: sticky; bottom: 0;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(248,250,252,0) 0%, var(--bg) 30%);
}
.detail-foot .ln-btn {
  flex: 1; padding: 11px 14px; font-size: .92rem;
  justify-content: center;
}
.detail-foot .ln-btn.detail-fav.on {
  background: #fef3c7; color: #b45309; border-color: #f59e0b;
}
.detail-go-swipe {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ---------- My take 引导 toast(刷到一定量时,引导去结构化即兴表达) ---------- */
#mytakeToast {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  padding: 0 14px calc(14px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  transition: transform .36s cubic-bezier(.22,1,.36,1);
  pointer-events: none;   /* 没显示时不吃点击 */
}
#mytakeToast.show {
  transform: translateY(0);
  pointer-events: auto;
}
.mytake-inner {
  position: relative;
  max-width: 560px; margin: 0 auto;
  background: rgba(255,255,255,0.86);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border: 1px solid rgba(37,99,235,0.18);
  border-radius: 20px;
  box-shadow:
    0 -4px 30px rgba(15,23,42,0.10),
    0 10px 40px rgba(37,99,235,0.12);
  padding: 18px 20px 16px;
}
.mytake-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  background: transparent; color: #94a3b8;
  border: 1px solid transparent;
  cursor: pointer; font-size: .82rem;
  transition: color .15s, background .15s, border-color .15s;
}
.mytake-close:hover { color: var(--text); background: #f1f5f9; border-color: #e2e8f0; }

.mytake-kicker {
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.mytake-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}
.mytake-tag {
  display: inline-block; padding: 2px 10px;
  background: #dbeafe; color: #1e40af;
  border-radius: 999px;
  font-size: .72rem; font-weight: 500;
}
.mytake-hook {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 8px;
}
.mytake-sub {
  font-size: .82rem; color: var(--muted);
  line-height: 1.55;
  margin-bottom: 14px;
}
.mytake-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: flex-end;
}
.mytake-secondary, .mytake-primary {
  height: 40px; padding: 0 16px;
  border-radius: 12px;
  font-size: .88rem; font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, background .15s;
}
.mytake-secondary {
  background: transparent; color: #475569;
  border: 1px solid #cbd5e1;
}
.mytake-secondary:hover { background: #f1f5f9; border-color: #94a3b8; }
.mytake-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff; border: none;
  box-shadow: 0 6px 14px rgba(37,99,235,0.30);
}
.mytake-primary:hover { transform: translateY(-1px); }
.mytake-primary:active { transform: translateY(0); }

.hidden { display: none !important; }

/* ===== AI 关联面板（你懂的 · 围绕当前知识卡生成关联点）===== */
.ai-relate { background: #f8fbff; border: 1px dashed #93c5fd; border-radius: 16px; padding: 14px 16px; margin-top: 14px; }
.ai-relate[hidden] { display: none; }
.ai-relate-hint { margin: 0 0 10px; font-size: .78rem; line-height: 1.5; color: #64748b; background: #eef5ff; border: 1px solid #dbeafe; border-radius: 10px; padding: 8px 10px; }
.ai-relate-head { font-weight: 700; font-size: .92rem; color: #1e40af; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.ai-relate-sub { font-weight: 400; font-size: .74rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
/* 自定义模型未填引导提示（选中 custom 但三项为空时显示） */
.ai-relate-custom-tip { margin: -4px 0 10px; font-size: .78rem; line-height: 1.55; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 10px; }
.ai-relate-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-relate-item { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; line-height: 1.5; }
.ai-relate-type { flex: none; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.ai-relate-text { color: #1e293b; }
.ai-relate-err { color: #b91c1c; font-size: .85rem; }
.ai-relate-raw { display: block; white-space: pre-wrap; word-break: break-word; color: #334155; font-size: .88rem; line-height: 1.6; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 10px 12px; }
.ai-relate-acts { margin-left: auto; display: flex; gap: 6px; }
.ai-mini { font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; cursor: pointer; }
.ai-mini:hover { background: #dbeafe; }
.ai-mini:disabled { opacity: .5; cursor: default; }
.ai-relate-pick { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ai-pick-label { font-size: .72rem; color: #64748b; font-weight: 600; }
.ai-pick { font-size: .74rem; color: #334155; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; border: 1px solid #e2e8f0; background: #f8fafc; user-select: none; }
.ai-pick:hover { border-color: #bfdbfe; background: #eff6ff; }
.ai-pick input { accent-color: #1e40af; margin: 0; }
/* 自定义模型输入区域 */
.ai-custom-row { margin: 6px 0 10px; padding: 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.ai-custom-row[hidden] { display: none; }
.ai-custom-inputs { display: flex; flex-direction: column; gap: 8px; }
.ai-custom-inputs input { width: 100%; padding: 7px 10px; font-size: .78rem; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; box-sizing: border-box; outline: none; }
.ai-custom-inputs input:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
.ai-custom-row2 { display: flex; gap: 6px; align-items: center; }
.ai-custom-row2 input { flex: 1; min-width: 0; }
.ai-key-toggle { flex-shrink: 0; width: 30px; height: 30px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; cursor: pointer; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.ai-key-toggle:hover { border-color: #3b82f6; }
.ai-probe-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ai-probe-btn { padding: 6px 14px; font-size: .76rem; font-weight: 600; color: #1e40af; background: #dbeafe; border: 1px solid #93c5fd; border-radius: 7px; cursor: pointer; }
.ai-probe-btn:hover { background: #bfdbfe; }
.ai-probe-btn:disabled { opacity: .55; cursor: default; }
.ai-probe-res { font-size: .74rem; line-height: 1.4; word-break: break-all; flex: 1; }
.ai-probe-res.ok { color: #065f46; }
.ai-probe-res.fail { color: #b91c1c; }
.ai-probe-res.testing { color: #64748b; }
.ai-relate-src { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #bfdbfe; font-size: .76rem; color: #64748b; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.ai-relate-src[hidden] { display: none; }

/* Loading 态：dots 慢响应时让用户看到「正在生成」反馈，避免以为没反应 */
.ai-relate-loading { display: flex; align-items: center; gap: 8px; padding: 14px 12px; font-size: .85rem; color: #1e40af; background: #eef5ff; border-radius: 10px; margin-bottom: 4px; }
.ai-relate-loading[hidden] { display: none; }
.ai-relate-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #bfdbfe; border-top-color: #1e40af;
  border-radius: 50%;
  animation: ai-spin .8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-src-label { font-weight: 700; color: #1e40af; }
.ai-src-link { color: #2563eb; text-decoration: none; border-bottom: 1px solid #bfdbfe; }
.ai-src-link:hover { color: #1e40af; }
.ln-btn.loading { opacity: .6; pointer-events: none; }

/* 用户选的引导提问：气泡靠右，蓝底白字 */
.ai-relate-user { display: block !important; justify-content: flex-start; }
.ai-relate-user { background: #1e40af; color: #fff; border-radius: 12px 12px 2px 12px; padding: 8px 12px; font-size: .85rem; line-height: 1.5; margin: 10px 0 4px auto; max-width: 88%; width: fit-content; box-shadow: 0 1px 3px rgba(30,64,175,.25); }
/* 引导提问气泡：可点击，浅蓝胶囊，hover 加深 */
.ai-relate-follow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #bfdbfe; }
.ai-relate-follow[hidden] { display: none; }
.ai-follow-btn {
  font-size: .8rem; line-height: 1.4; text-align: left;
  color: #1e40af; background: #eef5ff;
  border: 1px solid #bfdbfe; border-radius: 999px;
  padding: 7px 13px; cursor: pointer; max-width: 100%;
  transition: background .15s, transform .08s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.ai-follow-btn:hover { background: #dbeafe; border-color: #93c5fd; }
.ai-follow-btn:active { transform: scale(.97); }
.ai-follow-btn::before { content: " "; opacity: .6; }
.my-ai-guide { font-size: .76rem; color: var(--muted); line-height: 1.7; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.my-ai-guide a { color: var(--primary); font-weight: 700; text-decoration: none; }
.my-ai-guide a:hover { text-decoration: underline; }

/* ===== 悬浮 AI 助手（悬浮球 + 底部浮窗） ===== */
.ai-fab {
  position: fixed; right: 16px; bottom: 84px; z-index: 45;
  width: 52px; height: 52px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #fff; font-size: 1rem; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 6px 20px rgba(37,99,235,.4);
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  /* 灵动：默认呼吸吸引注意，hover 放大+光晕流动，按压缩放 */
  animation: aiFabBreath 2.6s ease-in-out infinite;
  transition: transform .12s ease, box-shadow .25s ease, background .3s ease;
}
.ai-fab:hover { transform: scale(1.1); animation: aiFabGlow 1.8s ease-in-out infinite; box-shadow: 0 8px 26px rgba(37,99,235,.55); }
.ai-fab:active { transform: scale(.92); animation: none; }
/* 展开浮窗时：更深蓝 + 持续心跳，表示已激活 */
.ai-fab.on {
  background: linear-gradient(135deg, #1e40af 0%, #4338ca 100%);
  box-shadow: 0 6px 22px rgba(30,64,175,.5);
  animation: aiFabBeat 1.1s ease-in-out infinite;
}
.ai-fab.on:hover { animation: aiFabBeat 1.1s ease-in-out infinite; }
/* 呼吸：缓慢放大收起，吸引注意但不打扰读卡 */
@keyframes aiFabBreath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
/* hover 光晕：阴影流动 + 轻缩放 */
@keyframes aiFabGlow {
  0%, 100% { transform: scale(1.05); box-shadow: 0 8px 26px rgba(37,99,235,.5); }
  50%      { transform: scale(1.12); box-shadow: 0 10px 32px rgba(37,99,235,.62); }
}
/* 激活心跳：两拍一收（类似已收藏的心跳节奏） */
@keyframes aiFabBeat {
  0%, 100% { transform: scale(1); }
  15%      { transform: scale(1.14); }
  30%      { transform: scale(1); }
  45%      { transform: scale(1.14); }
  60%      { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-fab { animation: none !important; transition: none !important; }
}
.ai-assist {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: block; max-width: 480px; margin: 0 auto;
  background: rgba(255,255,255,.96);
  border-top-left-radius: 18px; border-top-right-radius: 18px;
  box-shadow: 0 -8px 32px rgba(15,23,42,.18);
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  max-height: 72vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ai-assist.hidden { display: none; }
.ai-assist .ai-relate { margin-top: 0; border: none; background: transparent; padding: 0; }
.ai-assist-title { font-size: .92rem; font-weight: 800; color: #1e40af; }
.ai-assist-input { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #bfdbfe; }
.ai-assist-input input {
  flex: 1; min-width: 0; font-size: .86rem; color: #1e293b;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 999px;
  padding: 9px 14px; outline: none; transition: border-color .15s;
}
.ai-assist-input input:focus { border-color: #2563eb; }
.ai-send {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 1rem; color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.ai-send:active { transform: scale(.92); }

/* 尊重「减少动态效果」系统偏好：关掉心形弹跳动效 */
@media (prefers-reduced-motion: reduce) {
  .heart-ico { transition: none; }
  .card-star.on .heart-ico, .feed-card-star.on .heart-ico,
  .act.fav.on .heart-ico, .ln-btn-fav.on .heart-ico,
  .sec-heart.on .heart-ico { animation: none; }
}

/* ===== 桌面端适配：拓宽主容器，避免窄列在大屏上内容拥挤/截断 ===== */
@media (min-width: 768px) {
  /* 牌堆/我的：从 480px 扩到 640px，卡片和树图有更多呼吸空间 */
  .ln-stage { max-width: 640px; padding: 32px 24px 120px; }
  /* 瀑布流：720px 双列，单列比手机更宽，长标题/事实少换行 */
  .feed-stage { max-width: 720px; padding: 12px 24px 48px; }
  .feed-grid { column-gap: 14px; }
  /* 详情/AI 浮窗同步放宽 */
  .detail-panel { max-width: 680px; border-radius: 20px 20px 0 0; }
  .ai-assist { max-width: 640px; }
  /* 卡片在宽屏下稍微舒展 */
  .card { padding: 24px 22px 20px; }
  .card-hook { font-size: 1.42rem; }
}

@media (min-width: 1200px) {
  /* 大屏：进一步加宽，瀑布流三列 */
  .ln-stage { max-width: 780px; }
  .feed-stage { max-width: 1060px; }
  .feed-grid { column-count: 3; column-gap: 16px; }
  .detail-panel { max-width: 800px; }
  .ai-assist { max-width: 720px; }
}

