/* SEESAW 1:1 Monochrome Design System + 思源黑体 (Source Han Sans SC) */
@font-face {
  font-family: "SourceHanSansSC";
  src: url("media/fonts/SourceHanSansSC-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SourceHanSansSC";
  src: url("media/fonts/SourceHanSansSC-Bold.otf") format("opentype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #f5f5f5;
  --surface-hover: #eeeeee;
  --ink: #1c1c1c;
  --ink-strong: #171717;
  --ink-2: #737373;
  --ink-3: #a3a3a3;
  --line: #e5e5e5;
  --line-subtle: rgba(0, 0, 0, 0.065);
  --sidebar-w: 236px;
  --topbar-h: 72px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font: "SourceHanSansSC", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

/* ================= Topbar (Seesaw Pure White, No Border) ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  padding: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 16px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
}

.mobile-menu-btn {
  display: none;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.brand-badge:hover {
  border-color: #d4d4d4;
  background: #fafafa;
}

.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--ink);
  transform: translateY(-1px);
}

.topbar-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100% - 420px));
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 0;
}

.search-pill {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 480px;
}

.search-ico {
  position: absolute;
  left: 14px;
  color: var(--ink-3);
  pointer-events: none;
}

.search-pill input {
  width: 100%;
  height: 38px;
  padding: 0 50px 0 38px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}

.search-pill input:focus {
  background: #fff;
  border-color: var(--line);
}

.search-pill input::placeholder {
  color: var(--ink-3);
}

.search-kbd {
  position: absolute;
  right: 13px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: inherit;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 10px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1;
}

.topbar-right {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-outline,
.btn-solid {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn-outline {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--surface);
}

.btn-solid {
  border: 1px solid var(--ink-strong);
  background: var(--ink-strong);
  color: #fff;
}

.btn-solid:hover {
  opacity: 0.88;
}

/* ================= Two-Column Shell (Full Width, Zero Right Gap) ================= */
body.drawer-open {
  overflow: hidden;
}

.lbl-short {
  display: none;
}

.layout {
  display: flex;
  width: 100%;
  min-height: calc(100vh - var(--topbar-h));
  min-height: calc(100dvh - var(--topbar-h));
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  flex-shrink: 0;
  padding: 12px 16px 16px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.sidebar-drawer-head {
  display: none;
}

.mobile-footer {
  display: none;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-parent,
.nav-child {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background 0.14s, color 0.14s;
}

.nav-parent {
  height: 36px;
  padding: 0 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
}

.nav-parent:hover,
.nav-child:hover {
  background: var(--surface);
  color: var(--ink-strong);
}

.nav-parent.active {
  background: var(--surface);
  color: var(--ink-strong);
  font-weight: 600;
}

.nav-parent-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-ico {
  width: 15px;
  height: 15px;
  color: #262626;
  flex-shrink: 0;
}

.nav-parent.active .nav-ico,
.nav-parent:hover .nav-ico {
  color: var(--ink-strong);
}

.nav-caret {
  font-size: 12px;
  color: var(--ink-3);
  transition: transform 0.15s;
}

.nav-group.open .nav-caret {
  transform: rotate(90deg);
}

.nav-children {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 6px 17px;
  padding: 0 0 0 12px;
  border-left: 1px solid #ededed;
}

.nav-group.open .nav-children {
  display: flex;
}

.nav-child {
  height: 32px;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 400;
  color: #787878;
}

.nav-child-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav-child-ico {
  width: 14px;
  height: 14px;
  color: #9a9a9a;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-child-ico svg {
  width: 14px;
  height: 14px;
  display: block;
}

.nav-child.active {
  background: var(--surface);
  color: var(--ink-strong);
  font-weight: 500;
}

.nav-child.active .nav-child-ico,
.nav-child:hover .nav-child-ico {
  color: var(--ink);
}

.nav-count {
  font-size: 12px;
  color: var(--ink-3);
}

/* Seesaw Signature Sidebar Bottom */
.side-foot {
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-box {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.14s, color 0.14s;
}

.side-box:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.side-box-ico {
  color: var(--ink-3);
}

.side-foot-meta {
  padding: 2px 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--ink-3);
}

.side-foot-meta a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ================= Main Content (100% Width — Zero Empty Right Space!) ================= */
.main {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.main-inner {
  width: 100%;
  padding: 16px 28px 64px 20px;
}

/* ================= 5-Card 16:9 Coverflow Hero Carousel ================= */
.hero-carousel {
  position: relative;
  width: 100%;
  margin: 0 0 34px;
  user-select: none;
}

.carousel-stage {
  position: relative;
  width: 100%;
  height: clamp(240px, 29.5vw, 438px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: clip;
  overflow-y: visible;
}

.carousel-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(740px, 50%);
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.045);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
  text-align: left;
}

.carousel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.45s ease, transform 0.45s ease;
}

.carousel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
  transition: background 0.45s ease;
}

/* 第1层（主卡）：100% 清晰锐利，无底部阴影、无白缝 */
.carousel-card.pos-center {
  z-index: 6;
  opacity: 1;
  border-color: rgba(0, 0, 0, 0.085);
  transform: translate(-50%, -50%) scale(1);
  box-shadow: none;
}

.carousel-card.pos-center:hover {
  border-color: rgba(0, 0, 0, 0.16);
  transform: translate(-50%, -50%) scale(1.006);
}

.carousel-card.pos-center img {
  filter: contrast(1.02) saturate(1.03);
  transform: scale(1);
}

/* 第2层（左右紧邻）：保留完整圆角轮廓线，用极淡细边 + 极轻柔晕弱化生硬感 */
.carousel-card.pos-left {
  z-index: 3;
  opacity: 1;
  border-color: rgba(0, 0, 0, 0.045);
  transform: translate(-92%, -50%) scale(0.8);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.03);
}

.carousel-card.pos-right {
  z-index: 3;
  opacity: 1;
  border-color: rgba(0, 0, 0, 0.045);
  transform: translate(-8%, -50%) scale(0.8);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.03);
}

.carousel-card.pos-left img,
.carousel-card.pos-right img {
  filter: blur(3px) saturate(0.55) brightness(1.04);
  transform: scale(1.04);
}

.carousel-card.pos-left::after,
.carousel-card.pos-right::after {
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

/* 第3层（最外远景）：更小更浅，保留完整极淡轮廓 */
.carousel-card.pos-far-left {
  z-index: 1;
  opacity: 0.3;
  border-color: rgba(0, 0, 0, 0.04);
  transform: translate(-125%, -50%) scale(0.62);
  box-shadow: none;
}

.carousel-card.pos-far-right {
  z-index: 1;
  opacity: 0.3;
  border-color: rgba(0, 0, 0, 0.04);
  transform: translate(25%, -50%) scale(0.62);
  box-shadow: none;
}

.carousel-card.pos-far-left img,
.carousel-card.pos-far-right img {
  filter: blur(5.5px) saturate(0.2) brightness(1.08);
  transform: scale(1.07);
}

.carousel-card.pos-far-left::after,
.carousel-card.pos-far-right::after {
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.carousel-card.pos-hidden {
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.54);
}

.carousel-card.pos-left:hover img,
.carousel-card.pos-right:hover img {
  filter: blur(1.2px) saturate(0.82) brightness(1.01);
}

.carousel-card.pos-left:hover::after,
.carousel-card.pos-right:hover::after {
  background: rgba(255, 255, 255, 0.22);
}

.carousel-card.pos-far-left:hover,
.carousel-card.pos-far-right:hover {
  opacity: 0.52;
}

.carousel-card.pos-far-left:hover::after,
.carousel-card.pos-far-right:hover::after {
  background: rgba(255, 255, 255, 0.36);
}

.carousel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 48%, rgba(12, 12, 14, 0.82) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  color: #fff;
  transition: opacity 0.28s ease;
}

.carousel-card:not(.pos-center) .carousel-overlay {
  opacity: 0;
}

.carousel-meta {
  min-width: 0;
}

.carousel-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  margin-bottom: 6px;
}

