/* === Fww Home V2 — Active Design (2026-04-25) ===
   配色 / rail / bento / hero 規格來自 _sources/FwwMainPageV2/Fww Active Handoff.html
   Active defaults: bg=washi · hero=classic · bento=B · rail=film · corner=aurora
   所有規則 scoped 在 .hv2 wrapper 之下，避免污染既有文章 component CSS。
*/

/* ---------- CSS Variables (scoped to .hv2 to avoid leaking globally) ---------- */
.hv2 {
  --oak-main: #F0E6D2;
  --oak-card: #FAF5E9;
  --oak-footer: #E8DCC3;
  --oak-border: #D4C9B5;
  --oak-border-soft: #E3D7BE;
  --oak-text: #4A4A4A;
  --oak-text-sec: #8A7E6B;
  --oak-accent: #B88860;
  --oak-accent-deep: #8F5E3E;
}

/* ---------- Hide default app background while V2 home is mounted ---------- */
body.hv2-active #app-bg { display: none; }
body.hv2-active { background-color: var(--oak-main); }

/* ---------- V2 wrapper ---------- */
.hv2 {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  font-family: 'Noto Sans TC', 'Noto Sans', sans-serif;
  color: var(--oak-text);
  overflow: hidden;
}

/* ---------- Background layers (washi + grain) ---------- */
.hv2-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hv2-bg-washi {
  background: radial-gradient(ellipse at 20% 20%, #f6ecd6 0%, #ead9b9 40%, #d6bf95 100%);
}
.hv2-bg-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0.4 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Stage / Slide-wrap ---------- */
.hv2-stage {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  z-index: 1;
}
.hv2-slide-wrap {
  position: relative;
  width: 100%;
  min-height: 100dvh;
}

/* ---------- Slide (fade transition) ---------- */
.hv2-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  padding: 1.25rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
@media (min-width: 768px) {
  .hv2-slide {
    padding: 1.4rem 6rem 1.4rem 2.5rem;
    overflow-y: auto;
  }
}
.hv2-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Brand row ---------- */
.hv2-brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  position: relative;
  z-index: 10;
  font-family: 'Allura', cursive;
  font-size: 1.5rem;
  color: var(--oak-accent-deep);
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .hv2-brand {
    font-size: 1.75rem;
    margin-bottom: 0.55rem;
  }
}

