:root {
  --bg: #eef3f6;
  --bg-warm: #f4f0e7;
  --panel: #ffffff;
  --panel-soft: #f7faf9;
  --ink: #14212b;
  --muted: #64748b;
  --line: #d7e0e8;
  --line-strong: #b7c4d0;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #e5f4f1;
  --success: #147d4d;
  --success-soft: #e8f7ee;
  --warning: #a15c07;
  --warning-soft: #fff4d8;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --nav: #0d1b2a;
  --nav-muted: #a9b7c8;
  --shadow: 0 18px 38px rgba(20, 33, 43, .08);
  --radius: 8px;
  --radius-sm: 6px;
  --focus: 0 0 0 3px rgba(15, 118, 110, .22);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(238, 243, 246, .96), rgba(250, 252, 249, .95) 48%, rgba(244, 240, 231, .82)),
    var(--bg);
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 33, 43, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 33, 43, .035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .62), transparent 78%);
}

.app-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-content: start;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.button,
.link-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

button,
.button {
  background: #16313a;
  color: #fff;
}

button:hover:not(:disabled),
.button:hover:not(:disabled) {
  background: #0f252d;
  transform: translateY(-1px);
}

button:focus-visible,
.button:focus-visible,
.link-button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button:disabled,
.button:disabled {
  cursor: progress;
  opacity: .72;
  transform: none;
}

.button--secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
}

.button--secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.button--danger {
  background: var(--danger);
  color: #fff;
}

.button--danger:hover:not(:disabled) {
  background: #8f1d14;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(20, 47, 60, .94), rgba(13, 27, 42, .98)),
    var(--nav);
  border-right: 1px solid rgba(255, 255, 255, .08);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 20px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #14b8a6, #f59e0b);
  color: #07111d;
  font-weight: 900;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius);
  color: var(--nav-muted);
  font-weight: 700;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: #fbbf24;
}

.main {
  min-width: 0;
  padding: 28px 32px 42px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -8px 0 22px;
  padding: 12px 0;
  background: linear-gradient(180deg, rgba(238, 243, 246, .94), rgba(238, 243, 246, .72));
  backdrop-filter: blur(14px);
}

.page-title h1,
.login-panel h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

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

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.content-stack > * + * {
  margin-top: 18px;
}

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

.metric-card,
.panel {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(215, 224, 232, .92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.1;
}

.metric-card strong .status-badge {
  font-size: 12px;
  vertical-align: middle;
}

.panel {
  padding: 20px;
}

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

.panel-heading--stacked {
  align-items: flex-start;
}

.panel-heading h2,
.panel h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.panel-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

input:hover {
  border-color: #98a8b8;
}

input::placeholder {
  color: #94a3b8;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.inline-release {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, .9fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 510px;
}

.inline-release input,
.inline-release button {
  height: 40px;
}

.inline-release button {
  padding-inline: 18px;
}

.inline-release--project {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  min-width: 560px;
}

.inline-release--artifact {
  grid-template-columns: minmax(170px, 1.1fr) minmax(150px, .9fr) auto;
  min-width: 520px;
}

.inline-action {
  margin-top: 16px;
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.projects-table {
  min-width: 1180px;
}

.artifacts-table {
  min-width: 1260px;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child > th,
tr:last-child > td {
  border-bottom: 0;
}

thead th {
  color: var(--muted);
  font-weight: 800;
  background: #f7fafc;
  white-space: nowrap;
}

tbody th {
  width: 150px;
  color: var(--muted);
  font-weight: 800;
  background: #f8fafc;
}

tbody tr:hover td {
  background: #f8fcfb;
}

.path-cell {
  max-width: 380px;
  overflow-wrap: anywhere;
}

.action-cell {
  min-width: 540px;
}

.project-action-cell {
  min-width: 580px;
}

.artifact-action-cell {
  min-width: 540px;
}

.code-cell,
.time-cell {
  font-family: "Cascadia Mono", "Consolas", "Microsoft YaHei", monospace;
  font-size: 13px;
}

.code-cell {
  color: #213547;
}

.time-cell {
  color: #475569;
  white-space: nowrap;
}

.table-link,
.link-button {
  color: var(--accent);
  font-weight: 800;
}

.table-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--line-strong);
  background: #fff;
}

.link-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.muted {
  color: var(--muted);
}

.empty-state {
  padding: 28px 14px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.status-badge--active,
.status-badge--ready,
.status-badge--success,
.status-badge--rollback-success {
  color: var(--success);
  background: var(--success-soft);
}

.status-badge--pending,
.status-badge--running {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-badge--failed,
.status-badge--rollback-failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-badge--muted,
.status-badge--unknown {
  color: var(--muted);
  background: #f1f5f9;
}

.error {
  color: var(--danger);
  margin: 14px 0 0;
  font-weight: 700;
}

.logs {
  margin: 0;
  min-height: 180px;
  max-height: 520px;
  overflow: auto;
  background: #07111d;
  color: #d8ffe9;
  border: 1px solid #153b37;
  border-radius: var(--radius);
  padding: 16px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Cascadia Mono", "Consolas", "Microsoft YaHei", monospace;
  font-size: 13px;
}

.onboarding-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background:
    radial-gradient(circle at right top, rgba(245, 158, 11, .12), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(229, 244, 241, .88));
}

.onboarding-hero h2 {
  max-width: 760px;
  font-size: clamp(22px, 3vw, 30px);
}

.guide-steps,
.guide-checklist {
  margin: 0;
  padding-left: 22px;
}

.guide-steps li,
.guide-checklist li {
  margin: 9px 0;
}

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

.guide-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel-soft);
}

