/* ViCamBachGiai — navy cinematic library */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Be Vietnam Pro", "IBM Plex Sans", system-ui, sans-serif;
  background: #070b14;
  color: #e8eef8;
  min-height: 100dvh;
}
img, video, svg { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }

:root {
  --bg: #070b14;
  --bg-2: #0c1322;
  --ink: #e8eef8;
  --muted: #8b9bb3;
  --line: rgba(148, 187, 233, 0.12);
  --cyan: #9589E6;
  --cyan-2: #8174D8;
  --violet: #8174D8;
  --accent: #8174D8;
  --accent-fill: rgba(129, 116, 216, 0.40);
  --accent-fill-2: rgba(129, 116, 216, 0.28);
  --accent-line: rgba(149, 137, 230, 0.70);
  --accent-glow: 0 0 16px rgba(129, 116, 216, 0.22);
  --danger: #f07167;
  --serif: "Cormorant Garamond", "Fraunces", Georgia, serif;
  --read: "Source Serif 4", Georgia, serif;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 0.75rem;
}
@media (min-width: 720px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem 1rem; }
}
@media (min-width: 1100px) {
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.site-header.is-searching { z-index: 47; }
.header-inner {
  width: 100%; max-width: 1180px; margin: 0 auto;
  min-height: 56px; padding: 0.4rem 0.7rem;
  display: flex; align-items: center; gap: 0.45rem;
}
.brand { display: flex; align-items: center; gap: 0.55rem; flex-shrink: 0; }
.brand-mark-img { width: 38px; height: auto; display: block; }
.brand-word-img { height: 26px; width: auto; display: block; }
@media (min-width: 720px) {
  .brand-mark-img { width: 42px; }
  .brand-word-img { height: 30px; }
}
.nav-links { display: none; gap: 1.15rem; font-size: 0.92rem; color: var(--muted); }
.nav-links a.on, .nav-links a:hover { color: var(--ink); }
@media (min-width: 860px) { .nav-links { display: flex; } }
.head-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--muted);
  min-width: 40px;
  position: relative;
}
.head-search .search-ico { display: none; }
.head-search input {
  display: none;
  border: 0; background: transparent; color: var(--ink);
  width: 100%; outline: none; min-width: 0;
}
.search-toggle { flex-shrink: 0; }
.head-search.is-open {
  position: absolute;
  left: 0.6rem; right: 0.6rem; top: 8px;
  z-index: 46;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.2rem 0.45rem 0.2rem 0.15rem;
}
.head-search.is-open input { display: block; }
.btn-login {
  border: 1px solid rgba(148,187,233,0.28);
  min-height: 36px;
  padding: 0 0.7rem;
  flex-shrink: 0;
  font-size: 0.82rem;
}
.menu-btn { margin-left: 0; flex-shrink: 0; }
@media (min-width: 640px) {
  .search-toggle { display: none; }
  .head-search {
    background: #0b1220;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.3rem 0.7rem;
    min-width: 160px;
    max-width: 260px;
    width: 28vw;
    position: static;
  }
  .head-search .search-ico { display: inline; }
  .head-search input { display: block; }
  .head-search.is-open { position: static; }
  .btn-login { min-height: 38px; padding: 0 0.85rem; font-size: 0.88rem; }
}
@media (min-width: 860px) {
  .nav-links { display: flex; }
  .menu-btn { display: none; }
  .head-search { min-width: 200px; max-width: 280px; }
}

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--ink);
  border-radius: 999px; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.06); }
.avatar-chip {
  width: 32px; height: 32px; border-radius: 999px;
  display: grid; place-items: center;
  background: #1a2440; color: var(--cyan);
  font-size: 0.78rem; font-weight: 600;
}

