:root {
  color-scheme: dark;
  --bg: #080b12;
  --paper: rgba(13, 17, 27, .82);
  --paper-solid: #111722;
  --line: rgba(255, 255, 255, .13);
  --line-strong: rgba(255, 255, 255, .24);
  --text: #f7f7f2;
  --muted: rgba(247, 247, 242, .62);
  --accent: #d8ff59;
  --accent-strong: #b8ee1e;
  --danger: #ff7d7d;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; overflow-x: clip; }
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.background { position: fixed; inset: 0; z-index: -5; overflow: hidden; background: #10151e; }
.background video {
  width: 100%; height: 100%; object-fit: cover; transform: scale(1.012);
  filter: saturate(.76) contrast(1.08) brightness(.74);
}
.background__veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 66% 42%, transparent 0, rgba(4, 7, 12, .18) 48%, rgba(4, 7, 12, .76) 100%),
    linear-gradient(90deg, rgba(5, 8, 14, .78) 0%, rgba(5, 8, 14, .26) 52%, rgba(5, 8, 14, .4) 100%),
    linear-gradient(0deg, rgba(5, 8, 14, .68) 0%, transparent 36%);
}
.background__grain {
  position: absolute; inset: -60%; opacity: .18; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  animation: grain .22s steps(2) infinite;
}
@keyframes grain { 0% { transform: translate(0); } 25% { transform: translate(2%, -1%); } 50% { transform: translate(-1%, 2%); } 75% { transform: translate(1%, 1%); } }