.guide-card h3,
.guide-faq h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.guide-card ul,
.guide-card p,
.guide-faq p {
  margin: 0;
}

.guide-card li + li {
  margin-top: 8px;
}

.guide-code {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid #153b37;
  border-radius: var(--radius);
  background: #07111d;
  color: #d8ffe9;
  font-family: "Cascadia Mono", "Consolas", "Microsoft YaHei", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.guide-code + .guide-code {
  margin-top: 12px;
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef6f4;
  color: #0b5f59;
  font-family: "Cascadia Mono", "Consolas", "Microsoft YaHei", monospace;
  font-size: .92em;
}

.guide-code code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.guide-faq {
  display: grid;
  gap: 12px;
}

.guide-faq article {
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.login-page {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(7, 17, 29, .98), rgba(20, 47, 60, .96) 56%, rgba(43, 32, 18, .94)),
    #07111d;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-panel {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .32);
}

.login-panel form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

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

  .sidebar {
    position: relative;
    height: auto;
    padding: 16px 18px;
  }

  .brand {
    margin-bottom: 14px;
  }

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

  .nav-link {
    justify-content: center;
    padding: 10px 12px;
  }

  .nav-link.is-active::before {
    left: 12px;
  }

  .main {
    padding: 22px 22px 36px;
  }

  .topbar {
    margin-top: -6px;
  }

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

@media (max-width: 680px) {
  body::before {
    background-size: 24px 24px;
  }

  .sidebar {
    padding: 14px;
  }

  .brand {
    font-size: 18px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-link {
    flex: 0 0 auto;
    min-height: 38px;
  }

  .main {
    padding: 18px 14px 28px;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 18px;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .panel {
    padding: 16px;
  }

  .onboarding-hero {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 720px;
  }

  .login-panel {
    padding: 26px;
  }
}

/* ============================================================
   Toast 通知系统
   ============================================================ */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  position: relative;
  min-width: 280px;
  max-width: 400px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  box-shadow: 0 8px 24px rgba(20, 33, 43, .14);
  font-size: 14px;
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in .25s ease both;
  overflow: hidden;
}

.toast.toast--success { border-left-color: var(--success); }
.toast.toast--error  { border-left-color: var(--danger); }
.toast.toast--info   { border-left-color: var(--accent); }

.toast.toast-out {
  animation: toast-out .2s ease both;
}

.toast::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: currentColor;
  opacity: .18;
  animation: toast-progress 3s linear both;
  transform-origin: left;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ============================================================
   可点击表格行
   ============================================================ */
tr[data-href] {
  cursor: pointer;
}

tr[data-href]:hover td {
  background: var(--accent-soft) !important;
  transition: background-color .12s ease;
}

tr[data-href]:active td {
  background: #dceeed !important;
}

/* ============================================================
   面包屑导航
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--accent);
  transition: color .16s ease;
}

.breadcrumb a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb-sep {
  color: var(--line-strong);
  user-select: none;
}

/* ============================================================
   侧边栏导航图标
   ============================================================ */
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .65;
  transition: opacity .16s ease;
}

.nav-link:hover .nav-icon,
.nav-link.is-active .nav-icon {
  opacity: 1;
}

.nav-link {
  gap: 10px;
}

/* ============================================================
   侧边栏折叠
   ============================================================ */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  margin-top: auto;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .08);
  color: var(--nav-muted);
  border: none;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.sidebar-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform .2s ease;
}

