/* ==========================================================================
   焕影Club v18 — 首页
   ========================================================================== */

.read-card { display: block; width: 100%; text-align: left; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.clamp-2, .banner-summary, .feed-summary, .trend-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

.eyebrow { color: var(--accent-text); font-size: 12.5px; font-weight: 700; letter-spacing: .06em; }
.block-head { display: flex; align-items: baseline; gap: 10px; }
.block-head h2 { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.block-head h2::before { content: ""; width: 4px; height: 17px; border-radius: 2px; background: var(--accent-line); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent); }
.block-sub { color: var(--text-3); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px; }
:root[data-theme="light"] .card { box-shadow: var(--shadow-1); }

/* ---------- Media ---------- */
.media { position: relative; overflow: hidden; background: var(--img-bg); }
.media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.media-fallback { display: none; }
.media.is-fallback .media-fallback {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 2px; padding: 8px; text-align: center;
  color: var(--text-3); background: linear-gradient(135deg, var(--surface-2), var(--img-bg));
}
.media-credit { position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 6px; background: rgba(5, 12, 22, .6); color: rgba(255, 255, 255, .86); font-size: 11px; backdrop-filter: blur(6px); }
.media-fallback b { color: var(--text-2); font-size: 12px; font-weight: 600; }
.media-fallback small { font-size: 10.5px; }
.read-card:hover .media img { transform: scale(1.035); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: var(--text-3); font-size: 12.5px; line-height: 1.5; }
.meta-source { color: var(--text-2); font-weight: 500; }

/* ---------- Today / hero ---------- */
.today { padding: 28px 0 8px; background: var(--hero-glow); }
.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.today-date { color: var(--text-3); font-size: 13px; margin-bottom: 4px; }
.today h1 { font-size: 34px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
.today h1 .hl { font-style: normal; color: var(--accent); text-shadow: 0 0 24px rgba(184, 232, 117, .35); }
:root[data-theme="light"] .today h1 .hl { color: var(--text); text-shadow: none; background: linear-gradient(transparent 58%, var(--accent) 58%, var(--accent) 92%, transparent 92%); padding: 0 .08em; }
.feed-status {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; flex-shrink: 0;
  border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text-2); font-size: 12.5px; white-space: nowrap;
}
.feed-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent); }
.feed-status[data-state="stale"] i { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
.feed-status[data-state="error"] i { background: #e5484d; }
.feed-status[data-state="refreshing"] i { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.top-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.lead { min-width: 0; }
.banner-shell { position: relative; overflow: hidden; border-radius: var(--radius-l); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.banner-shell.is-dragging { cursor: grabbing; }
.banner-rail { display: flex; transition: transform .62s var(--ease); will-change: transform; }
.banner-slide { flex: 0 0 100%; min-width: 0; }
.banner-media { aspect-ratio: 16 / 9; border-radius: var(--radius-l); }
.banner-media img { -webkit-user-drag: none; }
.banner-copy { display: grid; gap: 8px; padding: 18px 2px 0; }
.banner-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); font-size: 13px; font-weight: 600; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); }
.banner-title { font-size: 28px; font-weight: 750; line-height: 1.3; letter-spacing: -.005em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.banner-slide:hover .banner-title { color: var(--accent-text); }
.banner-summary { color: var(--text-2); font-size: 15.5px; line-height: 1.65; }
.banner-time { color: var(--text-3); font-size: 13px; }
.banner-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; min-height: 38px; }
.banner-dots { display: flex; gap: 2px; }
.banner-dot { padding: 10px 3px; }
.banner-dot i { display: block; width: 18px; height: 3px; border-radius: 3px; background: var(--line-strong); transition: width .3s var(--ease), background-color .3s; }
.banner-dot.active i { width: 32px; background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }
.banner-arrows { display: flex; gap: 6px; }
.banner-arrows .icon-btn { border: 1px solid var(--line-strong); border-radius: 50%; }

.headlines { min-width: 0; }
.headlines .block-head { padding-bottom: 8px; border-bottom: 2px solid var(--accent-line); }
.headline-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 14px; align-items: start; padding: 15px 0; border-bottom: 1px solid var(--line); }
.headline-copy { display: grid; gap: 6px; min-width: 0; }
.headline-title { font-size: 15.5px; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.headline-row:hover .headline-title { color: var(--accent-text); }
.thumb { aspect-ratio: 4 / 3; border-radius: 10px; }

/* ---------- Stream ---------- */
.stream { padding-top: 44px; }
.stream-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; grid-template-areas: "trend" "feed" "sources"; }
.trending { grid-area: trend; }
.feed { grid-area: feed; min-width: 0; }
.sources { grid-area: sources; }

