:root {
  color-scheme: light;
  /* 石墨主题：中性 zinc 灰阶为底，深石墨文字，一抹克制的蓝色强调 */
  --bg-page: #f4f4f5;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-bar: #ffffff;
  --surface-mute: #e8e8ea;
  --surface-mute-2: #d9d9dc;
  --border: #e4e4e7;
  --border-soft: #ececee;
  --border-strong: #d4d4d8;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --ink-3: #71717a;
  --ink-4: #a1a1aa;
  /* 蓝色强调 */
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-soft-strong: #bfdbfe;
  --accent-line: #93c5fd;
  --accent-ink: #1e3a8a;
  --shadow: 0 18px 54px -36px rgba(24, 24, 27, 0.18);
  /* One typeface across the whole site: Fraunces (soft display serif w/ optical
     sizing + true italics). --mono aliases to the same family. CJK serif fallback.
     Keep ALL UI text on var(--sans)/var(--mono); do not introduce others. Hierarchy
     comes from weight (400→700), optical size, and tasteful italics. */
  --sans: "Fraunces", Georgia, "Times New Roman", "Songti SC", "宋体", serif;
  --mono: var(--sans);
}

/* Aster's single palette: cosmic glass on a starfield. Surfaces are translucent
   so the stars show through; blur on the big panels gives spatial depth. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #0a0b12;
  --bg: #0a0b12;
  --surface: rgba(26, 29, 42, 0.64);
  --surface-bar: rgba(26, 29, 42, 0.55);
  --surface-mute: rgba(255, 255, 255, 0.07);
  --surface-mute-2: rgba(255, 255, 255, 0.13);
  --border: rgba(255, 255, 255, 0.10);
  --border-soft: rgba(255, 255, 255, 0.055);
  --border-strong: rgba(255, 255, 255, 0.18);
  --ink: #f4f6fb;
  --ink-2: #d4d9e6;
  --ink-3: #9aa1b4;
  --ink-4: #6b7384;
  --accent: #8ea2ff;            /* starlight periwinkle */
  --accent-strong: #aab8ff;
  --accent-soft: rgba(142, 162, 255, 0.16);
  --accent-soft-strong: rgba(142, 162, 255, 0.26);
  --accent-line: rgba(142, 162, 255, 0.5);
  --accent-ink: #cdd6ff;
  --shadow: 0 30px 90px -50px rgba(0, 0, 0, 0.85);
}

* {
  box-sizing: border-box;
}

/* 全站取消斜体（em / i / address 等），统一正常体 */
em,
i,
address,
cite,
dfn,
var {
  font-style: normal;
}

/*
 * 滚动布局约束：.canvas 是唯一的滚动容器。
 * 所有上级元素必须用 height:100% + overflow:hidden，
 * 而非 min-height:100vh + overflow-y:auto。
 * 请勿在此链（html → body → .stage → .window → .body）上
 * 添加 overflow-y:auto 或 min-height:100vh，否则 canvas 无法滚动。
 */
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  overflow: hidden;
  padding: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 640px at 50% -14%, rgba(86, 96, 150, 0.30), transparent 60%),
    radial-gradient(860px 540px at 86% 2%, rgba(170, 178, 206, 0.10), transparent 55%),
    linear-gradient(180deg, #0a0b12 0%, #0a0b14 60%, #07070d 100%);
  font-family: var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* Content sits above the fixed starfield (body::before/::after) */
#app { position: relative; z-index: 1; }

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.stage {
  display: flex;
  width: 100%;
  height: 100vh; /* 不依赖 #app 父链，直接锁定视口高度 */
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 0;
}

.window {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.site-head {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 14px;
  padding: 10px 40px;
  background: rgba(10, 11, 18, 0.55);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--border-soft);
}

/* logo 固定宽度，不被工具区挤压 */
.site-head .site-title {
  width: auto;
  flex: 0 0 auto;
}

.site-title {
  display: flex;
  width: auto;
  align-items: center;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 22px;
  font-weight: 620;
  letter-spacing: 0;
}

.site-title .site-logo {
  display: block;
  width: auto;
  height: 26px;
  color: var(--ink);
}

.title-add {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--ink-3);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 19px;
  line-height: 1;
}

.title-add:hover,
.channel-add:hover,
.add-tab:hover,
.back-btn:hover,
.crumb-link:hover,
.btn-ghost:hover {
  color: var(--ink);
  background: var(--surface-mute);
}

.body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  background: transparent; /* let the body starfield show through the product */
  border: 0;
  border-radius: 0;
}

.header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 40px 14px;
}

.crumbs {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
  color: var(--ink-3);
  font-size: 14px;
}