.sidebar {
  display: flex;
  flex-direction: column;
  transition: width .2s ease, padding .2s ease;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
}

.app-page {
  transition: grid-template-columns .2s ease;
}

body.sidebar-collapsed .app-page {
  grid-template-columns: 60px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: 60px;
  padding: 24px 8px;
}

body.sidebar-collapsed .brand span:not(.brand-mark) {
  display: none;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px;
}

body.sidebar-collapsed .nav-link .nav-label {
  display: none;
}

body.sidebar-collapsed .nav-link.is-active::before {
  left: 3px;
}

body.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* ============================================================
   日志工具栏
   ============================================================ */
.logs-wrapper {
  display: flex;
  flex-direction: column;
}

.logs-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 10px;
  background: #0a1929;
  border: 1px solid #153b37;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

.logs-toolbar button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, .08);
  color: #8899aa;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 4px;
}

.logs-toolbar button:hover:not(:disabled) {
  background: rgba(255, 255, 255, .16);
  color: #c0d0e0;
}

.logs-toolbar button.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.logs-wrapper .logs {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin: 0;
}

/* ============================================================
   表格斑马纹 + 空状态增强
   ============================================================ */
tbody tr:nth-child(even) td {
  background: rgba(247, 250, 252, .5);
}

tbody tr:nth-child(even):hover td {
  background: #f8fcfb;
}

tbody tr:nth-child(even)[data-href]:hover td {
  background: var(--accent-soft) !important;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.empty-state {
  padding: 42px 14px;
  font-size: 14px;
}

.empty-state::before {
  content: "\2205";
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
  opacity: .35;
}

/* ============================================================
   指标卡片增强
   ============================================================ */
.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  top: -18px;
  right: -18px;
  opacity: .07;
  pointer-events: none;
}

.metric-card--projects::before { background: var(--accent); }
.metric-card--artifacts::before { background: #3b82f6; }
.metric-card--releases::before  { background: var(--success); }
.metric-card--status::before    { background: #f59e0b; }

.metric-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 4px;
}

.metric-card--projects .metric-icon { color: var(--accent); }
.metric-card--artifacts .metric-icon { color: #3b82f6; }
.metric-card--releases .metric-icon  { color: var(--success); }
.metric-card--status .metric-icon    { color: #f59e0b; }

.metric-label {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   登录页品牌感增强
   ============================================================ */
.login-brand {
  text-align: center;
  margin-bottom: 20px;
}

.login-brand .brand-mark {
  display: inline-grid;
  width: 56px;
  height: 56px;
  font-size: 28px;
}

.login-brand-name {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  margin: 10px 0 0;
}

.login-brand-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  color: rgba(255, 255, 255, .35);
  font-size: 12px;
}

.login-page {
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(15, 118, 110, .12), transparent),
    linear-gradient(145deg, rgba(7, 17, 29, .98), rgba(20, 47, 60, .96) 56%, rgba(43, 32, 18, .94)),
    #07111d;
}

/* ============================================================
   表单验证
   ============================================================ */
input.is-invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
}

input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .18);
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

/* ============================================================
   页面过渡微动画
   ============================================================ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.content-stack {
  animation: fade-up .3s ease both;
}

.metric-card:nth-child(1) { animation: fade-up .3s ease both; animation-delay: 0ms; }
.metric-card:nth-child(2) { animation: fade-up .3s ease both; animation-delay: 60ms; }
.metric-card:nth-child(3) { animation: fade-up .3s ease both; animation-delay: 120ms; }
.metric-card:nth-child(4) { animation: fade-up .3s ease both; animation-delay: 180ms; }

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

/* ============================================================
   新增项目表单
   ============================================================ */
.project-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.project-form-grid label:nth-child(3) {
  grid-column: 1 / -1;
}

.project-form-action {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

@media (max-width: 680px) {
  .project-form-grid {
    grid-template-columns: 1fr;
  }

  .project-form-grid label:nth-child(3) {
    grid-column: auto;
  }
}
