:root {
  --bg: #0b0b0b;
  --bar: #0a0a0a;
  --surface: #171717;
  --raised: #222;
  --fg: #f5f5f5;
  --fg-2: rgba(245, 245, 245, .92);
  --fg-3: rgba(255, 255, 255, .6);
  --line: rgba(255, 255, 255, .08);
  --brand: #e5243b;          /* Lipstick red */
  --brand-hover: #f03a50;
  --brand-soft: rgba(229, 36, 59, .24);
  --brand-text: #ff8a98;
  --gutter: 48px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --font: "Nunito Sans", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; }
.ico {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: 64px; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 24px;
  background: var(--bar);
  transition: box-shadow .2s var(--ease);
}
.topbar[data-scrolled="true"] { box-shadow: 0 1px 0 var(--line); }

.wordmark {
  position: relative; display: flex; align-items: center; flex: none; height: 33px;
  font-size: 30px; text-decoration: none;
}

.topbar-end { flex: 1; display: flex; align-items: center; min-width: 0; }
.search-slot { flex: 1; display: flex; justify-content: center; min-width: 0; padding: 0 16px; }
.search-form {
  width: 100%; max-width: 500px; height: 44px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px; border-radius: 16px;
  background: transparent;
  border: 1px solid transparent;
  transition: background .2s var(--ease), border-color .2s var(--ease);
  justify-content: center;
}
.search-form .ico { width: 20px; height: 20px; color: var(--fg-3); }
.search-form input {
  border: 0; outline: 0; background: transparent; color: var(--fg);
  font: inherit; font-size: 14px; font-weight: 600;
  width: 220px; max-width: 100%; transition: width .25s var(--ease);
}
/* grow to fit the (translated) placeholder instead of cutting it off */
@supports (field-sizing: content) {
  .search-form input { width: auto; field-sizing: content; min-width: 120px; }
}
.search-form input::placeholder { color: rgba(255, 255, 255, .72); }
.search-form input::-webkit-search-cancel-button { filter: invert(1); }
.search-form:hover { background: rgba(255, 255, 255, .06); }
.search-form:focus-within {
  background: #161616; border-color: rgba(255, 255, 255, .14);
  justify-content: flex-start;
}
.search-form:focus-within input { width: 100%; }

.topbar-right { display: flex; align-items: center; flex: none; }
.create-btn {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px 0 12px; margin-right: 8px;
  border-radius: 999px; background: var(--brand);
  font-size: 14px; font-weight: 700; line-height: 14px;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.create-btn .ico { width: 18px; height: 18px; }
.create-btn:hover { background: var(--brand-hover); }
.create-btn:active { transform: scale(.97); }
.nav-item {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; color: var(--fg-2);
  transition: background .15s var(--ease);
}
.nav-item:hover { background: rgba(255, 255, 255, .08); }
.nav-item .ico { width: 22px; height: 22px; }
.divider { width: 1px; height: 20px; background: rgba(255, 255, 255, .14); margin: 0 12px; }
.signin-btn {
  height: 44px; padding: 0 14px; border: 0; border-radius: 12px;
  background: #fff; color: #000; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .15s var(--ease), background .15s;
}
.signin-btn:hover { background: #e9e9e9; }
.signin-btn:active { transform: scale(.97); }

/* ---------- 标签行 ---------- */
.explore-main { padding: 64px var(--gutter) 64px; min-height: 100vh; }
.discover-head {
  height: 80px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 64px; z-index: 20; background: var(--bg);
}
.tab-viewport { flex: 1; min-width: 0; position: relative; overflow: hidden; }
.tab-list {
  --fade-l: 0px; --fade-r: 0px;
  position: relative; display: flex; align-items: center; gap: 24px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}
.tab-list::-webkit-scrollbar { display: none; }
.tab-viewport[data-overflow-left] .tab-list { --fade-l: 32px; }
.tab-viewport[data-overflow-right] .tab-list { --fade-r: 32px; }
.tab-list button {
  flex: none; padding: 6px 0; border: 0; background: none; cursor: pointer;
  color: var(--fg-3); font-size: 14px; font-weight: 700; line-height: 1.5; white-space: nowrap;
  transition: color .15s var(--ease);
}
.tab-list button:hover { color: var(--fg); }
.tab-list button[aria-selected="true"] { color: var(--brand); }
.tab-indicator {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 28px;
  border-radius: 999px; background: var(--brand); pointer-events: none;
  transition: transform .3s var(--ease), width .3s var(--ease);
}

.discover-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.dropdown { position: relative; }
.gender-trigger {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border: 0; border-radius: 999px; background: none; cursor: pointer;
  color: var(--fg-3); font-size: 14px; font-weight: 700;
  transition: color .15s, background .15s;
}
.gender-trigger:hover, .gender-trigger[aria-expanded="true"] { color: var(--fg); background: rgba(255, 255, 255, .06); }
.gender-trigger .chev { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.gender-trigger[aria-expanded="true"] .chev { transform: rotate(180deg); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 168px; z-index: 30;
  padding: 6px; border-radius: 12px; background: #1b1b1b;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  animation: pop .16s var(--ease);
}
.menu button {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--fg-2); font-size: 14px; font-weight: 600; text-align: left;
}
.menu button:hover { background: rgba(255, 255, 255, .08); }
.menu button[aria-checked="true"] { color: var(--fg); }
.menu button[aria-checked="true"]::after { content: "✓"; color: var(--brand); font-weight: 800; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }

.icon-btn {
  position: relative; width: 36px; height: 36px; padding: 0; cursor: pointer;
  display: grid; place-items: center; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12); background: transparent; color: var(--fg-2);
  transition: border-color .15s, transform .15s;
}
.icon-btn .ico { width: 18px; height: 18px; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { border-color: rgba(255, 255, 255, .3); }
.icon-btn:active { transform: scale(.97); }
.filter-dot {
  position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 2px var(--bg);
}

.filter-panel {
  margin: 0 0 20px; padding: 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  animation: pop .18s var(--ease);
}
.filter-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; }
.link-btn { border: 0; background: none; color: var(--fg-3); cursor: pointer; font-size: 13px; font-weight: 700; }
.link-btn:hover { color: var(--fg); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .12); background: transparent;
  color: var(--fg-2); font-size: 13px; font-weight: 600;
  transition: all .15s var(--ease);
}
.chip:hover { border-color: rgba(255, 255, 255, .3); }
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: transparent; color: var(--brand-text); }