.crumb-link,
.crumb-current {
  min-width: 0;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.crumb-link {
  color: var(--ink-3);
  background: transparent;
  border: 0;
}

.crumb-current {
  overflow: hidden;
  color: var(--ink);
  font-weight: 560;
  text-overflow: ellipsis;
}

.crumb-sep {
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 12px;
}

.header-search {
  display: flex;
  width: 205px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: var(--ink-3);
  background: var(--surface-mute);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition: width 220ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.header-search:focus-within {
  width: 280px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(125, 150, 80, 0.18);
}

.search {
  width: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}

.channel-add {
  min-height: 32px;
  padding: 6px 10px;
  color: var(--ink-3);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 560;
}

.add-tab,
.back-btn {
  min-height: 32px;
  padding: 6px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 560;
}

.back-btn {
  color: var(--ink-2);
}

.canvas {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 40px 54px;
  overscroll-behavior: contain;
}

.canvas-label {
  padding: 12px 4px 14px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.list {
  display: flex;
  flex-direction: column;
}

/* 首页：一摞「书架」—— 居中单列、玻璃质感、逐行浮入，读起来像个人收藏夹 */
/* High specificity to beat the generic `.canvas > :not(.brand-backdrop)` max-width */
.canvas .bars.focus-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
  padding-bottom: 40px;
}

/* Align the CHANNELS label with the centered bars column */
.canvas > .canvas-label:has(+ .bars) {
  max-width: 600px;
  width: 100%;
  margin-inline: auto;
}

/* 未登录：极简营销落地页 + 登录模态 overlay */
.login-stage {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg-page) 62%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: login-fade 180ms ease;
}
@keyframes login-fade { from { opacity: 0; } to { opacity: 1; } }

.login-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.login-close:hover { background: var(--surface-mute); color: var(--ink-2); }

.login-card {
  position: relative;
  display: flex;
  width: min(360px, 100%);
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 32px 32px;
  background: rgba(18, 20, 30, 0.9);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: login-pop 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes login-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .login-stage, .login-card { animation: none; }
}

.login-logo {
  width: auto;
  height: 40px;
  color: var(--ink);
}

.login-sub {
  margin: 0 0 8px;
  color: var(--ink-3);
  font-size: 14px;
}

/* Sign In | Sign Up 分段切换 */
.login-tabs {
  display: flex;
  width: 100%;
  padding: 3px;
  gap: 3px;
  background: var(--surface-mute);
  border-radius: 8px;
}

.login-tab {
  flex: 1;
  padding: 7px 0;
  font-size: 13.5px;
  font-weight: 540;
  color: var(--ink-3);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.login-tab.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.login-tab:not(.active):hover {
  color: var(--ink-2);
}

.login-google {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 540;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.login-google:hover {
  background: var(--surface-mute);
}

.login-google:disabled {
  opacity: 0.6;
  cursor: default;
}

.login-msg {
  margin: 0;
  color: var(--ink-3);
  font-size: 12.5px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--ink-4);
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.login-email-form,
.login-otp-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.login-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 140ms ease;
}
.login-input:focus {
  border-color: var(--accent);
}
.login-input::placeholder {
  color: var(--ink-4);
}

.login-otp-input {
  text-align: center;
  letter-spacing: 0.25em;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  padding: 12px;
}

.login-send {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 540;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 160ms ease;
}
.login-send:hover { opacity: 0.88; }
.login-send:disabled { opacity: 0.5; cursor: default; }

.login-otp-hint {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.login-otp-hint strong {
  color: var(--ink);
}

.login-back {
  background: none;
  border: none;
  padding: 0;
  font-size: 12.5px;
  color: var(--ink-4);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-back:hover { color: var(--ink-3); }

.login-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.login-foot-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--ink-4);
  cursor: pointer;
}
.login-foot-btn:hover { color: var(--ink-2); }

.login-foot-sep {
  color: var(--ink-4);
  font-size: 12px;
}

/* 头部账号头像 */
.account-chip {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  color: var(--ink-2);
  background: var(--surface-mute);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 640;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.account-chip:hover {
  border-color: var(--border-strong);
  box-shadow: 0 1px 4px rgba(24, 24, 27, 0.1);
}

.account-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 新建频道幽灵卡片 */
.bar-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  color: var(--ink-4);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.bar-ghost:hover {
  color: var(--ink);
  background: var(--surface-mute);
  border-color: var(--accent-line);
}

.list {
  gap: 2px;
}

.bar {
  display: grid;
  height: 100%;
  min-height: 74px;
  width: 100%;
  align-items: center;
  grid-template-columns: 44px 1fr auto;
  column-gap: 16px;
  padding: 14px 16px 14px 16px;
  text-align: left;
  background: var(--surface-bar);
  backdrop-filter: blur(12px) saturate(115%);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1), background 200ms ease, border-color 180ms ease, box-shadow 240ms ease, opacity 240ms ease, filter 240ms ease;
}

.bar:hover {
  z-index: 2;
  transform: translateY(-1px);
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: 0 14px 38px -16px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(142, 162, 255, 0.10);
}
.bar:active { transform: scale(0.985); }

/* Star-recede: the tapped shelf shrinks, drifts back and dissolves into the field */
.bar-outer.receding,
.subject-tile.receding {
  animation: star-recede 420ms cubic-bezier(0.55, 0, 0.7, 0.2) forwards;
  transform-origin: center;
  pointer-events: none;
}
@keyframes star-recede {
  0%   { transform: scale(1) translateY(0); opacity: 1; filter: blur(0); }
  55%  { transform: scale(0.72) translateY(-10px); opacity: 0.5; filter: blur(1px); }
  100% { transform: scale(0.42) translateY(-22px); opacity: 0; filter: blur(4px); }
}

/* Shelves settle in with one quick, uniform fade (no per-row stagger — that
   compounded with the recede + canvas crossfade and read as jank). */
.bars .bar-outer, .bars .bar-ghost, .bars .bar-divider {
  animation: shelf-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes shelf-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Divider between Global and Chinese platform groups */
.bar-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 4px 2px;
  color: var(--ink-4);
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.bar-divider::before, .bar-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

/* ── Creator tags ────────────────────────────────────────────────────────── */
.name-tags-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 1px;
}

.name-tags-row .tag-list {
  margin-top: 0;
}

.creator-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0.3px;
  white-space: nowrap;
  line-height: 1.6;
  pointer-events: none; /* row <a> handles the click */
}

/* Tag editor sheet — editable tags */
.tag-editor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 6px 0 4px;
}

.creator-tag.editable {
  pointer-events: auto;
  padding: 2px 4px 2px 9px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
}

