:root {
  color-scheme: dark;
  font: 100%/1.55 "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --bg: #100f0e;
  --panel: #181615;
  --field: #121110;
  --line: #342e2a;
  --text: #f6eee7;
  --muted: #b0a39a;
  --quiet: #978981;
  --accent: #ff985e;
  --accent-soft: #ffc19e;
  --danger: #ff9b92;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
button, input, textarea { min-width: 0; }
::selection { background: #653520; color: #fff; }
h1, h2, p { margin: 0; }
.icon-library { position: absolute; width: 0; height: 0; pointer-events: none; }
.icon { width: 1.125rem; height: 1.125rem; flex: none; stroke: currentColor; fill: none; stroke-width: 1.65; stroke-linejoin: round; stroke-linecap: round; }
.topbar, .main { width: min(1112px, calc(100% - 80px)); margin-inline: auto; }
.topbar { height: 99px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #292521; }
.brand { display: inline-flex; align-items: center; gap: .58rem; font: 680 .83rem/1.2 system-ui, sans-serif; letter-spacing: .14em; }
.brand-mark, .room-mark { display: inline-grid; place-items: center; flex: none; width: 37px; height: 37px; border-radius: 11px; border: 1px solid #473024; background: #241913; color: var(--accent); }
.brand-mark { margin-right: .12rem; }
.brand-mark .icon { width: 21px; height: 21px; }
.amp { color: var(--accent); margin-inline: -.18rem; }
.security-link { display: flex; align-items: center; gap: .45rem; padding: .45rem .7rem; border: 1px solid #39312a; border-radius: 100px; background: transparent; color: #d5c3b5; font-size: .8125rem; }
.security-link .icon { width: 15px; height: 15px; color: var(--accent); }
.security-link:hover, .secondary:hover { background: #28211c; border-color: #694733; }
.main { padding-top: clamp(25px, 6vh, 62px); }
.entry { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; }
.hero, .form-panel, .room, .ended { border: 1px solid var(--line); border-radius: 23px; overflow: hidden; }
.hero { position: relative; display: flex; isolation: isolate; flex-direction: column; justify-content: space-between; min-height: 513px; background: #0e0c0a; }
.hero::before { content: ""; position: absolute; z-index: -2; inset: 0; background: url('/embers.webp') center 63% / cover no-repeat; opacity: .94; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, #120f0ee8 0%, #100d0ad9 24%, #100d0a24 60%, #0d0b0980 78%, #100d0a 100%); }
.hero-copy { padding: clamp(28px, 4vw, 55px) clamp(26px, 4vw, 50px); }
.hero h1 { font-size: clamp(3.15rem, 5.75vw, 5.1rem); line-height: 1.14; font-weight: 720; letter-spacing: -.09em; white-space: nowrap; }
.hero h1 span { color: var(--accent); margin-left: -.06em; }
.hero p { margin-top: 1.2rem; color: #e3d3c6; font-size: clamp(.94rem, 1.5vw, 1.125rem); line-height: 1.7; }
.hero-foot { display: flex; align-items: center; gap: 15px; margin: 0 clamp(26px, 4vw, 50px) 29px; padding-top: 18px; border-top: 1px solid #dec8b137; color: #e2d1c4; font-size: .875rem; }
.hero-foot span { display: inline-flex; align-items: center; gap: .4rem; }
.hero-foot .icon { color: var(--accent); width: 16px; height: 16px; }
.feature-divider { width: 1px; height: 13px; background: #564038; }
.form-panel { padding: clamp(22px, 3.1vw, 37px); background: var(--panel); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; margin-bottom: 1.75rem; border: 1px solid #2c2623; border-radius: 12px; background: #100f0e; }
.modes button { padding: .57rem .2rem; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: .875rem; font-weight: 620; }
.modes button:hover { color: var(--text); }
.modes [aria-pressed=true] { border-color: #41362f; background: #2a221e; color: var(--accent-soft); }
.form-heading { margin-bottom: 1.45rem; }
.form-heading h2, dialog h2 { font-size: 1.55rem; font-weight: 680; letter-spacing: -.035em; }
.form-heading p { color: var(--muted); margin-top: .3rem; font-size: .875rem; }
form label, legend, dialog label { display: block; color: #e7dcd3; font-size: .875rem; font-weight: 600; margin-bottom: .42rem; }
.field, .password-field, textarea { width: 100%; border: 1px solid #433933; border-radius: 10px; background: var(--field); color: var(--text); }
.field, .password-field input { min-height: 46px; padding: .62rem .8rem; }
.password-field { display: flex; align-items: center; }
.password-field:focus-within { border-color: var(--accent); }
.password-field input { flex: 1; width: 100%; background: transparent; border: 0; outline: none; color: var(--text); }
input::placeholder, textarea::placeholder { color: #91837a; opacity: 1; }
#join-link:read-only { color: var(--muted); text-overflow: ellipsis; }
.icon-button { display: inline-grid; flex: none; place-items: center; width: 39px; height: 39px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--quiet); }
.icon-button:hover { color: var(--text); background: #ffffff0a; }
.password-field .icon-button { margin-right: 3px; }
.password-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .2rem .6rem; margin-top: .22rem; color: var(--quiet); font-size: .8125rem; }
.text-button { display: inline-flex; gap: .35rem; align-items: center; min-height: 33px; background: transparent; border: 0; border-radius: 5px; padding: .05rem 0 .05rem .25rem; color: var(--accent-soft); font-size: .8125rem; }
.text-button:hover { text-decoration: underline; }
.text-button .icon { width: 14px; height: 14px; }
fieldset { padding: 0; border: 0; margin: 1.02rem 0 1.4rem; min-width: 0; }
.duration { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .42rem; }
.duration label { position: relative; margin: 0; text-align: center; cursor: pointer; }
.duration input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.duration span { display: block; padding: .56rem .18rem; background: #141211; border: 1px solid #39312c; border-radius: 8px; color: var(--muted); font-size: .84rem; white-space: nowrap; }
.duration input:checked + span { border-color: #a85e3b; background: #35231a; color: var(--accent-soft); }
.duration input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; gap: .45rem; border-radius: 9px; font-weight: 670; white-space: nowrap; }
.primary { width: 100%; padding: .73rem 1rem; border: 1px solid transparent; background: var(--accent); color: #22120a; min-height: 47px; }
.primary:hover { background: #ffb389; }
.primary:disabled { opacity: .53; }
.secondary { background: #1d1916; border: 1px solid #48392f; color: #e9d9ce; padding: .52rem .75rem; font-size: .875rem; min-height: 39px; }
.secondary .icon { width: 16px; height: 16px; }
.spaced-label { margin-top: 1rem; }
.join-submit { margin-top: 1.55rem; }
.form-error { margin-top: .7rem; font-size: .875rem; color: var(--danger); }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1.2rem; color: var(--quiet); font-size: .8125rem; padding: 1.35rem .16rem 2rem; }
.room { max-width: 960px; margin-inline: auto; background: var(--panel); height: min(700px, calc(100dvh - 155px)); min-height: 405px; display: flex; flex-direction: column; }
.room-header { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: 1rem 1.35rem; border-bottom: 1px solid var(--line); }
.room-title, .room-actions, .room-time, .room-status, .identity { display: flex; align-items: center; }
.room-title { gap: .62rem; white-space: nowrap; }
.room-title h1 { font-size: 1.05rem; line-height: 1.3; }
.room-status { gap: .34rem; margin-top: .18rem; color: var(--muted); font-size: .75rem; }
.status-dot { width: 6px; height: 6px; background: #a8be8a; border-radius: 50%; }
.room-status.offline .status-dot { background: var(--accent); }
.room-actions { gap: .5rem; }
.room-time { gap: .32rem; color: var(--accent-soft); font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: .25rem; }
.room-time .icon { width: 16px; height: 16px; }
.danger-quiet { color: #ffa298; }
.message-list { position: relative; display: flex; flex-direction: column; gap: 1.05rem; flex: 1; min-height: 100px; overflow-y: auto; overscroll-behavior: contain; padding: 1.2rem 1.35rem; background: #141211; scrollbar-color: #574137 transparent; }
.empty-state { text-align: center; margin: auto; padding: .5rem; }
.empty-mark { display: inline-grid; place-items: center; width: 55px; height: 55px; color: var(--accent); background: #2a1e17; border: 1px solid #4b3224; border-radius: 16px; margin-bottom: .9rem; }
.empty-mark .icon { width: 24px; height: 24px; }
.empty-state h2 { font-size: 1.08rem; }
.empty-state p { margin: .35rem 0 .8rem; color: var(--muted); font-size: .875rem; }
.message { display: flex; align-items: flex-start; gap: .55rem; width: fit-content; max-width: 85%; }
.message.mine { align-self: flex-end; flex-direction: row-reverse; }
.message.mine .message-meta { justify-content: end; }
.avatar { display: inline-grid; place-items: center; width: 35px; height: 35px; flex: none; background: #31241c; border: 1px solid #514034; border-radius: 10px; font-size: 1.05rem; }
.avatar.c1 { background: #222e25; border-color: #394e3f; }
.avatar.c2 { background: #252737; border-color: #42445a; }
.avatar.c3 { background: #36272d; border-color: #523c47; }
.message-content { min-width: 0; }
.message-meta { display: flex; align-items: baseline; gap: .45rem; margin: 0 .15rem .25rem; font-size: .78rem; color: var(--muted); }
.message-meta time { color: var(--quiet); white-space: nowrap; margin-left: auto; }
.message.mine .message-meta time { margin-left: 0; }
.bubble { white-space: pre-wrap; overflow-wrap: anywhere; padding: .55rem .78rem; background: #26211e; border: 1px solid #382e29; border-radius: 3px 12px 12px 12px; }
.mine .bubble { background: #38251a; border-color: #533726; border-radius: 12px 3px 12px 12px; }
.room-error { padding: 0 1.35rem; }
.compose { padding: .76rem 1.35rem 1rem; border-top: 1px solid var(--line); }
.identity { gap: .42rem; color: #e8d9ce; font-size: .8125rem; margin-bottom: .52rem; }
.identity .avatar { width: 24px; height: 24px; font-size: .83rem; border-radius: 7px; }
.identity-own { color: var(--quiet); padding-left: .2rem; }
.compose-row { display: flex; align-items: end; gap: .55rem; }
textarea { min-height: 45px; max-height: 130px; resize: vertical; padding: .59rem .75rem; }
.send { width: auto; min-height: 45px; }
.ended { display: flex; flex-direction: column; align-items: center; background: var(--panel); text-align: center; gap: .7rem; padding: clamp(32px, 7vw, 85px) 1rem; }
.ended h1 { font-size: 1.6rem; }
.ended p { color: var(--muted); }
.ended .primary { width: auto; margin-top: .4rem; }
dialog { width: min(440px, calc(100% - 28px)); max-height: calc(100% - 34px); padding: 1.55rem; border: 1px solid #504238; border-radius: 18px; background: #1d1916; color: var(--text); }
dialog::backdrop { background: #070605be; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.dialog-heading .icon-button { margin-right: -.4rem; }
dialog p { margin-top: .65rem; color: var(--muted); font-size: .94rem; }
dialog label { margin-top: .95rem; }
.copy-row { display: flex; gap: .45rem; }
.copy-row .field { min-height: 39px; font-size: .875rem; }
.copy-status { min-height: 1.3rem; color: var(--accent-soft); margin-bottom: -.35rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; }
.dialog-actions .primary { width: auto; }
.danger { background: #ff9b92; }
.danger:hover { background: #ffb6ae; }
body.in-room .main { padding-top: 17px; }
body.in-room .topbar { height: 67px; }
body.in-room .footer { max-width: 960px; margin-inline: auto; padding-block: .65rem 1rem; }

@media (max-width: 800px) {
  .topbar, .main { width: calc(100% - 36px); }
  .topbar { height: 72px; }
  .entry { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 11px; }
  .hero { min-height: 475px; }
  .hero h1 { font-size: clamp(2.55rem, 6vw, 4rem); }
  .hero-foot { gap: 9px; font-size: .8rem; }
}
@media (max-width: 620px) {
  .topbar, .main { width: calc(100% - 26px); }
  .topbar { height: 61px; }
  .main { padding-top: 13px; }
  .entry { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .hero, .form-panel, .room, .ended { border-radius: 17px; }
  .hero { min-height: 242px; }
  .hero::before { background-position: 63% 57%; }
  .hero-copy { padding: 20px 23px 32px; }
  .hero h1 { font-size: clamp(2.5rem, 10.3vw, 3.7rem); }
  .hero p { margin-top: .6rem; }
  .hero-foot { margin: 0 23px 16px; padding-top: 10px; }
  .form-panel { padding: 19px 20px 22px; }
  .modes { margin-bottom: 1.1rem; }
  .form-heading { margin-bottom: 1rem; }
  .form-heading h2 { font-size: 1.33rem; }
  .footer { padding-top: .8rem; }
  body.in-room .topbar { height: 56px; }
  body.in-room .main { padding-top: 9px; }
  body.in-room .footer { display: none; }
  .room { height: calc(100dvh - 75px - env(safe-area-inset-bottom)); min-height: 300px; }
  .room-header, .message-list, .compose { padding-inline: .72rem; }
  .room-header { padding-block: .66rem; gap: .45rem; }
  .room-title { gap: .38rem; }
  .room-title h1 { font-size: .92rem; }
  .room-mark { width: 32px; height: 32px; }
  .room-time { margin: 0; font-size: .76rem; gap: .14rem; }
  .room-time .icon { width: 13px; height: 13px; }
  .room-actions { gap: .26rem; }
  .room-actions .secondary { padding-inline: .46rem; min-height: 35px; font-size: .8rem; }
  .room-actions .secondary .icon { display: none; }
  .message { max-width: 94%; }
}
