:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #637083;
  --line: #dbe2ea;
  --paper: #ffffff;
  --soft: #f4f7fa;
  --brand: #0f6b63;
  --brand-dark: #084d49;
  --accent: #c83f31;
  --gold: #b8862f;
  --blue: #2e6da4;
  --shadow: 0 18px 50px rgba(24, 35, 52, 0.12);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(20px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  font-weight: 800;
  background: var(--brand);
  border-radius: 8px;
}

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

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

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  padding: 9px 12px;
  color: #334155;
  border-radius: 6px;
  font-size: 14px;
}

.nav a:hover {
  color: var(--brand-dark);
  background: #e7f2f0;
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(48px, 7vw, 96px) clamp(20px, 5vw, 72px);
  background:
    linear-gradient(120deg, rgba(15, 107, 99, 0.9), rgba(18, 53, 69, 0.82)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
  color: #fff;
}

.hero-copy {
  max-width: 800px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffd27d;
}

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

h1 {
  margin-bottom: 22px;
  max-width: 900px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.3;
}

.hero-text {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.87);
  font-size: 19px;
  line-height: 1.8;
}

.hero-actions,
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 28px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

.primary-action {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(200, 63, 49, 0.24);
}

.secondary-action {
  color: var(--brand-dark);
  background: #fff;
  border-color: var(--line);
}

.compact {
  min-height: 38px;
  padding-inline: 14px;
  font-size: 14px;
}

.hero-panel {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.metric strong {
  font-size: 42px;
}

.metric span {
  color: rgba(255, 255, 255, 0.76);
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.workflow span {
  min-height: 64px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #0f332f;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.section {
  padding: clamp(56px, 8vw, 104px) clamp(20px, 5vw, 72px);
}

.muted {
  background: var(--soft);
}

.section-heading {
  max-width: 840px;
  margin-bottom: 28px;
}

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

.split {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.entry-grid,
.content-grid,
.scenario-grid,
.market-grid,
.dashboard-grid,
.stat-grid {
  display: grid;
  gap: 18px;
}

.entry-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.entry-card,
.content-card,
.scenario-card,
.market-card,
.profile-panel,
.list-panel,
.table-card,
.case-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(24, 35, 52, 0.06);
}

.entry-card {
  min-height: 190px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.entry-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--brand);
  border-radius: 8px;
  font-weight: 900;
}

.entry-card p,
.content-card p,
.market-card p,
.case-card p {
  color: var(--muted);
  line-height: 1.65;
}

.tools-section {
  background: #102c33;
  color: #fff;
}

.tools-section .section-heading p,
.tools-section .tools-copy p {
  color: rgba(255, 255, 255, 0.76);
}

.tools-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}

.tools-copy {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

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

.scenario-card {
  padding: 22px;
  color: var(--ink);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
}

.filter.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-box span {
  color: var(--muted);
  font-size: 14px;
}

.search-box input {
  min-width: 240px;
  border: 0;
  outline: 0;
}

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

.content-card,
.market-card,
.case-card {
  padding: 22px;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--brand-dark);
  background: #e7f2f0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.card-link {
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
}

.case-board {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.9fr;
  gap: 18px;
}

.case-card.featured {
  grid-row: span 2;
  color: #fff;
  background:
    linear-gradient(rgba(15, 107, 99, 0.9), rgba(15, 107, 99, 0.88)),
    url("https://images.unsplash.com/photo-1552664730-d307ca884978?auto=format&fit=crop&w=1200&q=80");
  background-position: center;
  background-size: cover;
  border-color: transparent;
}

.case-card.featured p {
  color: rgba(255, 255, 255, 0.86);
}

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

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-row span {
  padding: 6px 9px;
  color: #475569;
  background: #eef2f6;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.price {
  display: block;
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
}

.user-section {
  background: #f8fafc;
}

.dashboard-grid {
  grid-template-columns: 0.9fr 1fr 1fr;
}

.profile-panel,
.list-panel {
  padding: 24px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: #fff;
  background: var(--blue);
  border-radius: 8px;
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 18px;
}

.list-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-panel li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.list-panel li:last-child {
  border-bottom: 0;
}

.list-panel strong {
  color: var(--brand);
  white-space: nowrap;
}

.admin-section {
  background: #17202a;
  color: #fff;
}

.admin-section .section-heading p {
  color: rgba(255, 255, 255, 0.7);
}

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

.admin-menu {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.admin-menu button {
  min-height: 38px;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
}

.admin-menu button.active,
.admin-menu button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

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

.stat-card {
  padding: 18px;
  color: var(--ink);
  background: #fff;
  border-radius: 8px;
}

.stat-card strong {
  display: block;
  font-size: 28px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.table-card {
  overflow: auto;
  padding: 20px;
  color: var(--ink);
}

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

.table-heading h3 {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

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

th {
  color: var(--muted);
  font-size: 13px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(20px, 5vw, 72px);
  color: #cbd5e1;
  background: #101820;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 48px));
  padding: 14px 16px;
  color: #fff;
  background: #17202a;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.detail-dialog {
  width: min(680px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.detail-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}

@media (max-width: 1160px) {
  .entry-grid,
  .content-grid,
  .market-grid,
  .dashboard-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-board {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
  }

  .nav {
    display: none;
    position: absolute;
    left: 20px;
    right: 20px;
    top: 72px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    justify-content: flex-start;
  }

  .nav.open {
    display: flex;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .hero,
  .tools-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .split {
    display: block;
  }

  .filters {
    margin-top: 18px;
  }
}

@media (max-width: 640px) {
  .brand {
    min-width: 0;
  }

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

  .brand small {
    display: none;
  }

  .workflow,
  .entry-grid,
  .content-grid,
  .scenario-grid,
  .market-grid,
  .dashboard-grid,
  .stat-grid,
  .case-board {
    grid-template-columns: 1fr;
  }

  .search-box {
    margin-top: 16px;
    align-items: stretch;
  }

  .search-box input {
    min-width: 0;
    width: 100%;
  }

  .footer {
    display: block;
  }

  .footer span {
    display: block;
    margin-top: 8px;
  }
}


.auth-box {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.auth-user {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
}

.stack-form,
.inline-form {
  display: grid;
  gap: 14px;
}

.stack-form label,
.inline-form label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 700;
}

.stack-form input,
.stack-form textarea,
.inline-form input,
.inline-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  resize: vertical;
}

.stack-form input:focus,
.stack-form textarea:focus,
.inline-form input:focus,
.inline-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 107, 99, 0.12);
}

.inline-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.checkbox-line {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
}

.form-tip {
  padding: 10px 12px;
  color: #475569;
  background: #f1f5f9;
  border-radius: 6px;
  line-height: 1.6;
}

.empty-state {
  min-height: 140px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.admin-manager {
  margin-top: 18px;
}

.admin-manager table {
  min-width: 760px;
}

.card-link.danger {
  color: #b42318;
  margin-left: 10px;
}

.detail-dialog .button-row {
  margin-top: 18px;
}

@media (max-width: 980px) {
  .auth-box {
    order: 3;
    width: 100%;
    justify-content: flex-end;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }
}