/* ---------- Mobile horizontal film rail (above hero) ---------- */
.hv2-mrail {
  display: flex;
  background: #1a1510;
  border-radius: 4px;
  padding: 4px 6px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 40px;
  align-items: stretch;
  margin-bottom: 0.6rem;
}
@media (min-width: 768px) {
  .hv2-mrail { display: none; }
}
.hv2-mrail::before,
.hv2-mrail::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  background-image: repeating-linear-gradient(0deg,
    #1a1510 0 7px,
    #F0E6D2 7px 10px,
    #1a1510 10px 16px);
}
.hv2-mrail::before { left: 0; }
.hv2-mrail::after { right: 0; }
.hv2-mrail-inner {
  display: flex;
  gap: 3px;
  flex: 1;
  margin: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hv2-mrail-inner::-webkit-scrollbar { display: none; }
.hv2-mrail-item {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 5px 7px;
  background: #2a1d14;
  border: 1px solid #3a2a1e;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  transition: all 0.2s;
  color: #FAF5E9;
}
.hv2-mrail-item .fnum {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 8px;
  letter-spacing: 0.15em;
  color: #d4a878;
  opacity: 0.75;
}
.hv2-mrail-item .fname {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #FAF5E9;
  opacity: 0.65;
  font-weight: 500;
}
.hv2-mrail-item:hover { background: #3a2a1e; }
.hv2-mrail-item:hover .fnum,
.hv2-mrail-item:hover .fname { opacity: 1; }
.hv2-mrail-item.active {
  background: #F0E6D2;
  border-color: #F0E6D2;
}
.hv2-mrail-item.active .fnum { color: var(--oak-accent-deep); opacity: 1; }
.hv2-mrail-item.active .fname { color: var(--oak-text); opacity: 1; }

/* ---------- Vertical film rail (desktop only) ---------- */
.hv2-rail {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 56px;
  z-index: 30;
  flex-direction: column;
  background: #1a1510;
  border-left: 1px solid #3a2a1e;
  transition: width 0.35s cubic-bezier(0.4, 0.1, 0.2, 1);
}
@media (min-width: 768px) {
  .hv2-rail { display: flex; }
}
.hv2-rail::before,
.hv2-rail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  background-image: repeating-linear-gradient(90deg,
    #1a1510 0 10px,
    #F0E6D2 10px 14px,
    #1a1510 14px 22px);
  z-index: 1;
}
.hv2-rail::before { top: 0; }
.hv2-rail::after { bottom: 0; }
.hv2-rail:hover { width: 160px; }
.hv2-rail-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 2px 6px;
  padding: 8px 4px;
  background: #2a1d14;
  border: 1px solid #3a2a1e;
  border-radius: 2px;
  color: #FAF5E9;
  gap: 4px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  overflow: hidden;
}
.hv2-rail-item:first-child { margin-top: 20px; }
.hv2-rail-item:last-child { margin-bottom: 20px; }
.hv2-rail-item .num {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: #d4a878;
  opacity: 0.75;
}
.hv2-rail-item .name {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #FAF5E9;
  opacity: 0.65;
  font-weight: 500;
}
.hv2-rail-item:hover { background: #3a2a1e; }
.hv2-rail-item:hover .num,
.hv2-rail-item:hover .name { opacity: 1; }
.hv2-rail-item.active { background: #F0E6D2; border-color: #F0E6D2; }
.hv2-rail-item.active .num { color: var(--oak-accent-deep); opacity: 1; }
.hv2-rail-item.active .name { color: var(--oak-text); opacity: 1; }
.hv2-rail:hover .hv2-rail-item {
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
}

/* ---------- Top grid (hero + about) ---------- */
.hv2-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .hv2-top {
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    margin-bottom: 0.7rem;
  }
}

/* ---------- Hero (classic variant) ---------- */
.hv2-hero {
  position: relative;
  height: 220px;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(120deg, #8a6a4a 0%, #b8885c 60%, #d4a878 100%);
  color: #FAF5E9;
}
@media (min-width: 768px) {
  .hv2-hero { height: 218px; }
}
.hv2-hero-decoration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hv2-hero-content {
  position: absolute;
  inset: 0;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
}
@media (min-width: 768px) {
  .hv2-hero-content { padding: 1.5rem 1.75rem; }
}
.hv2-hero-kicker {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.9;
}
.hv2-hero-date {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.4rem;
}
.hv2-hero-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}
@media (min-width: 768px) {
  .hv2-hero-title-line { gap: 0.9rem; }
}
.hv2-hero-title {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.18;
  text-decoration: none;
  color: inherit;
  display: inline-block;
}
@media (min-width: 768px) {
  .hv2-hero-title { font-size: 2rem; }
}
.hv2-hero-title:hover { text-decoration: underline; }
.hv2-hero-sub {
  font-family: 'Allura', cursive;
  font-size: 1.55rem;
  font-weight: 400;
  opacity: 0.9;
  line-height: 1;
}
@media (min-width: 768px) {
  .hv2-hero-sub { font-size: 1.9rem; }
}
.hv2-hero-desc {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.9;
  max-width: 560px;
  line-height: 1.5;
}

/* ---------- About card ---------- */
.hv2-about {
  background: rgba(250, 245, 233, 0.88);
  border: 1px solid rgba(212, 201, 181, 0.6);
  border-radius: 0.75rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  min-height: 170px;
}
.hv2-about-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--oak-text-sec);
}
.hv2-about-quote {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--oak-text);
  font-style: italic;
  flex: 0 1 auto;
  max-height: 9.5rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.hv2-about-quote::-webkit-scrollbar { width: 4px; }
.hv2-about-quote::-webkit-scrollbar-track { background: transparent; }
.hv2-about-quote::-webkit-scrollbar-thumb { background: rgba(143, 94, 62, 0.25); border-radius: 2px; }
.hv2-about-source {
  font-size: 0.72rem;
  margin-top: 0.55rem;
  color: var(--oak-text-sec);
}
.hv2-about-meta {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--oak-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--oak-text-sec);
}

/* ---------- Category title row ---------- */
.hv2-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}
.hv2-cat-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--oak-text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
}
@media (min-width: 768px) {
  .hv2-cat-title { font-size: 1.875rem; gap: 0.75rem; }
}
.hv2-cat-sub {
  font-family: 'Allura', cursive;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--oak-accent-deep);
}
@media (min-width: 768px) {
  .hv2-cat-sub { font-size: 1.5rem; }
}
.hv2-cat-num {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--oak-text-sec);
}