.carousel-title {
  margin: 0;
  font-size: clamp(17px, 1.8vw, 24px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
}

.carousel-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.84);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-cta {
  flex-shrink: 0;
  height: 34px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: background 0.15s, transform 0.15s;
}

.carousel-arrow svg {
  display: block;
}

.carousel-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}

.carousel-arrow.prev {
  left: 14px;
}

.carousel-arrow.next {
  right: 14px;
}

.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #d4d4d4;
  transition: width 0.2s ease, background 0.2s ease;
}

.carousel-dot.active {
  width: 20px;
  background: var(--ink-strong);
}

/* Seesaw Editorial Head (for Category & Search pages) */
.hero-head {
  margin-bottom: 34px;
}

.hero-title {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.hero-sub {
  margin: 8px 0 0;
  font-size: 16.5px;
  font-weight: 400;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}

.hero-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-stat {
  font-size: 14px;
  color: var(--ink-3);
}

/* Section Headers */
.sec-block {
  margin-bottom: 42px;
}

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sec-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sec-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.sec-link {
  border: none;
  background: transparent;
  padding: 4px 2px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.sec-link:hover {
  color: var(--ink);
}

.sec-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-3);
}

/* Quiet Monochrome Filter Buttons (Seesaw 8px radius) */
.pill-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, color 0.14s;
}