.tag-text {
  color: var(--ink-2);
  font-size: 12px;
}

.tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.tag-remove:hover { background: rgba(255, 255, 255, 0.12); color: var(--ink); }

.tag-new-input {
  flex: 1;
  min-width: 120px;
  padding: 4px 6px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
}
.tag-new-input::placeholder { color: var(--ink-4); }
.tag-new-input:focus { border-bottom-color: var(--ink-3); }

/* Avatar editor */
.avatar-editor-preview {
  display: flex;
  justify-content: center;
  padding: 4px 0 8px;
}

.avatar-upload-label {
  display: flex;
  cursor: pointer;
}

.avatar-upload-btn {
  width: 100%;
  text-align: center;
}

.avatar-url-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* "Last post N ago" — shown on a creator row's trailing edge */
.row-age {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--ink-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .bar-outer.receding, .subject-tile.receding { animation: none; opacity: 0; }
  .bars .bar-outer, .bars .bar-ghost, .bars .bar-divider { animation: none; }
}

.bar-chip,
.banner-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.bar-chip {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.bar .bar-chip svg,
.bar .logo-img {
  width: 22px;
  height: 22px;
}

.bar-chip.small {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.bar-chip svg,
.banner-chip svg,
.logo-img {
  width: 34px;
  height: 34px;
}

.logo-img {
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand-backdrop {
  position: absolute;
  top: 4px;
  right: -9%;
  z-index: 0;
  width: min(820px, 76vw);
  height: min(620px, 78vh);
  pointer-events: none;
}

.brand-backdrop::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  /* a soft channel-coloured nebula in the corner — no logo silhouette */
  background: radial-gradient(closest-side at 72% 42%, var(--brand-color), transparent 70%);
  opacity: 0.16;
  filter: blur(50px);
}

.canvas > :not(.brand-backdrop) {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
}

.creator-add-tab {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: 78px;
  align-items: center;
  gap: 16px;
  margin: 4px 0 22px;
  padding: 18px;
  color: var(--ink);
  text-align: left;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.creator-add-tab:hover {
  background: var(--surface-mute);
  border-color: var(--ink-3);
  transform: translateY(-1px);
}

.creator-add-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--ink);
  background: var(--surface-mute);
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}

.creator-add-tab span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.creator-add-tab strong {
  font-size: 16px;
  font-weight: 620;
}

.creator-add-tab em {
  color: var(--ink-3);
  font-size: 13px;
  font-style: normal;
}

.bar-name-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.bar-name {
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.bar-domain,
.bar-stat em,
.banner-stat em,
.bar-recent em,
.row-body em,
.row-time,
.row-trail small {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
}

.bar-stat,
.banner-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-stat strong,
.banner-stat strong {
  color: var(--ink);
  font-size: 28px;
  font-weight: 450;
  line-height: 1;
}

.bar-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.avatar-stack {
  display: flex;
  min-height: 28px;
  align-items: center;
}

.banner,
.author-banner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 12px 0 24px;
  padding: 28px 14px 26px;
  border-bottom: 1px solid var(--border-soft);
}

.banner-chip {
  width: 68px;
  height: 68px;
  border-radius: 14px;
}

.banner-text {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.banner-text strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 28px;
  font-weight: 560;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-domain-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.banner-domain-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink-3);
  opacity: 0.9;
}

.author-row,
.item-row,
.creator-editing {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  padding: 16px 14px;
  color: inherit;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 10px;
  transition: background 180ms ease, transform 180ms ease, opacity 240ms ease, filter 240ms ease, box-shadow 180ms ease;
}

.author-row:hover,
.item-row:hover {
  background: var(--surface-mute);
  transform: scale(1.005);
}
.author-row:active,
.item-row:active { transform: scale(0.99); }

/* Creator rows twinkle when tapped (they open an external link in a new tab) */
.author-row.twinkle, .item-row.twinkle {
  animation: row-twinkle 460ms ease;
}
@keyframes row-twinkle {
  0%   { background: var(--surface-mute); }
  30%  { background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-line), 0 0 22px -4px var(--accent); }
  100% { background: transparent; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .author-row.twinkle, .item-row.twinkle { animation: none; }
}

.focus-group:has(.focus-item:hover) .focus-item:not(:hover) {
  opacity: 0.48;
  filter: saturate(0.55);
}

