html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #0c1017;
  color: #f5f7fb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
}

.player-shell.mud-container {
  min-height: 100vh;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.player-topbar,
.player-actions,
.subtitle-pane {
  background: #151922;
  border: 1px solid #252b38;
  border-radius: 8px;
}

.player-topbar {
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 18px;
  align-items: center;
}

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

.title-row h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: 0;
}

.status-chip {
  height: 24px;
  border-color: #384154;
  color: #a8b0bf;
  text-transform: uppercase;
}

#status {
  letter-spacing: 0.06em;
}

.account-nav {
  justify-self: end;
  max-width: 100%;
}

.account-nav .mud-button-label {
  max-width: min(240px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-logout {
  margin: 0;
}

.topbar-divider {
  grid-column: 1 / -1;
}

.threshold-control {
  grid-column: 1 / -1;
  color: #a8b0bf;
  flex-wrap: wrap;
}

.threshold-input-wrap {
  flex-wrap: wrap;
}

.threshold-control label {
  font-size: 13px;
  color: #a8b0bf;
}

.threshold-control input {
  width: 112px;
  height: 36px;
  background: #0f141d;
  border: 1px solid #30384a;
  color: #f5f7fb;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.threshold-control input:focus {
  outline: none;
  border-color: #4f8cff;
  box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.2);
}

.threshold-control .presets {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.threshold-control .presets .mud-button-root {
  min-width: 52px;
  height: 32px;
  padding: 0 10px;
  color: #cbd5e1;
  border-color: #30384a;
}

.player-actions {
  padding: 16px 20px;
}

.controls {
  flex-wrap: wrap;
}

.controls .mud-button-root {
  min-width: 104px;
  height: 40px;
}

.hint {
  color: #8d97a8;
}

.subtitle-pane {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px;
  min-height: 360px;
}

.subtitle-pane-title {
  color: #a8b0bf;
  width: 100%;
}

.subtitle-fullscreen-button {
  color: #a8b0bf;
}

.subtitle-fullscreen-button:hover {
  color: #f5f7fb;
}

.subtitle-current {
  font-size: 24px;
  line-height: 1.65;
  color: #f5f7fb;
  min-height: 56px;
  font-weight: 520;
}

.subtitle-divider {
  flex: 0 0 1px;
  width: 100%;
  background: #252b38;
}

.subtitle-history {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 0 1 auto;
  overflow-y: auto;
  color: #a8b0bf;
  font-size: 15px;
  line-height: 1.65;
  max-height: 520px;
}

.subtitle-history li {
  padding: 8px 0;
}

.subtitle-history li + li {
  border-top: 1px solid #202633;
}

.subtitle-pane:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 0;
  padding: 32px clamp(24px, 5vw, 72px);
  background: #0c1017;
  box-sizing: border-box;
}

.subtitle-pane:fullscreen .subtitle-current {
  min-height: 28vh;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1.55;
}

.subtitle-pane:fullscreen .subtitle-history {
  flex: 1;
  min-height: 0;
  max-height: none;
  font-size: clamp(18px, 1.8vw, 26px);
}

.subtitle-pane:fullscreen .subtitle-pane-title {
  font-size: 18px;
}

/* Ruby 中文注释样式：当前句和历史区都使用 */
ruby {
  ruby-position: over;
  ruby-align: center;
}

ruby > rt {
  font-size: 0.55em;
  color: #f59e0b;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.1;
  padding-bottom: 1px;
}

.subtitle-current ruby > rt {
  color: #fbbf24;
}

#blazor-error-ui {
  background: lightyellow;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  color: #333;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

.account-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: column;
  box-sizing: border-box;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px;
}

.account-panel {
  width: 100%;
  background: #151922;
  border: 1px solid #252b38;
  border-radius: 8px;
  padding: 28px;
  box-sizing: border-box;
}

.account-panel h1 {
  margin: 0 0 20px;
  color: #f5f7fb;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: 0;
}

.account-panel form {
  width: min(460px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.account-panel label {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  color: #cbd5e1;
  font-size: 13px;
}

.account-panel input[type="email"],
.account-panel input[type="password"] {
  background: #0f141d;
  border: 1px solid #30384a;
  border-radius: 8px;
  color: #f5f7fb;
  font-size: 15px;
  padding: 12px 14px;
  width: 100%;
  box-sizing: border-box;
}

.account-panel input:focus {
  border-color: #4f8cff;
  box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.2);
  outline: none;
}

.account-panel button,
.account-panel .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  min-height: 40px;
  background: #4f8cff;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  justify-self: start;
  padding: 10px 16px;
}

.account-panel button:hover,
.account-panel .primary:hover {
  background: #3d7af0;
}

.account-panel .external-login {
  margin-top: 12px;
  width: min(460px, 100%);
}

.account-panel .external-login button {
  background: #f8fafc;
  color: #111827;
  width: 100%;
}

.account-panel .external-login button:hover {
  background: #e5e7eb;
}

.checkline {
  align-items: center;
  display: flex !important;
  flex-direction: row !important;
}

.account-link,
.account-muted,
.account-alert {
  color: #a8b0bf;
  font-size: 13px;
  margin: 16px 0 0;
}

.account-link a {
  color: #9fc1ff;
}

.account-alert {
  background: #3b1d20;
  border: 1px solid #7f1d1d;
  border-radius: 8px;
  color: #fecaca;
  padding: 10px 12px;
}

.account-facts {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px 14px;
  margin: 0 0 20px;
}

.account-facts dt {
  color: #a8b0bf;
}

.account-facts dd {
  color: #f5f7fb;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .player-shell.mud-container,
  .account-shell {
    padding: 20px 14px;
  }

  .player-topbar {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .account-nav {
    justify-self: start;
  }

  .title-row h1,
  .account-panel h1 {
    font-size: 22px;
  }

  .threshold-control,
  .controls {
    align-items: flex-start !important;
  }

  .threshold-control .presets {
    justify-content: flex-start;
  }

  .subtitle-pane {
    min-height: 420px;
    padding: 16px;
  }

  .subtitle-current {
    font-size: 20px;
  }

  .account-panel {
    padding: 20px;
  }
}