/* ---------- Bento (B variant: 1.3 / 1 / 1) ---------- */
.hv2-bento {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(120px, auto);
  flex: 1;
  align-content: start;
}
@media (min-width: 768px) {
  .hv2-bento {
    gap: 0.75rem;
    grid-template-columns: 1.3fr 1fr 1fr;
    grid-template-rows: auto auto;
    min-height: 220px;
  }
}
.hv2-bento-card {
  background: rgba(250, 245, 233, 0.88);
  border: 1px solid var(--oak-border);
  border-radius: 0.875rem;
  padding: 0.8rem 1rem;
  position: relative;
  /* overflow visible by default — recent 加 More 後可自然撐高；
     corner aurora 需裁 SVG bg → 個別 override 為 hidden */
}
.hv2-bento-card.hv2-bento-corner { overflow: hidden; }
.hv2-bento-card.b-warm {
  background: linear-gradient(145deg, #9b6f4a, #7a4f2e);
  color: #FAF5E9;
  border-color: transparent;
}
.hv2-bento-card.b-sand {
  background: var(--oak-footer);
}
.hv2-bento-lead {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 150px;
}
@media (min-width: 768px) {
  .hv2-bento-lead {
    grid-column: 1;
    grid-row: 1 / span 2;
    min-height: 0;
  }
}
.hv2-bento-recent {
  grid-column: 1 / -1;
}
@media (min-width: 768px) {
  .hv2-bento-recent { grid-column: 2 / span 2; }
}
.hv2-bento-stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hv2-bento-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Corner aurora variant */
.hv2-corner-aurora {
  background: radial-gradient(circle at 30% 30%, #d4a878, #8a6a4a 70%);
  border: none;
  color: #FAF5E9;
}
.hv2-corner-aurora .hv2-corner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hv2-corner-name {
  font-family: 'Allura', cursive;
  font-size: 2rem;
  position: relative;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.hv2-corner-num {
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  opacity: 0.85;
  position: relative;
}

/* Bento typography */
.hv2-bento-kicker {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.8;
}
.hv2-bento-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.22;
  margin: 0.4rem 0 0;
  text-decoration: none;
  color: inherit;
  display: block;
}
@media (min-width: 768px) {
  .hv2-bento-title { font-size: 1.4rem; }
}
.hv2-bento-title:hover { text-decoration: underline; }
.hv2-bento-desc {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 0.4rem;
  line-height: 1.5;
}
.hv2-bento-empty {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 0.5rem;
}
.hv2-bento-stat-top {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--oak-text-sec);
}
.hv2-bento-stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--oak-text);
  line-height: 1;
}
.hv2-bento-stat-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  color: var(--oak-text-sec);
}

/* Recent list */
.hv2-recent-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  color: var(--oak-text-sec);
}
.hv2-recent-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--oak-border-soft);
}
.hv2-recent-row:last-child { border-bottom: none; }
.hv2-recent-date {
  font-size: 11px;
  color: var(--oak-text-sec);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  width: 78px;
  flex-shrink: 0;
}
.hv2-recent-link {
  flex: 1;
  font-size: 12px;
  color: var(--oak-text);
  font-weight: 500;
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.hv2-recent-link:hover { text-decoration: underline; }

/* More 列 — 排版與 .hv2-recent-row 對齊，看起來像「再多一篇文章」般融入清單 */
.hv2-more-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 8px 0;
  margin-top: 2px;
  background: transparent;
  border: none;
  border-top: 1px dashed var(--oak-border);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--oak-text-sec);
  transition: color 0.18s ease, background 0.18s ease;
}
.hv2-more-row .more-plus {
  width: 78px;
  flex-shrink: 0;
  text-align: center;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 14px;
  color: var(--oak-accent);
  letter-spacing: 0;
}
.hv2-more-row .more-text {
  flex: 1;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hv2-more-row:hover {
  color: var(--oak-accent-deep);
  background: rgba(212, 168, 120, 0.06);
}
.hv2-more-row:hover .more-plus {
  color: var(--oak-accent-deep);
}
.hv2-more-row:active {
  background: rgba(212, 168, 120, 0.16);
}