/* Fan banner — active card center, others flare both sides */
.hero.stack-hero {
  --hero-tone: #7c5cbf;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(58% 70% at 50% 42%, color-mix(in srgb, var(--hero-tone) 22%, transparent), transparent 72%),
    radial-gradient(80% 90% at 50% 0%, rgba(92, 70, 160, 0.16), transparent 62%),
    #070b14;
  height: clamp(23.5rem, 78vw, 28.2rem);
  perspective: 1400px;
}
@media (min-width: 720px) {
  .hero.stack-hero { height: 30.5rem; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .hero.stack-hero { height: 19.2rem; }
}
.stack-stage {
  position: relative;
  height: 100%;
  max-width: 1180px;
  margin: 0 auto;
  transform-style: preserve-3d;
}
.stack-card {
  --d: 0;
  --abs: 8;
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(54vw, 196px);
  height: min(72%, 21.6rem);
  border-radius: 18px;
  overflow: hidden;
  transform-origin: 50% 118%;
  transform:
    translate(-50%, -50%)
    translateX(calc(var(--d) * 3.15rem))
    rotate(calc(var(--d) * 11deg))
    scale(calc(0.86 - var(--abs) * 0.045));
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 28px rgba(0,0,0,0.42);
  transition:
    transform 620ms cubic-bezier(0.22, 0.78, 0.2, 1),
    opacity 420ms ease,
    filter 420ms ease,
    box-shadow 420ms ease,
    width 420ms ease,
    height 420ms ease;
  will-change: transform, opacity;
  background: #10131c;
  filter: saturate(0.88) brightness(0.78);
}
.stack-card[data-d="-2"],
.stack-card[data-d="-1"],
.stack-card[data-d="0"],
.stack-card[data-d="1"],
.stack-card[data-d="2"] { opacity: 1; }
.stack-card[data-d="-3"],
.stack-card[data-d="3"] { opacity: 0.18; }
.stack-card .stack-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}
.stack-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6,8,16,0.08) 18%, rgba(6,8,16,0.18) 42%, rgba(6,8,16,0.78) 78%, rgba(6,8,16,0.94) 100%);
  pointer-events: none;
}
.stack-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.85rem 0.9rem 1rem;
  z-index: 2;
  color: #f4f1ff;
}
.stack-badge {
  display: none;
  width: fit-content;
  margin: 0 0 0.55rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--tone, #7c5cbf) 72%, #2a1d4a);
  color: #efeaff;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.stack-chips {
  display: none;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.45rem 0 0.4rem;
}
.stack-chips span {
  font-size: 0.64rem;
  letter-spacing: 0.01em;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(10,12,22,0.38);
}
.stack-title {
  font-family: var(--serif);
  font-size: clamp(1.02rem, 4.4vw, 1.42rem);
  line-height: 1.05;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.stack-syn {
  margin: 0;
  color: #d8d3e8;
  font-size: 0.74rem;
  line-height: 1.45;
  display: none;
}
.stack-actions {
  display: none;
  gap: 0.4rem;
  margin-top: 0.7rem;
}
.stack-actions .btn { min-height: 34px; padding: 0 0.75rem; font-size: 0.76rem; }
.stack-card.is-active {
  pointer-events: auto;
  width: min(64vw, 236px);
  height: min(78%, 23.8rem);
  opacity: 1;
  filter: none;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  border-color: color-mix(in srgb, var(--tone, #a892ff) 55%, #fff 12%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--tone, #a892ff) 35%, transparent),
    0 18px 40px rgba(0,0,0,0.5),
    0 0 28px color-mix(in srgb, var(--tone, #7c5cbf) 28%, transparent);
}
.stack-card.is-active .stack-badge,
.stack-card.is-active .stack-chips,
.stack-card.is-active .stack-actions { display: flex; }
.stack-card.is-active .stack-syn {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.35rem;
}
.stack-card:not(.is-active) .stack-badge,
.stack-card:not(.is-active) .stack-syn,
.stack-card:not(.is-active) .stack-actions,
.stack-card:not(.is-active) .stack-chips { display: none; }
.stack-card:not(.is-active) .stack-title {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.85rem;
  font-size: 0.86rem;
  line-height: 1.15;
  text-shadow: 0 8px 18px rgba(0,0,0,0.55);
}
.stack-arrow {
  position: absolute;
  top: 50%;
  z-index: 50;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border-radius: 999px;
  border: 1px solid rgba(168,146,255,0.42);
  background: rgba(10,12,20,0.62);
  color: #efeaff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.stack-prev { left: 0.45rem; }
.stack-next { right: 0.45rem; }
.stack-arrow:hover { border-color: rgba(168,146,255,0.72); }
.hero.stack-hero .hero-nav {
  position: absolute;
  left: 0; right: 0; bottom: 0.55rem;
  z-index: 30;
  display: flex;
  justify-content: center;
}
.hero-dots {
  display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; justify-content: center; max-width: 80%;
}
.hero-dots button {
  width: 6px; height: 6px; border-radius: 99px; border: 0;
  background: rgba(255,255,255,0.28); padding: 0; cursor: pointer;
}
.hero-dots button.on { background: rgba(149,137,230,0.92); width: 18px; box-shadow: var(--accent-glow); }
.hero-count { display: none; }
@media (min-width: 720px) {
  .stack-card { width: 188px; height: 23.4rem; }
  .stack-card.is-active { width: 248px; height: 26rem; }
  .stack-card {
    transform:
      translate(-50%, -50%)
      translateX(calc(var(--d) * 4.35rem))
      rotate(calc(var(--d) * 12deg))
      scale(calc(0.88 - var(--abs) * 0.04));
  }
  .stack-card.is-active { transform: translate(-50%, -50%) rotate(0) scale(1); }
  .stack-title { font-size: 1.72rem; }
  .stack-syn { font-size: 0.82rem; }
  .stack-prev { left: max(0.6rem, calc(50% - 430px)); }
  .stack-next { right: max(0.6rem, calc(50% - 430px)); }
}
@media (prefers-reduced-motion: reduce) {
  .stack-card { transition: none !important; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 1.05rem;
  border-radius: 999px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; background: transparent; color: var(--ink);
  font-size: 0.88rem;
}
.btn-primary, .btn-cyan {
  background: linear-gradient(180deg, rgba(149, 137, 230, 0.42), rgba(129, 116, 216, 0.32));
  border: 1px solid var(--accent-line);
  color: #EDE9FE;
  font-weight: 600;
  box-shadow: var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
}
.btn-ghost { border-color: rgba(148,187,233,0.22); background: rgba(8,14,28,0.35); }
.auth-error { color: #f0b2a8; min-height: 1.2em; margin: 0.4rem 0 0.8rem; font-size: 0.88rem; }
.demo-logins { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 1rem; }
.demo-logins button { width: 100%; }
.btn-danger { border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: #f0b2a8; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.section { padding: 1.6rem 0 0.4rem; }
.section h2, .explore-row h2 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0;
}
.kicker {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cyan); margin: 0 0 0.25rem;
}
.explore-head { padding-top: 1.4rem; }
.explore-row {
  display: flex; flex-wrap: wrap; gap: 0.8rem 1rem;
  align-items: center; justify-content: space-between;
}
.sort-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.sort-pills a {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.45rem 0.85rem; color: var(--muted); font-size: 0.84rem;
}
.sort-pills a.on {
  border-color: var(--accent-line);
  color: #EDE9FE;
  background: var(--accent-fill);
  box-shadow: var(--accent-glow);
}

.rails { display: flex; flex-direction: column; gap: 1.1rem; padding: 1rem 1rem 2rem; }
.rail-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(16,28,48,0.65), rgba(8,14,26,0.9));
  padding: 1rem 0.85rem 0.85rem;
}
.rail-head, .rail-foot {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0 0.35rem 0.7rem;
}
.rail-head h2 {
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 1.15rem; font-weight: 600; margin: 0;
  display: flex; align-items: center; gap: 0.45rem;
}
.rail-head .count { margin-left: auto; color: var(--muted); font-size: 0.8rem; }
.live-dot {
  width: 8px; height: 8px; border-radius: 99px; display: inline-block;
  background: rgba(149,137,230,0.95); box-shadow: 0 0 10px rgba(129,116,216,0.35);
}
.tone-violet .live-dot { background: var(--violet); box-shadow: 0 0 10px var(--violet); }
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 78%);
  gap: 0.85rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.4rem;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 800px) {
  .rail { grid-auto-columns: minmax(460px, 48%); }
}
.rail::-webkit-scrollbar { height: 0; }
.rail-foot { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; }
.rail-foot [data-num] { margin-left: auto; font-variant-numeric: tabular-nums; }
.rail-track {
  flex: 1; height: 3px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden;
}
.rail-track span { display: block; height: 100%; width: 22%; background: var(--cyan); }
.rail-foot em { margin-left: auto; font-style: normal; letter-spacing: 0.12em; text-transform: uppercase; }

.wide-card {
  --tone: #7c5cbf;
  position: relative;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: minmax(7.6rem, 36%) minmax(0, 1fr);
  gap: 0.65rem 0.75rem;
  align-items: stretch;
  min-width: 0;
  padding: 0.65rem 0.7rem 0.7rem;
  border-radius: 16px;
  background:
    radial-gradient(90% 80% at 8% 12%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 58%),
    linear-gradient(180deg, rgba(14, 16, 32, 0.94), rgba(8, 10, 20, 0.97));
  border: 1px solid color-mix(in srgb, var(--tone) 18%, rgba(148,187,233,0.08));
}
@media (min-width: 720px) {
  .wide-card { grid-template-columns: minmax(9.6rem, 32%) minmax(0, 1fr); padding: 0.75rem; }
}
.wide-heart {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 3;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid rgba(168,154,230,0.28);
  border-radius: 999px;
  background: rgba(10,12,22,0.55);
  color: #c9c0e8;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
}
.wide-heart[aria-pressed="true"] {
  color: #f0b4d2;
  border-color: rgba(224,138,184,0.55);
  background: rgba(56, 22, 42, 0.55);
  box-shadow: 0 0 10px rgba(224,138,184,0.22);
}
.wide-cover { min-width: 0; align-self: stretch; }
.wide-cover .cover-frame {
  height: 100%;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--tone) 26%, transparent),
    0 10px 20px rgba(0,0,0,0.36),
    0 0 18px color-mix(in srgb, var(--tone) 18%, transparent);
}
.wide-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.wide-title { padding-right: 1.55rem; }
.wide-title {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
  color: inherit;
}
.wide-title h3 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--serif);
  font-size: clamp(1.08rem, 4.2vw, 1.48rem);
  line-height: 1.12;
  font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wide-title em {
  flex: 0 0 auto;
  margin-top: 0.18rem;
  color: #b7a8f0;
  font-style: normal;
  font-size: 1rem;
  line-height: 1;
}
.wide-body .by {
  margin: 0;
  color: #b7a8f0;
  font-size: clamp(0.76rem, 2.1vw, 0.88rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 0.28rem; }
.pill {
  font-size: 0.64rem; padding: 0.16rem 0.52rem; border-radius: 999px;
  background: linear-gradient(180deg, rgba(149, 137, 230, 0.42), rgba(129, 116, 216, 0.32));
  border: 1px solid var(--accent-line);
  color: #EDE9FE;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill-more {
  background: rgba(129, 116, 216, 0.18);
  border: 1px solid var(--accent-line);
  color: #EDE9FE;
  max-width: none;
}
.wide-stats {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0.28rem 0;
  color: var(--muted); font-size: 0.72rem;
  overflow: visible;
}
.wide-stats span {
  display: inline-flex; align-items: center; gap: 0.22rem;
  white-space: nowrap;
  padding: 0 0.42rem 0 0;
  margin-right: 0.42rem;
  border-right: 1px solid rgba(168,154,230,0.18);
}
.wide-stats span:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stat-eye {
  display: inline-block; width: 0.92em; height: 0.92em; flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 5c5.2 0 9.3 3.4 10.7 7-1.4 3.6-5.5 7-10.7 7S2.7 15.6 1.3 12C2.7 8.4 6.8 5 12 5zm0 2.2A4.8 4.8 0 1 0 16.8 12 4.8 4.8 0 0 0 12 7.2zm0 2A2.8 2.8 0 1 1 9.2 12 2.8 2.8 0 0 1 12 9.2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 5c5.2 0 9.3 3.4 10.7 7-1.4 3.6-5.5 7-10.7 7S2.7 15.6 1.3 12C2.7 8.4 6.8 5 12 5zm0 2.2A4.8 4.8 0 1 0 16.8 12 4.8 4.8 0 0 0 12 7.2zm0 2A2.8 2.8 0 1 1 9.2 12 2.8 2.8 0 0 1 12 9.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.metric-eye { display: inline-flex; align-items: center; gap: 0.28rem; }
.wide-latest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "lab go"
    "name go";
  column-gap: 0.4rem;
  margin-top: auto;
  padding: 0.38rem 0.5rem 0.4rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--tone) 24%, transparent);
  background: rgba(10, 12, 24, 0.42);
  color: inherit;
  font-size: 0.72rem;
  min-width: 0;
}
.wide-latest span {
  grid-area: lab;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: var(--muted);
  white-space: nowrap;
}
.wide-latest i {
  width: 6px; height: 6px; border-radius: 99px;
  background: color-mix(in srgb, var(--tone) 85%, #fff);
  box-shadow: 0 0 8px color-mix(in srgb, var(--tone) 55%, transparent);
}
.wide-latest b {
  grid-area: name;
  color: var(--ink); font-weight: 500;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wide-latest em {
  grid-area: go;
  align-self: center;
  color: #b7a8f0;
  font-style: normal;
}

.cover-frame {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden;
  background: #121826; border-radius: 6px;
}
.cover-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 18%; display: block;
}
.story-card { display: flex; flex-direction: column; min-width: 0; color: inherit; }
.story-card .meta { padding: 0.55rem 0.05rem 0; }
.story-card h3 { margin: 0; font-size: 0.95rem; font-weight: 600; line-height: 1.25; }
.story-card .by, .story-card .sub { color: var(--muted); font-size: 0.78rem; }
.badge { display: inline-flex; font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--cyan); }

