/* ==========================================================================
   flow.css — 首页 2.0（借鉴 aihot.news 的信息流式阅读界面）
   独立于 main.css 的 token 层，仅作用于 body.flow-page
   ========================================================================== */

body.flow-page {
  --f-bg: #faf9f6;
  --f-bg-sunk: #f3f3ef;
  --f-bg-muted: #e9ede9;
  --f-surface: #ffffff;
  --f-surface-2: #fdfdfb;
  --f-sidebar: #fdfdfb;
  --f-daybar: #f0f2ee;
  --f-ink: #202a30;
  --f-ink-2: #303c42;
  --f-ink-3: #59656b;
  --f-ink-4: #657176;
  --f-line: #dfe4e1;
  --f-line-strong: #d1d9d5;
  --f-line-soft: #e9ede9;
  --f-accent: #176b75;
  --f-accent-ink: #145f68;
  --f-accent-soft: rgba(23, 107, 117, 0.08);
  --f-accent-softer: rgba(23, 107, 117, 0.05);
  --f-hot: #b3402a;
  --f-hot-soft: rgba(179, 64, 42, 0.08);
  --f-amber: #b8873a;
  --f-amber-ink: #7c5a24;
  --f-amber-soft: rgba(184, 135, 58, 0.10);
  --f-ok: #2f7d5c;
  --f-ok-soft: rgba(47, 125, 92, 0.10);
  --f-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --f-shadow-card: 0 1px 2px rgba(32, 42, 48, 0.024);
  --f-shadow-hover: 0 3px 12px rgba(32, 42, 48, 0.055);
  --f-sbw: 184px;
  --f-barh: 48px;

  background: var(--f-bg);
  color: var(--f-ink);
  font-size: 14px;
  letter-spacing: 0;
  overflow-x: hidden;
}

/* 隐藏站内默认顶部导航（首页改用左侧固定侧栏） */
body.flow-page .site-header { display: none; }
body.flow-page main { padding-top: 0; }
body.flow-page .footer { margin-left: var(--f-sbw); }

/* ==========================================================================
   侧栏
   ========================================================================== */
.flow-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--f-sbw);
  display: flex;
  flex-direction: column;
  padding: 22px 10px 14px;
  background: var(--f-sidebar);
  border-right: 1px solid var(--f-line);
  overflow-y: auto;
  scrollbar-width: thin;
}

.flow-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px;
  margin-bottom: 18px;
  text-decoration: none;
  color: var(--f-ink);
}
.flow-brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 17px;
  border-radius: 8px;
  background: var(--f-accent-soft);
  flex-shrink: 0;
}
.flow-brand-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.flow-brand-name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.flow-brand-sub { font-size: 10.5px; color: var(--f-ink-4); margin-top: 2px; letter-spacing: 0.02em; }

.flow-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.flow-nav-group {
  padding: 12px 10px 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--f-ink-4);
}
.flow-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--f-ink-3);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 150ms, color 150ms;
}
.flow-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.flow-nav-item:hover { background: var(--f-bg-sunk); color: var(--f-ink); }
.flow-nav-item.active { background: var(--f-accent-soft); color: var(--f-accent); font-weight: 600; }
.flow-nav-item.active svg { stroke-width: 2; }

.flow-side-foot {
  margin-top: 14px;
  padding: 12px 10px 0;
  border-top: 1px solid var(--f-line-soft);
  font-size: 11px;
  color: var(--f-ink-4);
  line-height: 1.8;
}
.flow-side-foot b {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--f-ink-2);
  font-variant-numeric: tabular-nums;
}

/* 移动端抽屉 */
.flow-topbar-burger { display: none; }
.flow-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(32, 42, 48, 0.32);
  backdrop-filter: blur(2px);
}

/* ==========================================================================
   主区骨架
   ========================================================================== */
.flow-main { margin-left: var(--f-sbw); min-height: 100vh; }

.flow-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--f-barh);
  padding: 0 26px;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--f-line);
}
.flow-topbar h1 {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--f-ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.flow-topbar h1 em {
  font-style: normal;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--f-ink-4);
  letter-spacing: 0;
}
.flow-topbar-spacer { flex: 1; }

.flow-search {
  position: relative;
  width: 210px;
  flex-shrink: 0;
}
.flow-search input {
  width: 100%;
  height: 30px;
  padding: 0 10px 0 29px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--f-ink);
  background: var(--f-surface);
  border: 1px solid var(--f-line-strong);
  border-radius: 8px;
  outline: none;
  transition: border-color 150ms, background 150ms;
}
.flow-search input::placeholder { color: var(--f-ink-4); }
.flow-search input:focus { border-color: var(--f-line-strong); background: var(--f-surface); }
.flow-search svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--f-ink-4);
  pointer-events: none;
}

.flow-cols > * { min-width: 0; }

.flow-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 34px;
  max-width: 1280px;
  padding: 18px 28px 40px;
}

/* ==========================================================================
   筛选 chips
   ========================================================================== */