.avatar {
  display: inline-flex;
  width: var(--avatar-size);
  height: var(--avatar-size);
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  color: #334155;
  background: #dfe7ef;
  border-radius: 50%;
  font-size: calc(var(--avatar-size) * 0.42);
  font-weight: 680;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.row-body strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 560;
  line-height: 1.38;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 名字 hover 暗示可编辑（hover 行时右侧 ✎ 同步出现） */
.author-row:hover .row-body strong {
  width: fit-content;
  max-width: 100%;
  text-decoration: underline dashed var(--ink-4);
  text-underline-offset: 4px;
}

/* 编辑态：名字 + 备注 双输入纵排 */
.row-body.editing-fields {
  gap: 6px;
}

.editing-fields .inline-edit {
  width: 100%;
}

.editing-fields .edit-name {
  color: var(--ink);
  font-size: 15px;
  font-weight: 560;
}

.editing-fields .edit-url {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.5px;
}

.row-body small {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-trail {
  display: flex;
  min-width: 92px;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  transition: opacity 160ms ease;
}

.row-trail strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 560;
}

.row-trail em {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.row-time {
  margin-left: auto;
  white-space: nowrap;
}

.row-action {
  min-height: 30px;
  padding: 5px 9px;
  color: var(--ink-3);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
}

.row-action:hover {
  color: var(--ink);
  background: var(--surface-mute-2);
}

/* Inline description / note editing */
.desc-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}

.desc-text {
  color: var(--ink-3);
  font-size: 13px;
  font-style: normal;
}

.desc-edit-btn {
  padding: 1px 6px;
  color: var(--ink-4);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 160ms ease, color 120ms ease, background 120ms ease;
}

.author-banner:hover .desc-edit-btn,
.desc-line:hover .desc-edit-btn {
  opacity: 1;
}

.desc-edit-btn:hover {
  color: var(--ink);
  background: var(--surface-mute);
}

.inline-edit {
  width: 100%;
  max-width: 440px;
  padding: 5px 9px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: 0;
  font-family: var(--sans);
  font-size: 13px;
}

.inline-edit:focus {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.item-row.editing {
  background: var(--surface-mute);
}

/* 右键上下文菜单 */
.ctx-menu {
  position: fixed;
  z-index: 50;
  min-width: 184px;
  padding: 6px;
  background: rgba(18, 20, 30, 0.82);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 54px -18px rgba(0, 0, 0, 0.7);
  animation: ctx-pop 120ms ease;
}

@keyframes ctx-pop {
  from { opacity: 0; transform: scale(0.96) translateY(-2px); }
  to { opacity: 1; transform: none; }
}

@keyframes sheet-wrap-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-slide-in {
  from { opacity: 0; transform: translateY(22px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ctx-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  text-align: left;
}

.ctx-item:hover {
  background: var(--surface-mute);
}

.ctx-item.danger {
  color: #dc2626;
}

.ctx-item.danger:hover {
  background: #fee2e2;
}

.ctx-label {
  padding: 9px 10px 4px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.ctx-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 3px;
}

.empty {
  padding: 72px 0;
  color: var(--ink-3);
  font-size: 14px;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46vh;
  padding: 64px 24px;
  color: var(--ink-3);
  text-align: center;
}

.empty-heading {
  max-width: 30ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.empty-sub {
  max-width: 40ch;
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.5;
}

/* Channel bar wrapper */
.bar-outer {
  display: flex;
  position: relative;
  align-items: center;
  width: 100%;
}

.bar-outer .bar {
  flex: 1;
  min-width: 0;
}

/* Creator row wrapper */
.row-outer {
  display: flex;
  position: relative;
  align-items: center;
}

.row-outer .author-row {
  flex: 1;
  min-width: 0;
}

.creator-draggable {
  cursor: grab;
  transition: opacity 140ms ease;
}

.creator-draggable:active {
  cursor: grabbing;
}

.creator-draggable.is-dragging {
  z-index: 3;
  opacity: 0.42;
}

.link-draggable {
  cursor: grab;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease;
}

.link-draggable:active {
  cursor: grabbing;
}

.link-draggable.is-dragging {
  opacity: 0.32;
  transform: scale(0.985);
}

/* 博主行右侧工具：备注 ✎ + 删除，hover 显现 */
.row-tools {
  position: absolute;
  right: 12px;
  z-index: 2;            /* above .author-row (z-index:1) so its <a> doesn't swallow clicks */
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.row-outer:hover > .row-tools,
.row-tools:focus-within {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.row-outer:hover .row-trail,
.row-tools:focus-within ~ .author-row .row-trail {
  opacity: 0;
  pointer-events: none;
}

.row-tool-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  color: var(--ink-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.row-tool-btn:hover {
  color: var(--ink);
  background: var(--surface-mute);
  border-color: var(--border-strong);
}

.row-tool-btn.danger:hover {
  color: #dc2626;
  background: #fee2e2;
  border-color: #f3b4b4;
}

/* 删除区：拖拽时浮现的低调星域边界 */
.drag-delete-zone {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  min-height: 96px;
  place-items: center;
  color: rgba(244, 246, 251, 0.58);
  background:
    radial-gradient(560px 120px at 50% 118%, rgba(142, 162, 255, 0.16), transparent 74%),
    linear-gradient(180deg, rgba(10, 11, 18, 0), rgba(7, 8, 14, 0.78) 42%, rgba(3, 4, 10, 0.96));
  border: 0;
  border-top: 1px solid rgba(142, 162, 255, 0.10);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), color 160ms ease, border-color 160ms ease, box-shadow 180ms ease, letter-spacing 180ms ease;
}

.drag-delete-zone::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -1px;
  width: min(620px, 78vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(142, 162, 255, 0.18), rgba(244, 246, 251, 0.5), rgba(142, 162, 255, 0.18), transparent);
  transform: translateX(-50%);
  opacity: 0.56;
  transition: opacity 180ms ease, width 180ms ease;
}

body.dragging-active .drag-delete-zone {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.drag-delete-zone.active {
  color: rgba(244, 246, 251, 0.9);
  border-top-color: rgba(142, 162, 255, 0.24);
  letter-spacing: 2px;
  box-shadow: inset 0 22px 60px -40px rgba(142, 162, 255, 0.58), 0 -22px 70px -60px rgba(142, 162, 255, 0.9);
}

.drag-delete-zone.active::after {
  width: min(760px, 86vw);
  opacity: 0.92;
}

/* 拖入删除区时，被拖的卡片明显缩小，提示已进入删除区 */
body.over-delete .creator-draggable.is-dragging,
body.over-delete .channel-draggable.is-dragging,
body.over-delete .link-draggable.is-dragging {
  opacity: 0.34;
}

/* Channel bar drag reorder */
.channel-draggable {
  cursor: grab;
  transition: opacity 140ms ease;
}

.channel-draggable:active {
  cursor: grabbing;
}

.channel-draggable.is-dragging .bar {
  opacity: 0.56;
  transform: translateY(-2px) scale(1.006);
  border-color: rgba(142, 162, 255, 0.26);
  box-shadow: 0 18px 48px -28px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(142, 162, 255, 0.12);
}

.channel-draggable.is-dragging {
  will-change: transform;
}

.channel-draggable.drag-over-channel .bar,
.creator-draggable.drag-over .author-row {
  background: rgba(26, 29, 42, 0.72);
  border-color: rgba(142, 162, 255, 0.20);
}

.channel-draggable.drag-over-channel.drop-before .bar {
  box-shadow: inset 0 1px 0 rgba(244, 246, 251, 0.42), 0 -14px 28px -28px rgba(142, 162, 255, 0.86);
}

.channel-draggable.drag-over-channel.drop-after .bar {
  box-shadow: inset 0 -1px 0 rgba(244, 246, 251, 0.42), 0 14px 28px -28px rgba(142, 162, 255, 0.86);
}

.creator-draggable.drag-over.drop-before .author-row {
  box-shadow: inset 0 1px 0 rgba(244, 246, 251, 0.34), 0 -12px 24px -26px rgba(142, 162, 255, 0.78);
}

.creator-draggable.drag-over.drop-after .author-row {
  box-shadow: inset 0 -1px 0 rgba(244, 246, 251, 0.34), 0 12px 24px -26px rgba(142, 162, 255, 0.78);
}

/* Context-aware single add button in header */
.ctx-add-btn {
  min-height: 32px;
  padding: 6px 14px;
  color: var(--surface); /* opposite of --ink → readable in light AND dark */
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: background 160ms ease;
}

.ctx-add-btn:hover {
  background: var(--ink-2);
}

.sheet-wrap {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 86px;
  background: rgba(15, 15, 20, 0.28);
  backdrop-filter: blur(8px) saturate(120%);
  animation: sheet-wrap-in 180ms ease;
}

.sheet {
  display: flex;
  width: min(540px, calc(100% - 48px));
  max-height: calc(100% - 70px);
  overflow: auto;
  flex-direction: column;
  gap: 14px;
  padding: 28px 30px 22px;
  background: rgba(18, 20, 30, 0.88);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.85);
  animation: sheet-slide-in 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sheet.url-tab {
  width: min(520px, calc(100% - 48px));
  gap: 12px;
  padding: 18px 20px 16px;
}

.sheet.compact {
  width: min(420px, calc(100% - 48px));
}

.sheet-label {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2.5px;
}

.sheet-input {
  padding: 10px 0 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  outline: 0;
  font-family: var(--mono);
  font-size: 14px;
}

.url-tab-status {
  min-height: 18px;
  color: var(--ink-3);
  font-size: 12px;
}

.sheet-preview {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

.sheet-actions,
.sheet-card,
.sheet-foot {
  display: flex;
  align-items: center;
}

.sheet-actions {
  gap: 12px;
  color: var(--ink-3);
  font-size: 13px;
}

.sheet-card {
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--surface); /* not hardcoded #fff — must flip in dark mode */
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: 0;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.sheet-foot {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.sheet-foot.minimal {
  margin-top: 0;
  padding-top: 4px;
  border-top: 0;
}

.sheet-btn {
  padding: 8px 20px;
  border: 0;
  border-radius: 7px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  color: var(--surface);
  background: var(--ink);
  transition: opacity 120ms;
}
.sheet-btn:hover { opacity: 0.82; }
.sheet-btn.secondary {
  color: var(--ink-3);
  background: rgba(255, 255, 255, 0.07);
}

.btn-ghost,
.btn-solid {
  padding: 8px 18px;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 560;
}

.btn-ghost {
  color: var(--ink-3);
  background: transparent;
}

.btn-solid {
  color: var(--surface); /* opposite of --ink → readable in light AND dark */
  background: var(--ink);
}

.btn-solid.avocado {
  color: #ffffff;
  background: var(--accent);
}

.btn-solid.avocado:hover {
  background: var(--accent-strong);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

@media (max-width: 860px) {
  .site-head {
    padding: 0 16px;
  }

  .header {
    align-items: stretch;
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .crumbs {
    flex-basis: 100%;
  }

  .header-search {
    width: auto;
    flex: 1;
  }

  .header-search:focus-within {
    width: auto;
  }

  .canvas {
    padding: 6px 16px 28px;
  }

  .bar {
    height: auto;
    min-height: 88px;
    grid-template-columns: 44px 1fr 20px;
    column-gap: 14px;
    padding: 16px;
  }

  .bar-chip {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .bar-stat,
  .bar-recent {
    display: none;
  }

  .banner,
  .author-banner {
    padding-inline: 0;
  }

  .item-row {
    flex-wrap: wrap;
    gap: 12px;
  }

  .row-time {
    margin-left: 0;
  }

}

/* 搜索结果转场：仅内容区 .canvas 参与交叉淡化，头部/搜索框瞬时切换保持静止 */
html.vt-search .canvas {
  view-transition-name: search-canvas;
}

html.vt-search::view-transition-old(root),
html.vt-search::view-transition-new(root) {
  animation: none;
}

::view-transition-old(search-canvas) {
  animation: vt-canvas-out 150ms ease both;
}

::view-transition-new(search-canvas) {
  animation: vt-canvas-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes vt-canvas-out {
  to { opacity: 0; }
}

@keyframes vt-canvas-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html.vt-search .canvas { view-transition-name: none; }
}

/* ─── Hall / Discover ───────────────────────────────────────────────────────── */

.hall-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 540;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.hall-btn:hover { background: var(--surface-mute); color: var(--ink); }
.hall-btn.active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.hall-btn svg { display: block; }

.hall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding-bottom: 32px;
}

.hall-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}
.hall-card {
  backdrop-filter: blur(12px) saturate(115%);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
}
.hall-card:hover { border-color: var(--border-strong); background: var(--surface-bar); transform: translateY(-1px); }
.hall-card:active { transform: scale(0.99); }

.hall-card-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}
.hall-card-body strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hall-card-body em { color: var(--ink-3); font-size: 12.5px; }

.hall-banner { justify-content: flex-start; }
.subscribe-all-btn { flex: 0 0 auto; margin-left: auto; }

.hall-section { margin-bottom: 22px; }
.hall-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0 2px;
}
.hall-section-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex: 0 0 auto;
}
.hall-section-chip img,
.hall-section-chip svg { width: 16px; height: 16px; }
.hall-section-name { font-size: 14px; font-weight: 560; color: var(--ink); }
.hall-section-count {
  font-size: 12px;
  color: var(--ink-4);
  background: var(--surface-mute);
  border-radius: 20px;
  padding: 1px 8px;
}

/* Subscribe diff sheet */
.sub-sheet { width: min(460px, 100%); max-height: 80vh; }
.sub-scroll {
  overflow-y: auto;
  max-height: 52vh;
  margin: 4px 0 8px;
  padding-right: 4px;
}
.sub-group { margin-bottom: 16px; }
.sub-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sub-group-name { font-size: 14px; font-weight: 560; color: var(--ink); }
.sub-group-add { font-size: 12.5px; color: var(--accent); font-weight: 540; }
.sub-group-items { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px 4px 4px;
  background: var(--surface-mute);
  border-radius: 20px;
  font-size: 12.5px;
}
.sub-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-chip .avatar { --avatar-size: 22px; }
.sub-empty { color: var(--ink-3); font-size: 13.5px; text-align: center; padding: 16px 0; }

/* ─── Landing (signed-out marketing) ────────────────────────────────────────── */

.landing {
  display: flex;
  flex-direction: column;
  height: 100dvh;        /* body is overflow:hidden — landing scrolls internally */
  overflow-y: auto;
  background: var(--bg-page);
}

.landing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 28px;
}
.landing-logo { height: 30px; color: var(--ink); display: block; }

.landing-nav { display: flex; align-items: center; gap: 10px; }
.landing-ghost {
  padding: 9px 14px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 540;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.landing-ghost:hover { background: var(--surface-mute); color: var(--ink); }
.landing-cta-sm {
  padding: 9px 18px;
  color: var(--color-on-primary, #fff);
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  transition: transform 120ms ease, opacity 150ms ease;
}
.landing-cta-sm:hover { opacity: 0.9; }
.landing-cta-sm:active { transform: scale(0.98); }

.landing-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 28px 64px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding-top: 48px;
}
.landing-title {
  margin: 0;
  max-width: 24ch;
  color: var(--ink);
  font-size: clamp(32px, 5.2vw, 50px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.landing-lede {
  margin: 0;
  max-width: 46ch;
  color: var(--ink-3);
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.6;
  text-wrap: balance;
}
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
}
.landing-cta {
  min-height: 46px;
  padding: 0 26px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 560;
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease;
}
.landing-cta:hover { background: var(--accent-strong); }
.landing-cta:active { transform: scale(0.98); }
.landing-textlink {
  padding: 8px 6px;
  color: var(--ink-3);
  background: none;
  border: 0;
  font-size: 14px;
  cursor: pointer;
  transition: color 150ms ease;
}
.landing-textlink:hover { color: var(--ink); }

/* Product mock */
.landing-visual { display: flex; justify-content: center; }
.lm-card {
  position: relative;
  width: min(420px, 100%);
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* Fake cursor that glides to the active channel and clicks */
.lm-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  z-index: 6;
  pointer-events: none;
  transform: translate(48px, 44px);
  transition: transform 460ms cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
}
.lm-cursor-inner {
  display: block;
  transform-origin: 6px 4px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.lm-cursor-inner svg { display: block; }
.lm-cursor.click .lm-cursor-inner { animation: lm-click 320ms ease; }
@keyframes lm-click {
  0% { transform: scale(1); }
  32% { transform: scale(0.74); }
  100% { transform: scale(1); }
}
.lm-cursor-ring {
  position: absolute;
  left: 1px;
  top: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  opacity: 0;
  transform: scale(0.3);
  pointer-events: none;
}
.lm-cursor.click .lm-cursor-ring { animation: lm-ring 460ms ease-out; }
@keyframes lm-ring {
  0% { opacity: 0.75; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(1.7); }
}
@media (prefers-reduced-motion: reduce) {
  .lm-cursor { display: none; }
}
.lm-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 4px 8px 12px;
}
.lm-rows { display: flex; flex-direction: column; }
.lm-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 9px;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  transition: background 200ms ease;
}
.lm-row + .lm-row { box-shadow: 0 -1px 0 var(--border-soft); }
.lm-row.active { background: rgba(255, 255, 255, 0.07); }
.lm-row.tapped { animation: lm-tap 340ms ease; }
@keyframes lm-tap { 0% { transform: scale(1); } 42% { transform: scale(0.965); } 100% { transform: scale(1); } }
.lm-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: 0 0 auto;
}
/* Monochrome brand glyphs render white on the brand-colour tile (same as the
   product's .logo-img) — keeps logos correct in any theme. */
.lm-logo { width: 20px; height: 20px; filter: brightness(0) invert(1); }
.lm-chip img.lm-logo, .lm-chip svg.lm-logo { width: 20px; height: 20px; }
.lm-name { flex: 1; font-size: 14.5px; font-weight: 540; color: var(--ink); }

/* Creators that "pop out" of the active channel */
.lm-reveal {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 168px;            /* reserve space (incl. Follow-all) so the card never jumps */
  margin-top: 8px;
  padding: 12px 4px 2px;
  border-top: 1px solid var(--border-soft);
  opacity: 0;
  transition: opacity 220ms ease;
}
.lm-reveal.show { opacity: 1; }
.lm-creator {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border-soft);
}
/* Visible by default; the container's opacity masks the swap, the animation
   just gives each row a staggered pop-in. Never gets stuck hidden. */
.lm-reveal.show .lm-creator {
  animation: lm-pop 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--j) * 85ms + 60ms);
}
@keyframes lm-pop {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.lm-creator .avatar { --avatar-size: 24px; }
.lm-cname { flex: 1; font-size: 13.5px; font-weight: 520; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) {
  .lm-reveal .lm-creator { animation: none; }
}

/* Hall scene: person rows (name + role/count) */
.lm-person .avatar { --avatar-size: 30px; }
.lm-person .lm-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}
.lm-sub { font-size: 11px; font-weight: 460; color: var(--ink-4); }

/* Follow-all action inside the Hall reveal */
.lm-followall {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 3px;
  padding: 9px 12px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.lm-followall.done {
  color: #bfe9cf;
  background: rgba(63, 185, 122, 0.16);
  border-color: rgba(63, 185, 122, 0.4);
}
.lm-followall svg { display: block; }

/* Features — fixed 2×2 grid so the four cards always line up */
.landing-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 560px) {
  .landing-features { grid-template-columns: 1fr; }
}
.feat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 160ms ease, transform 160ms ease;
}
.feat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 4px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
}
.feat-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.feat-body { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-3); }