.trend-list { list-style: none; margin: 10px 0 0; padding: 0; }
.trend-list li + li .trend-row { border-top: 1px solid var(--line); }
.trend-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 12px 0; }
.trend-rank { font-family: var(--font-num); font-size: 22px; font-weight: 750; line-height: 1.2; color: var(--text-3); font-style: italic; }
.trend-list li:nth-child(-n+3) .trend-rank { color: var(--accent-text); }
.trend-copy { display: grid; gap: 4px; min-width: 0; }
.trend-title { font-size: 15px; font-weight: 600; line-height: 1.5; }
.trend-row:hover .trend-title { color: var(--accent-text); }

.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--accent-line); }
.text-btn { color: var(--accent-text); font-size: 13.5px; font-weight: 600; }
.topic-chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.topic-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; height: 32px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; box-shadow: 0 2px 0 var(--accent-shadow); }
.chip:active { transform: translateY(1px); }

.feed-row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 148px; gap: 18px; align-items: start;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.feed-time { display: grid; gap: 2px; padding-top: 2px; }
.feed-time b { font-family: var(--font-num); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.feed-time small { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.feed-body { display: grid; gap: 7px; min-width: 0; }
.feed-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed-title { font-size: 18px; font-weight: 650; line-height: 1.45; }
.feed-row:hover .feed-title { color: var(--accent-text); }
.feed-summary { color: var(--text-2); font-size: 14.5px; line-height: 1.65; }
.feed-thumb { border-radius: 12px; }
.empty-state { padding: 48px 0; text-align: center; color: var(--text-2); }
.empty-state b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

.source-list { display: grid; margin-top: 10px; }
.source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.source-row:first-child { border-top: 0; }
.source-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
a.source-row:hover .source-name { color: var(--link); }
.source-kind { color: var(--text-3); font-size: 12px; }
.source-count { text-align: right; font-family: var(--font-num); font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.source-note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12.5px; line-height: 1.7; }

/* ---------- Workshop ---------- */
.workshop { padding-top: 72px; }
.section-head { margin-bottom: 22px; }
.section-head h2 { margin-top: 6px; font-size: 28px; font-weight: 750; letter-spacing: -.005em; }
.section-sub { margin-top: 6px; color: var(--text-2); font-size: 15px; }
.tutorial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tutorial-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-l);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.tutorial-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.tutorial-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--img-bg); }
.tutorial-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.tutorial-card:hover .tutorial-cover img { transform: scale(1.04); }
.tutorial-cover .ep { position: absolute; top: 12px; left: 12px; padding: 3px 8px; border-radius: 6px; background: rgba(5, 12, 22, .66); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; backdrop-filter: blur(6px); }
.tutorial-body { display: grid; gap: 6px; padding: 16px 18px 18px; }
.tutorial-body h3 { font-size: 18px; font-weight: 700; }
.tutorial-body p { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.tutorial-body .go { margin-top: 6px; color: var(--link); font-size: 13.5px; font-weight: 600; }

.follow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px; margin-top: 28px; padding: 26px 28px; }
.follow-copy h3 { margin-top: 6px; font-size: 21px; font-weight: 700; line-height: 1.4; }
.follow-copy p:last-child { margin-top: 8px; color: var(--text-2); font-size: 14.5px; line-height: 1.7; max-width: 34em; }
.qr-grid { display: grid; grid-template-columns: repeat(2, 132px); gap: 18px; }
.qr-card { margin: 0; display: grid; gap: 8px; justify-items: center; text-align: center; }
.qr-card img { width: 132px; height: 132px; object-fit: contain; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.qr-card figcaption { display: grid; gap: 1px; }
.qr-card b { font-size: 14px; }
.qr-card small { color: var(--text-3); font-size: 12px; }

.download-anchor { display: block; height: 0; overflow: hidden; }

/* ---------- Assistant (右下角 Q 版助手) ---------- */
.assistant-float {
  position: fixed; right: 20px; bottom: 24px; z-index: 55;
  display: flex; align-items: flex-end; gap: 10px;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.assistant-float.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.assistant-avatar {
  width: 68px; height: 68px; flex-shrink: 0; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #1d3657, #0b1729);
  border: 2px solid var(--surface); box-shadow: var(--shadow-2), 0 0 0 1px var(--line-strong);
  transition: transform .2s var(--ease);
}
.assistant-avatar:hover { transform: translateY(-2px) rotate(-3deg); }
.assistant-avatar img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.18) translateY(4%); }
.assistant-bubble-wrap { position: relative; margin-bottom: 14px; }
.assistant-bubble {
  display: grid; gap: 3px; max-width: 220px; padding: 12px 16px 12px 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px 16px 4px 16px; box-shadow: var(--shadow-2);
}
.assistant-bubble-kicker { color: var(--link); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.assistant-bubble-copy { font-size: 14px; font-weight: 600; line-height: 1.45; }
.assistant-bubble-link { color: var(--accent-text); font-size: 13px; font-weight: 700; }
.assistant-close {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong);
  color: var(--text-2); font-size: 14px; line-height: 1;
}
.assistant-download-chip {
  display: none; align-items: center; gap: 6px; height: 36px; margin-bottom: 16px; padding: 0 14px 0 12px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; box-shadow: 0 3px 0 var(--accent-shadow), var(--shadow-2);
}
.assistant-float.is-collapsed .assistant-bubble-wrap { display: none; }
.assistant-float.is-collapsed .assistant-download-chip { display: inline-flex; animation: chipIn .35s var(--ease); }
@keyframes chipIn { from { opacity: 0; transform: translateX(8px); } }