.flow-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.flow-chips::-webkit-scrollbar { display: none; }
.flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--f-line);
  background: var(--f-surface);
  color: var(--f-ink-3);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 150ms;
}
.flow-chip:hover { color: var(--f-accent); border-color: var(--f-line-strong); }
.flow-chip.on {
  background: var(--f-accent-soft);
  border-color: rgba(23, 107, 117, 0.22);
  color: var(--f-accent-ink);
  font-weight: 600;
}
.flow-chip b {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.flow-chipbar {
  position: sticky;
  top: var(--f-barh);
  z-index: 35;
  padding: 10px 0 8px;
  background: var(--f-bg);
}

/* ==========================================================================
   日期分组 + 时间轴列表
   ========================================================================== */
.flow-day { margin-bottom: 8px; }

.flow-daybar {
  position: sticky;
  top: calc(var(--f-barh) + 44px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0 7px;
  margin-bottom: 2px;
  background: var(--f-bg);
  font-size: 12.5px;
  color: var(--f-ink-3);
}
.flow-daybar::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--f-line);
}
.flow-daybar strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--f-ink);
  letter-spacing: -0.01em;
}
.flow-daybar .n {
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--f-accent);
  background: var(--f-accent-soft);
  border-radius: 999px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}

.flow-list { list-style: none; margin: 0; padding: 0; }

.flow-row {
  display: grid;
  grid-template-columns: 46px 22px minmax(0, 1fr);
  align-items: stretch;
}
.flow-row[hidden] { display: none; }

.flow-idx {
  padding-top: 17px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--f-ink-4);
  text-align: right;
  padding-right: 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.flow-axis { position: relative; }
.flow-axis .dot {
  position: absolute;
  left: 7px;
  top: 24px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--f-line-strong);
  box-shadow: 0 0 0 4px var(--f-bg);
  transition: transform 200ms, background 200ms;
}
.flow-row.is-new .flow-axis .dot { background: var(--f-accent); }
.flow-row:hover .flow-axis .dot { transform: scale(1.25); background: var(--f-accent); }
.flow-axis .line {
  position: absolute;
  left: 10px;
  top: 33px;
  bottom: -8px;
  width: 1px;
  background: var(--f-line);
}
.flow-row:last-child .flow-axis .line { display: none; }

.flow-card {
  position: relative;
  min-width: 0;
  margin-bottom: 9px;
  padding: 14px 18px 14px;
  background: var(--f-surface);
  border: 1px solid var(--f-line);
  border-radius: 12px;
  box-shadow: var(--f-shadow-card);
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.flow-card:hover {
  border-color: var(--f-line-strong);
  box-shadow: var(--f-hover-shadow, var(--f-shadow-hover));
}

.flow-head {
  display: flex;
  min-width: 0;
  overflow: hidden;
  align-items: center;
  gap: 7px;
  min-height: 18px;
  font-size: 12px;
  line-height: 18px;
  color: var(--f-ink-4);
}
.flow-src {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}
.flow-head .sep { color: var(--f-line-strong); }
.flow-head .flow-src + .sep + .flow-src { color: var(--f-ink-3); }
.flow-head .ml { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  flex-shrink: 0;
}
.flow-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.flow-pill-pick { background: var(--f-amber-soft); color: var(--f-amber-ink); }
.flow-pill-kind { background: var(--f-accent-soft); color: var(--f-accent-ink); }
.flow-pill-free { background: var(--f-ok-soft); color: var(--f-ok); }
.flow-pill-hot { background: var(--f-hot-soft); color: var(--f-hot); }

.flow-num {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--f-line);
  color: var(--f-ink-4);
  font-size: 11px;
  font-family: var(--f-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.flow-num i { font-style: normal; opacity: 0.65; font-family: var(--f-sans, inherit); font-weight: 500; }

.flow-title {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.52;
  letter-spacing: -0.011em;
  color: var(--f-ink);
}
.flow-title a { color: inherit; text-decoration: none; }
.flow-title a:hover { color: var(--f-accent); }
.flow-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }

.flow-excerpt {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--f-ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flow-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}
.flow-tag {
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--f-bg-sunk);
  color: var(--f-ink-3);
  white-space: nowrap;
}
.flow-tag.k { background: var(--f-accent-softer); color: var(--f-accent-ink); }

/* 高亮 / 收藏按钮 */
.flow-act {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--f-ink-4);
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms, background 150ms, color 150ms;
}
.flow-card:hover .flow-act { opacity: 1; }
.flow-act:hover { background: var(--f-bg-sunk); color: var(--f-ink-2); }
.flow-act.on { color: var(--f-accent); opacity: 1; }

/* 空态 */
.flow-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--f-ink-4);
  font-size: 13.5px;
}
.flow-empty[hidden] { display: none; }

.flow-more {
  display: flex;
  justify-content: center;
  padding: 14px 0 0;
}
.flow-more a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--f-line);
  background: var(--f-surface);
  color: var(--f-ink-3);
  font-size: 12.5px;
  text-decoration: none;
  transition: all 150ms;
}
.flow-more a:hover { color: var(--f-accent); border-color: var(--f-line-strong); box-shadow: var(--f-shadow-card); }

