:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #eef1f3;
  color: #15202b;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #eef1f3; }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #101820; }
.login-panel { width: min(100%, 380px); background: #fff; padding: 36px; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.26); }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: #e43f3f; color: #fff; font-size: 22px; font-weight: 800; }
.login-panel h1 { margin: 22px 0 6px; font-size: 25px; line-height: 1.3; }
.login-panel p { margin: 0 0 26px; color: #63707a; }
.login-panel label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.login-panel input { width: 100%; height: 46px; border: 1px solid #b8c1c8; border-radius: 6px; padding: 0 12px; outline: none; }
.login-panel input:focus { border-color: #e43f3f; box-shadow: 0 0 0 3px rgba(228,63,63,.14); }
.login-panel button { width: 100%; height: 46px; margin-top: 16px; border: 0; border-radius: 6px; color: #fff; background: #d93636; font-weight: 700; }
.login-panel button:hover { background: #bf2d2d; }
.error { min-height: 20px; margin-top: 12px; color: #b3261e; font-size: 13px; }

.monitor-view { min-height: 100vh; }
header { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; color: #fff; background: #101820; }
header h1 { margin: 0; font-size: 19px; }
header p { margin: 4px 0 0; color: #aeb9c2; font-size: 12px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #3b4852; border-radius: 6px; color: #fff; background: transparent; }
.icon-button:hover { background: #26323b; }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 72px); }
aside { padding: 24px 16px; background: #fff; border-right: 1px solid #d9dfe3; }
.section-label { margin: 0 10px 12px; color: #6a7680; font-size: 12px; font-weight: 700; }
.camera-list { display: grid; gap: 6px; }
.camera-button { width: 100%; min-height: 52px; display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 12px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #26323b; text-align: left; }
.camera-button:hover { background: #f1f4f5; }
.camera-button.active { border-color: #efb4b4; background: #fff0f0; color: #a82929; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #97a3ab; }
.camera-button.active .status-dot { background: #df3737; box-shadow: 0 0 0 4px rgba(223,55,55,.12); }
.camera-name { overflow-wrap: anywhere; font-weight: 700; }
.camera-state { color: #7b878f; font-size: 11px; }

.player-area { min-width: 0; padding: 26px 30px 34px; }
.player-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.player-heading h2 { margin: 0; font-size: 20px; }
.player-heading p { margin: 5px 0 0; color: #66737c; font-size: 13px; }
.secondary-button { min-height: 38px; padding: 0 14px; border: 1px solid #bdc6cc; border-radius: 6px; background: #fff; color: #34424d; }
.secondary-button:hover { background: #f4f6f7; }
.video-shell { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 190px); overflow: hidden; background: #070b0e; border-radius: 6px; box-shadow: 0 12px 34px rgba(16,24,32,.16); }
video { display: block; width: 100%; height: 100%; object-fit: contain; background: #070b0e; }
.empty-state { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: #8c979f; }
.empty-state svg { width: 50px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }

@media (max-width: 720px) {
  header { height: 64px; padding: 0 16px; }
  .workspace { grid-template-columns: 1fr; min-height: calc(100vh - 64px); }
  aside { padding: 14px 12px; border-right: 0; border-bottom: 1px solid #d9dfe3; }
  .camera-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .camera-button { min-height: 58px; grid-template-columns: 8px 1fr; gap: 8px; padding: 8px; }
  .camera-state { grid-column: 2; }
  .player-area { padding: 18px 12px 28px; }
  .player-heading { align-items: flex-start; }
  .player-heading h2 { font-size: 18px; }
  .video-shell { max-height: none; }
}

@media (max-width: 430px) {
  .login-panel { padding: 28px 22px; }
  .camera-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