/* ---------- 卡片网格 ---------- */
.explore-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 24px 16px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (min-width: 1680px) { .explore-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1279px) { .explore-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .explore-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card { position: relative; min-width: 0; border-radius: 8px; }
.card-main {
  display: block; position: relative; width: 100%; padding: 0; border: 0;
  border-radius: inherit; background: none; color: #fff; text-align: start; cursor: pointer;
}
.card-main:focus-visible { outline: none; }
.card-main:focus-visible .card-media { box-shadow: inset 0 0 0 2px #fff; }
.card-media {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 9 / 16; border-radius: 8px; background: var(--surface);
}
.card-media img.poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 0%;
  opacity: 0; transition: transform .2s var(--ease), opacity .35s var(--ease);
}
.card-media img.poster.loaded { opacity: 1; }
.poster-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center 32%;
  background:
    radial-gradient(120% 80% at 30% 15%, hsl(var(--h) 70% 55% / .55), transparent 60%),
    radial-gradient(90% 70% at 80% 60%, hsl(calc(var(--h) + 50) 60% 40% / .5), transparent 65%),
    #161616;
}
.poster-placeholder b { font-size: 96px; font-weight: 900; color: rgba(255,255,255,.18); line-height: 1; }
.gen-badge {
  position: absolute; top: 8px; left: 8px; height: 22px; padding: 2px 8px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; line-height: 18px;
}
.new-story-badge {
  position: absolute; top: 0; left: 0; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px;
  border-end-end-radius: 10px; background: #c31650; color: #fff;
  font-size: 11px; font-weight: 900; line-height: 16px;
}
.new-story-badge > span { font-size: 15px; }
.card.is-new .card-utility { top: 30px; }
.card.is-new .gen-badge { top: 29px; left: 48px; }
.card:hover .gen-badge { opacity: 0; }
.modal-media.no-img {
  background:
    radial-gradient(120% 80% at 30% 15%, hsl(var(--h) 70% 55% / .55), transparent 60%),
    radial-gradient(90% 70% at 80% 60%, hsl(calc(var(--h) + 50) 60% 40% / .5), transparent 65%),
    #161616;
}
.modal-media.no-img img { display: none; }
.card-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .5) 64%, rgba(0, 0, 0, .92) 100%);
}
.card-scrim::after {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(rgba(0, 0, 0, 0) 8%, rgba(0, 0, 0, .55) 36%, rgba(0, 0, 0, .94) 100%);
  transition: opacity .4s var(--ease);
}
.heat {
  position: absolute; top: 8px; right: 8px;
  display: flex; align-items: center; gap: 4px;
  height: 28px; padding: 4px 6px; border-radius: 4px;
  background: rgba(0, 0, 0, .8); color: rgba(255, 255, 255, .8);
  font-size: 14px; font-weight: 600; line-height: 20px;
}
.heat svg { width: 14px; height: 14px; color: #ff4d4f; fill: currentColor; }
.card-utility {
  position: absolute; top: 8px; left: 8px; width: 32px; height: 32px;
  display: grid; place-items: center; border: 0; border-radius: 6px; cursor: pointer;
  background: rgba(0, 0, 0, .72); color: #fff; opacity: 0;
  transition: opacity .15s var(--ease), background .15s;
}
.card-utility svg { width: 16px; height: 16px; }
.card-utility:hover { background: rgba(10, 10, 10, .88); }
.card-utility[aria-pressed="true"] { opacity: 1; color: var(--brand); }
.card-utility[aria-pressed="true"] svg { fill: currentColor; }
.card-copy {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0; pointer-events: none;
}
.card-copy strong {
  font-size: 24px; line-height: 30px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-copy small {
  color: rgba(255, 255, 255, .88); font-size: 14px; line-height: 20px; min-height: 60px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.card-tags { display: none; gap: 4px; max-height: 18px; overflow: hidden; flex-wrap: wrap; }
.tag {
  height: 18px; padding: 2px 4px; border-radius: 4px; font-size: 10px; font-weight: 500; line-height: 14px;
  background: var(--brand-soft); color: var(--brand-text); white-space: nowrap;
}
.card-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  color: rgba(255, 255, 255, .9); font-size: 14px; font-weight: 600; line-height: 20px;
}
.creator { display: flex; align-items: center; gap: 6px; min-width: 0; }
.creator img {
  width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none;
  background: rgba(255, 255, 255, .16);
}
.avatar-fallback {
  width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-text); font-size: 11px; font-weight: 800;
}
.modal-creator .avatar-fallback { width: 24px; height: 24px; }
.creator span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (hover: hover) and (pointer: fine) {
  .card:hover img.poster { transform: scale(1.025); }
  .card:hover .card-utility { opacity: 1; }
  .card:hover .card-scrim::after { opacity: 1; }
  .card:hover .card-copy small { -webkit-line-clamp: 6; min-height: 60px; }
  .card:hover .card-tags { display: flex; }
}
@media (hover: none) { .card-utility { opacity: 1; } }

/* 骨架屏 */
.card.skeleton { animation: none; }
.skeleton .card-media, .card-media:has(img.poster:not(.loaded)) {
  background: linear-gradient(100deg, #141414 30%, #222 50%, #141414 70%) 0 0 / 300% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton .card-media { border-radius: 8px; }
.skeleton .sk-bars { position: absolute; left: 12px; right: 12px; bottom: 12px; display: grid; gap: 8px; }
.skeleton .sk-bars i { display: block; height: 11px; border-radius: 4px; background: rgba(255,255,255,.06); }
.skeleton .sk-bars i:first-child { width: 52%; height: 20px; margin-bottom: 8px; border-radius: 5px; background: rgba(255,255,255,.08); }
.skeleton .sk-bars i:last-child { width: 76%; }
.skeleton .card-copy, .skeleton .card-meta { display: none; }
/* tab row skeleton (first load) */
.discover-head.is-loading > :not(.sk-head) { visibility: hidden; }
.sk-head { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.sk-tabs { display: flex; gap: 32px; }
.sk-tabs i, .sk-tools i { display: block; height: 14px; border-radius: 4px;
  background: linear-gradient(100deg, #1c1c1c 30%, #2a2a2a 50%, #1c1c1c 70%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
.sk-tabs i:nth-child(1) { width: 56px; } .sk-tabs i:nth-child(2) { width: 64px; } .sk-tabs i:nth-child(3) { width: 40px; }
.sk-tabs i:nth-child(4) { width: 52px; } .sk-tabs i:nth-child(5) { width: 68px; }
.sk-tools { display: flex; gap: 8px; }
.sk-tools i { width: 44px; height: 44px; border-radius: 12px; }
@media (max-width: 767px) { .sk-tabs { gap: 20px; } .sk-tabs i:nth-child(n+4) { display: none; } .sk-tools i { width: 36px; height: 36px; } }
@keyframes shimmer { to { background-position: -150% 0; } }

.empty { text-align: center; padding: 80px 0; color: var(--fg-3); }
.pill-btn {
  height: 36px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
}
.sentinel { height: 1px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); backdrop-filter: blur(6px); animation: fade .2s var(--ease); }
.modal-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 400px);
  max-height: calc(100vh - 48px); overflow: hidden;
  border-radius: 16px; background: #141414; border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: pop .24s var(--ease);
}
.modal-media { position: relative; aspect-ratio: 9 / 16; background: var(--surface); max-height: calc(100vh - 48px); }
.modal-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; }
.modal-body { padding: 32px 28px 28px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.modal-body h2 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 800; }
.modal-body p { margin: 0; color: rgba(255, 255, 255, .85); font-size: 15px; line-height: 1.6; }
.modal-body p.modal-blurb { color: #fff; font-weight: 700; font-size: 16px; }
.modal-intro { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.modal-intro p { font-size: 14px !important; color: rgba(255,255,255,.72) !important; }
.chip-n { opacity: .5; font-size: 11px; margin-left: 2px; }
.card-media video.cover-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%;
  opacity: 0; transition: opacity .3s var(--ease);
}
.card-media video.cover-video.on { opacity: 1; }
.modal-heat { display: inline-flex; align-self: flex-start; align-items: center; gap: 4px; color: rgba(255, 255, 255, .7); font-size: 13px; font-weight: 700; }
.modal-heat svg { width: 14px; height: 14px; fill: #ff4d4f; }
.modal-creator { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--fg-2); }
.modal-creator img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,.16); }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-tags .tag { height: 24px; padding: 4px 8px; font-size: 12px; line-height: 16px; }
.start-btn {
  margin-top: auto; height: 48px; border: 0; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 800;
  transition: background .15s, transform .15s;
}
.start-btn .ico { width: 18px; height: 18px; }
.start-btn:hover { background: var(--brand-hover); }
.start-btn:active { transform: scale(.98); }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff;
}
.modal-close .ico { width: 20px; height: 20px; }
.modal-close:hover { background: rgba(0, 0, 0, .8); }

