:root {
  color-scheme: light;
  --surface: #ffffff;
  --surface-muted: #f6faf9;
  --ink: #1a2733;
  --ink-soft: #334855;
  --muted: #6b8495;
  --line: #d9eee8;
  --line-subtle: #eaf6f2;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --accent: #18b5aa;
  --accent-deep: #0f9b91;
  --accent-soft: rgba(24, 181, 170, 0.14);
  --accent-ink: #0a6d66;
  --sky: #42b4e0;
  --sky-soft: rgba(66, 180, 224, 0.14);
  --lavender: #9b8fd9;
  --lavender-soft: rgba(155, 143, 217, 0.14);
  --warning: #e09a3d;
  --warning-soft: rgba(224, 154, 61, 0.16);
  --danger: #e05563;
  --danger-soft: rgba(224, 85, 99, 0.12);
  --success: #2fb87a;
  --success-soft: rgba(47, 184, 122, 0.14);
  --shadow: 0 10px 40px rgba(15, 91, 84, 0.06);
  --shadow-sm: 0 2px 12px rgba(26, 39, 51, 0.04);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1000px 520px at 8% -6%, rgba(24, 181, 170, 0.11), transparent 55%),
    radial-gradient(800px 420px at 96% 4%, rgba(66, 180, 224, 0.12), transparent 48%),
    radial-gradient(600px 400px at 50% 100%, rgba(155, 143, 217, 0.06), transparent 45%),
    linear-gradient(168deg, #f3faf8 0%, #f5f9fc 45%, #f7faf7 100%);
}

