:root {
  color-scheme: light;
  --bg: #f4f2eb;
  --panel: #fffdfa;
  --panel-strong: #f8f5ed;
  --text: #16211d;
  --muted: #65716d;
  --line: #ddd8cc;
  --accent: #247365;
  --accent-strong: #15584f;
  --warm: #c75b46;
  --gold: #d5a43a;
  --ink: #111816;
  --shadow: 0 18px 50px rgba(30, 36, 33, 0.1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101513;
  --panel: #171f1b;
  --panel-strong: #1d2822;
  --text: #eef4ee;
  --muted: #aab5ae;
  --line: #314039;
  --accent: #61b7a7;
  --accent-strong: #8bd6ca;
  --warm: #e1836e;
  --gold: #e0b850;
  --ink: #f8fbf7;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.5;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  overflow-wrap: anywhere;
}

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

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  min-height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--muted);
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--text);
  background: var(--panel-strong);
}

.domain-box {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.copy-line {
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
}

.workspace {
  padding: 28px;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
}

.topbar,
.section-heading,
.hero-actions,
.top-actions,
.control-strip,
.segments,
.status-list div {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1,
.section-heading h2,
.hero-copy h2,
.note-panel h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 28px;
}

.top-actions {
  gap: 10px;
}

.icon-button,
.primary-action,
.secondary-action {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--text);
  background: var(--panel);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.secondary-action:hover,
.icon-button:hover,
.copy-line:hover {
  border-color: var(--accent);
}

.secondary-action.compact {
  min-height: 38px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero-copy h2 {
  max-width: 760px;
  font-size: 42px;
}

.hero-copy p {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-map {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.eyebrow {
  display: block;
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.control-strip {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.search-box {
  flex: 1;
  min-width: 220px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.segments {
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.segment {
  height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
}

.segment.active {
  color: #ffffff;
  background: var(--ink);
}

.section-block {
  margin-top: 28px;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2,
.note-panel h2 {
  font-size: 22px;
}

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

.service-card {
  min-height: 176px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent), var(--line) 35%);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  flex: 0 0 auto;
}

.service-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.service-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.status-pill.planned {
  color: var(--warm);
  background: color-mix(in srgb, var(--warm) 14%, transparent);
}

.card-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.open-link,
.ghost-link {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  white-space: nowrap;
  background: transparent;
}

.open-link {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
}

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

.domain-table,
.download-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.domain-row,
.download-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 130px;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.domain-row:first-child,
.download-row:first-child {
  border-top: 0;
}

.domain-name,
.download-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.domain-purpose,
.download-desc {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.domain-state {
  justify-self: end;
  color: var(--muted);
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.note-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}

.note-panel ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.note-panel li + li {
  margin-top: 8px;
}

.status-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.status-list div {
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
}

.status-list dt {
  font-weight: 800;
}

.status-list dd {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  min-width: 180px;
  max-width: min(420px, calc(100vw - 32px));
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

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

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px;
  }

  .side-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
  }

  .domain-box {
    margin: 0 0 0 auto;
    border-top: 0;
    padding-top: 0;
    min-width: 190px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-map {
    height: 300px;
  }

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

@media (max-width: 760px) {
  .workspace {
    padding: 18px 14px;
  }

  .topbar,
  .control-strip,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .hero-actions {
    width: 100%;
  }

  .primary-action,
  .secondary-action {
    flex: 1;
  }

  .hero-panel {
    padding: 18px;
  }

  .hero-copy h2 {
    font-size: 30px;
  }

  .segments {
    width: 100%;
    overflow-x: auto;
  }

  .segment {
    flex: 1;
    min-width: 76px;
  }

  .service-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .domain-row,
  .download-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .domain-state {
    justify-self: start;
  }

  .sidebar {
    gap: 14px;
  }

  .domain-box {
    width: 100%;
    margin-left: 0;
  }
}