.filter-pill:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--ink-strong);
  color: #fff;
  font-weight: 500;
}

.sort-select {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  outline: none;
}

.filter-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 24px;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-row-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.bar-label {
  display: inline-block;
  width: 34px;
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.filter-count {
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  margin-left: auto;
}

/* ================= Full-Width 4-Column Seesaw 16:9 Grid ================= */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 18px;
  width: 100%;
}

.item-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  min-width: 0;
}

.item-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-subtle);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.item-card:hover .item-thumb {
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0.14);
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.item-card:hover .item-thumb img {
  transform: scale(1.018);
}

.thumb-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(23, 23, 23, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.item-card:hover .thumb-badge,
.thumb-badge.always {
  opacity: 1;
}

/* Exact Seesaw Card Caption: 20px icon + Title (#1C1C1C) + 1-line Desc (#A3A3A3) */
.item-caption {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding-top: 10px;
  min-width: 0;
}

.item-icon {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.item-icon svg {
  width: 12px;
  height: 12px;
}

.item-caption.no-desc {
  align-items: center;
}

.item-caption.no-desc .item-icon {
  margin-top: 0;
}

.item-text {
  min-width: 0;
  flex: 1;
}

.item-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-desc {
  margin: 1px 0 0;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 20px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-caption.inline-pill {
  align-items: center;
}

.item-caption.inline-pill .item-icon {
  margin-top: 0;
}

.item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.item-title-row .item-title {
  min-width: 0;
}

.item-tag-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.055);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.loading-box,
.empty-box {
  padding: 64px 20px;
  text-align: center;
  color: var(--ink-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.empty-box h3 {
  margin: 0 0 6px;
  color: var(--ink);
}

/* ================= Full-Viewport Stage (App & Courseware) ================= */
.stage-view {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 80;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.stage-view.bar-collapsed .stage-bar-dark {
  display: none;
}

.stage-view.virtual-landscape {
  position: fixed;
  inset: auto;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  width: 100vh;
  width: 100dvh;
  height: 100vw;
  transform: rotate(90deg) translateY(-100%);
  transform-origin: top left;
  padding-bottom: 0;
  z-index: 95;
}

.stage-dark {
  background: #111111;
  color: #f5f5f5;
}

.stage-light {
  background: #f5f5f5;
  color: var(--ink);
}

.stage-bar {
  height: 48px;
  flex-shrink: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stage-bar-dark {
  background: #141414;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-bar-light {
  height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.stage-bar-light .stage-bar-left {
  justify-self: start;
  max-width: 100%;
}

.stage-bar-light .segmented {
  justify-self: center;
}

.stage-bar-light .stage-bar-right {
  justify-self: end;
}

.stage-bar-left,
.stage-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stage-back {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: inherit;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.14s;
}

.stage-dark .stage-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.stage-light .stage-back:hover {
  background: var(--surface);
}

.stage-logo {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  flex-shrink: 0;
}

.stage-brand {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.stage-sep {
  opacity: 0.35;
}

.stage-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-sub {
  font-size: 12.5px;
  opacity: 0.52;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e5e5;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.14s, opacity 0.14s;
}

.stage-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.stage-btn-white {
  background: #ffffff;
  border-color: #ffffff;
  color: #171717;
}

.stage-btn-white:hover {
  background: #ececec;
}

.stage-btn-light {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.stage-btn-light:hover {
  background: var(--surface);
}

.stage-btn-solid {
  border-color: var(--ink-strong);
  background: var(--ink-strong);
  color: #fff;
}

.stage-btn-solid:hover {
  opacity: 0.88;
}

.stage-frame-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: #111111;
}

.stage-iframe-box {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111111;
}

.stage-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #111111;
}

.stage-frame-wrap.is-portrait-framed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 0 calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}

.stage-frame-wrap.is-portrait-framed .stage-iframe-box {
  flex-shrink: 0;
  width: 100%;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-portrait-cta {
  width: 100%;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  flex-shrink: 0;
}

.stage-portrait-tip {
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.stage-landscape-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  color: #141414;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.stage-landscape-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.stage-portrait-sub {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.56);
}

.stage-float-controls {
  position: absolute;
  top: max(8px, env(safe-area-inset-top, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.stage-float-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.stage-float-btn-white {
  background: #ffffff;
  border-color: #ffffff;
  color: #141414;
}

.stage-vland-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 26;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  white-space: nowrap;
  max-width: calc(100% - 24px);
}

.stage-vland-close {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
}

.stage-btn.is-active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.42);
  color: #ffffff;
}

.stage-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  color: #a3a3a3;
  background: #111111;
  z-index: 2;
}

.stage-watermark {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 5;
  pointer-events: none;
  user-select: none;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.34);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.tool-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #111111;
}

.tool-placeholder-card {
  max-width: 520px;
  width: 100%;
  padding: 32px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.tool-placeholder-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #fff;
}

.tool-placeholder-card p {
  margin: 0 0 20px;
  font-size: 14px;
  color: #a3a3a3;
}

.tool-facts {
  text-align: left;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: #d4d4d4;
}

/* ================= Courseware Reader ================= */
.segmented {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  gap: 2px;
}

.seg-btn {
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.14s, color 0.14s;
}

.seg-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
}

.related-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cw-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.ppt-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 24px 12px;
  gap: 10px;
  background: #f5f5f5;
}

.ppt-canvas-row {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 50px;
  container-type: size;
}

.ppt-viewport {
  position: relative;
  width: min(100cqw, calc(100cqh * 16 / 9));
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  user-select: none;
  touch-action: pan-y;
}

.ppt-viewport.is-zoomed {
  touch-action: none;
  cursor: grab;
}

.ppt-viewport.is-dragging {
  cursor: grabbing;
}

.ppt-slide-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
  transform: translate(var(--ppt-tx, 0px), var(--ppt-ty, 0px)) scale(var(--ppt-zoom, 1));
  transform-origin: center center;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ppt-viewport.is-dragging .ppt-slide-img {
  transition: none;
}

.ppt-zoom-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: 999px;
  border: none;
  background: rgba(23, 23, 23, 0.76);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(6px);
}

.ppt-mobile-bar {
  display: none;
}

.video-center-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(20, 20, 22, 0.68);
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

#ppt-video-viewport.is-paused .video-center-play {
  display: inline-flex;
}

.ppt-slide-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.ppt-slide-video.is-active {
  opacity: 1;
}

.ppt-video-wm {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  z-index: 3;
}

.ppt-anim-loading {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.72);
  color: #fff;
  font-size: 12px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.ppt-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  z-index: 4;
}

