:root {
  --bg: #f4f0e8;
  --paper: #fffdf8;
  --ink: #2d211d;
  --muted: #7d6e65;
  --line: #e7ddd1;
  --accent: #b74b32;
  --accent-soft: #f6e3db;
  --wine: #5f2923;
  --green: #446b54;
  --gold: #c18b43;
  --shadow: 0 18px 60px rgba(72, 48, 37, 0.09);
  --radius: 22px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(220, 178, 134, 0.2), transparent 30rem),
    radial-gradient(circle at 96% 28%, rgba(183, 75, 50, 0.08), transparent 28rem),
    var(--bg);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
code { font-family: "SFMono-Regular", "Cascadia Code", ui-monospace, monospace; }

.hero {
  position: relative;
  overflow: hidden;
  color: #f9eee5;
  background:
    linear-gradient(135deg, rgba(48, 30, 24, 0.96), rgba(87, 38, 31, 0.94)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 8px);
  padding: 34px max(24px, calc((100vw - 1240px) / 2)) 58px;
}
.hero-glow {
  position: absolute;
  width: 46rem;
  height: 46rem;
  border-radius: 50%;
  right: -16rem;
  top: -28rem;
  background: radial-gradient(circle, rgba(229, 159, 102, 0.32), transparent 64%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 15px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.08);
}
.brand-copy { display: grid; line-height: 1.3; }
.brand-copy strong { font-size: 18px; letter-spacing: 0.04em; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}
.brand-copy .eyebrow { color: rgba(255, 245, 236, 0.62); }
.status-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 13px;
  color: rgba(255, 245, 236, 0.82);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.07);
}
.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #85d299;
  box-shadow: 0 0 0 4px rgba(133, 210, 153, 0.13);
}
.hero-copy { max-width: 870px; padding: 62px 0 28px; }
.kicker {
  margin: 0 0 12px;
  color: #e9bd8d;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.hero h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(34px, 5.4vw, 64px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.035em;
}
.hero-note {
  max-width: 760px;
  margin: 22px 0 0;
  color: rgba(255, 245, 236, 0.66);
  font-size: 14px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}
.hero-meta span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 12px;
  color: rgba(255, 245, 236, 0.65);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 3px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(244, 240, 232, 0.88);
  backdrop-filter: blur(18px);
}
.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 16px 18px 13px;
  color: var(--muted);
  background: transparent;
  font-weight: 600;
  font-size: 14px;
}
.tab span { color: #b1a399; font-size: 11px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-color: var(--accent); }

main {
  width: min(1240px, calc(100vw - 48px));
  margin: 34px auto 70px;
}
.view { display: none; }
.view.active { display: block; animation: fade-up 0.35s ease; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.card, .panel {
  border: 1px solid rgba(221, 207, 193, 0.7);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.91);
  box-shadow: var(--shadow);
}
.kpi {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 20px;
}
.kpi::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: 0.62;
}
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi-value {
  display: block;
  margin: 10px 0 3px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 31px;
  line-height: 1;
}
.kpi-note { color: #a29389; font-size: 10px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.panel { padding: 24px; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.panel h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}
.panel-hint { color: #a29185; font-size: 11px; white-space: nowrap; }

.price-summary {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}
.price-summary div { display: grid; }
.price-summary strong { font-family: "Songti SC", "STSong", serif; font-size: 26px; }
.price-summary span { color: var(--muted); font-size: 10px; }
.bar-chart {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 190px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 8px;
  height: 100%;
}
.bar-col b { font-size: 11px; font-weight: 600; }
.bar {
  width: min(44px, 100%);
  min-height: 4px;
  border-radius: 10px 10px 3px 3px;
  background: linear-gradient(180deg, #d27c57, #a5412b);
  transition: height 0.5s ease;
}
.bar-label {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.rank-list { display: grid; gap: 14px; }
.rank-item { display: grid; gap: 6px; }
.rank-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.rank-top span:last-child { color: var(--muted); }
.rank-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee5da;
}
.rank-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #bc5a3e, #dba274);
}

.city-list { display: flex; flex-wrap: wrap; gap: 8px; }
.city-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 11px;
  background: #faf6ef;
  font-size: 12px;
}
.city-chip b { color: var(--accent); }
.city-chip small { color: #a99b91; font-size: 9px; }

.sold-list { display: grid; gap: 11px; }
.sold-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0e9e0;
}
.sold-item:last-child { border-bottom: 0; }
.sold-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}
.sold-copy { min-width: 0; }
.sold-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sold-copy span { color: var(--muted); font-size: 10px; }
.sold-count { color: var(--accent); font-size: 12px; font-weight: 700; }

.tag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tag-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 9px;
  background: #faf6ef;
}
.tag-card img, .tag-card .thumb { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 10px; }
.tag-card div { min-width: 0; }
.tag-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.tag-card span { color: var(--muted); font-size: 10px; }

.recommend-list { display: grid; gap: 10px; }
.recommend-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px;
  border: 1px solid #f0e7dc;
  border-radius: 13px;
  background: #fcf9f4;
}
.recommend-item img, .recommend-item .thumb { width: 44px; height: 44px; border-radius: 10px; }
.recommend-item strong { display: block; font-size: 12px; }
.recommend-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.recommend-item b { color: var(--accent); font-size: 12px; }

.api-band { overflow: hidden; }
.api-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.api-risk-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fbf8f2;
}
.api-risk-card strong { display: block; font-family: "Songti SC", "STSong", serif; font-size: 27px; }
.api-risk-card span { color: var(--muted); font-size: 11px; }
.api-note {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--muted);
  background: #f6eee5;
  font-size: 11px;
}
.api-note strong { flex: 0 0 auto; color: var(--accent); }

