:root {
  --surface: rgba(255, 255, 255, 0.92);
  --ink: #172033;
  --muted: #667085;
  --line: rgba(23, 32, 51, 0.12);
  --accent: #12b8a6;
  --accent-dark: #0b3a75;
  --accent-soft: rgba(18, 184, 166, 0.14);
  --danger-soft: rgba(180, 71, 45, 0.12);
  --warning-soft: rgba(185, 135, 40, 0.12);
  --shadow: 0 18px 60px rgba(23, 28, 26, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-sans: "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --font-mono: "Cascadia Code", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(18, 184, 166, 0.16), transparent 30%),
    radial-gradient(circle at right 20%, rgba(37, 99, 235, 0.13), transparent 26%),
    linear-gradient(180deg, #f7fbff 0%, #eef7f5 100%);
  font-family: var(--font-sans);
}

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

.shell {
  position: relative;
  overflow-x: hidden;
}

.mesh {
  position: fixed;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.6;
  pointer-events: none;
}

.mesh-a {
  top: -8rem;
  right: -6rem;
  width: 20rem;
  height: 20rem;
  background: rgba(13, 138, 106, 0.16);
}

.mesh-b {
  bottom: -10rem;
  left: -8rem;
  width: 24rem;
  height: 24rem;
  background: rgba(185, 135, 40, 0.15);
}

.topbar,
.page-shell,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem);
}

.brand-title {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-logo {
  width: 10.5rem;
  max-width: 42vw;
  height: auto;
  display: block;
}

.brand-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topnav a,
.ghost-button,
.secondary-button,
.primary-button,
.danger-button {
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  font: inherit;
  cursor: pointer;
}

.topnav a,
.ghost-button,
.secondary-button {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 10px 25px rgba(13, 138, 106, 0.25);
}

.danger-button {
  color: white;
  background: linear-gradient(135deg, #ca5c41 0%, #8f2f1c 100%);
}

.secondary-button:hover,
.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.topnav a:hover {
  transform: translateY(-1px);
}

.page-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 3rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 2rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.flash-banner,
.panel-card,
.hero-panel,
.stat-card,
.activity-card {
  backdrop-filter: blur(16px);
}

.flash-banner {
  margin-bottom: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(244, 255, 251, 0.92);
  border: 1px solid rgba(13, 138, 106, 0.18);
  box-shadow: var(--shadow);
}

.hero-panel,
.panel-card,
.stat-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
}

.hero-panel h1,
.panel-card h1,
.panel-card h2 {
  margin: 0;
  line-height: 1.1;
}

.hero-panel h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.hero-text {
  margin: 0.85rem 0 0;
  max-width: 48rem;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

.action-row {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

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

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 0.55rem 0 0.35rem;
  font-size: clamp(1.7rem, 2vw, 2.5rem);
}

.tone-blue { background: linear-gradient(180deg, rgba(233, 246, 255, 0.95), rgba(255, 252, 247, 0.92)); }
.tone-green { background: linear-gradient(180deg, rgba(228, 249, 241, 0.95), rgba(255, 252, 247, 0.92)); }
.tone-amber { background: linear-gradient(180deg, rgba(255, 244, 217, 0.95), rgba(255, 252, 247, 0.92)); }
.tone-red { background: linear-gradient(180deg, rgba(255, 233, 225, 0.95), rgba(255, 252, 247, 0.92)); }
.tone-slate { background: linear-gradient(180deg, rgba(238, 243, 241, 0.95), rgba(255, 252, 247, 0.92)); }
.tone-ink { background: linear-gradient(180deg, rgba(231, 236, 234, 0.95), rgba(255, 252, 247, 0.92)); }

.content-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

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

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

.panel-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
}

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

.toolbar {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.toolbar-search {
  min-width: min(25rem, 100%);
}

.toolbar-select {
  width: 11rem;
}

.table-wrap {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 0.95rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.data-table tbody tr:hover {
  background: rgba(13, 138, 106, 0.04);
}

.mono,
code,
.inline-code-block {
  font-family: var(--font-mono);
}

.subtle-text {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
}

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

.badge-warning {
  color: #8c6400;
  background: var(--warning-soft);
}

.badge-danger {
  color: #7a2715;
  background: var(--danger-soft);
}

.activity-list {
  display: grid;
  gap: 0.85rem;
}

.activity-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.activity-meta {
  display: grid;
  gap: 0.2rem;
  justify-items: end;
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-state,
.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
}

.inline-form {
  margin: 0;
}

.stack-form {
  display: grid;
  gap: 1rem;
}

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

.field {
  display: grid;
  gap: 0.45rem;
}

.field span:first-child {
  font-size: 0.93rem;
  font-weight: 600;
}

.field-hint {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.text-input,
.text-area,
select.text-input {
  width: 100%;
  border: 1px solid rgba(29, 43, 38, 0.16);
  border-radius: var(--radius-sm);
  padding: 0.88rem 0.95rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font: inherit;
}

.text-input:focus,
.text-area:focus {
  outline: none;
  border-color: rgba(13, 138, 106, 0.42);
  box-shadow: 0 0 0 4px rgba(13, 138, 106, 0.09);
}

.text-area {
  resize: vertical;
}

.checkbox-field {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.validation-summary,
.field-error {
  color: #9c3320;
  font-size: 0.92rem;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.detail-list div {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.detail-list dd {
  margin: 0;
  line-height: 1.65;
}

.detail-list .full-row {
  grid-column: 1 / -1;
}

.action-grid {
  display: grid;
  gap: 0.8rem;
}

.full-width {
  width: 100%;
  justify-content: center;
}

.code-block {
  margin: 0 0 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: #1f2826;
  color: #f4f4ee;
  overflow-x: auto;
  line-height: 1.6;
}

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

.login-shell {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
  align-items: center;
  min-height: calc(100vh - 14rem);
}

.login-copy {
  padding: 1.5rem;
}

.feature-list {
  margin: 1.1rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.85;
}

.login-card {
  max-width: 32rem;
  justify-self: end;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.narrow-panel {
  max-width: 42rem;
  margin: 4rem auto;
}

.inline-code-block {
  display: inline-flex;
  padding: 0.65rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .detail-grid,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-card {
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .topbar,
  .page-shell,
  .footer {
    width: min(100% - 1rem, 100%);
  }

  .topbar,
  .hero-panel,
  .panel-header,
  .hero-actions,
  .toolbar,
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid,
  .form-grid,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .detail-list .full-row {
    grid-column: auto;
  }

  .activity-card {
    flex-direction: column;
  }

  .activity-meta {
    justify-items: start;
  }
}