.ppt-nav svg {
  display: block;
}

.ppt-nav:hover {
  background: #fff;
}

.ppt-nav.prev {
  left: 4px;
}

.ppt-nav.next {
  right: 4px;
}

.ppt-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.ppt-ctrl-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.ppt-playing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
  animation: pptPulse 1.1s ease-in-out infinite;
}

@keyframes pptPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.ppt-ctrl-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
}

.ppt-ctrl-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ppt-ctrl-btn {
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.ppt-ctrl-btn:hover {
  background: var(--surface);
}

.ppt-ctrl-btn.is-playing {
  background: var(--ink-strong);
  border-color: var(--ink-strong);
  color: #fff;
}

.ppt-ctrl-btn.is-playing:hover {
  opacity: 0.88;
}

.ppt-ctrl-btn.is-off {
  background: var(--surface);
  color: var(--ink-2);
}

.ppt-ico-sq {
  width: 8px;
  height: 8px;
  border-radius: 1.5px;
  background: currentColor;
  display: inline-block;
}

.ppt-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  flex-shrink: 0;
}

.ppt-thumb {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  aspect-ratio: 16 / 9;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #fff;
  opacity: 0.62;
  transition: opacity 0.14s, border-color 0.14s;
}

.ppt-thumb.active,
.ppt-thumb:hover {
  opacity: 1;
  border-color: var(--ink-strong);
}

.ppt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.ppt-thumb-num {
  position: absolute;
  left: 4px;
  bottom: 3px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(23, 23, 23, 0.68);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
}

.ppt-video-el {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #111;
}

.video-controls-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 7px 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.video-play-btn {
  height: 28px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--ink-strong);
  background: var(--ink-strong);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.video-play-btn:hover {
  opacity: 0.88;
}