.data-head { align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.toolbar label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: 0.05em; }
.toolbar input, .toolbar select {
  min-width: 116px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fffefa;
  outline: none;
}
.toolbar input:focus, .toolbar select:focus, .search-field input:focus { border-color: #b86b54; box-shadow: 0 0 0 3px rgba(184, 107, 84, 0.12); }
.toolbar .search-field input { min-width: 210px; }
.check-field { display: flex !important; flex-direction: row; align-items: center; gap: 7px !important; padding-top: 19px; }
.check-field input { width: 15px; min-width: 15px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: #9a887d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}
td { padding: 12px; border-bottom: 1px solid #f1ebe3; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-alias] { cursor: pointer; transition: background 0.16s; }
tbody tr[data-alias]:hover { background: #fcf7f1; }
.goods-cell { display: flex; align-items: center; gap: 11px; min-width: 250px; }
.goods-cell img, .thumb {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1e8dd;
  color: #ad9788;
  font-family: "Songti SC", serif;
  font-size: 20px;
}
.goods-copy { min-width: 0; }
.goods-copy strong { display: block; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goods-copy span { display: block; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9a8b81; font-size: 10px; }
.price { font-family: "Songti SC", "STSong", serif; font-size: 15px; color: var(--accent); white-space: nowrap; }
.muted { color: var(--muted); }
.status-open { color: var(--green); font-weight: 700; }
.status-closed { color: #a5968c; }
.risk-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.risk-public_read { color: #2d6748; background: #e1f0e6; }
.risk-public_write { color: #8c5621; background: #f7ead6; }
.risk-private_or_dynamic { color: #8f3434; background: #f6dfdc; }
.risk-unclassified { color: #675b54; background: #eee9e3; }
.api-path { max-width: 520px; overflow-wrap: anywhere; font-family: "SFMono-Regular", ui-monospace, monospace; font-size: 11px; }

.result-meta {
  padding-top: 18px;
  color: var(--muted);
  font-size: 11px;
}
.empty { padding: 44px 10px; color: var(--muted); text-align: center; }

.api-intro { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 18px; }
.api-intro h2 { margin-bottom: 6px; }
.api-intro p { max-width: 700px; margin: 0; color: var(--muted); font-size: 12px; }
.api-intro code { color: var(--accent); font-size: 11px; }
.endpoint-example {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 320px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px;
  background: #faf6ef;
}
.endpoint-example span { width: 100%; color: var(--muted); font-size: 9px; }
.endpoint-example code { flex: 1; overflow-wrap: anywhere; font-size: 10px; }
.endpoint-example button {
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  color: #fff;
  background: var(--accent);
  font-size: 10px;
}

dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 40px 120px rgba(35, 20, 15, 0.28);
}
dialog::backdrop { background: rgba(37, 25, 20, 0.55); backdrop-filter: blur(5px); }
.dialog-close {
  position: sticky;
  top: 12px;
  z-index: 3;
  float: right;
  margin: 12px 14px 0 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.9);
  font-size: 21px;
  line-height: 1;
}
#detail-content { padding: 28px; }
.detail-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 26px; }
.gallery-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  background: #f1e8dd;
}
.gallery-thumbs { display: flex; gap: 7px; margin-top: 8px; overflow-x: auto; }
.gallery-thumbs img { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; cursor: pointer; opacity: 0.72; }
.gallery-thumbs img:hover { opacity: 1; }
.detail-copy h2 { margin: 4px 0 7px; font-family: "Songti SC", serif; font-size: 28px; line-height: 1.2; }
.detail-subtitle { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.detail-price { color: var(--accent); font-family: "Songti SC", serif; font-size: 30px; }
.detail-price small { color: #a4958b; font-family: inherit; font-size: 12px; text-decoration: line-through; }
.detail-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.fact { border-radius: 11px; padding: 10px; background: #f7f1e9; }
.fact span { display: block; color: var(--muted); font-size: 9px; }
.fact strong { font-size: 15px; }
.detail-section { margin-top: 24px; }
.detail-section h3 { margin: 0 0 9px; font-family: "Songti SC", serif; font-size: 18px; }
.detail-section p { margin: 0; color: #6e5e55; font-size: 12px; }
.mini-table { width: 100%; min-width: 0; }
.mini-table td, .mini-table th { padding: 8px; font-size: 11px; }
.store-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.store-pill { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); font-size: 9px; background: #fbf7f1; }
a.store-pill { color: var(--accent); text-decoration: none; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1240px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  color: #a49489;
  font-size: 10px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  transform: translate(-50%, 20px);
  border-radius: 999px;
  padding: 9px 16px;
  color: #fff;
  background: #36251f;
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.skeleton { min-height: 126px; background: linear-gradient(100deg, #f6f0e8 30%, #fffaf3 50%, #f6f0e8 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

@media (max-width: 1050px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .api-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hero { padding-top: 24px; }
  .brand-copy .eyebrow { display: none; }
  .status-pill { font-size: 10px; }
  .hero-copy { padding-top: 42px; }
  main, footer { width: min(100% - 24px, 1240px); }
  .tabs { padding: 0 12px; overflow-x: auto; }
  .tab { flex: 0 0 auto; padding-inline: 13px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { min-height: 110px; padding: 15px; }
  .kpi-value { font-size: 26px; }
  .panel { padding: 18px; }
  .panel-head, .data-head, .api-intro { align-items: stretch; flex-direction: column; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar .search-field { grid-column: 1 / -1; }
  .toolbar .search-field input { width: 100%; min-width: 0; }
  .toolbar label, .toolbar select { min-width: 0; }
  .check-field { padding-top: 2px; }
  .tag-grid { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .api-note { flex-direction: column; gap: 5px; }
  .endpoint-example { min-width: 0; }
  footer { flex-direction: column; gap: 4px; }
}