.landing-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 28px 30px;
  border-top: 1px solid var(--border-soft);
}
.landing-foot-brand { font-size: 14px; color: var(--ink-2); font-weight: 600; letter-spacing: -0.01em; }
.landing-foot-contact { font-size: 13px; color: var(--ink-4); }

@media (max-width: 560px) {
  .landing-head { padding: 16px 18px; }
  .landing-main { padding: 16px 18px 48px; gap: 44px; }
  .landing-hero { padding-top: 28px; }
  .landing-foot { padding: 16px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .lm-row { animation: none; }
}

/* ─── Subjects (学科) — the top level, big centered blocks ───────────────────── */
/* Home galaxy — subjects float as glowing stars; each is the button into the subject */
.subjects-sky {
  position: relative;
  min-height: 100%;
  width: 100%;
}
.subjects-sky.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.subject-star {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
  width: max-content;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  animation: star-float var(--dur, 12s) ease-in-out var(--delay, 0s) infinite,
             star-in 600ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.subject-star > * { animation-delay: inherit; }

/* The glowing orb (the "star") holding the subject icon */
.star-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--size, 80px);
  height: var(--size, 80px);
  border-radius: 50%;
  color: var(--accent-ink);
  background:
    radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.16), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(142, 162, 255, 0.22), rgba(40, 50, 92, 0.34) 70%, transparent 100%);
  border: 1px solid rgba(180, 196, 255, 0.28);
  box-shadow: 0 0 28px -6px rgba(142, 162, 255, 0.5), inset 0 0 22px -10px rgba(190, 205, 255, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 260ms ease, border-color 260ms ease;
}
.star-icon {
  display: grid;
  place-items: center;
  width: 42%;
  height: 42%;
  color: #eaf0ff;
}
.star-icon svg { width: 100%; height: 100%; }

