:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #edf1ed;
  color: #1b2828;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #edf1ed;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid #d7dfd9;
  background: rgba(250, 252, 250, 0.96);
  backdrop-filter: blur(12px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand__mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid #15352f;
  border-radius: 50%;
  color: #15352f;
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #52625d;
  font-size: 14px;
}

.nav__link:hover,
.nav__link.is-active {
  border-bottom-color: #d4573f;
  color: #15352f;
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(278px, 0.68fr);
  gap: 28px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 8px;
  color: #c44e38;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.player-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 54px;
  margin-bottom: 14px;
  gap: 20px;
}

.player-head h1,
.section-head h2,
.studio-head h1 {
  margin: 0;
  color: #15352f;
  font-size: 26px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.22;
}

.muted {
  margin: 5px 0 0;
  color: #66756f;
  font-size: 14px;
  line-height: 1.55;
}

.status {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #c4d0c8;
  border-radius: 3px;
  background: #f8faf8;
  color: #5b6c63;
  font-size: 12px;
  font-weight: 700;
}

.status::before {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status--live {
  border-color: #e3a194;
  background: #fff4f1;
  color: #bd3d2a;
}

.status--scheduled {
  border-color: #d6c48d;
  background: #fff9e7;
  color: #8c6c13;
}

.status--ended {
  border-color: #d5d9d7;
  background: #f4f5f4;
  color: #68736f;
}

.player {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #263d39;
  border-radius: 6px;
  background: #0d1918;
}

.player video {
  display: block;
  width: 100%;
  height: 100%;
  background: #0d1918;
}

.player__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #102220;
  color: #ecf3ed;
  text-align: center;
}

.player__empty-inner {
  max-width: 320px;
}

.player__empty-mark {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  place-items: center;
  border: 1px solid #77968a;
  border-radius: 50%;
  color: #d7c672;
  font-family: Georgia, serif;
  font-size: 38px;
}

.player__empty h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 720;
}

.player__empty p {
  margin: 8px 0 0;
  color: #b7c8bf;
  font-size: 14px;
  line-height: 1.55;
}

.room-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  margin-top: 16px;
  border-top: 1px solid #d3dcd5;
  border-bottom: 1px solid #d3dcd5;
}

.room-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  margin: 16px 12px 16px 0;
  place-items: center;
  border-radius: 50%;
  background: #d7c672;
  color: #15352f;
  font-size: 14px;
  font-weight: 800;
}

.room-meta__body {
  min-width: 0;
  padding: 14px 0;
}

.room-meta__host {
  margin: 0;
  color: #254238;
  font-size: 14px;
  font-weight: 720;
}

.room-meta__desc {
  margin: 4px 0 0;
  color: #6a7873;
  font-size: 13px;
  line-height: 1.55;
}

.room-list-panel {
  border-top: 2px solid #15352f;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 15px 0 14px;
  border-bottom: 1px solid #cbd6ce;
  gap: 16px;
}

.section-head h2 {
  font-size: 18px;
}

.section-count {
  color: #6e7a75;
  font-size: 12px;
}

.room-list {
  display: grid;
}

.room-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid #d4ddd6;
  background: transparent;
  color: inherit;
  text-align: left;
  gap: 11px;
}

.room-row:hover .room-row__title,
.room-row.is-selected .room-row__title {
  color: #c44e38;
}

.room-row__avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #d8e3dc;
  color: #1d483c;
  font-size: 12px;
  font-weight: 800;
}

.room-row__title {
  overflow: hidden;
  margin: 0;
  color: #24352f;
  font-size: 14px;
  font-weight: 740;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-row__host {
  margin: 3px 0 0;
  color: #73807b;
  font-size: 12px;
}

.empty-list {
  padding: 32px 0;
  color: #71807a;
  font-size: 14px;
  line-height: 1.6;
}

.studio-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid #15352f;
  gap: 24px;
}

