:root {
  --ink: #10213d;
  --muted: #637087;
  --paper: #f5f8ff;
  --surface: #ffffff;
  --line: #d8e0ef;
  --blue: #2457f5;
  --blue-dark: #173fc2;
  --cyan: #3ed6d0;
  --success: #14805e;
  --danger: #c83b4c;
  --shadow: 0 20px 60px rgba(26, 52, 105, 0.14);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

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

body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(36, 87, 245, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 87, 245, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button { font: inherit; }

.workspace {
  width: min(1600px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.brand-block { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 13px 13px 13px 4px;
  color: white;
  background: var(--blue);
  box-shadow: 8px 8px 0 var(--cyan);
  font: 700 18px/1 Consolas, monospace;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(22px, 2.3vw, 32px); letter-spacing: -.04em; }

.actions { display: flex; gap: 10px; }

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.button:not(:disabled):hover { transform: translateY(-2px); }
.button:focus-visible { outline: 3px solid rgba(62, 214, 208, .6); outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 8px 18px rgba(36, 87, 245, .22); }
.button-primary:not(:disabled):hover { background: var(--blue-dark); }
.button-secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }

.status-strip {
  display: grid;
  grid-template-columns: 92px minmax(220px, 1fr) auto;
  align-items: center;
  min-height: 86px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
}

.status-rail { display: flex; align-items: center; width: 66px; }
.status-rail span:not(.status-dot) { width: 16px; height: 2px; background: var(--line); }
.status-dot { width: 12px; height: 12px; border: 3px solid var(--line); border-radius: 50%; background: white; }
.status-dot.is-active { border-color: var(--blue); box-shadow: 0 0 0 5px rgba(36, 87, 245, .1); }
.status-label { margin: 0 0 3px; font-weight: 800; }
.status-detail { margin: 0; color: var(--muted); font-size: 13px; }
.status-label.is-success { color: var(--success); }
.status-label.is-error { color: var(--danger); }

.session-meta { display: flex; gap: 28px; margin: 0; }
.session-meta div { min-width: 74px; }
.session-meta dt { margin-bottom: 3px; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.session-meta dd { margin: 0; font: 700 13px/1.3 Consolas, "Microsoft YaHei UI", monospace; }

.notebook-frame {
  position: relative;
  height: calc(100vh - 180px);
  min-height: 580px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
}

.notebook-frame iframe { width: 100%; height: 100%; border: 0; background: white; }

.loading-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
  background: white;
  transition: opacity .3s ease, visibility .3s ease;
}

.loading-cover.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-grid { display: grid; grid-template-columns: repeat(3, 12px); gap: 6px; transform: rotate(45deg); }
.loader-grid i { width: 12px; height: 12px; background: var(--blue); animation: pulse 1.15s ease-in-out infinite alternate; }
.loader-grid i:nth-child(2n) { background: var(--cyan); animation-delay: .18s; }
.loader-grid i:nth-child(3n) { animation-delay: .36s; }

@keyframes pulse { to { transform: scale(.35); opacity: .35; } }

@media (max-width: 760px) {
  .workspace { width: calc(100vw - 20px); padding-top: 12px; }
  .topbar { align-items: flex-end; }
  .brand-mark { display: none; }
  .button { padding: 0 12px; }
  .status-strip { grid-template-columns: 1fr; gap: 10px; }
  .status-rail { display: none; }
  .session-meta { justify-content: space-between; gap: 10px; }
  .notebook-frame { height: calc(100vh - 220px); min-height: 480px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

