:root {
  color-scheme: light;
  --bg: #eef4f2;
  --surface: #ffffff;
  --surface-soft: #edf5f2;
  --text: #18201f;
  --muted: #66706d;
  --line: #d8e3df;
  --primary: #0f766e;
  --primary-dark: #0a5852;
  --accent: #d97706;
  --danger: #b42318;
  --warning: #a16207;
  --success: #137333;
  --shadow: 0 18px 45px rgba(24, 32, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, rgba(15, 118, 110, 0.14), transparent 28%),
    radial-gradient(circle at 92% 4%, rgba(217, 119, 6, 0.13), transparent 26%),
    var(--bg);
}

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

.site-header,
.site-footer,
.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
}

.brand,
.nav,
.hero-actions,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
}

.nav {
  gap: 12px;
}

.nav a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.nav a[aria-current="page"],
.nav a:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 22px;
}

.page-shell {
  padding: 24px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 28px;
  align-items: stretch;
  min-height: 460px;
}

.hero-copy,
.hero-visual,
.hero-panel,
.auth-card,
.content-panel,
.stats-grid article,
.panel-link,
.feature-grid article,
.sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 72px);
}

.hero-visual {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  background: url('../hero-bg.png') center / cover no-repeat;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 32, 31, 0.08), rgba(24, 32, 31, 0.62));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.hero-copy p:not(.eyebrow),
.section-title p,
.auth-card p,
.content-panel p,
.feature-grid p {
  color: var(--muted);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
  cursor: pointer;
}

.button:hover {
  background: var(--primary-dark);
}

.button-small {
  min-height: 38px;
}

.button-ghost {
  color: var(--text);
  background: var(--surface-soft);
}

.button-ghost:hover {
  background: #e5dccd;
}

.hero-panel {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 28px;
  background: rgba(27, 36, 33, 0.84);
  color: #fff;
  backdrop-filter: blur(8px);
}

.hero-panel div {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.hero-panel span,
.stats-grid span,
.panel-link span,
.user-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.hero-panel span {
  color: rgba(255, 255, 255, 0.68);
}

.hero-panel strong,
.stats-grid strong,
.panel-link strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
}

.feature-grid,
.stats-grid,
.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.feature-grid article,
.stats-grid article,
.panel-link,
.content-panel {
  padding: 22px;
}

.auth-card {
  width: min(480px, 100%);
  margin: 36px auto;
  padding: 28px;
}

.auth-card-wide {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.05fr);
  gap: 0;
  width: min(900px, 100%);
  padding: 0;
  overflow: hidden;
}

.auth-intro {
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 38px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(11, 75, 69, 0.18), rgba(11, 75, 69, 0.86)),
    url('../hero-bg.png') center / cover no-repeat;
}

.auth-intro .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.auth-intro h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.12;
}

.auth-intro p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
}

.auth-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.auth-points span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.86rem;
  font-weight: 800;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 48px);
  background: rgba(255, 255, 255, 0.96);
}

.auth-heading {
  margin-bottom: 22px;
}

.auth-heading h2 {
  margin-bottom: 6px;
  font-size: 1.8rem;
  line-height: 1.2;
}

.auth-card.compact {
  text-align: center;
}

.install-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

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

.form label {
  display: grid;
  gap: 6px;
  color: #2b3533;
  font-size: 0.94rem;
  font-weight: 800;
}

.form input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #f9fbfa;
}

.form input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

.login-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 6px;
  border-radius: 8px;
  background: #edf5f2;
}

.login-switch button {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: 160ms ease;
}

.login-switch button.is-active {
  color: var(--text);
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.14);
}

.login-switch button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
}

.button-full {
  width: 100%;
}

.muted {
  margin: 16px 0 0;
  color: var(--muted);
}

.muted a {
  color: var(--primary);
  font-weight: 800;
}

.flash {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.flash-success {
  color: var(--success);
  background: #e9f6ed;
}

.flash-danger {
  color: var(--danger);
  background: #fff0ee;
}

.flash-warning {
  color: var(--warning);
  background: #fff7db;
}

.admin-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar {
  display: grid;
  gap: 8px;
  padding: 16px;
  position: sticky;
  top: 16px;
}

.sidebar a {
  padding: 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.sidebar a:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.user-card {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-content {
  min-width: 0;
}

.section-title {
  padding: 6px 0 10px;
}

.stats-grid article {
  min-width: 0;
}

.stats-grid strong {
  overflow-wrap: anywhere;
}

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

.panel-link:hover {
  transform: translateY(-2px);
}

.content-panel {
  margin-top: 20px;
}

.site-footer {
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 760px) {
  .site-header {
    position: relative;
  }

  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 72px;
    right: 0;
    left: 0;
    z-index: 10;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .nav.is-open {
    display: flex;
  }

  .hero,
  .admin-layout,
  .feature-grid,
  .stats-grid,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

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

  .hero-panel {
    right: 14px;
    bottom: 14px;
    left: 14px;
    padding: 18px;
  }

  .auth-card {
    margin-top: 12px;
    padding: 22px;
  }

  .auth-card-wide {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .auth-intro {
    min-height: 260px;
    padding: 26px;
  }

  .auth-panel {
    padding: 24px;
  }

  .sidebar {
    position: static;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