.motif-row { display: flex; flex-wrap: wrap; gap: 0.45rem; padding-bottom: 1.4rem; }
.motif-row a {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.75rem; color: var(--muted);
}
.site-footer {
  border-top: 1px solid var(--line); padding: 2.2rem 0 3rem; color: var(--muted); font-size: 0.84rem;
  text-align: center;
}
.site-footer .brand {
  margin: 0 auto 0.55rem;
  justify-content: center;
}


.story-page { padding: 0.85rem 0 5.6rem; }
.story-top { display: block; }
.story-hero {
  display: grid;
  grid-template-columns: minmax(7.4rem, 34%) minmax(0, 1fr);
  gap: clamp(0.7rem, 2.4vw, 1.35rem);
  align-items: stretch;
}
@media (min-width: 720px) {
  .story-hero { grid-template-columns: minmax(10.5rem, 30%) minmax(0, 1fr); }
}
@media (min-width: 1024px) {
  .story-hero { grid-template-columns: minmax(12.5rem, 26%) minmax(0, 1fr); }
}
.story-cover {
  width: 100%;
  min-width: 0;
  align-self: stretch;
}
.story-cover .cover-frame {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.38);
}
.story-cover .cover-frame img {
  object-fit: cover;
  object-position: center 18%;
}
.story-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
}
.story-copy { min-width: 0; }
.story-info .badge {
  display: block;
  margin: 0;
  font-size: clamp(0.62rem, 1.6vw, 0.74rem);
  letter-spacing: 0.12em;
  color: #b7a8f0;
}
.story-info h1 {
  font-family: var(--serif);
  font-size: clamp(1.22rem, 4.2vw, 2.15rem);
  line-height: 1.12;
  margin: 0.18rem 0 0.28rem;
  font-weight: 600;
}
.story-info .by {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: clamp(0.78rem, 2.1vw, 0.95rem);
}
.story-info .by span { color: #b7a8f0; }
.story-info .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.18rem 0.58rem;
  border: 1px solid rgba(168, 154, 230, 0.28);
  border-radius: 999px;
  color: #d5d0ea;
  font-size: clamp(0.64rem, 1.8vw, 0.76rem);
  letter-spacing: 0.01em;
  background: rgba(18, 16, 36, 0.45);
}
.chip-more { color: var(--muted); }
.story-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid rgba(168, 154, 230, 0.22);
  border-radius: 12px;
  background: rgba(12, 14, 28, 0.55);
  overflow: hidden;
}
.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  padding: 0.48rem 0.15rem 0.42rem;
  text-align: center;
  border-left: 1px solid rgba(168, 154, 230, 0.14);
}
.metric:first-child { border-left: 0; }
.metric-ico {
  font-size: 0.78rem;
  line-height: 1;
  color: #c4b8f0;
}
.metric-ico.heart { color: #e08ab8; }
.metric b {
  font-size: clamp(0.82rem, 2.2vw, 1rem);
  font-weight: 650;
  color: #f0ecff;
  line-height: 1.1;
}
.metric small {
  color: var(--muted);
  font-size: clamp(0.56rem, 1.5vw, 0.68rem);
}
.story-acts {
  display: grid;
  grid-template-columns: 1.18fr 1fr 1fr;
  gap: 0.42rem;
}
.story-acts .btn {
  min-width: 0;
  min-height: clamp(36px, 8vw, 44px);
  padding: 0 0.4rem;
  font-size: clamp(0.7rem, 2vw, 0.84rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 10px;
}
.story-acts .btn-cyan {
  box-shadow: 0 0 0 1px rgba(149, 137, 230, 0.35), 0 8px 18px rgba(88, 70, 170, 0.28);
}
.story-tabs {
  display: flex;
  gap: 0;
  margin: 0.35rem 0 0.85rem;
  border-bottom: 1px solid var(--line);
}
.story-tabs a {
  flex: 1;
  text-align: center;
  padding: 0.7rem 0.2rem 0.55rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.84rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.story-tabs a.on { color: #EDE9FE; border-bottom-color: rgba(149,137,230,0.85); }
.intro-sheet, .toc-box, .rate-box, .same-author {
  padding: 0.15rem 0 0.2rem;
}
.intro-card, .info-card {
  position: relative;
  width: 100%;
  margin: 0 0 0.85rem;
  padding: clamp(1rem, 3vw, 1.45rem) clamp(0.95rem, 2.8vw, 1.4rem) 1.05rem;
  border: 1px solid rgba(168, 154, 230, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 100% 8%, rgba(129, 116, 216, 0.10), transparent 46%),
    linear-gradient(180deg, rgba(16, 18, 34, 0.92), rgba(10, 12, 24, 0.96));
  overflow: hidden;
}
.intro-card::after, .info-card::after {
  content: "";
  position: absolute;
  inset: auto -6% -18% auto;
  width: min(46%, 220px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.16;
  background:
    radial-gradient(circle at 70% 40%, rgba(168, 146, 255, 0.55), transparent 42%),
    radial-gradient(circle at 30% 70%, rgba(129, 116, 216, 0.35), transparent 50%);
  mask-image: radial-gradient(circle at 60% 50%, #000 0 42%, transparent 74%);
}
.intro-title, .info-title {
  position: relative;
  z-index: 1;
  margin: 0 0 0.7rem;
  font-size: clamp(0.78rem, 2.1vw, 0.92rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4b5fd;
  font-weight: 700;
}
.intro-body {
  position: relative;
  z-index: 1;
  color: #d8deea;
  font-size: clamp(1.02rem, 2.7vw, 1.12rem);
  line-height: 1.78;
}
.intro-body.is-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 17.8em;
}
.intro-more, .info-more {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-top: 0.7rem;
  padding: 0;
  border: 0;
  background: none;
  color: #c4b5fd;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
}
.info-card {
  padding-bottom: 0.95rem;
}
.info-body {
  position: relative;
  z-index: 1;
  padding: 0.15rem 0 0.15rem 0.85rem;
  border-left: 2px solid rgba(149, 137, 230, 0.55);
}
.info-body p {
  margin: 0 0 0.42rem;
  color: #d8deea;
  font-size: clamp(0.92rem, 2.4vw, 1.02rem);
  line-height: 1.55;
}
.info-body p:last-child { margin-bottom: 0; }
.info-body strong { color: #f1edff; font-weight: 650; }
.info-body.is-clamp {
  max-height: 16.5rem;
  overflow: hidden;
}
.info-more {
  width: 100%;
  margin-top: 0.85rem;
  min-height: 40px;
  justify-content: center;
  border: 1px solid rgba(168, 154, 230, 0.28);
  border-radius: 10px;
  background: rgba(18, 16, 36, 0.4);
}
.same-author {
  margin-top: 1.2rem;
  padding: clamp(0.85rem, 3vw, 1.15rem);
  border: 1px solid rgba(168, 154, 230, 0.25);
  border-radius: 16px;
  background:
    radial-gradient(90% 115% at 100% 0%, rgba(129, 116, 216, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(17, 20, 38, 0.92), rgba(10, 13, 26, 0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 14px 32px rgba(0,0,0,.16);
  overflow: hidden;
}
.same-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.same-head h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: #f0edff;
  font-size: clamp(.82rem, 2.8vw, 1rem);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.same-head h3::before {
  content: "";
  width: 1.4rem;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(90deg, #9b70ff, #c5a9ff);
  box-shadow: 0 0 10px rgba(155,112,255,.7);
}
.same-head span { color: var(--muted); font-size: 0.78rem; }
.same-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(94px, 25vw, 116px);
  gap: 0.72rem;
  overflow-x: auto;
  padding: .12rem .1rem .28rem;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.same-rail::-webkit-scrollbar { display: none; }
.same-card {
  min-width: 0;
  padding: .34rem .34rem .45rem;
  color: inherit;
  border: 1px solid rgba(168,154,230,.2);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(20,23,42,.86), rgba(12,15,29,.92));
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
  scroll-snap-align: start;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.same-card:active {
  transform: translateY(-2px);
  border-color: rgba(183,160,255,.55);
  box-shadow: 0 10px 24px rgba(42,30,95,.28), 0 0 0 1px rgba(155,112,255,.12);
}
.same-card .cover-frame {
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  border-radius: 8px;
  background: #0b0e19;
}
.same-card .cover-frame img { width: 100%; height: 100%; object-fit: cover; }
.same-card b {
  display: block;
  min-height: 2.5em;
  margin-top: 0.42rem;
  overflow: hidden;
  color: #f0f1f8;
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.same-card small {
  display: block;
  margin-top: 0.18rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.same-card em {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  max-width: 100%;
  margin-top: .42rem;
  padding: .16rem .38rem;
  overflow: hidden;
  border: 1px solid rgba(168,154,230,.25);
  border-radius: 999px;
  color: #aaa7bd;
  font-size: .56rem;
  font-style: normal;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.same-card em::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9b70ff;
  box-shadow: 0 0 7px rgba(155,112,255,.7);
}
.recommended-stories { margin-top: 1rem; }
.toc-box, .rate-box {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}
.toc-head { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-bottom: 0.7rem; }
.toc-head input {
  flex: 1; min-width: 140px; background: #0b1220; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.65rem;
}
.toc-groups { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.toc-groups a {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.28rem 0.6rem;
  font-size: 0.78rem; color: var(--muted);
}
.toc-groups a.on { border-color: var(--cyan); color: var(--cyan); }
.story-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: center;
  padding: 0.55rem 0.8rem calc(0.55rem + env(safe-area-inset-bottom));
  background: rgba(7,11,20,0.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.dock-read { min-height: 46px; border-radius: 10px; }
.dock-fav {
  min-height: 46px;
  min-width: 92px;
  padding: 0 0.85rem;
  border-radius: 10px;
}

.stat-row { display: flex; flex-wrap: wrap; gap: 0.9rem 1.2rem; color: var(--muted); font-size: 0.86rem; margin: 0.8rem 0; }
.action-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chapter-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.6rem 0 0.8rem; }
.chapter-list { list-style: none; padding: 0; margin: 0; }
.chapter-list li { border-top: 1px solid var(--line); }
.chapter-list a, .chapter-list .row {
  display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 0.6rem;
  padding: 0.72rem 0.1rem; color: inherit; align-items: baseline;
}
.chapter-list .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.chapter-list .read { color: var(--muted); }
.pager { display: flex; gap: 0.5rem; justify-content: center; padding: 1rem 0 2rem; }

/* Premium eBook reader */
.reader-page {
  --rbg: #111318;
  --rink: #e8e4dc;
  --rmuted: #9a9488;
  --rline: rgba(255,255,255,0.1);
  --rpanel: #1a1d24;
  --rchip: rgba(255,255,255,0.08);
  --raccent: #c4b5a0;
  background: var(--rbg);
  color: var(--rink);
  min-height: 100dvh;
}
.reader-page[data-theme="light"] {
  --rbg: #f7f4ee;
  --rink: #1c1a16;
  --rmuted: #6b655c;
  --rline: rgba(28,26,22,0.1);
  --rpanel: #ffffff;
  --rchip: rgba(28,26,22,0.06);
  --raccent: #3d3a34;
}
.reader-page[data-theme="sepia"] {
  --rbg: #f3ead8;
  --rink: #3a2c18;
  --rmuted: #7a684c;
  --rline: rgba(90,68,36,0.14);
  --rpanel: #f8f1e2;
  --rchip: rgba(90,68,36,0.08);
  --raccent: #6b4f2a;
}
.reader-page[data-font="sans"] { --read: "Be Vietnam Pro", system-ui, sans-serif; }
.reader-page[data-font="serif"], .reader-page { --read: "Source Serif 4", "Cormorant Garamond", Georgia, serif; }
.reader-chrome {
  position: fixed;
  left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: color-mix(in srgb, var(--rpanel) 88%, transparent);
  color: var(--rink);
  border-color: var(--rline);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.reader-top {
  top: 0;
  padding: calc(0.4rem + env(safe-area-inset-top, 0px)) 0.7rem 0.55rem;
  min-height: 3.1rem;
}
.reader-bot {
  bottom: 0;
  left: 50%;
  right: auto;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  margin-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--rline);
  border-radius: 999px;
  padding: 0.28rem 0.4rem;
  justify-content: space-between;
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}
.reader-page.is-immersed .reader-top { opacity: 0; pointer-events: none; transform: translateY(-10px); }
.reader-page.is-immersed .reader-bot { opacity: 0; pointer-events: none; transform: translate(-50%, 12px); }
.r-ico {
  width: 36px; height: 36px;
  border: 0; background: transparent; color: inherit;
  font-size: 1.05rem; cursor: pointer;
  display: grid; place-items: center;
  text-decoration: none;
  flex: 0 0 auto;
}
.r-head-copy { flex: 1; min-width: 0; text-align: center; }
.r-story { font-size: 0.92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-sub { font-size: 0.72rem; color: var(--rmuted); margin-top: 0.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-progress {
  position: absolute; left: 0.85rem; right: 3.2rem; bottom: 0.28rem;
  height: 2px; background: var(--rline); border-radius: 99px; overflow: hidden;
}
.r-progress span { display: block; height: 100%; width: 0; background: var(--raccent); }
.r-pct { position: absolute; right: 0.7rem; bottom: 0.08rem; font-size: 0.62rem; color: var(--rmuted); }
.reader-body {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3.4rem 1.25rem 7.2rem;
  font-family: var(--read);
  font-size: var(--rsize, 1.12rem);
  line-height: 1.85;
}
.reader-body, .reader-body * { color: inherit; }
.reader-body h2 {
  font-family: "Cormorant Garamond", var(--serif);
  font-weight: 500;
  font-size: clamp(1.55rem, 5.6vw, 2.15rem);
  text-align: center;
  margin: 0.4rem 0 0.35rem;
  line-height: 1.2;
}
.r-orn {
  width: 7.5rem; height: 10px; margin: 0.15rem auto 1.4rem;
  background:
    linear-gradient(90deg, transparent, var(--rline) 18%, var(--rline) 82%, transparent),
    radial-gradient(circle at 50% 50%, var(--raccent) 0 1.5px, transparent 1.8px);
  background-size: 100% 1px, 10px 10px;
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  opacity: 0.7;
}
.reader-body p.r-p {
  position: relative;
  margin: 0 0 1.15em;
  padding-right: 1.4rem;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.p-bubble {
  position: absolute;
  right: -0.15rem; top: 0.15rem;
  width: 1.15rem; min-height: 1.15rem;
  border: 0; background: transparent;
  color: var(--rmuted);
  font-size: 0.62rem;
  opacity: 0;
  cursor: pointer;
}
.p-bubble.has, .r-p:hover .p-bubble { opacity: 0.7; }
.p-bubble.has::before { content: "💬 "; font-size: 0.62rem; }
.p-menu {
  position: absolute;
  z-index: 40;
  display: flex; gap: 0.25rem;
  background: var(--rpanel);
  border: 1px solid var(--rline);
  border-radius: 999px;
  padding: 0.2rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.p-menu button, .quote-pop button {
  border: 0; background: transparent; color: var(--rink);
  font-size: 0.75rem; padding: 0.28rem 0.55rem; cursor: pointer;
}
.quote-pop { position: absolute; }
.r-engage {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin: 1.6rem 0 0.4rem;
  border: 1px solid var(--rline);
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--rpanel) 70%, transparent);
}
.r-engage button {
  border: 0; border-right: 1px solid var(--rline);
  background: transparent; color: var(--rink);
  padding: 0.75rem 0.35rem;
  font-size: 0.72rem;
  cursor: pointer;
}
.r-engage button:last-child { border-right: 0; }
.r-engage span { display: block; font-size: 0.95rem; margin-bottom: 0.1rem; }
.r-engage b { display: block; font-weight: 500; }
.r-engage em { display: block; color: var(--rmuted); font-style: normal; margin-top: 0.12rem; }
.r-engage .on { color: var(--raccent); }
.r-nav {
  flex: 1;
  color: inherit;
  text-decoration: none;
  font-size: 0.78rem;
  padding: 0.55rem 0.4rem;
  white-space: nowrap;
}
.r-nav-r { text-align: right; }
.r-nav.is-off { opacity: 0.28; pointer-events: none; }
.r-toc {
  width: 46px; height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--raccent);
  color: var(--rbg);
  margin: 0 0.15rem;
  cursor: pointer;
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.r-toc span, .r-toc span::before, .r-toc span::after {
  display: block; width: 14px; height: 1.5px; background: currentColor; position: relative;
}
.r-toc span::before, .r-toc span::after {
  content: ""; position: absolute; left: 0;
}
.r-toc span::before { top: -5px; }
.r-toc span::after { top: 5px; }
.r-hint {
  text-align: center;
  color: var(--rmuted);
  font-size: 0.72rem;
  margin: 0 1rem 5.5rem;
}
.reader-page .drawer {
  background: var(--rpanel);
  color: var(--rink);
  border-color: var(--rline);
}
.reader-page .drawer.sheet {
  left: 0.7rem; right: 0.7rem; bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
  max-height: 42dvh;
  border-radius: 18px;
  border: 1px solid var(--rline);
  overflow: auto;
}
.reader-page .drawer.side {
  top: auto; bottom: 0; left: 0; right: 0;
  height: min(72dvh, 560px);
  width: 100%;
  border-radius: 18px 18px 0 0;
  overflow: auto;
}
.aa-pad { padding: 0.85rem 1rem 1.05rem; }
.aa-pad .set-lab { margin: 0.55rem 0 0.3rem; color: var(--rmuted); font-size: 0.72rem; }
.aa-row { display: flex; gap: 0.4rem; }
.aa-chip {
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--rline);
  background: var(--rchip);
  color: inherit;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
}
.aa-chip.on { background: color-mix(in srgb, var(--raccent) 22%, var(--rpanel)); border-color: color-mix(in srgb, var(--raccent) 40%, var(--rline)); }
.toc-pad { max-height: inherit; }
.toc-pad .chapter-list a.on { color: var(--raccent); }
.reader-page .quote-ref { border-left-color: var(--raccent); color: var(--rmuted); }
.reader-page .comment { border-top-color: var(--rline); }
.reader-page .empty { color: var(--rmuted); }
@media (min-width: 720px) {
  .reader-body { padding-top: 4rem; font-size: var(--rsize, 1.18rem); }
}

.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 50; }
.drawer { position: fixed; z-index: 51; background: #0c1322; color: var(--ink); border-top: 1px solid var(--line); }
.drawer.bottom { left: 0; right: 0; bottom: 0; max-height: 82dvh; border-radius: 16px 16px 0 0; overflow: auto; }
.drawer.side { top: 0; right: 0; bottom: 0; width: min(420px, 100%); overflow: auto; }
.drawer-pad { padding: 1rem 1rem 1.4rem; }
.drawer-head {
  display: flex; align-items: center; gap: 0.25rem;
  margin: -0.25rem 0 0.65rem -0.35rem;
}
.drawer-head h3 { margin: 0; font-size: 1.1rem; }
.comment { padding: 0.85rem 0; border-top: 1px solid var(--line); }
.quote-ref {
  font-size: 0.86rem; color: var(--muted);
  border-left: 2px solid var(--cyan); padding-left: 0.6rem; margin-bottom: 0.4rem;
}

.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.8rem; }
.field label { font-size: 0.78rem; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; background: #0b1220; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.65rem 0.75rem;
}
.field textarea { min-height: 7rem; resize: vertical; }
.field textarea[name="description"] { min-height: 14rem; }

.toast-wrap {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  z-index: 80; display: flex; flex-direction: column; gap: 0.4rem; width: min(92vw, 360px);
}
.toast {
  background: #121a2c; border: 1px solid var(--line); color: var(--ink);
  padding: 0.7rem 0.9rem; border-radius: 10px; font-size: 0.88rem;
}

.search-panel {
  position: absolute; right: 1rem; top: 60px; width: min(92vw, 360px);
  background: #0c1322; border: 1px solid var(--line); border-radius: 10px;
  padding: 0.6rem; z-index: 45;
}
.search-hit { display: flex; gap: 0.6rem; padding: 0.45rem; border-radius: 8px; }
.search-hit:hover { background: rgba(255,255,255,0.04); }
.search-hit img { width: 36px; height: 54px; object-fit: cover; border-radius: 2px; }

.admin-shell { display: grid; gap: 1rem; padding: 1rem 0 3rem; }
@media (min-width: 860px) { .admin-shell { grid-template-columns: 200px 1fr; } }
.admin-nav a { display: block; padding: 0.45rem 0; color: var(--muted); font-size: 0.9rem; }
.admin-nav a.on, .admin-nav a:hover { color: var(--ink); }
.kpi { background: #0c1322; border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem; }
.kpi b { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 500; }
.editor-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0b1220;
  margin: 0.4rem 0 0.7rem;
}
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.28rem;
  padding: 0.45rem;
  border-bottom: 1px solid var(--line);
  background: #0e1628;
  position: sticky; top: 56px; z-index: 6;
}
.editor-toolbar button {
  min-width: 36px; min-height: 36px; padding: 0 0.45rem;
  border: 1px solid var(--line);
  background: #0b1220; color: var(--ink); border-radius: 6px; cursor: pointer;
  font-size: 0.78rem; font-weight: 600;
}
.editor-toolbar button:hover { border-color: var(--accent-line); }
.editor-area {
  min-height: 280px;
  max-height: min(68dvh, 620px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #0b1220;
  color: #e8eef8;
  padding: 0.95rem 1rem 1.4rem;
  outline: none;
  line-height: 1.7;
  contain: content;
}
.editor-area:empty:before {
  content: attr(data-placeholder);
  color: var(--muted);
}
.editor-area, .editor-area * {
  color: #e8eef8 !important;
  background: transparent !important;
}
.editor-area a { color: #c4b5fd !important; text-decoration: underline; }
.editor-area p { margin: 0 0 var(--ed-gap, 0.9em); }
.editor-area h2, .editor-area h3 { font-family: var(--serif); font-weight: 500; margin: 1em 0 0.5em; }
.editor-area img { max-width: 100%; height: auto; border-radius: 6px; }
.editor-area blockquote {
  margin: 0.8rem 0; padding-left: 0.8rem;
  border-left: 2px solid var(--accent-line);
}
.editor-hint { color: var(--muted); font-size: 0.78rem; margin: 0 0 0.9rem; }
.empty { color: var(--muted); padding: 2rem 0; text-align: center; }
.stars button { background: none; border: 0; color: var(--cyan); font-size: 1.2rem; cursor: pointer; padding: 0.15rem; }
[hidden] { display: none !important; }
.mobile-menu {
  display: none;
  position: fixed; inset: 0 0 auto 0; top: 64px;
  background: #0a1020; border-bottom: 1px solid var(--line);
  padding: 0.8rem 1rem 1.1rem; z-index: 39;
  flex-direction: column; gap: 0.85rem;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a { font-size: 1.02rem; color: var(--ink); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.lower-wrap { display: flex; flex-direction: column; gap: 1rem; padding: 0.4rem 1rem 2rem; }
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14,24,44,0.82), rgba(7,12,24,0.94));
  padding: 1.15rem 1rem 1.2rem;
}
.panel h2 {
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: clamp(1.25rem, 4.4vw, 1.7rem);
  font-weight: 650; margin: 0.15rem 0 0.35rem; line-height: 1.25;
}
.lead { color: var(--muted); margin: 0 0 0.9rem; font-size: 0.88rem; }
.live {
  color: var(--cyan); letter-spacing: 0.14em; font-size: 0.68rem; margin-left: 0.35rem;
}
.rank-list { display: flex; flex-direction: column; gap: 0.55rem; }
.rank-row {
  display: grid; grid-template-columns: 2.1rem 52px 1fr auto;
  gap: 0.65rem; align-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0.55rem 0.65rem; background: rgba(6,12,24,0.45);
}
.rank-n { font-weight: 700; color: var(--cyan); font-variant-numeric: tabular-nums; }
.rank-cover { width: 52px; }
.rank-cover .cover-frame { border-radius: 6px; }
.rank-meta { min-width: 0; }
.rank-meta b { display: block; font-size: 0.95rem; }
.rank-meta small { color: var(--muted); font-size: 0.74rem; }
.rank-bar {
  display: block; height: 4px; border-radius: 99px; margin-top: 0.35rem;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
.rank-bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, rgba(149,137,230,0.85), rgba(129,116,216,0.55));
}
.rank-score { text-align: right; color: var(--cyan); }
.rank-score em { display: block; font-style: normal; font-size: 1.15rem; font-weight: 700; }
.rank-score small { display: block; color: var(--muted); font-size: 0.68rem; }
@media (max-width: 520px) {
  .rank-row { grid-template-columns: 1.6rem 44px 1fr; }
  .rank-score { display: none; }
}
.signal-grid { display: grid; gap: 0.75rem; }
@media (min-width: 860px) { .signal-grid { grid-template-columns: 1fr 1fr; } }
.inner-card {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 0.8rem; background: rgba(6,12,24,0.4);
}
.tl { display: flex; flex-direction: column; gap: 0.7rem; }
.tl-item {
  display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.6rem;
  padding-left: 0.85rem; border-left: 2px solid rgba(129,116,216,0.38);
}
.tl-item small { grid-column: 1; color: var(--cyan); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.tl-item b { grid-column: 1; }
.tl-item span { grid-column: 1; color: var(--muted); font-size: 0.8rem; }
.tl-item em { grid-column: 2; grid-row: 1 / span 3; color: var(--muted); font-style: normal; font-size: 0.75rem; align-self: start; }
.note-card { border: 1px solid var(--line); border-radius: 12px; padding: 0.65rem 0.7rem; margin-bottom: 0.5rem; }
.note-top { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.25rem; }
.note-top time { margin-left: auto; color: var(--muted); font-size: 0.72rem; }
.note-card p { margin: 0.2rem 0 0.35rem; }
.note-card a { color: var(--cyan); font-size: 0.78rem; }
.note-form { display: flex; gap: 0.4rem; margin-top: 0.55rem; }
.note-form input {
  flex: 1; min-width: 0; background: #0b1220; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.7rem;
}
.mood-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.9rem;
}
@media (min-width: 720px) { .mood-grid { grid-template-columns: 1fr 1fr 1fr; } }
.mood-btn {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(6,12,24,0.4); color: var(--ink); cursor: pointer;
}
.mood-btn.on { border-color: #818cf8; background: linear-gradient(180deg, rgba(91,70,180,0.28), rgba(8,14,28,0.5)); }
.btn-grad {
  background: linear-gradient(180deg, rgba(149, 137, 230, 0.42), rgba(129, 116, 216, 0.32));
  border: 1px solid var(--accent-line);
  color: #EDE9FE; font-weight: 600; display: inline-flex;
  box-shadow: var(--accent-glow);
}
.quote-grid { display: grid; gap: 1rem; align-items: center; }
@media (min-width: 800px) { .quote-grid { grid-template-columns: 1fr 160px; } }
.quote-grid blockquote {
  font-family: var(--serif); font-size: 1.25rem; margin: 0.4rem 0 0.6rem; line-height: 1.4;
}
.orb {
  width: 140px; height: 140px; margin: 0 auto;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(129,116,216,0.42) 0 28%, transparent 30%),
    repeating-radial-gradient(circle, transparent 0 18px, rgba(149,137,230,0.22) 18px 19px);
  box-shadow: 0 0 28px rgba(129,116,216,0.16);
}
.poll-grid { display: grid; gap: 0.5rem; margin: 0.8rem 0 1rem; }
@media (min-width: 800px) { .poll-grid { grid-template-columns: 1fr 1fr 1fr; } }
.poll-opt {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.35rem 0.5rem; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 0.65rem 0.7rem;
}
.poll-opt .rank-bar { grid-column: 1 / -1; }
.foot-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border: 1px solid var(--line); border-radius: 18px;
  padding: 1.6rem 1rem 1.4rem; text-align: center;
  background: linear-gradient(180deg, rgba(14,24,44,0.7), rgba(7,12,24,0.95));
}
.foot-desc { max-width: 36rem; margin: 0.7rem auto 1rem; color: var(--muted); }
.foot-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.foot-social { color: var(--muted); }
.foot-social a { color: var(--muted); }
.foot-copy { color: #6b7a90; font-size: 0.74rem; margin-top: 1rem; }

.social-strip {
  display: flex; justify-content: center; align-items: center;
  gap: 0.7rem; padding: 0.85rem 0 0.15rem;
}
.social-ico {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148,187,233,0.18);
  background: rgba(8,14,28,0.45);
  color: #d7def0;
}
.social-ico svg { width: 18px; height: 18px; display: block; }
.social-ico:hover {
  border-color: var(--accent-line);
  color: #EDE9FE;
  box-shadow: var(--accent-glow);
}

.sig-wrap { padding: 0.4rem 0 2.2rem; }
.sig-board {
  border: 1px solid rgba(168,154,230,0.22);
  border-radius: 18px;
  background:
    radial-gradient(90% 70% at 0% 0%, rgba(129,116,216,0.12), transparent 52%),
    linear-gradient(180deg, rgba(14,16,32,0.96), rgba(8,10,20,0.98));
  padding: 1rem 0.9rem 1.05rem;
}
.sig-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; }
.sig-brand { display: flex; gap: 0.7rem; align-items: flex-start; min-width: 0; }
.sig-mark {
  width: 2.4rem; height: 2.4rem; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(149,137,230,0.46), rgba(129,116,216,0.32));
  border: 1px solid var(--accent-line);
}
.sig-brand h2 {
  margin: 0;
  font-size: clamp(1.05rem, 3.6vw, 1.28rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 0.35rem;
}
.sig-brand h2 i {
  width: 1.1rem; height: 0.7rem;
  background: linear-gradient(90deg, transparent, #c4b5fd, transparent);
  clip-path: polygon(0 50%, 18% 20%, 36% 70%, 54% 10%, 72% 80%, 90% 30%, 100% 50%, 100% 60%, 90% 40%, 72% 90%, 54% 20%, 36% 80%, 18% 30%, 0 60%);
}
.sig-brand p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.82rem; }
.sig-count {
  margin: 0.75rem 0 0.85rem;
  color: #d8deea;
  font-size: 0.86rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
}
.sig-tools {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.sig-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sig-tab {
  border: 1px solid var(--line);
  background: rgba(8,14,28,0.4);
  color: var(--muted);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
}
.sig-tab.on {
  color: #EDE9FE;
  border-color: var(--accent-line);
  background: var(--accent-fill);
}
.sig-filter select {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8,14,28,0.4);
  color: var(--ink);
  padding: 0 0.8rem;
  font-size: 0.78rem;
}
.sig-list { display: flex; flex-direction: column; gap: 0.7rem; }
.sig-card, .sig-reply {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.8rem 0.75rem;
  border: 1px solid rgba(168,154,230,0.16);
  border-radius: 14px;
  background: rgba(10,12,24,0.45);
}
.sig-card.is-hidden, .sig-reply.is-more { display: none; }
.sig-ava {
  width: 2.4rem; height: 2.4rem;
  border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(129,116,216,0.28);
  color: #EDE9FE;
  font-weight: 700;
  overflow: hidden;
}
.sig-ava.sm { width: 1.85rem; height: 1.85rem; font-size: 0.78rem; }
.sig-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sig-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.4rem;
  margin-bottom: 0.35rem;
}
.sig-meta b { font-size: 0.92rem; }
.sig-meta time { color: var(--muted); font-size: 0.74rem; }
.sig-badge {
  font-size: 0.62rem;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  background: rgba(129,116,216,0.32);
  color: #EDE9FE;
}
.sig-badge.staff {
  background: linear-gradient(180deg, rgba(149,137,230,0.5), rgba(129,116,216,0.34));
  border: 1px solid var(--accent-line);
}
.sig-hot {
  margin-left: auto;
  font-size: 0.68rem;
  color: #c4b5fd;
}
.sig-quote {
  margin: 0 0 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(168,154,230,0.22);
  border-radius: 10px;
  background: rgba(18,16,36,0.4);
  color: #cfd3e4;
  font-size: 0.84rem;
}
.sig-quote p { margin: 0 0 0.3rem; }
.sig-quote cite { display: block; text-align: right; font-style: normal; color: #b7a8f0; font-size: 0.74rem; }
.sig-text { margin: 0 0 0.35rem; line-height: 1.55; color: #e8eef8; }
.sig-loc { display: inline-block; color: #c4b5fd; font-size: 0.8rem; margin-bottom: 0.45rem; }
.sig-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.sig-chip, .sig-act {
  border: 1px solid rgba(168,154,230,0.2);
  background: rgba(8,14,28,0.35);
  color: var(--muted);
  border-radius: 999px;
  min-height: 30px;
  padding: 0 0.6rem;
  font-size: 0.74rem;
  cursor: pointer;
}
.sig-chip.on { color: #f0b4d2; border-color: rgba(224,138,184,0.45); }
.sig-reply {
  margin-top: 0.55rem;
  grid-template-columns: 1.85rem minmax(0, 1fr);
  background: rgba(8,10,20,0.55);
}
.sig-to { margin: 0 0 0.2rem; color: #b7a8f0; font-size: 0.76rem; }
.sig-more, .sig-more-replies {
  display: block;
  width: 100%;
  margin: 0.75rem 0 0;
  border: 0;
  background: none;
  color: #c4b5fd;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.sig-more {
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  min-height: 40px;
  background: rgba(129,116,216,0.16);
}
.sig-compose {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.95rem;
  padding: 0.65rem;
  border: 1px solid rgba(168,154,230,0.18);
  border-radius: 14px;
}
.sig-fake {
  min-width: 0;
  min-height: 40px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8,14,28,0.4);
  color: var(--muted);
  padding: 0 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.sig-login { text-align: center; color: var(--muted); font-size: 0.82rem; margin: 0.7rem 0 0; }
.sig-login a { color: #c4b5fd; font-weight: 650; }
.sig-drawer { max-height: 88dvh; }
@media (max-width: 640px) {
  .sig-compose { grid-template-columns: 2.2rem 1fr; }
  .sig-compose .btn { grid-column: 1 / -1; }
}
@media (min-width: 800px) {
  .sig-board { padding: 1.2rem 1.15rem 1.2rem; }
}