.subject-star:hover .star-orb {
  transform: scale(1.08);
  border-color: rgba(200, 212, 255, 0.55);
  box-shadow: 0 0 44px -4px rgba(142, 162, 255, 0.7), inset 0 0 22px -8px rgba(200, 212, 255, 0.85);
}
.subject-star:active .star-orb { transform: scale(1.02); }
.subject-star:focus-visible { outline: none; }
.subject-star:focus-visible .star-orb { border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-soft-strong), 0 0 40px -6px rgba(142,162,255,0.7); }

.star-name {
  font-size: clamp(15px, 2.4vmin, 21px);
  font-weight: 580;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-align: center;
}
.star-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.subjects-add {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 9px 20px;
  color: var(--ink-2);
  background: var(--surface-mute);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.subjects-sky.empty .subjects-add { position: static; transform: none; }
.subjects-add:hover { background: var(--surface-mute-2); color: var(--ink); border-color: var(--border-strong); }

/* One quick content fade on navigation (replaces the costly View Transition) */
.canvas-enter { animation: canvas-enter 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes canvas-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@keyframes star-float {
  0%   { transform: translate(-50%, -50%); }
  50%  { transform: translate(-50%, calc(-50% - var(--fy, 10px))); }
  100% { transform: translate(-50%, -50%); }
}
@keyframes star-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .subject-star { animation: star-in 400ms ease backwards; }
  .canvas-enter { animation: none; }
}

/* Subject banner chip (inside a subject) reuses the channel banner slot */
.banner-chip.subject-chip-lg {
  background: var(--surface-mute);
  border: 1px solid var(--border);
  color: var(--accent-ink);
}
.banner-chip.subject-chip-lg svg { width: 60%; height: 60%; }

/* Two-up field row in the add-creator sheet (Subject + Folder) */
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }

/* Icon picker in the subject create/edit sheet */
.subj-icon-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.subj-icon-opt {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 8px;
  color: var(--ink-3);
  background: var(--surface-mute);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.subj-icon-opt svg { width: 100%; height: 100%; }
.subj-icon-opt:hover { color: var(--ink-2); background: var(--surface-mute-2); }
.subj-icon-opt.active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: var(--accent-line);
  transform: translateY(-1px);
}
@media (max-width: 520px) {
  .subj-icon-grid { grid-template-columns: repeat(5, 1fr); }
  .field-row { flex-direction: column; gap: 0; }
}

/* ─── Cosmic starfield — applied globally to body, behind landing AND product ── */
.landing { background: transparent; }

/* Deep-space layer — one fixed #starfield (injected at boot) behind everything.
   Hundreds of real stars (generated in app.js) of varied size + brightness,
   concentrated into a diagonal Milky-Way river, over a faint nebula wash.
   No moon, no sun. Drift + twinkle disabled under reduced-motion. */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1300px 900px at 72% 14%,  rgba(104, 124, 176, 0.07), transparent 60%),
    radial-gradient(1100px 900px at 18% 86%,  rgba(96, 116, 160, 0.05), transparent 62%),
    radial-gradient(1600px 1100px at 50% 50%, rgba(34, 44, 74, 0.18), transparent 72%),
    linear-gradient(180deg, #07080e 0%, #06070c 55%, #050608 100%);
}

