.room-switcher {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  gap: 4px;
  text-align: start;
  font-family: var(--font);
}
.room-switcher label { font-size: 14px; font-weight: 600; }
.room-switcher select, .room-danmaku input, .room-danmaku button {
  min-width: 0;
  border: 1px solid var(--arena-line);
  border-radius: 2px;
  background: var(--arena-surface, #fff);
  color: var(--arena-ink, #00356b);
  font: 500 14px/1.4 var(--font);
}
.room-switcher select { min-height: 44px; width: 100%; padding: 6px 10px; }
#room-context { font-size: 13px; line-height: 1.4; }
.arena-shell .page-heading { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,265px) auto; gap: 20px; }
.arena-shell .page-heading .room-switcher { color: #f6f4ef; }
.trading-main .trading-context { flex-wrap: wrap; gap: 12px 20px; }
.trading-context .room-switcher { width: min(100%,280px); }
.room-danmaku {
  flex: 0 0 auto;
  min-width: 0;
  padding: 6px 12px 8px;
  border-block: 1px solid var(--arena-line);
  background: var(--arena-surface, #fff);
  color: var(--arena-ink, #00356b);
}
.danmaku-top, .room-danmaku form { display: flex; gap: 8px; align-items: center; }
.danmaku-title { flex: none; font-size: 13px; font-weight: 600; }
.danmaku-lane { position: relative; flex: 1; overflow: hidden; height: 26px; }
.danmaku-line {
  display: block; width: max-content; max-width: none; line-height: 26px;
  white-space: nowrap; font-size: 14px;
}
.danmaku-line.is-moving { animation: room-comment-drift 9s linear forwards; }
@keyframes room-comment-drift {
  from { transform: translateX(0); margin-inline-start: 90%; }
  to { transform: translateX(-100%); margin-inline-start: 0; }
}
.room-danmaku.is-paused .danmaku-line { animation-play-state: paused; }
.room-danmaku button { cursor: pointer; padding: 4px 10px; min-height: 34px; white-space: nowrap; }
.room-danmaku form { margin-top: 4px; }
.room-danmaku input { flex: 1; padding: 6px 8px; height: 34px; }
.room-danmaku input::placeholder { color: var(--arena-muted, #4a6176); }
.room-danmaku [hidden] { display: none; }
.room-danmaku form button { background: #00356b; color: #f6f4ef; border-color: #00356b; }
.room-danmaku button:hover, .room-switcher select:hover { border-color: var(--arena-ink, #00356b); }
.room-danmaku form button:hover { background: #164e85; }
.room-danmaku :is(button, input):focus-visible, .room-switcher select:focus-visible { outline: 2px solid #2869ba; outline-offset: 2px; }
.fusion-footer-links { grid-template-columns: repeat(auto-fit,minmax(min(100%,10.5rem),1fr)); gap: 4px 16px; }
.fusion-footer-links a { justify-content: flex-start; text-align: start; }
html[lang|="zh"] .fusion-footer-links a span { white-space: nowrap; }
html[data-theme="dark"] :is(.room-switcher select,.room-danmaku,.room-danmaku input,.room-danmaku button) { background: #10263c; color: #f6f4ef; border-color: #66819a; }
html[data-theme="dark"] .room-danmaku input::placeholder { color: #c8daee; }
html[data-theme="dark"] .room-danmaku form button { color: #00356b; background: #f6f4ef; }
@media (max-width: 1050px) {
  .arena-shell .page-heading { grid-template-columns: minmax(0,1fr) minmax(180px,265px); }
  .arena-shell .page-heading .live-controls { grid-column: 1/-1; }
}
@media (max-width: 680px) {
  .arena-shell .page-heading { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .arena-shell .page-heading .live-controls { justify-content: flex-start; }
  .trading-main .trading-context { display: flex; flex-wrap: wrap; align-items: flex-end; }
  .trading-context .trading-context-main { width: 100%; }
  .trading-context .room-switcher { flex: 1 1 180px; }
  .room-danmaku input, .room-danmaku button { min-height: 44px; }
  .room-danmaku input, .room-switcher select { font-size: 16px; }
  .trading-page .terminal-market { height: auto; min-height: 540px; }
}
@media (prefers-reduced-motion: reduce) {
  .danmaku-lane { height: auto; min-height: 26px; }
  .danmaku-line, .danmaku-line.is-moving { width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; animation: none; }
}

.trading-page .direction-controls button:disabled { color: var(--arena-muted); background: var(--arena-surface); border-style: dashed; opacity: 1; cursor: not-allowed; }
.trading-page .direction-controls button:disabled strong { color: inherit; }
.room-danmaku form .danmaku-preview { background: var(--arena-surface); color: var(--arena-ink); border-color: var(--arena-control); }
.room-danmaku button:disabled { color: var(--arena-muted); background: var(--arena-surface); border-style: dashed; cursor: wait; }
.danmaku-feedback { color: var(--arena-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.danmaku-feedback [role="status"]:not(:empty) { display: inline-block; margin-block-start: 4px; }
.danmaku-login { color: var(--arena-action); margin-inline-start: 6px; text-decoration: underline; }
.danmaku-feedback a:focus-visible { outline: 2px solid var(--arena-action); }
@media (max-width: 480px) {
  .trading-page .records-toolbar { padding-inline: 6px; }
  .trading-page .record-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2px; }
  .trading-page .record-tabs button, .trading-page .record-tabs button:last-child { width: auto; padding-inline: 2px; }
}
@media (max-width: 480px) {
  .trading-main .trading-context { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .trading-context .trading-context-main { grid-area: 1 / 1; width: auto; }
  .trading-context .trading-context-tools { grid-area: 1 / 2; align-self: start; }
  .trading-context .room-switcher { grid-area: 2 / 1 / auto / -1; width: 100%; max-width: 100%; }
  .room-switcher { overflow-x: clip; }
  .room-switcher select:focus-visible { outline-offset: -3px; }
}