/* ---------- Responsive ---------- */
@media (min-width: 1024px) {
  .top-grid { grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 40px; }
  .stream-grid { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto 1fr; grid-template-areas: "feed trend" "feed sources"; column-gap: 40px; row-gap: 24px; align-items: start; }
  .sources { position: sticky; top: calc(var(--header-h) + 20px); }
  .today { padding-top: 36px; }
  .today h1 { font-size: 38px; }
}
@media (max-width: 1023px) {
  .banner-arrows { display: none; }
}
@media (max-width: 899px) {
  .assistant-float { right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .assistant-avatar { width: 58px; height: 58px; }
  .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .tutorial-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 8px; scrollbar-width: none; }
  .tutorial-grid::-webkit-scrollbar { display: none; }
  .tutorial-card { scroll-snap-align: start; }
  .follow { grid-template-columns: 1fr; padding: 22px 20px; }
  .qr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr-card img { width: 100%; height: auto; aspect-ratio: 1; max-width: 150px; }
}
@media (max-width: 640px) {
  .today { padding-top: 20px; }
  .today-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
  .today h1 { font-size: 27px; }
  .banner-shell, .banner-media { border-radius: 14px; }
  .banner-copy { padding-top: 14px; gap: 6px; }
  .banner-title { font-size: 21px; }
  .banner-summary { font-size: 14.5px; }
  .headline-row { grid-template-columns: minmax(0, 1fr) 92px; gap: 12px; padding: 14px 0; }
  .headline-title { font-size: 15px; }
  .stream { padding-top: 32px; }
  .card { padding: 16px; border-radius: 14px; }
  .feed-row { grid-template-columns: minmax(0, 1fr) 96px; grid-template-areas: "time time" "body thumb"; gap: 6px 14px; padding: 18px 0; }
  .feed-time { grid-area: time; display: flex; align-items: baseline; gap: 6px; padding: 0; }
  .feed-time b { font-size: 13px; }
  .feed-body { grid-area: body; gap: 6px; }
  .feed-thumb { grid-area: thumb; border-radius: 10px; margin-top: 30px; }
  .feed-title { font-size: 16px; }
  .feed-summary { font-size: 13.5px; }
  .workshop { padding-top: 52px; }
  .section-head h2 { font-size: 23px; }
  .follow-copy h3 { font-size: 18px; }
}

/* ---------- 工坊档案夹动效：舞台固定为深海蓝展示面板（两种配色下保持原动效观感） ---------- */
.tutorial-folder-stage {
  --mint: #b8e875; --cyan: #8fe8ff; --paper: #e8f1ff; --muted: #8ba0bd; --muted-2: #637b9e;
  --deck-face: #071426; --deck-edge: #657e9f; --deck-edge-hot: #8fe8ff; --deck-inner: #2d4767; --deck-inner-hot: #b8e875;
  color: #e8f1ff; color-scheme: dark;
}
:root[data-theme="light"] .tutorial-folder-stage {
  padding: 20px 22px 16px; border-radius: 20px;
  background: radial-gradient(900px 420px at 30% 20%, #15325a 0%, #0a1a31 55%, #061124 100%);
  box-shadow: 0 24px 60px rgba(7, 20, 38, .22), inset 0 0 0 1px rgba(143, 232, 255, .12);
}
@media (max-width: 640px) { :root[data-theme="light"] .tutorial-folder-stage { padding: 14px 14px 10px; border-radius: 16px; } }
.workshop .section-head { margin-bottom: 18px; }