.video-scrub {
  flex: 1;
  min-width: 80px;
  height: 4px;
  accent-color: var(--ink-strong);
  cursor: pointer;
}

.video-time {
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.video-speed-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 7px;
  background: var(--surface);
  flex-shrink: 0;
}

.video-speed-btn {
  height: 24px;
  min-width: 34px;
  padding: 0 7px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background 0.14s, color 0.14s;
}

.video-speed-btn:hover {
  color: var(--ink);
}

.video-speed-btn.active {
  background: #ffffff;
  color: var(--ink-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ================= Word 1:1 Paginated A4 Reader ================= */
.word-viewer {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #eceff4;
  user-select: none;
  -webkit-user-select: none;
}

.word-canvas {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px 76px;
}

.word-pages {
  width: max-content;
  min-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.word-page {
  margin: 0;
  width: var(--word-page-w, 816px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.word-page img {
  width: 100%;
  height: auto;
  display: block;
  background: #ffffff;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.09);
  user-select: none;
  -webkit-user-drag: none;
}

.word-page-foot {
  font-size: 12px;
  color: #64748b;
}

.word-float-bar,
.stage-float-pill {
  position: fixed;
  top: 66px;
  right: 24px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 23, 42, 0.09);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
  font-size: 12.5px;
  color: var(--ink);
}

.word-float-page {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.word-float-sep {
  width: 1px;
  height: 14px;
  background: var(--line);
}

.word-float-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.word-zoom-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.word-zoom-btn:hover {
  background: var(--surface);
  border-color: var(--line);
}

.word-zoom-val {
  min-width: 38px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.doc-viewer {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 28px 20px 64px;
  user-select: none;
  -webkit-user-select: none;
}

.doc-sheet {
  position: relative;
  max-width: 840px;
  margin: 0 auto;
  padding: 36px 42px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}

.doc-sheet-wm {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  z-index: 2;
}

.doc-content {
  position: relative;
  z-index: 1;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink);
}

.doc-content h2 {
  font-size: 20px;
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.doc-content h3 {
  font-size: 16px;
  margin: 20px 0 8px;
}

.doc-content h4 {
  font-size: 14.5px;
  margin: 16px 0 6px;
}

.doc-content p {
  margin: 8px 0;
}

.doc-content blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 3px solid #d4d4d4;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  color: var(--ink-2);
}

.doc-table-wrap {
  overflow-x: auto;
  margin: 14px 0;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.doc-table th,
.doc-table td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  vertical-align: top;
  text-align: left;
}

.doc-table th {
  background: var(--surface);
  font-weight: 600;
}

.doc-table td.doc-key {
  width: 120px;
  background: #fafafa;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.doc-notice {
  max-width: 840px;
  margin: 0 auto 14px;
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ================= Contact Popover (Top-Right, No Backdrop / No Blur on Desktop) ================= */
.contact-scrim {
  display: none;
}

.contact-popover {
  position: fixed;
  top: 62px;
  right: 24px;
  z-index: 120;
  width: 392px;
  max-width: calc(100vw - 24px);
  padding: 20px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  transform-origin: top right;
  animation: popIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.shop-close-btn {
  display: none;
}

.contact-popover .qr-img {
  -webkit-touch-callout: default !important;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}

.contact-popover.in-stage {
  top: 54px;
  right: 16px;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.qr-card {
  padding: 12px;
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qr-img {
  width: 148px;
  height: 148px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  object-fit: contain;
}

.qr-placeholder {
  width: 148px;
  height: 148px;
  border-radius: 8px;
  border: 1px dashed #d4d4d4;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}

.qr-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.contact-handle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--surface);
  font-size: 13px;
  color: var(--ink);
}

.contact-handle-text {
  font-weight: 500;
}

.contact-copy-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: none;
  background: var(--ink-strong);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.contact-copy-btn:hover {
  opacity: 0.86;
}

.shop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.shop-head img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
}

.shop-head h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
}

.shop-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-2);
}

.shop-steps {
  margin: 0 0 18px;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.shop-qr {
  width: 180px;
  height: 180px;
  margin: 0 auto 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: contain;
}

.shop-actions {
  display: grid;
  gap: 8px;
}

.btn-full-dark,
.btn-full-light {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
}

.btn-full-dark {
  border: none;
  background: var(--ink-strong);
  color: #fff;
}

.btn-full-light {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 150;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.92);
  color: #fff;
  font-size: 13px;
}

/* ================= Responsive (Desktop >= 1280px 100% Preserved) ================= */
@keyframes popCenterIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Tablet Landscape: 1024px ~ 1279px */
@media (max-width: 1279px) {
  :root {
    --sidebar-w: 204px;
  }
  .topbar-center {
    width: min(440px, calc(100% - 370px));
  }
  .grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .carousel-stage {
    height: max(240px, calc(min(620px, (100vw - var(--sidebar-w) - 48px) * 0.64) * 9 / 16 + 20px));
  }
  .carousel-card {
    width: min(620px, 64%);
  }
  .carousel-card.pos-far-left,
  .carousel-card.pos-far-right {
    opacity: 0;
    pointer-events: none;
  }
  .stage-bar-dark {
    height: 44px;
  }
}

/* Narrow Tablet Landscape (1024px ~ 1180px): prevent lab title & pill crowding */
@media (min-width: 1024px) and (max-width: 1180px) {
  .item-caption.inline-pill {
    align-items: flex-start;
  }
  .item-caption.inline-pill .item-icon {
    margin-top: 1px;
  }
  .item-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .item-title-row .item-title {
    width: 100%;
  }
  .item-tag-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .stage-bar-light .stage-sub {
    display: none;
  }
}

/* <= 1024px: Word float bar bottom-centered for thumb ergonomics & short video tab */
@media (max-width: 1024px) {
  #cw-tab-video .lbl-full {
    display: none;
  }
  #cw-tab-video .lbl-short {
    display: inline;
  }
  .word-float-bar {
    top: auto;
    right: auto;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    height: 48px;
    padding: 0 14px;
    gap: 10px;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  }
  .word-zoom-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 50%;
  }
  .word-zoom-val {
    min-width: 42px;
    font-size: 13px;
  }
}

/* Tablet Portrait & Phone Landscape: <= 1023px (Drawer Sidebar + 2 Columns + Mobile ICP Footer) */
@media (max-width: 1023px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0 14px;
    gap: 10px;
  }
  .topbar-left {
    justify-content: flex-start;
    padding: 0;
  }
  .topbar-center {
    position: static;
    transform: none;
    width: 100%;
    padding: 0;
  }
  .topbar-right {
    position: static;
    transform: none;
  }
  .mobile-menu-btn {
    display: inline-grid;
    width: 40px;
    height: 40px;
  }
  .btn-outline {
    display: none;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 82vw);
    height: 100vh;
    height: 100dvh;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-drawer-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink-strong);
  }
  .sidebar-drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 20px;
    line-height: 1;
    display: inline-grid;
    place-items: center;
  }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.34);
    z-index: 65;
  }
  .main-inner {
    padding: 16px 16px 32px;
  }
  .mobile-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 10px;
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    margin-top: 8px;
    border-top: 1px solid var(--line-subtle);
    font-size: 12px;
    color: var(--ink-3);
    text-align: center;
  }
  .mobile-footer a {
    color: var(--ink-2);
    text-decoration: none;
  }
  .mobile-footer a:hover,
  .mobile-footer a:active {
    color: var(--ink-strong);
    text-decoration: underline;
  }
  .carousel-stage {
    height: calc(min(620px, (100vw - 32px) * 0.64) * 9 / 16 + 24px);
    min-height: 220px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 14px;
  }
  .hero-title {
    font-size: 26px;
  }
  .stage-sub,
  .stage-brand,
  .stage-sep {
    display: none;
  }
  .stage-bar-light {
    padding: 0 12px;
    gap: 8px;
  }
  .doc-sheet {
    padding: 22px 18px;
  }
  .word-canvas {
    padding: 16px 12px calc(84px + env(safe-area-inset-bottom, 0px));
  }
}

