
:root {
  --bg: #07111f;
  --bg-soft: #0d1827;
  --surface: rgba(9, 18, 31, 0.78);
  --surface-strong: rgba(10, 20, 35, 0.94);
  --surface-alt: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f7fb;
  --muted: #98a8be;
  --accent: #ff7a18;
  --accent-strong: #ff9b3d;
  --accent-cool: #49c6e5;
  --success: #39d98a;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  color: var(--text);
  font-family: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(73, 198, 229, 0.12), transparent 24%),
    radial-gradient(circle at 86% 14%, rgba(255, 122, 24, 0.18), transparent 22%),
    linear-gradient(180deg, #08111e 0%, #050b14 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
}

.site-bg,
.site-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.site-bg {
  inset: 24px;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 32px;
}

.site-glow {
  width: 32vw;
  height: 32vw;
  filter: blur(40px);
  opacity: 0.55;
}

.site-glow-a {
  top: 10vh;
  left: -8vw;
  background: radial-gradient(circle, rgba(255, 122, 24, 0.22), transparent 70%);
}

.site-glow-b {
  right: -10vw;
  bottom: 6vh;
  background: radial-gradient(circle, rgba(73, 198, 229, 0.2), transparent 70%);
}

body > * {
  position: relative;
  z-index: 1;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.login-panel {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 420px);
  gap: 28px;
  align-items: stretch;
}

.login-copy {
  padding: 40px 12px 40px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-copy h2,
.page-topbar h2,
.hero-card h3,
.panel-heading h3,
.login-card h3 {
  margin: 10px 0 12px;
  font-family: "Avenir Next", "IBM Plex Sans", "PingFang SC", sans-serif;
  letter-spacing: 0.01em;
}

.login-copy h2 {
  font-size: clamp(2.1rem, 4vw, 4.4rem);
  line-height: 1;
  max-width: 12ch;
}

.login-copy p,
.muted {
  color: var(--muted);
}

.strong-copy {
  max-width: 70ch;
  line-height: 1.7;
}

.login-points {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  max-width: 560px;
}

.login-points article,
.sidebar-note,
.stat-card,
.apply-list article,
.note-list li,
.event,
.table-status,
.status-chip,
.card-checkbox {
  border: 1px solid var(--line);
}

.login-points article {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.login-points strong {
  font-size: 1rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
}

.sidebar {
  padding: 28px;
  border-right: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(8, 17, 30, 0.92), rgba(7, 14, 25, 0.78));
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand-block h1 {
  margin: 10px 0 12px;
  font-size: 2rem;
  line-height: 1.02;
}

.brand-block p,
.sidebar-note p,
.nav-links small,
.stat-card small,
.metric-label {
  color: var(--muted);
}

.brand-kicker,
.page-eyebrow,
.panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cool);
}

.nav-links {
  display: grid;
  gap: 12px;
}

.nav-links a {
  color: inherit;
  text-decoration: none;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-links a span {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 700;
}

.nav-links a:hover,
.nav-links a.active {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border-color: rgba(255, 122, 24, 0.36);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.sidebar-note {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
}

.content-shell {
  padding: 32px;
}

.page-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.page-topbar h2 {
  font-size: clamp(1.8rem, 2.4vw, 2.7rem);
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.topbar-meta span {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.page-body,
.stack-panel {
  display: grid;
  gap: 20px;
}

.hero-card,
.panel,
.login-card {
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 22, 37, 0.92), rgba(8, 15, 26, 0.9));
  box-shadow: var(--shadow);
}

.hero-card,
.panel {
  padding: 26px;
}

.login-card {
  padding: 30px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,122,24,0.22), transparent 68%);
  pointer-events: none;
}

.hero-card-config::before,
.hero-card-status::before,
.hero-card-history::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(73,198,229,0.08), transparent 35%, rgba(255,122,24,0.06) 80%);
}

.hero-side {
  min-width: 220px;
  display: grid;
  gap: 14px;
  justify-items: end;
  text-align: right;
}

.actions-right {
  align-items: end;
}

.history-side strong {
  font-size: 3rem;
  line-height: 1;
}

.content-grid.two-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
  gap: 20px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading.compact {
  margin-bottom: 14px;
}

.panel-heading h3,
.hero-card h3,
.login-card h3 {
  font-size: 1.45rem;
}

.form {
  display: grid;
  gap: 16px;
}

.grid-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

label {
  display: grid;
  gap: 10px;
}

label span {
  font-size: 0.92rem;
  color: #c6d3e2;
}

.field-help {
  display: block;
  margin-top: -2px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
}

