:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #eef5f0;
  --ink: #17211b;
  --muted: #66736c;
  --line: #d9e0dc;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --warm: #b45309;
  --danger-soft: #fff7ed;
  --shadow: 0 18px 45px rgba(24, 34, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  min-height: 280px;
  padding: 44px clamp(18px, 5vw, 72px) 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 28px;
  align-items: end;
  background:
    linear-gradient(rgba(9, 40, 35, 0.74), rgba(9, 40, 35, 0.78)),
    url("https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  color: #bde8df;
  font-size: 14px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 21px;
}

h3 {
  font-size: 18px;
}

.subtitle {
  max-width: 760px;
  margin-bottom: 0;
  color: #e8f3ef;
  font-size: 18px;
}

.data-warning {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.data-warning strong,
.data-warning span {
  display: block;
}

.data-warning span {
  margin-top: 8px;
  color: #f6fbf9;
  font-size: 14px;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: -22px auto 40px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filters-panel,
.table-panel,
.detail-panel,
.ai-panel {
  padding: 22px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.compact {
  margin-bottom: 8px;
}

.filters-grid,
.ai-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 14px;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  margin-top: 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: #304139;
  font-size: 13px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.is-selected {
  background: #f0faf7;
}

td a {
  color: var(--accent);
  font-weight: 700;
}

.detail-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.detail-title {
  margin: 8px 0 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.trend-list,
.nearby-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.trend-list li,
.nearby-list li {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  font-size: 14px;
}

.ai-panel {
  margin-top: 18px;
}

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

.ai-form {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.wide,
.ai-actions {
  grid-column: 1 / -1;
}

.ai-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-output {
  min-height: 360px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  white-space: pre-wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

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

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

.ghost-button {
  background: #fff;
  color: var(--accent-dark);
  border-color: var(--line);
}

.ghost-button:hover {
  border-color: var(--accent);
}

.notice {
  padding: 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--warm);
}

@media (max-width: 1100px) {
  .app-header,
  .content-grid,
  .ai-layout {
    grid-template-columns: 1fr;
  }

  .filters-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 720px) {
  .app-header {
    min-height: 360px;
    padding: 28px 18px 34px;
  }

  .app-shell {
    width: calc(100% - 20px);
  }

  .filters-panel,
  .table-panel,
  .detail-panel,
  .ai-panel {
    padding: 16px;
  }

  .section-heading {
    display: grid;
  }

  .filters-grid,
  .ai-form {
    grid-template-columns: 1fr;
  }

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