.studio-head h1 {
  font-size: 28px;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  border-top: 1px solid #c8d3cb;
  border-bottom: 1px solid #c8d3cb;
}

.studio-section {
  min-width: 0;
  padding: 24px 28px 28px 0;
}

.studio-section + .studio-section {
  padding: 24px 0 28px 28px;
  border-left: 1px solid #c8d3cb;
}

.studio-section h2 {
  margin: 0 0 18px;
  color: #1e3931;
  font-size: 18px;
  font-weight: 760;
}

.key-form,
.room-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: #52645d;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid #bdcbc1;
  border-radius: 4px;
  outline: none;
  background: #fafdF9;
  color: #1c2d28;
  font-size: 14px;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: #15352f;
  box-shadow: 0 0 0 3px rgba(21, 53, 47, 0.11);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #15352f;
  border-radius: 4px;
  background: #15352f;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.button:hover {
  background: #1c4a3f;
}

.button--secondary {
  background: #f8fbf8;
  color: #15352f;
}

.button--secondary:hover {
  background: #e2ebe3;
}

.button--danger {
  border-color: #b34131;
  background: #fff7f4;
  color: #a73526;
}

.button--danger:hover {
  background: #fbe6e0;
}

.studio-secret {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #d5bd70;
  border-radius: 4px;
  background: #fffbea;
}

.studio-secret h3 {
  margin: 0 0 8px;
  color: #6e5610;
  font-size: 14px;
}

.secret-value {
  overflow-wrap: anywhere;
  padding: 9px 10px;
  border: 1px solid #e0cb85;
  background: #fffef8;
  color: #47390f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.studio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.studio-table th,
.studio-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #d4ddd6;
  text-align: left;
  vertical-align: middle;
}

.studio-table th {
  color: #68776f;
  font-size: 11px;
  font-weight: 760;
}

.studio-table td:first-child,
.studio-table th:first-child {
  padding-left: 0;
}

.studio-table td:last-child,
.studio-table th:last-child {
  padding-right: 0;
}

.table-title {
  display: block;
  max-width: 220px;
  overflow: hidden;
  color: #20362e;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-slug {
  display: block;
  margin-top: 3px;
  color: #7a8782;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.text-button {
  min-height: 28px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: #25584a;
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover {
  color: #b44231;
  text-decoration: underline;
}

.notice {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(360px, calc(100% - 40px));
  padding: 12px 14px;
  border: 1px solid #9eb7a7;
  border-radius: 4px;
  background: #f7fcf8;
  box-shadow: 0 8px 24px rgba(24, 49, 42, 0.14);
  color: #234237;
  font-size: 13px;
  line-height: 1.45;
}

.notice--error {
  border-color: #d99286;
  background: #fff7f5;
  color: #982f21;
}

.loading {
  display: grid;
  min-height: 44vh;
  place-items: center;
  color: #688077;
  font-size: 14px;
}

@media (max-width: 820px) {
  .topbar__inner,
  .page {
    width: min(100% - 28px, 680px);
  }

  .page {
    padding-top: 24px;
  }

  .watch-layout,
  .studio-layout {
    grid-template-columns: 1fr;
  }

  .room-list-panel {
    margin-top: 10px;
  }

  .studio-section {
    padding: 20px 0;
  }

  .studio-section + .studio-section {
    padding: 24px 0 20px;
    border-top: 1px solid #c8d3cb;
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .topbar__inner {
    min-height: 56px;
    gap: 12px;
  }

  .brand {
    font-size: 15px;
  }

  .brand__mark {
    width: 25px;
    height: 25px;
    font-size: 18px;
  }

  .nav__link {
    min-height: 34px;
    padding: 0 7px;
    font-size: 13px;
  }

  .player-head,
  .studio-head {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .player-head h1,
  .studio-head h1 {
    font-size: 23px;
  }

  .studio-table th:nth-child(2),
  .studio-table td:nth-child(2) {
    display: none;
  }

  .table-actions {
    justify-content: flex-start;
  }
}