/* Faint Milky-Way haze under the dense star river (cool blue-white, no purple) */
.sky-band {
  position: absolute;
  left: -30%;
  right: -30%;
  top: 18%;
  height: 64vh;
  transform: rotate(-24deg);
  transform-origin: center;
  background:
    radial-gradient(70% 42% at 50% 50%, rgba(202, 214, 242, 0.09), transparent 72%),
    radial-gradient(46% 30% at 42% 48%, rgba(170, 188, 226, 0.07), transparent 74%);
  filter: blur(22px);
  animation: nebula-breathe 100s ease-in-out infinite alternate;
}

/* Faint cool-blue wash for depth (kept very low so stars stay the subject) */
.sky-nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform;
}
.sky-nebula-1 {
  top: -10%; left: -8%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle at 50% 50%, rgba(116, 140, 196, 0.08), transparent 68%);
  animation: nebula-drift-1 72s ease-in-out infinite alternate;
}
.sky-nebula-2 {
  bottom: -14%; right: -10%;
  width: 56vw; height: 56vw;
  background: radial-gradient(circle at 50% 50%, rgba(96, 122, 170, 0.06), transparent 68%);
  animation: nebula-drift-2 86s ease-in-out infinite alternate;
}

/* Parallax star layers (populated in app.js); inset gives drift headroom */
.sky-layer {
  position: absolute;
  inset: -20%;
  will-change: transform;
}
.sky-far  { opacity: 0.85; animation: star-drift-a 240s linear infinite; }
.sky-near { animation: star-drift-b 320s linear infinite; }

/* The dense diagonal "star river" (Milky Way) — crisp, not blurred */
.sky-band-stars {
  position: absolute;
  left: -30%;
  right: -30%;
  top: 18%;
  height: 64vh;
  transform: rotate(-24deg);
  transform-origin: center;
  animation: star-drift-a 280s linear infinite;
}

.star {
  position: absolute;
  border-radius: 50%;
  will-change: opacity;
}
/* Premium shimmer: a gentle brightness breath (never blinks fully out) plus a
   barely-there scale, each star on its own slow desynced cycle. */
.star.tw {
  animation: star-tw var(--tw-dur, 5s) ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes star-tw {
  from { opacity: var(--tw-min, 0.5); transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1.12); }
}
@keyframes star-drift-a { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-60px, -40px, 0); } }
@keyframes star-drift-b { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(52px, 32px, 0); } }
@keyframes nebula-drift-1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(50px, 36px, 0) scale(1.12); }
}
@keyframes nebula-drift-2 {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-44px, -30px, 0) scale(1); }
}
@keyframes nebula-breathe { from { opacity: 0.6; } to { opacity: 1; } }

.landing-head, .landing-main, .landing-foot { position: relative; z-index: 1; }

.landing-logo { color: #fff; }
.landing-title {
  background: linear-gradient(180deg, #ffffff 0%, #c4c9d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-cta {
  background: linear-gradient(180deg, #ffffff, #d4d9e6);
  color: #0a0b14;
  box-shadow: 0 12px 34px -14px rgba(214, 218, 230, 0.55);
}
.landing-cta:hover { background: linear-gradient(180deg, #ffffff, #c3c9da); }

.landing-cta-sm {
  background: linear-gradient(180deg, #f4f6fb, #d4d9e6);
  color: #0a0b14;
}
.landing-cta-sm:hover { opacity: 0.92; }

.landing-ghost { color: var(--ink-2); }
.landing-ghost:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.landing-textlink { color: var(--ink-3); }
.landing-textlink:hover { color: #fff; }

.landing-guest {
  align-self: center;
  margin-top: 6px;
  padding: 9px 18px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.landing-guest:hover { background: rgba(255, 255, 255, 0.09); color: #fff; border-color: var(--border-strong); }

@media (prefers-reduced-motion: reduce) {
  .sky-layer, .sky-band-stars, .sky-nebula, .sky-band, .star.tw { animation: none; }
}

/* Login scrim sits over the dark cosmic landing — keep it dark */
#login-overlay.login-stage { background: rgba(6, 7, 12, 0.66); }

/* ─── Guest chip (product header) — uses the product tokens, respects theme ── */
.guest-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  color: var(--ink-2);
  background: var(--surface-mute);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 540;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 150ms ease, color 150ms ease;
}
.guest-chip:hover { color: var(--ink); }
.guest-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