/* tooltip / toast */
.tooltip {
  position: fixed; z-index: 200; pointer-events: none;
  padding: 6px 10px; border-radius: 8px; background: #fff; color: #000;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  animation: fade .12s var(--ease);
}
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 300; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px; background: #fff; color: #000;
  font-size: 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: toastIn .25s var(--ease);
}

@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(4px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { 50% { opacity: .5; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- 响应式 ---------- */
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .topbar { gap: 8px; height: 56px; }
  .explore-main { padding-top: 56px; }
  .discover-head { top: 56px; height: 56px; }
  .wordmark { font-size: 25px; }
  .search-slot { justify-content: flex-end; padding: 0 4px; }
  .search-form { width: 44px; padding: 0 12px; }
  .search-form input { width: 0; min-width: 0; field-sizing: fixed; }
  .search-form:focus-within { position: absolute; left: 16px; right: 16px; width: auto; max-width: none; z-index: 2; }
  .create-btn span, .nav-item:not(:first-of-type), .divider { display: none; }
  .create-btn { padding: 0 10px; margin-right: 4px; }
  .nav-item { width: 40px; }
  .signin-btn { height: 36px; margin-left: 4px; }
  .explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .card-copy { left: 8px; right: 8px; bottom: 8px; }
  .card-copy strong { font-size: 17px; line-height: 22px; }
  .card-copy small { font-size: 12px; line-height: 16px; min-height: 48px; }
  .card-foot { font-size: 12px; }
  .creator img { width: 16px; height: 16px; }
  .heat { font-size: 12px; height: 24px; padding: 2px 5px; top: 6px; right: 6px; }
  .modal { padding: 0; align-items: end; }
  .modal-card { grid-template-columns: 1fr; border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto; }
  .modal-media { aspect-ratio: 4 / 5; max-height: none; }
  .modal-body { padding: 20px 16px 24px; }
  .modal-body h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- PWA: notch / home-indicator safe areas (viewport-fit=cover) ---------- */
.topbar { padding-top: env(safe-area-inset-top); height: calc(64px + env(safe-area-inset-top)); }
.discover-head { top: calc(64px + env(safe-area-inset-top)); }
@media (max-width: 767px) {
  .topbar { height: calc(56px + env(safe-area-inset-top)); }
  .explore-main { padding-top: calc(56px + env(safe-area-inset-top)); }
  .discover-head { top: calc(56px + env(safe-area-inset-top)); }
}
body { padding-bottom: env(safe-area-inset-bottom); }

/* ---------- 手機底部導航（tabbar.js） ---------- */
.tabbar { display: none; }
@media (max-width: 767px) {
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(20, 20, 20, .94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255, 255, 255, .06);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 56px; color: rgba(255, 255, 255, .45); -webkit-tap-highlight-color: transparent; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .tb-item span { font-size: 10px; font-weight: 700; line-height: 1; }
  .tabbar .tb-item[aria-current="page"] { color: #fff; }
  .tabbar .tb-item:active svg { transform: scale(.92); }
  .tabbar .tb-create { height: auto; justify-self: center; width: 52px; height: 34px; border-radius: 999px; background: var(--brand); color: #fff; box-shadow: 0 4px 14px var(--brand-soft); }
  .tabbar .tb-create svg { width: 22px; height: 22px; stroke-width: 2.6; }
  .tabbar .tb-create:active { transform: scale(.95); }
  body.has-tabbar { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  /* bottom bar now carries 創作 and the page links; keep the top bar to logo, search, Bells and avatar */
  body.has-tabbar .topbar .create-btn, body.has-tabbar .topbar .nav-item { display: none; }
  body.has-tabbar .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
}
