/* 默认深色；浅色见 html[data-theme="light"] */
html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

header {
  display: none !important;
}

html,
body {
  height: 100%;
  min-height: 100%;
}

:root,
html:not([data-theme="light"]) {
  --bg: #0b0e14;
  --panel: #11151f;
  --border: #1e2430;
  --fg: #c7d1e0;
  --muted: #6b7689;
  --accent: #39bae6;
}

html[data-theme="light"] {
  --bg: #fafbfc;
  --panel: #ffffff;
  --border: #e3e6ea;
  --fg: #333333;
  --muted: #888888;
  --accent: #4a7cff;
}

body {
  background: var(--bg);
  color: var(--fg);
}

#tabbar {
  background: var(--panel);
}

html[data-theme="light"] #tabbar {
  background: #f0f2f5;
}

html[data-theme="light"] .tab.active {
  background: var(--bg);
}

html[data-theme="light"] .node.served {
  background: #eef3ff;
}

.embed-prefs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 6px 0.5rem 8px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.embed-prefs-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.embed-prefs-item select,
.embed-prefs-item input {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  min-width: 4rem;
}

.embed-prefs-item input {
  width: 3.5rem;
}

@media (max-width: 900px) {
  main {
    flex-direction: column !important;
  }

  #left {
    flex: 1 1 auto;
    min-height: 42vh;
  }

  #terminals {
    min-height: 220px;
  }

  #panel {
    width: 100% !important;
    max-height: 36vh;
    overflow-y: auto;
    border-left: none !important;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }

  .embed-prefs-bar {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
}
