/* ===========================================================
   TangoAI Daily — 每日 AI / 开源精选情报站
   设计语言：现代渐变 + 毛玻璃 + 柔和阴影卡片（RiPro-V5 风格）
   内容形态：卡片流 + 分类彩色药丸 + 热门榜（ahhhfs 风格）
   浅色 / 深色双主题；移动优先；Focus 可见
   =========================================================== */

:root {
  --brand: #3b6ff5;
  --brand-2: #7c5cf6;
  --brand-3: #ec4899;
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;

  --bg: #f0f2f5;
  --bg-soft: #e6e9f0;
  --surface: #ffffff;
  --surface-2: #f3f5f9;
  --border: #e5e9f2;
  --border-strong: #d4dae8;
  --text: #171a2b;
  --text-2: #4b5269;
  --text-3: #8189a0;
  --glass: rgba(255, 255, 255, .72);

  --cat-github: #3b6ff5;
  --cat-rising: #f59e0b;
  --cat-skills: #8b5cf6;
  --cat-prompts: #ec4899;
  --cat-fun: #10b981;
  --cat-sites: #06b6d4;
  --cat-hf: #ef4444;
  --cat-x: #0f1419;
  --cat-default: #64748b;

  --shadow-sm: 0 1px 2px rgba(23, 26, 43, .05), 0 2px 8px rgba(23, 26, 43, .05);
  --shadow: 0 4px 14px rgba(23, 26, 43, .07), 0 10px 30px rgba(23, 26, 43, .07);
  --shadow-lg: 0 8px 22px rgba(23, 26, 43, .10), 0 20px 48px rgba(23, 26, 43, .13);
  --shadow-brand: 0 6px 18px rgba(59, 111, 245, .32);

  --radius: 16px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --max: 1240px;
  --header-h: 64px;
  --filterbar-h: 100px;
  --ease: cubic-bezier(.33, 1, .68, 1);
}

html[data-theme="dark"] {
  --bg: #12141d;
  --bg-soft: #171a25;
  --surface: #1b1e2b;
  --surface-2: #232737;
  --border: #2b3044;
  --border-strong: #3a4059;
  --text: #eef1f8;
  --text-2: #b4bbcf;
  --text-3: #7e86a0;
  --glass: rgba(27, 30, 43, .72);

  --cat-github: #6f96ff;
  --cat-rising: #fbbf24;
  --cat-skills: #a78bfa;
  --cat-prompts: #f472b6;
  --cat-fun: #34d399;
  --cat-sites: #22d3ee;
  --cat-hf: #f87171;
  --cat-x: #9ca8bc;
  --cat-default: #94a3b8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .3);
  --shadow: 0 4px 14px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 8px 22px rgba(0, 0, 0, .45), 0 20px 48px rgba(0, 0, 0, .5);
  --shadow-brand: 0 6px 18px rgba(59, 111, 245, .4);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Header（毛玻璃吸顶） ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(23, 26, 43, .04);
}
html[data-theme="dark"] .site-header { box-shadow: 0 1px 12px rgba(0, 0, 0, .25); }