/* ==========================================================================
   右栏
   ========================================================================== */
.flow-rail {
  position: sticky;
  top: calc(var(--f-barh) + 14px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

.rail-card {
  background: var(--f-surface);
  border: 1px solid var(--f-line);
  border-radius: 12px;
  box-shadow: var(--f-shadow-card);
  overflow: hidden;
}
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px 8px;
}
.rail-head h2 {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--f-ink-2);
}
.rail-head a {
  font-size: 11.5px;
  color: var(--f-ink-4);
  text-decoration: none;
}
.rail-head a:hover { color: var(--f-accent); }
.rail-body { padding: 0 8px 9px; }

.rail-rank { display: flex; flex-direction: column; }
.rail-rank-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 5px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--f-ink-2);
  font-size: 12.5px;
  transition: background 150ms;
}
.rail-rank-item:hover { background: var(--f-bg-sunk); }
.rail-rank-n {
  width: 15px;
  flex-shrink: 0;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--f-ink-4);
  font-variant-numeric: tabular-nums;
}
.rail-rank-item:nth-child(1) .rail-rank-n { color: #b3402a; }
.rail-rank-item:nth-child(2) .rail-rank-n { color: #a3642f; }
.rail-rank-item:nth-child(3) .rail-rank-n { color: #96702e; }
.rail-rank-logo {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  flex-shrink: 0;
}
.rail-rank-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.rail-rank-score {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--f-ink-4);
  font-variant-numeric: tabular-nums;
}

.rail-stats { display: flex; flex-direction: column; gap: 1px; }
.rail-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 5px;
  font-size: 12.5px;
  color: var(--f-ink-3);
  text-decoration: none;
  border-radius: 7px;
}
.rail-stat:hover { background: var(--f-bg-sunk); color: var(--f-ink); }
.rail-stat b {
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--f-ink);
  font-variant-numeric: tabular-nums;
}

.rail-about {
  margin: 0;
  padding: 0 5px 8px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--f-ink-3);
}
.rail-dot { margin: 0 6px; color: var(--f-line-strong); }

.rail-note {
  padding: 11px 13px 12px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--f-ink-4);
  border-top: 1px solid var(--f-line-soft);
}
.rail-note a { color: var(--f-accent-ink); text-decoration: none; }

/* ==========================================================================
   页脚适配
   ========================================================================== */
body.flow-page .footer {
  margin-left: var(--f-sbw);
  background: var(--f-bg-sunk);
  border-top: 1px solid var(--f-line);
}
body.flow-page .footer-column h4,
body.flow-page .footer-logo { color: var(--f-ink); }
body.flow-page .footer-desc,
body.flow-page .footer-column a { color: var(--f-ink-3); }
body.flow-page .footer-column a:hover { color: var(--f-accent); }
body.flow-page .footer-copyright,
body.flow-page .footer-meta { color: var(--f-ink-4); }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1180px) {
  .flow-cols { grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; padding: 16px 20px 36px; }
  .flow-topbar { padding: 0 20px; }
}

@media (max-width: 1024px) {
  body.flow-page { --f-sbw: 0px; }
  .flow-cols { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 14px 18px 32px; }
  .flow-rail { position: static; padding-top: 0; }
  .flow-main { margin-left: 0; }
  body.flow-page .footer { margin-left: 0; }

  /* 侧栏 → 抽屉 */
  .flow-sidebar {
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 12px 32px rgba(28, 39, 51, 0.12);
    width: 232px;
  }
  body.nav-open .flow-sidebar { transform: translateX(0); }
  body.nav-open .flow-scrim { display: block; }
  .flow-topbar-burger {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-right: -4px;
    border: 1px solid var(--f-line);
    border-radius: 8px;
    background: var(--f-surface);
    color: var(--f-ink-2);
    cursor: pointer;
    flex-shrink: 0;
  }
  .flow-search { width: 150px; }
}

@media (max-width: 720px) {
  .flow-topbar { gap: 10px; padding: 0 14px; }
  .flow-topbar h1 { font-size: 13.5px; }
  .flow-topbar h1 em { display: none; }
  .flow-search { width: 122px; }
  .flow-cols { padding: 12px 14px 28px; }
  .flow-row { grid-template-columns: 18px minmax(0, 1fr); }
  .flow-idx { display: none; }
  .flow-axis .dot { left: 4px; top: 20px; width: 6px; height: 6px; }
  .flow-axis .line { left: 6.5px; top: 28px; }
  .flow-card { padding: 12px 13px; border-radius: 11px; }
  .flow-act { opacity: 1; right: 6px; bottom: 6px; }
  .flow-title { font-size: 15px; }
  .flow-excerpt { font-size: 12.5px; -webkit-line-clamp: 3; }
  .flow-daybar { top: calc(var(--f-barh) + 42px); }
}
