:root {
  --bg: #071018;
  --panel: #0d1823;
  --panel-2: #111f2d;
  --line: rgba(130, 170, 190, 0.22);
  --text: #eef7fb;
  --muted: #90a4b4;
  --cyan: #38bdf8;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  display: grid;
  place-items: center;
  background: #071018;
}

.login-shell {
  width: min(1080px, calc(100vw - 32px));
  min-height: 620px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: center;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 18px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.18);
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 20px;
}

.login-brand h1 {
  margin: 0 0 8px;
  font-size: 54px;
  line-height: 1;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.login-card {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 24, 35, 0.88);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-card h2,
.panel-head h1,
.module-section h2 {
  margin: 0;
}

.login-card p,
.panel-head p {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07111b;
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 120px;
  padding-top: 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--cyan);
}

.primary-btn,
.ghost-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 18px;
  color: var(--text);
  background: var(--cyan);
  color: #041018;
  font-weight: 800;
}

.primary-btn {
  width: 100%;
  margin-top: 22px;
}

.primary-btn.compact {
  width: auto;
  margin-top: 0;
}

.ghost-btn {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}

.feedback {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--red);
  font-size: 13px;
}

.feedback[data-type="success"] {
  color: var(--green);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07111b;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.auth-tab.active {
  color: #041018;
  background: var(--green);
  font-weight: 800;
}

[hidden] {
  display: none !important;
}

.login-note {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

code {
  color: var(--cyan);
  word-break: break-all;
}

.workspace-page {
  background: #08111a;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 17, 26, 0.92);
}

.brand-inline,
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-inline span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  min-width: 78px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.status-pill[data-state="ok"] {
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.36);
}

.status-pill[data-state="warn"] {
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.36);
}

.workspace-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 68px);
}

.side-rail {
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #09131d;
}

.rail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.module-nav {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.module-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.module-tab.active {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.1);
}

.module-tab small {
  color: var(--green);
}

.route-note {
  margin-top: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.main-panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

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

.info-card,
.module-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.info-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
}

.info-card.wide {
  grid-column: span 1;
}

.info-card span,
.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.info-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.module-section {
  margin-top: 16px;
  padding: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.area-list,
.action-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.content-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(180px, 260px) 1fr auto;
  gap: 12px;
  align-items: end;
}

.content-form .field {
  margin-top: 0;
}

.wide-field {
  min-width: 0;
}

.area-item,
.action-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.action-item {
  display: grid;
  gap: 8px;
}

.action-item span {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 13px;
}

.result-box {
  min-height: 140px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #061019;
  color: #c9e6f2;
  overflow: auto;
}

@media (max-width: 860px) {
  .login-shell,
  .workspace-layout,
  .info-grid,
  .content-form {
    grid-template-columns: 1fr;
  }

  .login-shell {
    padding: 24px 0;
  }

  .login-brand h1 {
    font-size: 40px;
  }

  .side-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .panel-head {
    display: grid;
  }
}
