:root {
  --ink: #191615;
  --muted: #6d6864;
  --line: #e6e0dc;
  --paper: #fffdfb;
  --surface: #ffffff;
  --rose: #b9545d;
  --rose-dark: #88353e;
  --sage: #6e8376;
  --blue: #506f8e;
  --gold: #b2894c;
  --black: #111111;
  --soft-rose: #f7e8e9;
  --soft-sage: #eaf0ec;
  --soft-blue: #e9f0f6;
  --soft-gold: #f6efe3;
  --shadow: 0 18px 46px rgba(29, 24, 20, 0.08);
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: #fffaf8;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 6px 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--black);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
}

.brand-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.nav-group {
  margin: 6px 0 8px;
  padding: 4px;
  border-radius: 8px;
  background: transparent;
}

.nav-group:not(.collapsed) {
  background: rgba(255, 255, 255, 0.68);
}

.nav-group.active-group {
  background: #f7e8e9;
}

.nav-toggle {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.nav-toggle:hover {
  background: #fff;
  color: var(--ink);
}

.nav-group:not(.collapsed) .nav-toggle,
.nav-group.active-group .nav-toggle {
  color: var(--rose-dark);
}

.nav-group.collapsed .nav-toggle {
  color: #7b746f;
}

.toc {
  display: grid;
  gap: 5px;
}

.toc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
}

.toc a:hover,
.toc a.active {
  background: var(--soft-rose);
  color: var(--rose-dark);
}

.nav-pill {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.main {
  padding: 18px 24px 42px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rose-dark);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.2;
}

h2 {
  margin: 0;
  font-size: 22px;
}

h3 {
  margin: 0;
  font-size: 16px;
}

.page-intro {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--sage);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--black);
  border-radius: 6px;
  background: var(--black);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.button.rose {
  background: var(--rose-dark);
  border-color: var(--rose-dark);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.content {
  display: grid;
  gap: 14px;
  padding-top: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.module-card,
.status-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 98px;
  padding: 14px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  margin-top: 12px;
  font-size: 26px;
  font-weight: 800;
}

.metric-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.panel {
  padding: 14px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.panel-title {
  display: grid;
  gap: 5px;
}

.panel-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.input,
.select {
  height: 40px;
  min-width: 180px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

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

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

.module-card {
  min-height: 112px;
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.module-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft-sage);
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.rose {
  background: var(--soft-rose);
  color: var(--rose-dark);
}

.badge.blue {
  background: var(--soft-blue);
  color: var(--blue);
}

.badge.gold {
  background: var(--soft-gold);
  color: var(--gold);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 10px;
}

.pipeline-step {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbf8f6;
  border-radius: 8px;
}

.pipeline-step strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.pipeline-step span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  word-break: break-word;
}

.data-table th {
  color: var(--muted);
  background: #fbf8f6;
  font-weight: 800;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.empty-state {
  min-height: 128px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
}

.empty-state p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.chart-shell {
  height: 220px;
  display: grid;
  grid-template-columns: 52px repeat(6, 1fr);
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.axis-labels {
  display: grid;
  gap: 24px;
  align-self: stretch;
  color: var(--muted);
  font-size: 12px;
}

.bar {
  min-height: 32px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--rose), var(--blue));
}

.bar:nth-child(3n) {
  background: linear-gradient(180deg, var(--sage), var(--gold));
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  background: var(--paper);
}

.login-visual {
  padding: 42px;
  display: grid;
  align-content: space-between;
  background: #111;
  color: #fff;
}

.login-visual h1 {
  max-width: 560px;
  font-size: 52px;
  line-height: 1.08;
}

.login-visual p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.8;
}

.login-card {
  width: min(520px, calc(100% - 48px));
  justify-self: center;
  align-self: center;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}


.auth-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-heading h2 {
  font-size: 26px;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-switch {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-switch a {
  color: var(--rose-dark);
  font-weight: 800;
  text-decoration: none;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.tab {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--black);
  border-color: var(--black);
  color: #fff;
}

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

.form .input {
  width: 100%;
}

.notice {
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 13px;
  line-height: 1.6;
}

.notice.error {
  background: var(--soft-rose);
  color: var(--rose-dark);
}

.permission-grid {
  overflow-x: auto;
}

.matrix-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--rose-dark);
}

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

.status-card {
  min-height: 88px;
  padding: 16px;
}

.status-card strong {
  display: block;
  margin-bottom: 10px;
}

.status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.locked {
  opacity: 0.52;
}

.footer-note {
  padding-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1120px) {
  .metric-grid,
  .module-grid,
  .grid-3,
  .status-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .pipeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .main {
    padding: 22px 18px 48px;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .metric-grid,
  .module-grid,
  .grid-3,
  .status-row,
  .pipeline,
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 360px;
  }
}

