:root {
  --page-bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --panel-border: #e5e7eb;
  --muted: #667085;
  --subtle: #98a2b3;
  --text: #101828;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --success-soft: #ecfdf3;
  --warning-soft: #fffaeb;
  --danger-soft: #fef3f2;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.boot-error {
  margin: 16px;
  padding: 12px 14px;
  border: 1px solid #fda29b;
  border-radius: 8px;
  background: var(--danger-soft);
  color: #b42318;
  line-height: 1.6;
}

.full-button,
.full-width {
  width: 100%;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(5, 150, 105, 0.08), transparent 36%),
    var(--page-bg);
}

.login-shell {
  width: min(980px, 100%);
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 420px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-visual {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: 44px;
  background:
    linear-gradient(160deg, rgba(16, 24, 40, 0.92), rgba(31, 41, 55, 0.82)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0, rgba(255, 255, 255, 0.08) 1px, transparent 1px, transparent 56px);
  color: #ffffff;
}

.product-mark,
.brand-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.login-visual h1 {
  margin: 0;
  font-size: 52px;
  line-height: 1;
  letter-spacing: 0;
}

.login-visual p {
  max-width: 480px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 17px;
  line-height: 1.8;
}

.login-metrics {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.login-metrics div {
  min-width: 136px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.login-metrics strong,
.login-metrics span {
  display: block;
}

.login-metrics span {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

.login-card {
  display: grid;
  align-content: center;
  border: 0;
  border-radius: 0;
  padding: 34px;
}

.login-title {
  margin-bottom: 28px;
}

.login-title span,
.header-copy span,
.table-subtitle,
.persona-card-head span,
.stat-card span {
  color: var(--muted);
}

.login-title h2 {
  margin: 6px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.layout {
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--panel-border);
}

.brand {
  height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid var(--panel-border);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 19px;
}

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

.side-menu {
  border-right: 0;
  padding: 12px;
}

.side-menu .el-menu-item {
  height: 44px;
  margin-bottom: 6px;
  border-radius: 8px;
}

.side-menu .el-menu-item.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.menu-dot {
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.42;
}

.page-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
}

.header-copy span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 3px 0 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.header-actions,
.card-header,
.detail-toolbar,
.tag-list,
.persona-actions,
.persona-card-head,
.section-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions,
.card-header,
.persona-card-head,
.section-strip {
  justify-content: space-between;
}

.page-main {
  padding: 24px;
}

.module-page,
.detail-page {
  max-width: 1280px;
  margin: 0 auto;
}

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

.stat-card,
.section-strip,
.panel-card,
.persona-card {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface);
}

.stat-card {
  padding: 18px;
}

.stat-card span,
.stat-card strong {
  display: block;
}

.stat-card strong {
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.panel-card {
  overflow: hidden;
}

.panel-card.el-card,
.persona-card.el-card {
  --el-card-border-radius: 8px;
  border-color: var(--panel-border);
}

.card-header > div {
  display: grid;
  gap: 5px;
}

.clean-table {
  --el-table-border-color: var(--panel-border);
}

.clean-table .el-table__header th {
  background: var(--surface-soft);
  color: #475467;
  font-weight: 600;
}

.clean-table .el-table__row {
  height: 68px;
}

.table-link {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.table-link:hover {
  color: var(--primary);
}

.table-subtitle {
  margin-top: 6px;
  font-size: 13px;
}

.section-strip {
  min-height: 76px;
  margin-bottom: 18px;
  padding: 18px 20px;
}

.section-strip strong {
  margin-right: 8px;
  font-size: 28px;
}

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

.persona-card {
  min-height: 236px;
}

.persona-card .el-card__body {
  display: flex;
  min-height: 236px;
  flex-direction: column;
}

.persona-card-head strong,
.persona-card-head span {
  display: block;
}

.persona-card-head strong {
  font-size: 18px;
}

.persona-card-head span {
  margin-top: 6px;
  font-size: 13px;
}

.persona-card p {
  flex: 1;
  margin: 18px 0;
  color: #475467;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

.persona-actions {
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
}

.detail-toolbar {
  margin-bottom: 16px;
}

.detail-hero {
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface);
}

.detail-hero h2 {
  margin: 12px 0 6px;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: 0;
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
}

.article-card,
.meta-card,
.steps-card {
  margin-bottom: 18px;
}

.article-content h1 {
  margin: 0 0 18px;
  font-size: 29px;
  line-height: 1.35;
  letter-spacing: 0;
}

.cover-text {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: var(--primary-soft);
  display: grid;
  gap: 7px;
}

.cover-text span,
.article-section h2 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cover-text strong {
  font-size: 18px;
  line-height: 1.5;
}

.article-section {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--panel-border);
}

.article-section h2 {
  margin: 0 0 10px;
}

.article-section p {
  margin: 0 0 12px;
  color: #344054;
  line-height: 1.9;
  white-space: pre-wrap;
}

.article-section.pinned {
  padding: 16px 18px;
  border: 1px solid #a7f3d0;
  background: var(--success-soft);
  border-radius: 8px;
}

.tag-list {
  flex-wrap: wrap;
}

.notice {
  padding: 16px 18px;
  border-radius: 8px;
  background: var(--warning-soft);
  border: 1px solid #fedf89;
}

.notice h3,
.notice h2 {
  margin-top: 0;
}

.notice ul {
  margin: 0;
  padding-left: 18px;
  color: #7a4b00;
  line-height: 1.8;
}

.notice.danger {
  background: var(--danger-soft);
  border-color: #fda29b;
}

.notice.danger pre,
.raw-input,
.step-output {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

.raw-input {
  max-height: 62vh;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--panel-border);
}

.steps-card .el-card__body {
  padding: 0 18px 18px;
}

.step-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-title span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.step-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.step-meta p {
  margin: 6px 0 0;
}

.step-output {
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #344054;
  font-size: 13px;
}

.clean-dialog {
  border-radius: 10px;
}

.clean-dialog .el-dialog__header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--panel-border);
}

.clean-dialog .el-dialog__footer {
  border-top: 1px solid var(--panel-border);
}

.persona-dialog textarea {
  line-height: 1.7;
}

.el-button {
  border-radius: 7px;
}

.el-input__wrapper,
.el-textarea__inner,
.el-select__wrapper {
  border-radius: 7px;
}

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

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

  .layout {
    display: block;
  }

  .sidebar {
    width: 100% !important;
    border-right: 0;
    border-bottom: 1px solid var(--panel-border);
  }

  .brand {
    height: 66px;
  }

  .side-menu {
    display: flex;
    padding-top: 0;
  }

  .side-menu .el-menu-item {
    flex: 1;
    margin-bottom: 0;
  }

  .page-header {
    height: auto;
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .page-main {
    padding: 16px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .stats-grid,
  .persona-grid {
    grid-template-columns: 1fr;
  }

  .article-content h1,
  .detail-hero h2 {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .login-page {
    padding: 16px;
  }

  .login-visual {
    padding: 28px;
  }

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

  .login-metrics {
    flex-direction: column;
  }

  .login-card {
    padding: 24px;
  }

  .section-strip,
  .card-header,
  .persona-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .card-header .el-button,
  .section-strip .el-button,
  .persona-actions .el-button {
    width: 100%;
  }

  .detail-hero {
    padding: 18px;
  }
}