input {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

input::placeholder {
  color: rgba(152, 168, 190, 0.72);
}

input:focus {
  border-color: rgba(73, 198, 229, 0.65);
  background: rgba(255,255,255,0.08);
  transform: translateY(-1px);
}

.full {
  grid-column: 1 / -1;
}

.card-checkbox {
  grid-column: span 1;
  min-height: 100%;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox input {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
  flex: 0 0 auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button.primary {
  color: #111;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 30px rgba(255,122,24,0.22);
}

button.secondary {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
}

button.secondary:hover {
  border-color: rgba(73, 198, 229, 0.42);
  background: rgba(255,255,255,0.08);
}

button.danger {
  color: #ffb4b4;
}

button.wide {
  width: 100%;
}

.feedback {
  min-height: 24px;
  margin: 0;
}

.feedback.error {
  color: #ffb4b4;
}

.feedback.success {
  color: #9ef0c7;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  font-weight: 700;
  color: var(--text);
}

.status-chip.recording,
.status-chip.stopping,
.status-chip.merging {
  color: #91f3bf;
  border-color: rgba(57, 217, 138, 0.28);
  background: rgba(57, 217, 138, 0.12);
}

.status-chip.error {
  color: #ffb6b6;
  border-color: rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.12);
}

.status-chip.disabled,
.status-chip.idle {
  color: #c8d5e5;
  border-color: rgba(73, 198, 229, 0.24);
  background: rgba(73, 198, 229, 0.1);
}

.apply-list {
  display: grid;
  gap: 12px;
}

.apply-list article {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  display: grid;
  gap: 6px;
}

.apply-list span {
  color: var(--muted);
  line-height: 1.6;
}

.info-panel {
  min-height: 100%;
}

.accent-panel {
  background: linear-gradient(180deg, rgba(10, 22, 37, 0.92), rgba(16, 26, 42, 0.92));
}

.dark-panel {
  background: linear-gradient(180deg, rgba(9, 15, 25, 0.96), rgba(7, 12, 20, 0.96));
}

.note-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.note-list li {
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  line-height: 1.65;
  color: #d6e0eb;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  padding: 20px 22px;
  border-radius: 24px;
  background: rgba(255,255,255,0.04);
}

.stat-card span {
  display: block;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 16px 0 10px;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  line-height: 1.25;
}

.stat-card.emphasis {
  background: linear-gradient(135deg, rgba(255,122,24,0.16), rgba(73,198,229,0.11));
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

.summary-grid div {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.summary-grid dt {
  margin-bottom: 8px;
  color: var(--muted);
}

.summary-grid dd {
  margin: 0;
  line-height: 1.65;
  word-break: break-word;
}

.event-list {
  display: grid;
  gap: 12px;
}

.event {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
}

.event-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.event-head span,
.event p {
  color: var(--muted);
}

.event p {
  margin: 0;
  line-height: 1.6;
}

.table-panel {
  padding: 10px;
}

.table-wrap {
  overflow: auto;
  border-radius: 22px;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
 td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}

th {
  font-size: 0.84rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr {
  background: rgba(255,255,255,0.02);
}

tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.035);
}

.path,
.empty-cell {
  word-break: break-all;
}

.table-status {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: #d9e4ef;
}

.table-status.completed {
  color: #9ef0c7;
  border-color: rgba(57, 217, 138, 0.28);
}

.table-status.failed,
.table-status.error {
  color: #ffb4b4;
  border-color: rgba(255, 107, 107, 0.28);
}

@media (max-width: 1180px) {
  .content-grid.two-columns,
  .login-panel,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-side,
  .actions-right {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .content-shell {
    padding: 22px;
  }

  .page-topbar,
  .hero-card {
    flex-direction: column;
  }

  .topbar-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .login-shell,
  .content-shell,
  .sidebar {
    padding: 18px;
  }

  .hero-card,
  .panel,
  .login-card {
    border-radius: 24px;
    padding: 20px;
  }

  .grid-form,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }

  .site-bg {
    inset: 10px;
    border-radius: 22px;
  }
}

@media (max-width: 820px) {
  .table-panel {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody,
  tbody tr,
  tbody td {
    display: block;
    width: 100%;
  }

  tbody tr {
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(12, 22, 37, 0.92), rgba(8, 15, 26, 0.9));
    box-shadow: var(--shadow);
  }

  tbody tr:nth-child(even) {
    background: linear-gradient(180deg, rgba(12, 22, 37, 0.92), rgba(8, 15, 26, 0.9));
  }

  tbody td {
    padding: 0;
    border-bottom: 0;
  }

  tbody td + td {
    margin-top: 12px;
  }

  tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .empty-cell {
    padding: 20px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(12, 22, 37, 0.92), rgba(8, 15, 26, 0.9));
    box-shadow: var(--shadow);
  }

  .empty-cell::before {
    display: none;
  }
}