/* Courseware Reader 2-Row Topbar: <= 768px */
@media (max-width: 768px) {
  .lbl-full {
    display: none;
  }
  .lbl-short {
    display: inline;
  }
  .stage-bar-light {
    height: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 8px;
    gap: 8px;
  }
  .stage-bar-light .stage-bar-left {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
  }
  .stage-bar-light .stage-bar-right {
    order: 2;
    flex-shrink: 0;
    gap: 6px;
  }
  .stage-bar-light .segmented {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: 3px;
  }
  .stage-bar-light .seg-btn {
    min-height: 36px;
    padding: 6px 4px;
    font-size: 13px;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .stage-bar-light .stage-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 12.5px;
  }
  .stage-float-pill {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 12px;
  }
}

/* Phone Portrait: <= 639px */
@media (max-width: 639px) {
  .topbar {
    height: auto;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    border-bottom: 1px solid var(--line-subtle);
  }
  .topbar-left {
    grid-row: 1;
    grid-column: 1;
    min-width: 0;
    gap: 8px;
  }
  .topbar-right {
    grid-row: 1;
    grid-column: 2;
  }
  .topbar-center {
    grid-row: 2;
    grid-column: 1 / -1;
    width: 100%;
  }
  .mobile-menu-btn {
    width: 42px;
    height: 42px;
  }
  .brand-badge {
    height: 38px;
    padding: 0 14px 0 8px;
    gap: 7px;
  }
  .brand-logo {
    width: 22px;
    height: 22px;
  }
  .brand-name {
    font-size: 15.5px;
  }
  .btn-solid {
    height: 38px;
    padding: 0 14px;
    font-size: 13.5px;
  }
  .search-pill {
    max-width: none;
  }
  .search-pill input {
    height: 42px;
    font-size: 16px;
    padding: 0 42px 0 38px;
  }
  .search-clear {
    width: 32px;
    height: 32px;
    right: 5px;
    font-size: 16px;
  }

  /* Phone Carousel: focused single card + edge peek */
  .hero-carousel {
    margin: 0 0 22px;
  }
  .carousel-stage {
    height: calc((100vw - 32px) * 0.88 * 9 / 16 + 14px);
    min-height: 176px;
  }
  .carousel-card {
    width: 88%;
    border-radius: 14px;
  }
  .carousel-card.pos-left {
    transform: translate(-142%, -50%) scale(0.92);
    opacity: 0.65;
  }
  .carousel-card.pos-right {
    transform: translate(42%, -50%) scale(0.92);
    opacity: 0.65;
  }
  .carousel-arrow {
    display: none;
  }
  .carousel-dots {
    margin-top: 8px;
    gap: 8px;
  }
  .carousel-dot {
    position: relative;
  }
  .carousel-dot::before {
    content: "";
    position: absolute;
    inset: -10px -6px;
  }

  /* Compact Single-Row Horizontal Scrollable Filter Pills */
  .hero-head {
    margin-bottom: 14px;
  }
  .hero-title {
    font-size: 22px;
  }
  .hero-sub {
    font-size: 14px;
  }
  .sec-block {
    margin-bottom: 28px;
  }
  .sec-head {
    gap: 10px;
    margin-bottom: 14px;
  }
  .sec-head-left {
    width: 100%;
    gap: 8px;
  }
  .sec-head-right {
    width: 100%;
    justify-content: space-between;
  }
  .pill-row,
  .filter-row-main {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    padding: 2px 16px 4px 0;
    mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
  }
  .pill-row::-webkit-scrollbar,
  .filter-row-main::-webkit-scrollbar {
    display: none;
  }
  .filter-block {
    gap: 8px;
    margin: 0 0 16px;
  }
  .filter-row {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .filter-count {
    font-size: 12px;
  }
  .filter-pill {
    flex-shrink: 0;
    height: 36px;
    padding: 0 13px;
    font-size: 13px;
  }

  /* 1-Column Card Grid + Non-Truncating Lab Card Header */
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .item-caption.inline-pill {
    align-items: flex-start;
  }
  .item-caption.inline-pill .item-icon {
    margin-top: 1px;
  }
  .item-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .item-title-row .item-title {
    width: 100%;
  }
  .item-tag-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Dark Stage Topbar (Phone Portrait Zero Overflow) */
  .stage-bar-dark {
    height: calc(48px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 10px 0;
    gap: 6px;
  }
  .stage-bar-dark .stage-bar-left {
    gap: 4px;
    flex: 1;
    min-width: 0;
  }
  .stage-bar-dark .stage-back {
    width: 40px;
    height: 40px;
  }
  .stage-bar-dark .stage-logo {
    display: none;
  }
  .stage-bar-dark .stage-title {
    font-size: 13.5px;
  }
  .stage-bar-dark .stage-bar-right {
    gap: 6px;
    flex-shrink: 0;
  }
  .stage-bar-dark .stage-btn {
    height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }
  #cw-related-wrap > :nth-child(n + 2) {
    display: none;
  }

  /* PPT Reader on Phone Portrait: Full-Width 16:9 + Thumb Nav Bar */
  .ppt-stage {
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }
  .ppt-canvas-row {
    padding: 0;
  }
  .ppt-nav {
    display: none;
  }
  .ppt-stage > .stage-float-pill {
    display: none;
  }
  .ppt-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px;
    flex-shrink: 0;
  }
  .ppt-mob-btn {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  .ppt-mob-counter {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
  }
  .ppt-thumb {
    width: 76px;
  }

  /* Video Preview 2-Row Controls Bar (Zero Overflow) */
  .video-controls-bar {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 10px 8px;
  }
  .video-scrub {
    order: 1;
    flex: 1 1 calc(100% - 104px);
    min-width: 120px;
    height: 24px;
  }
  .video-time {
    order: 2;
    flex-shrink: 0;
    font-size: 11.5px;
  }
  .video-play-btn {
    order: 3;
    height: 40px;
    padding: 0 14px;
    font-size: 13.5px;
  }
  .video-speed-group {
    order: 4;
    margin-left: auto;
    padding: 3px;
  }
  .video-speed-btn {
    height: 34px;
    min-width: 38px;
    padding: 0 8px;
    font-size: 12.5px;
  }

  /* Word & HTML Doc Fallback on Phone */
  .word-canvas {
    padding: 12px 8px calc(84px + env(safe-area-inset-bottom, 0px));
  }
  .doc-viewer {
    padding: 14px 10px calc(48px + env(safe-area-inset-bottom, 0px));
  }
  .doc-notice {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 10px;
  }
  .doc-sheet {
    padding: 18px 14px;
    border-radius: 10px;
  }
  .doc-table {
    min-width: 480px;
  }
  .doc-table td.doc-key {
    width: auto;
    min-width: 72px;
    white-space: normal;
  }

  /* Contact Modal: Centered Card + Scrim + Square QR + Close Button */
  .contact-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 115;
    background: rgba(0, 0, 0, 0.38);
  }
  .contact-popover,
  .contact-popover.in-stage {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    width: min(358px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    animation: popCenterIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .shop-close-btn {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
  }
  .qr-grid {
    gap: 10px;
  }
  .qr-card {
    padding: 10px;
  }
  .qr-img,
  .qr-placeholder {
    width: 100%;
    max-width: 152px;
    height: auto;
    aspect-ratio: 1 / 1;
  }
  .contact-handle-bar {
    padding: 10px 12px;
    gap: 8px;
  }
  .contact-handle-text {
    font-size: 12.5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .contact-copy-btn {
    height: 40px;
    padding: 0 16px;
    font-size: 13.5px;
    border-radius: 8px;
  }
  .toast {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 32px);
    text-align: center;
  }
}

/* ================= Touch Devices Across All Breakpoints (Phones + iPads) ================= */
@media (hover: none), (pointer: coarse) {
  button,
  a,
  .item-card,
  .filter-pill {
    -webkit-tap-highlight-color: transparent;
  }
  .item-card:hover .item-thumb {
    transform: none;
    border-color: var(--line-subtle);
  }
  .item-card:hover .item-thumb img {
    transform: none;
  }
  .carousel-card.pos-center:hover {
    transform: translate(-50%, -50%) scale(1);
  }
  .item-card:active .item-thumb {
    transform: scale(0.985);
    opacity: 0.92;
  }
  .btn-solid:active,
  .stage-btn:active,
  .filter-pill:active,
  .contact-copy-btn:active,
  .ppt-mob-btn:active {
    transform: scale(0.97);
    opacity: 0.86;
  }
  .thumb-badge {
    opacity: 0.92;
  }
  .nav-parent {
    min-height: 44px;
  }
  .nav-child {
    min-height: 40px;
  }
  .filter-pill {
    min-height: 40px;
    padding: 0 14px;
  }
  .sort-select {
    min-height: 40px;
  }
  .btn-solid,
  .btn-outline {
    min-height: 40px;
  }
  .stage-back {
    width: 44px;
    height: 44px;
  }
  .stage-btn {
    min-height: 38px;
  }
  .seg-btn {
    min-height: 36px;
  }
  .ppt-nav {
    width: 44px;
    height: 44px;
  }
  .word-zoom-btn {
    width: 40px;
    height: 40px;
  }
  .video-play-btn {
    min-height: 38px;
  }
  .video-speed-btn {
    min-height: 34px;
    min-width: 40px;
  }
  .contact-copy-btn {
    min-height: 38px;
    padding: 0 14px;
  }
  .search-clear {
    width: 32px;
    height: 32px;
    right: 5px;
  }
}