.shell { min-height: 100dvh; display: flex; flex-direction: column; padding: 28px 42px max(24px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.22); }
.brand span { display: grid; gap: 1px; }
.brand b { font-size: 16px; letter-spacing: .14em; }
.brand small { color: var(--muted); font-size: 8px; letter-spacing: .24em; }
.topbar__actions { display: flex; align-items: center; gap: 9px; }
.live-status { display: inline-flex; align-items: center; gap: 7px; margin-right: 4px; color: var(--muted); font-size: 12px; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: #ffc65c; box-shadow: 0 0 12px currentColor; }
.live-status.is-online i { background: var(--accent); }
.live-status.is-offline i { background: var(--danger); }
.icon-button, .text-button, .cancel-button, .close-button, .sort-tab, .reaction-button, .comment-action, .footer-note button {
  border: 0; background: transparent; cursor: pointer;
}
.icon-button {
  min-height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 0 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(11, 15, 22, .28); backdrop-filter: blur(14px); transition: .25s var(--ease);
}
.icon-button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.08); transform: translateY(-1px); }
.icon-button[aria-pressed="false"] { color: var(--muted); }
.icon-button--accent { background: var(--accent); color: #11160a; border-color: var(--accent); font-weight: 700; }
.icon-button--accent:hover { color: #11160a; background: #e3ff82; border-color: #e3ff82; }
.icon-button--accent b { font-size: 11px; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; background: rgba(17,22,10,.15); }
.icon { width: 15px; height: 15px; position: relative; display: inline-block; }
.icon--music::before { content: "♪"; position: absolute; inset: -6px 0 0; font-size: 21px; }
.icon--danmaku::before { content: "〓"; position: absolute; inset: -4px 0 0; font-size: 17px; transform: rotate(90deg); }
.icon--comments::before { content: ""; position: absolute; inset: 1px 0 2px; border: 1.8px solid currentColor; border-radius: 5px; }
.icon--comments::after { content: ""; position: absolute; left: 3px; bottom: 0; width: 5px; height: 5px; border-left: 1.8px solid currentColor; transform: skew(-28deg); }

.hero { margin: auto 0; width: min(690px, 70vw); position: relative; z-index: 10; padding-bottom: 44px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .24em; }
.eyebrow span { display: inline-block; width: 32px; height: 1px; background: currentColor; }
.hero h1 { margin: 0; font-family: Georgia, "STSong", serif; font-size: clamp(52px, 7.4vw, 112px); line-height: .92; letter-spacing: -.045em; font-weight: 500; text-shadow: 0 10px 40px rgba(0,0,0,.35); }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero__lead { width: min(530px, 90%); margin: 26px 0 0; color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.8; letter-spacing: .04em; }
.hero__actions { display: flex; align-items: center; gap: 22px; margin-top: 28px; }
.primary-button, .send-button, .panel-write-button {
  border: 0; border-radius: 999px; background: var(--accent); color: #11160a; font-weight: 750; cursor: pointer;
  transition: .25s var(--ease); box-shadow: 0 12px 34px rgba(191, 255, 45, .15);
}
.primary-button { min-height: 48px; padding: 0 22px; }
.primary-button span { margin-left: 12px; }
.primary-button:hover, .send-button:hover, .panel-write-button:hover { background: #e5ff8b; transform: translateY(-2px); box-shadow: 0 16px 42px rgba(191, 255, 45, .22); }
.text-button { color: rgba(255,255,255,.68); padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.3); font-size: 13px; }
.text-button:hover { color: #fff; border-color: #fff; }

.composer {
  width: min(900px, calc(100vw - 84px)); margin: 0 auto; min-height: 82px; padding: 12px 12px 12px 15px;
  position: relative; z-index: 30; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  border: 1px solid var(--line-strong); border-radius: 22px; background: rgba(12, 16, 24, .64); backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 28px 70px rgba(0,0,0,.3);
}
.composer:focus-within { border-color: rgba(216,255,89,.58); box-shadow: 0 28px 70px rgba(0,0,0,.38), 0 0 0 3px rgba(216,255,89,.08); }
.composer__identity { display: flex; align-items: center; gap: 10px; padding-right: 14px; border-right: 1px solid var(--line); }
.composer__identity > span:last-child { display: grid; gap: 2px; }
.composer__identity b { font-size: 12px; white-space: nowrap; }
.composer__identity small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: rgba(216,255,89,.12); color: var(--accent); border: 1px solid rgba(216,255,89,.25); font: 700 13px Georgia, serif; }
.composer__field { position: relative; display: flex; align-items: center; min-width: 0; }
.composer textarea { width: 100%; max-height: 88px; resize: none; border: 0; outline: 0; background: transparent; color: #fff; padding: 14px 60px 14px 0; line-height: 1.55; }
.composer textarea::placeholder { color: rgba(255,255,255,.42); }
#characterCount { position: absolute; right: 4px; bottom: 12px; color: rgba(255,255,255,.35); font-size: 10px; }
.composer__actions { display: flex; align-items: center; gap: 8px; }
.send-button { min-width: 94px; height: 54px; padding: 0 18px; }
.send-button span { margin-left: 7px; font-size: 17px; }
.send-button:disabled { cursor: not-allowed; filter: grayscale(.7); opacity: .55; transform: none; }
.cancel-button { color: var(--muted); padding: 10px 8px; }
.cancel-button:hover { color: #fff; }

.footer-note { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 42px; color: rgba(255,255,255,.45); font-size: 10px; letter-spacing: .06em; position: relative; z-index: 20; }
.footer-note__sep { width: 3px; height: 3px; background: rgba(255,255,255,.35); border-radius: 50%; }
.footer-note button { color: inherit; padding: 6px 0; }
.footer-note button:hover { color: #fff; }

.danmaku-stage { position: fixed; inset: 82px 0 150px; z-index: 8; overflow: hidden; pointer-events: none; }
.danmaku-stage.is-hidden { opacity: 0; visibility: hidden; }
.danmaku-stage.is-paused .danmaku { animation-play-state: paused; }
.danmaku {
  --opacity: .9; --duration: 16s; position: absolute; left: 100%; top: var(--lane, 0px); width: max-content; max-width: min(72vw, 760px);
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 15px 9px 10px; border-radius: 999px;
  color: #fff; background: rgba(8, 12, 18, .45); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0,0,0,.18); opacity: var(--opacity); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: fly var(--duration) linear forwards; will-change: transform;
}
.danmaku b { max-width: 570px; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
.danmaku small { display: inline-flex; gap: 7px; color: var(--accent); font-size: 10px; }
.danmaku__avatar { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #12180a; font-size: 10px; font-weight: 800; }
@keyframes fly { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 100% - 40px)); } }

.panel-scrim { position: fixed; inset: 0; z-index: 89; background: rgba(4,7,12,.48); backdrop-filter: blur(3px); opacity: 0; transition: opacity .32s var(--ease); }
.panel-scrim.is-visible { opacity: 1; }
.comment-panel {
  position: fixed; z-index: 90; top: 14px; right: 14px; bottom: 14px; width: min(430px, calc(100vw - 28px));
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 26px;
  background: rgba(10, 14, 22, .92); backdrop-filter: blur(30px) saturate(1.25); box-shadow: -24px 0 80px rgba(0,0,0,.38);
  transform: translateX(calc(100% + 28px)); transition: transform .42s var(--ease); overflow: hidden;
}
.comment-panel.is-open { transform: translateX(0); }
.panel-header { padding: 26px 25px 19px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-header p { margin: 0 0 6px; color: var(--accent); font-size: 9px; letter-spacing: .25em; }
.panel-header h2 { margin: 0; font: 500 27px Georgia, "STSong", serif; }
.close-button { width: 38px; height: 38px; border-radius: 50%; color: var(--muted); font-size: 25px; line-height: 1; }
.close-button:hover { color: #fff; background: rgba(255,255,255,.08); }
.sort-tabs { display: flex; align-items: center; gap: 6px; padding: 15px 22px 12px; }
.sort-tab { color: var(--muted); border-radius: 999px; padding: 7px 13px; font-size: 12px; }
.sort-tab.is-active { color: #151b0c; background: var(--accent); font-weight: 700; }
.sort-tabs > span { margin-left: auto; color: rgba(255,255,255,.38); font-size: 10px; }
.comment-list { flex: 1; overflow: auto; padding: 4px 16px 104px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
.comment-card { padding: 17px 9px; border-bottom: 1px solid rgba(255,255,255,.09); }
.comment-card__meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.comment-card__meta .mini-avatar { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: rgba(216,255,89,.12); color: var(--accent); font-weight: 800; }
.comment-card__meta b { color: rgba(255,255,255,.75); font-size: 11px; }
.comment-card__meta .mine-badge { color: var(--accent); border: 1px solid rgba(216,255,89,.28); border-radius: 99px; padding: 2px 6px; }
.comment-card__meta time { margin-left: auto; }
.comment-card__text { margin: 12px 0 13px 33px; color: rgba(255,255,255,.92); line-height: 1.65; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-card__footer { margin-left: 30px; display: flex; align-items: center; gap: 6px; }
.reaction-button { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.055); font-size: 11px; }
.reaction-button:hover { color: #fff; background: rgba(255,255,255,.1); }
.reaction-button.is-active { color: var(--accent); background: rgba(216,255,89,.11); }
.comment-actions { margin-left: auto; display: flex; }
.comment-action { color: rgba(255,255,255,.4); padding: 6px; font-size: 10px; }
.comment-action:hover { color: #fff; }
.comment-action--danger:hover { color: var(--danger); }
.panel-write-button { position: absolute; left: 21px; right: 21px; bottom: 20px; height: 54px; box-shadow: 0 12px 45px rgba(0,0,0,.46); }
.panel-write-button span { margin-left: 8px; }
.empty-state { min-height: 250px; display: grid; place-content: center; justify-items: center; gap: 10px; color: rgba(255,255,255,.38); }
.empty-state span { color: var(--accent); font-size: 29px; }
.empty-state p { margin: 0; font-size: 12px; }

.privacy-dialog { width: min(520px, calc(100vw - 34px)); color: var(--text); border: 1px solid var(--line-strong); border-radius: 25px; padding: 31px; background: rgba(13,17,27,.96); box-shadow: 0 35px 110px rgba(0,0,0,.6); }
.privacy-dialog::backdrop { background: rgba(4,7,11,.72); backdrop-filter: blur(8px); }
.privacy-dialog .close-button { position: absolute; right: 18px; top: 18px; }
.privacy-dialog h2 { margin: 0 0 18px; font: 500 29px Georgia, "STSong", serif; }
.privacy-dialog > p:not(.eyebrow) { color: rgba(255,255,255,.66); font-size: 13px; line-height: 1.8; }
.privacy-dialog .primary-button { margin-top: 8px; width: 100%; }
.toast { position: fixed; z-index: 120; left: 50%; top: 24px; transform: translate(-50%, -20px); padding: 10px 16px; border-radius: 999px; color: #10150a; background: var(--accent); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .28s var(--ease); box-shadow: 0 12px 34px rgba(0,0,0,.25); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #ffb1b1; color: #431010; }
.noscript { position: fixed; inset: auto 20px 20px; z-index: 200; padding: 12px; text-align: center; color: #251f04; background: #fff0a4; border-radius: 12px; }

@media (max-width: 760px) {
  .shell { padding: 18px 17px max(14px, env(safe-area-inset-bottom)); }
  .topbar { gap: 8px; }
  .brand, .topbar__actions { min-width: 0; }
  .brand img { width: 36px; height: 36px; }
  .brand { gap: 9px; }
  .brand b { font-size: 14px; letter-spacing: .1em; white-space: nowrap; }
  .brand small, .button-label, .live-status span { display: none; }
  .live-status { display: none; }
  .topbar__actions { gap: 6px; }
  .icon-button { width: 39px; min-width: 39px; min-height: 39px; padding: 0; }
  .icon-button--accent { width: auto; padding: 0 11px; }
  .hero { width: 100%; padding-bottom: 24px; }
  .hero h1 { font-size: clamp(50px, 17vw, 76px); }
  .hero__lead { width: 100%; max-width: 100%; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
  .hero__actions { margin-top: 20px; }
  .composer { width: 100%; min-width: 0; min-height: 72px; grid-template-columns: minmax(0, 1fr) auto; padding: 9px 9px 9px 14px; border-radius: 19px; gap: 7px; overflow: hidden; }
  .composer__field { width: 100%; min-width: 0; }
  .composer__identity { display: none; }
  .composer textarea { min-height: 48px; padding: 12px 52px 10px 0; font-size: 13px; }
  .send-button { min-width: 70px; height: 50px; padding: 0 12px; }
  .send-button span { display: none; }
  .footer-note > span:first-child, .footer-note__sep { display: none; }
  .danmaku-stage { inset: 72px 0 126px; }
  .danmaku { max-width: 88vw; padding: 7px 12px 7px 8px; }
  .danmaku b { max-width: 63vw; font-size: 12px; }
  .danmaku small { display: none; }
  .comment-panel { top: 0; right: 0; bottom: 0; width: 100%; border-radius: 0; border: 0; }
}

@media (max-height: 680px) and (min-width: 761px) {
  .shell { padding-top: 20px; }
  .hero { padding-bottom: 14px; }
  .hero h1 { font-size: clamp(48px, 7vw, 82px); }
  .hero__lead { margin-top: 16px; }
  .hero__actions { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .danmaku-stage { display: none; }
}