.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { display: flex; filter: drop-shadow(0 3px 8px rgba(59, 111, 245, .35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16.5px; letter-spacing: -.02em; }
.brand-text strong i {
  font-style: normal;
  background: linear-gradient(92deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text em {
  font-style: normal; font-size: 11.5px; color: var(--text-3); letter-spacing: .02em;
}

.header-tools { display: flex; align-items: center; gap: 10px; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 14px; height: 38px; min-width: 220px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(59, 111, 245, .15);
}
.search-box .icon { width: 17px; height: 17px; fill: var(--text-3); flex-shrink: 0; }
.search-box input {
  border: 0; background: transparent; outline: none; color: var(--text);
  font-size: 14px; width: 100%; height: 100%;
}
.search-box input::placeholder { color: var(--text-3); }

.theme-toggle {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.theme-toggle .icon { width: 18px; height: 18px; fill: var(--text-2); }

/* ---------- Hero（渐变光晕 + 呼吸灯 + 渐变数字） ---------- */
.hero {
  padding: 52px 0 34px;
  background:
    radial-gradient(900px 380px at 12% -10%, rgba(59, 111, 245, .14), transparent 70%),
    radial-gradient(760px 340px at 88% 0%, rgba(124, 92, 246, .12), transparent 70%),
    radial-gradient(600px 300px at 60% 110%, rgba(236, 72, 153, .07), transparent 70%);
  border-bottom: 1px solid var(--border);
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 13px; border-radius: 999px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
html[data-theme="dark"] .hero-kicker { color: var(--cat-github); }
.hero-kicker .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .55);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero-title {
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -.03em;
  background: linear-gradient(96deg, var(--text) 15%, var(--brand) 55%, var(--brand-2) 80%, var(--brand-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 14px;
}

.stat-row {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 20px; min-width: 126px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-num {
  display: block; font-size: 23px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 65%, var(--brand-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- 分类筛选栏（毛玻璃吸顶 + 图文分类卡） ---------- */
.filter-bar {
  position: sticky; top: var(--header-h); z-index: 30;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.filter-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding-top: 9px; padding-bottom: 9px;
}
.chips {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  padding: 2px 0;
}
.chips::-webkit-scrollbar { display: none; }
/* 可横向滚动时的边缘渐隐提示（哪侧还有内容由 app.js 打 data-fade） */
.chips[data-fade="right"] {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent 100%);
}
.chips[data-fade="left"] {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px);
  mask-image: linear-gradient(90deg, transparent 0, #000 26px);
}
.chips[data-fade="both"] {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 34px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 34px), transparent 100%);
}
.chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  white-space: nowrap;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(59, 111, 245, .30);
}
.chip:active { transform: translateY(1px); }
/* 图文分类卡片：插画感渐变底（光晕 + 斜纹 + 图标水印）+ 居中数量徽章 + 白色分类名
   配色由 JS 注入 CSS 变量：--cc-base / --cc-base-2 底色，--cc-ga / --cc-gb 双光晕色。
   卡片自带深色底，所以明暗两套主题下都统一用白字。 */
.chip-card {
  position: relative; flex-shrink: 0;
  width: 154px; height: 82px; border: 0; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 0 10px;
  color: #fff; cursor: pointer; overflow: hidden;
  scroll-snap-align: start;
  background-color: var(--cc-base, #221d5c);
  background-image:
    radial-gradient(125% 105% at 8% -6%, var(--cc-ga, rgba(103, 105, 255, .62)) 0%, transparent 60%),
    radial-gradient(120% 110% at 96% 104%, var(--cc-gb, rgba(168, 85, 247, .44)) 0%, transparent 62%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.13' stroke-width='1'%3E%3Ccircle cx='10' cy='14' r='3.2'/%3E%3Ccircle cx='46' cy='26' r='4.2'/%3E%3Ccircle cx='22' cy='50' r='2.6'/%3E%3Ccircle cx='56' cy='54' r='3'/%3E%3Cpath d='M10 14 46 26 22 50 56 54M46 26 22 50'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.13'%3E%3Ccircle cx='34' cy='8' r='1.6'/%3E%3Ccircle cx='6' cy='34' r='1.6'/%3E%3Ccircle cx='40' cy='40' r='1.6'/%3E%3C/g%3E%3C/svg%3E"),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 9px),
    linear-gradient(155deg, var(--cc-base, #221d5c), var(--cc-base-2, #111233));
  background-size: auto, auto, 64px 64px, auto, auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .13);
  outline: 2px solid transparent; outline-offset: 1px;
  font-family: inherit;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), outline-color .2s var(--ease);
}
.chip-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0, 0, 0, .30), inset 0 1px 0 rgba(255, 255, 255, .18); }
.chip-card:focus-visible { outline: 2px solid #fff; }
.chip-card[aria-selected="true"] {
  outline-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .20);
}
.cc-badge {
  position: relative; z-index: 2;
  font-size: 12px; font-weight: 700; line-height: 1;
  padding: 4px 10px; border-radius: 6px; color: #fff;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 2px 6px rgba(0, 0, 0, .18);
}
.cc-name {
  position: relative; z-index: 2;
  font-size: 15px; font-weight: 800; letter-spacing: .2px; white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .38);
}
.cc-icon {
  position: absolute; right: -9px; bottom: -11px; z-index: 1;
  width: 60px; height: 60px; opacity: .20; pointer-events: none;
  transform: rotate(-6deg);
}

.sort-box select {
  height: 36px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 0 16px;
  font-size: 13.5px; cursor: pointer; outline: none; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s var(--ease);
}
.sort-box select:hover { border-color: var(--border-strong); }

/* ---------- 主体布局：卡片流 2/3 + 右侧栏 1/3 ---------- */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 26px;
  align-items: start;
  padding-top: 28px;
  padding-bottom: 10px;
}
.side-col {
  /* header 64px + 筛选栏（图文分类卡）96px + 间距 */
  position: sticky;
  top: calc(var(--header-h) + var(--filterbar-h) + 14px);
  display: flex; flex-direction: column; gap: 20px;
}

/* ---------- 卡片流 ---------- */
.feed {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
/* 网格子项默认 min-width:auto 会被卡内 nowrap 内容（标签行、推文长文本）顶宽，
   导致整列被撑到几百像素、窄屏直接横向溢出 → 统一放开下限 */
.main-col, .feed, .feed-section { min-width: 0; }
.feed-section { display: block; }
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 20px;
}
.section-grid > * { min-width: 0; }

/* 分区 sticky 小标题（流内分区替代原横向分类 tab） */
.section-head {
  position: sticky;
  top: calc(var(--header-h) + var(--filterbar-h));
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 8px 2px;
  background: linear-gradient(180deg, var(--bg) 62%, rgba(240, 242, 245, 0));
}
.section-head .sh-dot {
  width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(135deg, #3b6ff5, #7c5cf6);
  box-shadow: 0 0 0 4px rgba(59, 111, 245, .16);
}
.section-head .sh-title { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.section-head .sh-count { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 栏目推荐滑轨（每隔约 8 张卡穿插进信息流） */
.col-rail {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  box-shadow: var(--shadow-sm);
}
.col-rail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.col-rail-head .col-emoji { font-size: 18px; line-height: 1; }
.col-rail-head .col-title { font-weight: 800; font-size: 15px; }
.col-rail-head .col-tag {
  margin-left: auto; font-size: 11px; color: #fff;
  background: linear-gradient(135deg, #3b6ff5, #7c5cf6);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.col-rail-track {
  display: flex; gap: 12px; overflow-x: auto;
  scrollbar-width: thin; padding-bottom: 4px;
}
.col-rail-track::-webkit-scrollbar { height: 6px; }
.col-rail-track::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.col-link {
  flex: 0 0 auto; width: 232px;
  display: flex; flex-direction: column; gap: 5px;
  text-decoration: none; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.col-link:hover { transform: translateY(-3px); border-color: var(--brand); }
.col-link .cl-title {
  font-weight: 700; font-size: 14px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.col-link .cl-desc {
  font-size: 12.5px; color: var(--text-3); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
/* hover 顶部流动彩虹渐变条 */
.card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 3;
  background: linear-gradient(90deg,
    #3b6ff5, #8b5cf6, #ec4899, #ef4444, #f59e0b, #10b981, #06b6d4, #3b6ff5);
  background-size: 250% 100%;
  transform: scaleX(0); transform-origin: left center;
  transition: transform .4s var(--ease);
  animation: rainbow-flow 2.6s linear infinite;
}
.card:hover, .card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.card:hover::before, .card:focus-within::before { transform: scaleX(1); }
@keyframes rainbow-flow {
  0%   { background-position: 0% 0; }
  100% { background-position: 250% 0; }
}

.card-media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background:
    linear-gradient(135deg, rgba(59, 111, 245, .16), rgba(124, 92, 246, .16) 55%, rgba(236, 72, 153, .14)),
    var(--surface-2);
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity .5s var(--ease), transform .4s var(--ease);
}
.card-media img.is-loaded { opacity: 1; }
.card:hover .card-media img { transform: scale(1.045); }

.card-flag {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  font-size: 11.5px; font-weight: 650; color: #fff;
  padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  box-shadow: 0 4px 12px rgba(239, 68, 68, .38);
  /* 四语角标长度差异较大（今日热榜 / Trending / 편집자 추천），禁止折行 */
  white-space: nowrap;
  max-width: calc(100% - 20px);
  overflow: hidden; text-overflow: ellipsis;
}

.card-body { padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 9px; flex: 1; }

.card-topline {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.cat-pill {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 650; color: #fff;
  padding: 3px 10px; border-radius: 999px;
  background: var(--cat-default);
  letter-spacing: .01em;
}
.cat-pill[data-cat="github"]  { background: var(--cat-github); }
.cat-pill[data-cat="rising"]  { background: var(--cat-rising); }
.cat-pill[data-cat="skills"]  { background: var(--cat-skills); }
.cat-pill[data-cat="prompts"] { background: var(--cat-prompts); }
.cat-pill[data-cat="fun"]     { background: var(--cat-fun); }
.cat-pill[data-cat="sites"]   { background: var(--cat-sites); }
.cat-pill[data-cat="hf"]      { background: var(--cat-hf); }
.cat-pill[data-cat="x"]       { background: var(--cat-x); }
.card-src {
  font-size: 11.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.card-title {
  font-size: 15.5px; font-weight: 680; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a { transition: color .18s var(--ease); }
.card-title a:hover { color: var(--brand); }

.card-desc {
  font-size: 13.4px; color: var(--text-2); line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11.5px; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 9px;
}

.card-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 12.5px; color: var(--text-3);
  border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px;
}
.card-meta .m { display: inline-flex; align-items: center; gap: 4px; }
.card-meta .m svg { width: 13px; height: 13px; fill: currentColor; }
.card-meta .star { color: var(--amber); font-weight: 650; }
.card-meta .today { color: var(--green); font-weight: 650; }
.card-meta .like { color: var(--red); font-weight: 600; }

/* ---------- 骨架屏 ---------- */
.skeleton-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 20px;
}
.sk-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding-bottom: 16px; overflow: hidden;
}
.sk-media {
  aspect-ratio: 16 / 9; margin-bottom: 14px;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--bg-soft) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}
.sk-line {
  height: 13px; border-radius: 6px; margin: 0 16px 10px;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--bg-soft) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}
.sk-line.w60 { width: 60%; }
.sk-line.w80 { width: 80%; margin-bottom: 0; }
@keyframes shimmer {
  0%   { background-position: 120% 0; }
  100% { background-position: -20% 0; }
}

.empty-state {
  text-align: center; color: var(--text-3); padding: 60px 0; font-size: 14.5px;
}

/* ---------- 按钮（渐变 + hover 微光扫过） ---------- */
.load-more-row { display: flex; justify-content: center; padding: 28px 0 8px; }
.btn {
  position: relative; overflow: hidden;
  border-radius: 999px; padding: 11px 30px; font-size: 14px; font-weight: 650;
  cursor: pointer; border: 0;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2) 70%, var(--brand-3));
  background-size: 150% 100%;
  color: #fff; box-shadow: var(--shadow-brand);
}
.btn-primary::after {
  content: "";
  position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  transition: left .5s var(--ease);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(59, 111, 245, .42); }
.btn-primary:hover::after { left: 130%; }
.btn-primary:active { transform: translateY(0); }

.archive-note {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid rgba(245, 158, 11, .4);
  color: var(--text-2); border-radius: var(--radius-sm); padding: 10px 16px;
  font-size: 13.5px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
/* hidden 属性会被上面的显式 display 覆盖，必须显式压回（否则归档提示条永远可见） */
.archive-note[hidden] { display: none; }
.link-btn {
  background: none; border: 0; color: var(--brand);
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--brand-2); }

/* ---------- 右侧栏 ---------- */
.side-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 18px 20px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.side-title {
  font-size: 15.5px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
/* section 标题渐变装饰线 */
.side-title::before {
  content: "";
  width: 4px; height: 16px; border-radius: 999px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
}

.rank-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.rank-tab {
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); border-radius: 999px; padding: 3px 11px;
  font-size: 12px; font-weight: 550; cursor: pointer;
  transition: all .18s var(--ease);
}
.rank-tab:hover { border-color: var(--border-strong); color: var(--text); }
.rank-tab.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 10px rgba(59, 111, 245, .3);
}

.rank-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
}
.rank-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.rank-item:last-child { border-bottom: 0; padding-bottom: 0; }

/* 金银铜渐变徽章 */
.rank-badge {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 750; color: #fff;
  background: var(--surface-2); color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.rank-badge.rank-1 {
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #7c2d12;
  box-shadow: 0 3px 8px rgba(245, 158, 11, .4);
}
.rank-badge.rank-2 {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  color: #334155;
  box-shadow: 0 3px 8px rgba(148, 163, 184, .4);
}
.rank-badge.rank-3 {
  background: linear-gradient(135deg, #fdba74, #c2410c);
  color: #fff;
  box-shadow: 0 3px 8px rgba(194, 65, 12, .38);
}

.rank-title {
  flex: 1; min-width: 0; font-size: 13.2px; font-weight: 550; line-height: 1.45;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .18s var(--ease);
}
.rank-title:hover { color: var(--brand); }
.rank-heat {
  flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--red);
  font-variant-numeric: tabular-nums;
}
.rank-empty { color: var(--text-3); font-size: 13px; padding: 8px 0; }

.about-text { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 12px; }
.about-list {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12.8px; color: var(--text-2);
}
.about-list li { display: flex; align-items: center; gap: 8px; }
.about-ico {
  width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0;
  background: var(--cat-default);
}
.about-ico[data-cat="github"]  { background: var(--cat-github); }
.about-ico[data-cat="skills"]  { background: var(--cat-skills); }
.about-ico[data-cat="hf"]      { background: var(--cat-hf); }
.about-links { display: flex; flex-wrap: wrap; gap: 8px; }
.about-links a {
  font-size: 12.5px; font-weight: 600; color: var(--brand);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 13px;
  transition: all .18s var(--ease);
}
.about-links a:hover {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-brand);
}

/* ---------- 历史归档 ---------- */
.archive-section { padding: 44px 20px 64px; }
.section-title { font-size: 20px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
/* section 标题渐变装饰线 */
.section-title::before {
  content: "";
  width: 5px; height: 20px; border-radius: 999px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
  box-shadow: 0 3px 10px rgba(59, 111, 245, .3);
}
.section-desc { color: var(--text-3); font-size: 13.5px; margin-bottom: 18px; }

/* ---------- 首页：关于/运营说明 ---------- */
.intro-about { padding: 44px 20px 60px; }
.intro-about .intro-about-body {
  max-width: 760px;
  color: var(--text-2);
  line-height: 1.85;
  font-size: 15.5px;
}
.intro-about .intro-about-body p { margin: 0 0 14px; }
.intro-about .intro-about-body a { color: var(--brand); font-weight: 600; }
.intro-about .intro-about-body a:hover { text-decoration: underline; }

.date-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.date-chip {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); border-radius: 999px; padding: 8px 15px;
  font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all .2s var(--ease);
}
.date-chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.date-chip.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-color: transparent;
  box-shadow: var(--shadow-brand);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background:
    radial-gradient(600px 240px at 85% 120%, rgba(124, 92, 246, .07), transparent 70%),
    var(--surface);
  padding: 32px 0;
}
.footer-inner {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start;
}
.footer-brand {
  font-weight: 750; font-size: 15.5px; margin-bottom: 6px;
  background: linear-gradient(92deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block;
}
.footer-note { font-size: 12.8px; color: var(--text-3); max-width: 560px; line-height: 1.6; }
.footer-meta { display: flex; gap: 16px; font-size: 12.8px; color: var(--text-3); flex-wrap: wrap; align-items: center; }
.footer-meta a { transition: color .18s var(--ease); }
.footer-meta a:hover { color: var(--brand); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  /* 必须用 minmax(0,1fr)：写成 1fr 时列宽带 min-content 下限，
     会被卡内 nowrap 内容顶到 870px，整页横向溢出、右侧内容被裁 */
  .main-grid { grid-template-columns: minmax(0, 1fr); }
  .side-col {
    position: static;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: start;
  }
}
@media (max-width: 860px) {
  .hero { padding: 36px 0 26px; }
  .stat { flex: 1 1 calc(50% - 12px); min-width: 0; }
  .search-box { min-width: 0; flex: 1; }
  .brand-text em { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .main-grid { padding-top: 20px; gap: 18px; }
  .side-col { grid-template-columns: minmax(0, 1fr); }
  .feed { gap: 22px; }
  /* 同上：1fr → minmax(0,1fr)，杜绝卡片流把页面撑宽 */
  .section-grid, .skeleton-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .col-link { width: 200px; }
  /* header 两行化后内容实际需要 ~90px，写死 58px 会让搜索框溢出压住 hero → 交回内容撑高 */
  .header-inner { height: auto; }
  .filter-inner { flex-direction: column; align-items: stretch; }
  .sort-box select { width: 100%; }
  .footer-inner { flex-direction: column; }
  .archive-section { padding: 32px 14px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ===========================================================
   详情页（detail.html）专属样式 — v20261026e 基线
   沿用上方设计系统：CSS 变量 / 圆角卡片 / 毛玻璃 / 深色模式自动适配
   =========================================================== */

/* ---------- 布局 ---------- */
.detail-main { padding: 26px 0 56px; }
.detail-wrap { max-width: 880px; }

/* 首页卡片整卡可点 */
.card { cursor: pointer; }
.card-ext {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-3);
  transition: all .18s var(--ease);
}
.card-ext svg { width: 12px; height: 12px; display: block; }
.card-ext:hover {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-brand);
}

/* ---------- Hero 卡片 ---------- */
.detail-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.detail-cover {
  aspect-ratio: 21 / 9;
  background:
    linear-gradient(135deg, rgba(59, 111, 245, .16), rgba(124, 92, 246, .16) 55%, rgba(236, 72, 153, .14)),
    var(--surface-2);
  overflow: hidden;
}
.detail-cover img {
  width: 100%; height: 100%; object-fit: cover;
}
.detail-hero-body {
  padding: 22px 26px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.detail-topline {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.detail-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.detail-title {
  font-size: clamp(22px, 3.4vw, 30px);
  letter-spacing: -.02em;
  line-height: 1.3;
}
.detail-desc { color: var(--text-2); font-size: 14.5px; line-height: 1.7; }
.detail-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  font-size: 13px; color: var(--text-3);
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.detail-meta .m { display: inline-flex; align-items: center; gap: 5px; }
.detail-meta .m svg { width: 13px; height: 13px; fill: currentColor; }
.detail-meta .star { color: var(--amber); font-weight: 650; }
.detail-meta .today { color: var(--green); font-weight: 650; }
.detail-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-top: 4px;
}

/* ---------- 次按钮（描边胶囊） ---------- */
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; padding: 11px 24px; font-size: 14px; font-weight: 650;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); cursor: pointer; text-decoration: none;
  transition: all .2s var(--ease);
}
.btn-secondary:hover {
  border-color: var(--brand); color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(59, 111, 245, .18);
}
.btn-secondary:active { transform: translateY(0); }
.btn-secondary-sm { padding: 7px 15px; font-size: 13px; }

/* ---------- 内容区块 ---------- */
.detail-section {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
}
.detail-sec-title {
  font-size: 17px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.detail-sec-title::before {
  content: "";
  width: 4px; height: 17px; border-radius: 999px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
  box-shadow: 0 2px 8px rgba(59, 111, 245, .28);
}

/* 站内导读：渐变浅底 + 徽章 */
.ai-summary-box {
  position: relative;
  background: linear-gradient(135deg, rgba(59, 111, 245, .07), rgba(124, 92, 246, .06) 55%, rgba(236, 72, 153, .05));
  border: 1px solid rgba(59, 111, 245, .22);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.ai-summary-badge {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 650; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2) 70%, var(--brand-3));
  border-radius: 999px; padding: 3px 11px;
  margin-bottom: 10px;
  letter-spacing: .02em;
}
.ai-summary-text {
  font-size: 14.5px; line-height: 1.85; color: var(--text);
  overflow-wrap: anywhere;
}

/* 四语导读容器：四种语言的摘要同时落在 HTML 里，
   由脚本按当前语言显示其中一份（AI 爬虫能取到全部四语） */
.ai-summary-multi .ai-summary-text[hidden] { display: none; }
.ai-summary-lang {
  display: inline-block;
  font-size: 11px; font-weight: 650; letter-spacing: .03em;
  color: var(--brand);
  background: rgba(59, 111, 245, .10);
  border-radius: 999px; padding: 2px 9px;
  margin-right: 4px;
  vertical-align: 2px;
}

/* 面包屑 */
.crumb {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-3);
  margin-bottom: 14px;
}
.crumb a { color: var(--text-2); text-decoration: none; }
.crumb a:hover { color: var(--brand); text-decoration: underline; }
.crumb span[aria-hidden="true"] { opacity: .5; }

/* 同类项目内链列表 */
.rel-list { list-style: none; margin: 0; padding: 0; }
.rel-list li {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.rel-list li:last-child { border-bottom: 0; }
.rel-list a {
  font-size: 14px; color: var(--text); text-decoration: none;
  overflow-wrap: anywhere;
}
.rel-list a:hover { color: var(--brand); text-decoration: underline; }
.rel-meta { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

/* README 区块 */
.readme-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.readme-src { font-size: 12.5px; color: var(--text-3); }
.readme-src a { color: var(--brand); font-weight: 600; }
.readme-src a:hover { color: var(--brand-2); text-decoration: underline; text-underline-offset: 3px; }

.detail-empty { text-align: center; padding: 34px 10px 26px; }
.detail-empty-title { font-size: 15.5px; font-weight: 650; margin-bottom: 6px; }
.detail-empty-text { font-size: 13.5px; color: var(--text-3); margin-bottom: 16px; }

/* ---------- Markdown 正文 ---------- */
.md-body {
  font-size: 14.2px; line-height: 1.78; color: var(--text);
  overflow-wrap: break-word;
}
.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 {
  margin: 22px 0 10px; line-height: 1.4;
}
.md-body > :first-child { margin-top: 0; }
.md-body h1 { font-size: 20px; }
.md-body h2 { font-size: 18px; }
.md-body h3 { font-size: 16px; }
.md-body h4, .md-body h5, .md-body h6 { font-size: 15px; }
.md-body p { margin: 0 0 12px; }
.md-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.md-body a:hover { color: var(--brand-2); }
.md-body ul, .md-body ol { margin: 0 0 12px; padding-left: 24px; }
.md-body li { margin: 4px 0; }
.md-body img {
  border-radius: var(--radius-sm); margin: 8px 0;
  border: 1px solid var(--border);
}
.md-body hr {
  border: 0; border-top: 1px solid var(--border);
  margin: 20px 0;
}
.md-body blockquote {
  margin: 0 0 12px; padding: 10px 16px;
  border-left: 3px solid var(--brand);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
}
.md-body blockquote p:last-child { margin-bottom: 0; }
/* 行内代码 */
.md-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .92em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5px 6px;
}
/* 围栏代码块：内容不解析 HTML，深浅主题均取 surface-2 底 */
.md-body pre {
  margin: 0 0 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 1.6;
}
.md-body pre code {
  background: none; border: 0; padding: 0;
  font-size: 13px; color: var(--text);
  white-space: pre;
}
/* 基础表格样式（渲染器暂不产出表格，留作扩展） */
.md-body table {
  width: 100%; border-collapse: collapse; margin: 0 0 14px;
  font-size: 13.5px;
}
.md-body th, .md-body td {
  border: 1px solid var(--border);
  padding: 7px 12px; text-align: left;
}
.md-body th { background: var(--surface-2); font-weight: 650; }

/* ---------- 底部操作 / 404 ---------- */
.detail-footer-actions {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 12px;
  margin-top: 30px;
}
.detail-notfound { text-align: center; padding: 72px 0 60px; }
.notfound-code {
  font-size: 64px; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 8px;
}
.notfound-text { font-size: 14.5px; color: var(--text-2); margin-bottom: 22px; }

/* 骨架辅助 */
.detail-skeleton { box-shadow: none; }
.detail-sk-media { aspect-ratio: 21 / 9; margin: 0; border-radius: 0; }
.detail-skeleton .sk-line { margin-left: 26px; margin-right: 26px; }
.sk-line.w40 { width: 40%; }

/* ---------- 详情页响应式 ---------- */
@media (max-width: 560px) {
  .detail-main { padding: 16px 0 44px; }
  .detail-hero-body { padding: 16px 16px 18px; }
  .detail-section { padding: 16px; margin-top: 16px; }
  .detail-actions .btn, .detail-actions .btn-secondary { flex: 1 1 auto; justify-content: center; }
  .detail-footer-actions { margin-top: 22px; }
  .detail-footer-actions .btn, .detail-footer-actions .btn-secondary { flex: 1 1 auto; justify-content: center; }
}

/* ===========================================================
   语言切换器（i18n）— v20261026h
   胶囊分段按钮组，沿用毛玻璃导航的变量体系，自动适配深色模式
   对比度：选中态白字 #3666e1→#7255e2 = 5.07/5.11，未选中态
   var(--text-2) 浅色 7.75 / 深色 8.64，均满足 WCAG AA（4.5:1）。
   故此处不复用 --brand/--brand-2（白字仅 4.39/4.45，不达标）。
   =========================================================== */
.lang-switch {
  display: inline-flex; align-items: center; gap: 2px;
  flex-shrink: 0; padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.lang-btn {
  appearance: none; -webkit-appearance: none;
  margin: 0; border: 0;
  height: 32px; padding: 0 9px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px; font-weight: 650; line-height: 32px;
  letter-spacing: .01em;
  cursor: pointer; white-space: nowrap;
  transition: color .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.lang-btn:hover { color: var(--text); background: var(--surface-2); }
.lang-btn[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, #3666e1, #7255e2);
  box-shadow: 0 3px 10px rgba(54, 102, 225, .28);
}
.lang-btn[aria-pressed="true"]:hover { color: #fff; background: linear-gradient(135deg, #3666e1, #7255e2); }
.lang-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
/* 窄屏用单字缩写，避免挤压搜索框 */
.lang-short { display: none; }

/* 各语言的字体栈微调（中日韩字形差异） */
html[data-lang="ja"] body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "Meiryo", "Noto Sans JP", "Segoe UI", Arial, sans-serif;
}
html[data-lang="ko"] body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", "Segoe UI", Arial, sans-serif;
}

@media (max-width: 560px) {
  /* 详情页头部的返回按钮让位给语言切换器（页面内仍有两处返回入口） */
  .header-back { display: none; }
  .header-tools { gap: 8px; }
}

@media (max-width: 520px) {
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .lang-btn { padding: 0 8px; }
  /* 只保留 Logo 图形，把宽度让给语言切换器与搜索框 */
  .brand-text { display: none; }
}

@media (max-width: 380px) {
  .search-box { min-width: 0; }
  .lang-btn { padding: 0 6px; font-size: 11.5px; }
}


/* ===========================================================
   [增量 2026-10-27] X/Twitter 推文卡片
   =========================================================== */

.card-tweet { cursor: pointer; }
.card-tweet .card-body { padding: 16px 18px 14px; }

.tweet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 4px 0 10px;
}

.tweet-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.tweet-idbox {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.tweet-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tweet-badge {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #1d9bf0;
  position: relative;
}
.tweet-badge::after {
  content: "";
  position: absolute;
  inset: 3px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9.6 15.9 5.7 12l-1.4 1.4 5.3 5.3 10-10L18.2 7.3z' fill='%23fff'/></svg>") center / contain no-repeat;
}

.tweet-handle {
  font-size: 12.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tweet-time {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.tweet-text {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.68;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tweet-text a {
  color: var(--brand);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.tweet-text a:hover { text-decoration: underline; }
.tweet-hashtag { color: var(--brand); font-weight: 600; }

.tweet-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tweet-media[data-count="1"] { grid-template-columns: 1fr; }
.tweet-media[data-count="3"] img:nth-child(1) { grid-column: 1 / -1; }
.tweet-media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.tweet-summary {
  margin: 0 0 10px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tweet-summary-tag {
  display: inline-block;
  margin-right: 7px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: rgba(59, 111, 245, .10);
  border-radius: 999px;
  vertical-align: 1px;
}
html[data-theme="dark"] .tweet-summary-tag { background: rgba(111, 150, 255, .16); }

.card-tweet .m.rt,
.card-tweet .m.reply,
.card-tweet .m.view { color: var(--text-3); }

@media (max-width: 560px) {
  .tweet-avatar { width: 36px; height: 36px; }
  .tweet-time { display: none; }
  .tweet-text { font-size: 13.5px; }
}

/* ===========================================================
   [增量 2026-10-27b] 移动端体验改造（参考 ahhhhhfs 移动端）
   核心思路：og 文本封面在窄屏与标题信息完全重复 → 隐藏封面改紧凑列表；
   Header 两行化；新增底部快捷导航；全站间距紧凑化。
   仅 ≤560px 生效，桌面端零改动。
   =========================================================== */
@media (max-width: 560px) {
  /* ---------- Header 两行化：品牌+语言+主题 / 搜索框独占整行 ---------- */
  .header-inner { flex-wrap: wrap; row-gap: 6px; padding: 6px 14px 8px; }
  .theme-toggle { width: 36px; height: 36px; }
  /* 工具区拆平（display:contents）后重排：第一行 品牌+语言+主题，第二行 搜索框独占整行，
     避免搜索框被挤出屏幕右侧 */
  .header-tools { display: contents; }
  .brand { order: 1; }
  .lang-switch { order: 2; margin-left: auto; }
  .theme-toggle { order: 3; }
  .search-box { order: 4; flex: 1 1 100%; min-width: 0; height: 38px; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .lang-btn { height: 30px; padding: 0 10px; font-size: 12.5px; }
  .brand-text em { display: none; }

  /* ---------- 图文分类卡片紧凑化 ---------- */
  /* 5 张卡装不进 362px → 横向滚动。左右内边距交给 .chips 自己（满宽滚动），
     这样首卡与容器左边距对齐、选中描边环不会被滚动容器裁掉一半 */
  .filter-inner { padding: 8px 0; }
  .chips { padding: 4px 14px; scroll-padding-left: 14px; }
  .sort-box { margin: 0 14px; }
  .chip-card { width: 134px; height: 72px; border-radius: 11px; gap: 5px; padding: 0 8px; }
  .cc-badge { font-size: 11px; padding: 3px 8px; }
  .cc-name { font-size: 13px; }
  .cc-icon { width: 48px; height: 48px; right: -7px; bottom: -9px; }
  /* 移动端 header 换行成两排、筛选栏也换行，吸顶高度算不准 → 都不吸顶，避免互相遮挡 */
  .filter-bar { position: static; }
  .section-head { position: static; background: none; padding: 4px 2px; }

  /* ---------- Hero 紧凑化 ---------- */
  .hero { padding: 26px 0 18px; }
  .hero-title { font-size: 25px; margin-bottom: 10px; }
  .stat-row { gap: 8px; margin-top: 16px; }
  .stat { flex: 1 1 40%; min-width: 0; padding: 9px 10px; border-radius: 12px; }
  .stat-num { font-size: 16px; }
  .stat-label { font-size: 11px; }

  /* ---------- 主区紧凑化 ---------- */
  .main-grid { padding-top: 12px; }
  .feed { gap: 10px; }
  .card { border-radius: 14px; }
  .card-body { padding: 13px 14px 12px; gap: 8px; }

  /* og 文本封面与标题信息重复且占两屏 → 窄屏隐藏，回归紧凑列表 */
  .card-media { display: none; }

  /* 来源在 meta 行已有，topline 只留分类药丸，去重复 */
  .card-topline .card-src { display: none; }

  /* tags 横向滑动，不换行不撑高 */
  .card-tags {
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin: 0 -14px; padding: 0 14px;
  }
  .card-tags::-webkit-scrollbar { display: none; }
  .tag { flex-shrink: 0; }

  .card-meta { gap: 10px; font-size: 12px; padding-top: 8px; }

  /* 骨架屏同步收紧 */
  .skeleton-grid { gap: 10px; }

  /* ---------- 底部快捷导航 ---------- */
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .bn-item {
    appearance: none; -webkit-appearance: none; margin: 0; border: 0;
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: transparent; cursor: pointer;
    font-family: inherit; font-size: 10.5px; font-weight: 600;
    color: var(--text-3); padding: 3px 0 2px;
    border-radius: 10px;
    transition: color .18s var(--ease);
  }
  .bn-item svg { width: 21px; height: 21px; }
  .bn-item.is-active { color: var(--brand); }
  .bn-item.is-active span { font-weight: 700; }
  .bn-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -1px; }

  /* 底部导航不遮挡加载更多 / 页脚 */
  .load-more-row { padding: 18px 0 8px; }
  .load-more-row .btn { width: 100%; }
  .site-footer { padding-bottom: 18px; }
  .archive-section { padding-bottom: 10px; }

  /* 详情页：og 文本封面在窄屏同样与标题重复 → 隐藏，紧凑进入正文 */
  .detail-cover { display: none; }
}
@media (min-width: 561px) {
  .bottom-nav { display: none; }
}

/* ============================================================
   学习资料页（resources.html）
   ============================================================ */
.res-hero { padding-bottom: 6px; }
.hero-sub {
  max-width: 760px; margin: 14px 0 0;
  color: var(--text-2); font-size: 15px; line-height: 1.65;
}

/* 拉新说明条 */
.res-lead {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 18px 0 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(59,111,245,.10), rgba(124,92,246,.10));
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: 14px;
}
.res-lead-ico { font-size: 18px; line-height: 1.4; flex-shrink: 0; }
.res-lead p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.res-lead strong { color: var(--text); font-weight: 700; }

/* 资料网格：auto-fill + minmax(0,1fr) 杜绝卡片把页面撑宽（同首页修复） */
.resource-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding: 22px 0 44px;
}
.resource-grid > * { min-width: 0; }

.res-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 2px 10px rgba(0,0,0,.08));
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.res-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md, 0 12px 28px rgba(0,0,0,.16)); border-color: var(--border-strong, var(--border)); }

.res-cover {
  position: relative; height: 116px;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--cc-base, #221d5c);
  background-image:
    radial-gradient(120% 110% at 10% -10%, var(--cc-ga, rgba(103,105,255,.60)) 0%, transparent 58%),
    radial-gradient(120% 120% at 96% 108%, var(--cc-gb, rgba(168,85,247,.42)) 0%, transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 1px, transparent 1px 10px),
    linear-gradient(155deg, var(--cc-base, #221d5c), var(--cc-base-2, #111233));
}
.res-emoji { font-size: 44px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.res-type-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 4px 9px; border-radius: 999px; color: #fff;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.res-type-badge.type-ori { background: rgba(34,211,238,.22); box-shadow: inset 0 0 0 1px rgba(34,211,238,.55); }
.res-type-badge.type-agg { background: rgba(251,191,36,.20); box-shadow: inset 0 0 0 1px rgba(251,191,36,.55); }

.res-body { display: flex; flex-direction: column; gap: 9px; padding: 16px 16px 18px; flex: 1; }
.res-title { margin: 0; font-size: 16.5px; font-weight: 700; color: var(--text); line-height: 1.35; }
.res-desc { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.res-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.res-tags .tag {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2, rgba(127,127,140,.12)); color: var(--text-2);
  border: 1px solid var(--border); white-space: nowrap;
}
.res-meta { font-size: 12px; color: var(--text-3); margin-top: auto; }

.res-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.quark-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13.5px; font-weight: 700; line-height: 1;
  padding: 9px 14px; border-radius: 10px; cursor: pointer; text-decoration: none;
  color: #fff; background: linear-gradient(135deg, #1c64f2, #2f80ed);
  box-shadow: 0 6px 14px rgba(28,100,242,.30);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease);
}
.quark-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(28,100,242,.36); filter: brightness(1.04); }
.quark-btn .q-ico { width: 16px; height: 16px; }
.quark-code-btn {
  font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  color: var(--text-2); background: var(--surface-2, rgba(127,127,140,.10));
  border: 1px dashed var(--border-strong, var(--border));
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.quark-code-btn:hover { color: var(--brand); border-color: var(--brand); }
.res-promo { font-size: 12.5px; font-weight: 600; color: #b45309; text-decoration: none; padding: 4px 2px; }
.res-promo:hover { text-decoration: underline; }
.res-source { font-size: 12.5px; color: var(--text-3); text-decoration: none; padding: 4px 2px; }
.res-source:hover { color: var(--brand); text-decoration: underline; }
.quark-pending { font-size: 12.5px; color: var(--text-3); font-style: italic; }

.resource-grid > .empty-state { color: var(--text-3); font-size: 14px; padding: 40px 0; text-align: center; grid-column: 1 / -1; }

@media (max-width: 560px) {
  .resource-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 0 32px; }
  .res-cover { height: 100px; }
  .res-emoji { font-size: 38px; }
  .res-lead { margin-top: 14px; padding: 12px 13px; }
  .res-lead p { font-size: 12.5px; }
  .hero-sub { font-size: 14px; }
  .res-title { font-size: 15.5px; }
  body.page-resources { padding-bottom: 0; }
}