/* 左侧导航 + 主区域 */
.dash-app {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.dash-sidebar {
  width: 258px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 14px 20px;
  background: var(--panel-strong);
  border-right: 1px solid var(--line-subtle);
  box-shadow: 4px 0 24px rgba(26, 39, 51, 0.04);
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  z-index: 50;
}
.dash-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 14px;
  margin-bottom: 4px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line-subtle);
  border-radius: 0;
}
.dash-sidebar-brand:hover .dash-sidebar-brand-title {
  color: var(--accent-deep);
}
.dash-sidebar-brand-mark {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(24, 181, 170, 0.28);
}
.dash-sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-sidebar-brand-title {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
  color: var(--ink);
}
.dash-sidebar-brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.dash-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  padding: 6px 0;
  min-height: 0;
}
.dash-main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}
.dash-main-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 22px 40px;
}
.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 16px;
}
.dash-toolbar-hint {
  font-size: 13px;
}
.dash-context-banner {
  display: none;
  margin-bottom: 16px;
}
.dash-context-banner.is-visible {
  display: block;
}
.dash-focus-panel {
  margin-bottom: 18px;
}
.dash-nav-link-config {
  margin-top: 8px;
  padding-top: 12px !important;
  border-top: 1px dashed var(--line);
  color: var(--accent-deep);
}
.dash-nav-link-config:hover {
  color: var(--accent-ink);
}
.dash-foot-card {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line-subtle);
  box-sizing: border-box;
}
.dash-foot-card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.dash-foot-card-body {
  font-size: 12px;
  line-height: 1.55;
}
.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}
.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
  margin-bottom: 18px;
}
.hero-card,
.panel,
.metric,
.binding-card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-sm), var(--shadow);
}
.hero-card {
  border-radius: 24px;
  padding: 28px 30px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
}
h1 {
  margin: 14px 0 10px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
}
.hero p {
  margin: 0;
  line-height: 1.75;
  color: var(--muted);
  max-width: 70ch;
}
.hero-side {
  display: grid;
  gap: 16px;
}
.hero-side .panel {
  border-radius: 20px;
  padding: 18px 20px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
input,
select,
button,
textarea {
  font: inherit;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 15px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(24, 181, 170, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
button {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
button:hover {
  transform: translateY(-1px);
}
button.primary {
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 4px 16px rgba(24, 181, 170, 0.28);
}
button.primary:hover {
  box-shadow: 0 6px 22px rgba(24, 181, 170, 0.34);
}
button.ghost {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}
.stack {
  display: grid;
  gap: 18px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
body[data-dashboard-page]:not([data-dashboard-page="overview"]) .metrics {
  display: none !important;
}
.metric {
  border-radius: 18px;
  padding: 18px 20px;
}
.metric .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.metric .value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}
.panel {
  border-radius: 20px;
  padding: 20px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.panel-header h2 {
  margin: 0;
  font-size: 18px;
}
.subtle {
  color: var(--muted);
  font-size: 13px;
}
.inline-link {
  color: var(--accent-deep);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid rgba(24, 181, 170, 0.35);
}
.inline-link:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent-deep);
}
.dash-nav-link {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 12px 10px 11px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  text-decoration: none;
  box-sizing: border-box;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.dash-nav-link:hover {
  color: var(--accent-ink);
  background: var(--surface-muted);
  border-color: var(--line-subtle);
  border-left-color: transparent;
}
.dash-nav-link.active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid rgba(24, 181, 170, 0.28);
  border-left: 3px solid var(--accent-deep);
  box-shadow: none;
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  border: 1px solid transparent;
}
.tab.active {
  color: var(--accent-ink);
  background: var(--surface);
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}
.table-wrap {
  overflow: auto;
  border-radius: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--line-subtle);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.time-local {
  cursor: help;
  border-bottom: 1px dotted var(--muted);
}
th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
  word-break: break-word;
}
th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:last-child td {
  border-bottom: none;
}
.list {
  display: grid;
  gap: 12px;
}
.event {
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line-subtle);
}
.event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.stream {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.badge.audio {
  background: var(--sky-soft);
  color: #1a7aa8;
}
.badge.todo {
  background: var(--warning-soft);
  color: #9a6b1f;
}
.badge.device {
  background: var(--lavender-soft);
  color: #5c4ba3;
}
.badge.notification {
  background: var(--danger-soft);
  color: #b03642;
}
.pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.pill.ok {
  background: var(--success-soft);
  color: #1d7a4e;
}
.pill.warn {
  background: var(--warning-soft);
  color: #8a5f18;
}
.pill.fail {
  background: var(--danger-soft);
  color: #a32f3c;
}
.binding-card {
  border-radius: 20px;
  padding: 20px;
}
.binding-card form {
  display: grid;
  gap: 12px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
}
.secret-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.secret-row input {
  flex: 1;
  min-width: 0;
}
.eye-btn {
  flex: 0 0 auto;
  padding: 12px 14px;
  min-width: 52px;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.eye-btn:hover {
  transform: translateY(-1px);
}
.error {
  display: none;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(224, 85, 99, 0.22);
  color: #9a2a36;
}
.success {
  display: none;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--success-soft);
  border: 1px solid rgba(47, 184, 122, 0.22);
  color: #1d7a4e;
}
.error .error-line {
  font-weight: 700;
}
.error .diag-pre {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid rgba(224, 85, 99, 0.2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}
.diag-check-row {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line-subtle);
}
.diag-check-row.fail {
  border-left: 4px solid var(--danger);
}
.diag-check-row.ok {
  border-left: 4px solid var(--success);
}
.diag-check-row .diag-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  word-break: break-all;
}
.diag-pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(24, 181, 170, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
}
.test-result-modal-body .diag-pre {
  max-height: none;
}
.test-result-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(26, 39, 51, 0.48);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}
.test-result-modal-backdrop.is-open {
  display: flex;
}
.test-result-modal {
  width: min(720px, 100%);
  max-height: min(85vh, 820px);
  display: flex;
  flex-direction: column;
  background: var(--panel-strong);
  border-radius: 22px;
  border: 1px solid var(--line-subtle);
  box-shadow: 0 24px 64px rgba(15, 91, 84, 0.12);
  overflow: hidden;
}
.test-result-modal--ok {
  border-color: rgba(47, 184, 122, 0.35);
}
.test-result-modal--fail {
  border-color: rgba(224, 85, 99, 0.35);
}
.test-result-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-subtle);
  flex-shrink: 0;
}
.test-result-modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.test-result-modal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px 0;
  flex-shrink: 0;
}
.test-result-modal-body {
  margin: 0;
  padding: 14px 20px 20px;
  overflow: auto;
  flex: 1;
  min-height: 100px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
@media (max-width: 1100px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .dash-app {
    flex-direction: column;
  }
  .dash-sidebar {
    width: 100%;
    min-height: 0;
    max-height: none;
    position: sticky;
    top: 0;
    flex-flow: row wrap;
    align-items: flex-start;
    padding: 14px 12px 12px;
    border-right: none;
    border-bottom: 1px solid var(--line-subtle);
    box-shadow: 0 6px 22px rgba(26, 39, 51, 0.06);
  }
  .dash-sidebar-brand {
    flex: 1 1 auto;
    min-width: 0;
    border-bottom: none;
    padding: 6px 8px 10px;
    margin-bottom: 0;
  }
  .dash-sidebar-nav {
    flex: 1 1 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 8px;
  }
  .dash-nav-link {
    width: auto;
    flex: 1 1 calc(50% - 6px);
    min-width: 108px;
    justify-content: center;
    font-size: 12px;
    padding: 8px 10px;
    border-left-width: 1px;
  }
  .dash-nav-link.active {
    border-left-width: 1px;
    border-left-color: rgba(24, 181, 170, 0.35);
  }
  .dash-main {
    min-height: 0;
  }
}
@media (max-width: 720px) {
  .shell {
    padding: 16px 14px 30px;
  }
  .metrics,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .dash-nav-link {
    flex: 1 1 100%;
  }
}

.minutes-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(26, 39, 51, 0.48);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}
.minutes-modal-backdrop.is-open {
  display: flex;
}
.minutes-modal {
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--panel-strong);
  border-radius: 22px;
  border: 1px solid var(--line-subtle);
  box-shadow: 0 24px 64px rgba(15, 91, 84, 0.12);
  overflow: hidden;
}
.minutes-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-subtle);
  flex-shrink: 0;
}
.minutes-modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.minutes-modal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 22px 0;
  flex-shrink: 0;
}
.minutes-modal-toolbar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.minutes-modal-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px 22px 48px;
  flex: 1;
  min-height: 200px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.minutes-modal-loading.is-visible {
  display: flex;
}
.minutes-modal-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: minutes-spin 0.7s linear infinite;
}
@keyframes minutes-spin {
  to {
    transform: rotate(360deg);
  }
}
.minutes-modal-body.is-hidden {
  display: none;
}
.minutes-modal-meta {
  margin: 0;
  padding: 8px 22px 0;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.minutes-modal-body {
  margin: 0;
  padding: 14px 22px 22px;
  overflow: auto;
  flex: 1;
  min-height: 120px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "PingFang SC", "Hiragino Sans GB", ui-monospace, Menlo, monospace;
  color: var(--ink);
}
