:root {
  --orange: #e8662a;
  --orange-600: #d0551c;
  --orange-700: #b44714;
  --orange-50: #fff3e8;
  --orange-100: #ffe3cc;
  --ink: #201d18;
  --ink-2: #4b453c;
  --muted: #8b8376;
  --muted-2: #a79e90;
  --paper: #f6f1e8;
  --card: #fffdf8;
  --line: #e9e0d3;
  --line-soft: #f1eae0;
  --up: #cf3d2c;
  --down: #1e7a4c;
  --blue: #2f6d8c;
  --purple: #7a5aa6;
  --shadow-sm: 0 1px 2px rgba(74, 48, 20, 0.05);
  --shadow-md: 0 14px 34px rgba(96, 62, 24, 0.08);
  --shadow-lg: 0 24px 60px rgba(96, 62, 24, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", system-ui,
    -apple-system, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 12% -10%, rgba(232, 102, 42, 0.12), transparent 38%),
    radial-gradient(circle at 88% 0%, rgba(52, 120, 78, 0.08), transparent 34%),
    linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.55;
}

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

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

button {
  cursor: pointer;
}

.num,
.price,
.stat-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.2) blur(14px);
  background: rgba(250, 246, 239, 0.88);
  border-bottom: 1px solid rgba(214, 202, 185, 0.6);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 66px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fffaf3;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(145deg, #f0803f, var(--orange-600));
  box-shadow: 0 5px 14px rgba(216, 84, 26, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  letter-spacing: 0;
}

.brand-mark.small {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 16px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 18px;
  letter-spacing: 1px;
}

.brand-text small {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.6px;
  margin-top: 3px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

.main-nav a,
.nav-button {
  padding: 8px 12px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background 0.18s, color 0.18s;
}

.main-nav a:hover,
.nav-button:hover {
  background: var(--orange-50);
  color: var(--orange-700);
}

.main-nav a[data-active="true"] {
  color: var(--orange-700);
  background: var(--orange-50);
  font-weight: 600;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
  white-space: nowrap;
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a9b64;
  box-shadow: 0 0 0 0 rgba(58, 155, 100, 0.5);
  animation: pulse 2.2s infinite;
}

.data-status.is-loading .pulse {
  background: var(--orange);
  animation-duration: 1s;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(58, 155, 100, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(58, 155, 100, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(58, 155, 100, 0);
  }
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  display: grid;
  place-items: center;
  transition: transform 0.4s ease, border-color 0.2s, color 0.2s;
  color: var(--ink-2);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  border-color: var(--orange);
  color: var(--orange-700);
}

.icon-btn.is-spinning svg {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 布局 ---------- */
.app-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 22px 40px;
  min-height: 62vh;
}

.section {
  margin-top: 30px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.3px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(var(--orange), var(--orange-700));
}

.section-sub {
  margin: 4px 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
}

.section-link {
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 2px;
}

.section-link:hover {
  color: var(--orange-700);
  border-color: var(--orange);
}

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

/* ---------- 首页 Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 34px;
  align-items: center;
  padding: 20px 0 8px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--orange-700);
  background: var(--orange-50);
  border: 1px solid var(--orange-100);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 4.3vw, 52px);
  line-height: 1.12;
  letter-spacing: -1.2px;
  font-weight: 800;
}

.hero h1 em {
  font-style: normal;
  color: var(--orange-700);
  position: relative;
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 9px;
  border-radius: 4px;
  background: rgba(232, 102, 42, 0.18);
  z-index: -1;
}

.hero-lead {
  margin: 16px 0 22px;
  max-width: 520px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.75;
}

.hero-lead b {
  color: var(--ink);
  font-weight: 600;
}

.search-wrap {
  position: relative;
  max-width: 540px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(96, 62, 24, 0.08);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: rgba(232, 102, 42, 0.55);
  box-shadow: 0 0 0 4px rgba(232, 102, 42, 0.12), 0 14px 30px rgba(96, 62, 24, 0.1);
}

.search-box .search-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.9;
  stroke-linecap: round;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  padding: 9px 0;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.search-box .search-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  color: #fff8f1;
  background: linear-gradient(145deg, #f17d3d, var(--orange-600));
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(216, 84, 26, 0.25);
  transition: transform 0.15s, box-shadow 0.2s;
}

.search-box .search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(216, 84, 26, 0.3);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 30;
  max-height: 380px;
  overflow-y: auto;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.search-item:last-child {
  border-bottom: 0;
}

.search-item:hover,
.search-item.is-active {
  background: var(--orange-50);
}

.search-item .s-name {
  font-size: 14px;
  font-weight: 600;
}

.search-item .s-cat {
  font-size: 11px;
  color: var(--muted);
  background: var(--paper);
  border-radius: 5px;
  padding: 1px 6px;
}

.search-item .s-price {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink);
}

.search-empty {
  padding: 18px 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.hot-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.chip-link {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.6);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  color: var(--ink-2);
  transition: all 0.18s;
}

.chip-link:hover {
  border-color: var(--orange);
  color: var(--orange-700);
  background: var(--orange-50);
}

.hero-visual {
  position: relative;
  min-height: 320px;
}

.hero-frame {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #f4c59b, #dd7a3c 45%, #5b7a42);
}

.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
}

.hero-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 20, 10, 0) 45%, rgba(30, 20, 10, 0.42));
}

.hero-badge {
  position: absolute;
  left: 18px;
  bottom: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 13px;
  background: rgba(255, 251, 244, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  z-index: 2;
}

.hero-badge .flag {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--orange-50);
  color: var(--orange-700);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.hero-badge .hb-main {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

.hero-badge .hb-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.hero-badge .hb-count {
  margin-left: auto;
  text-align: right;
  font-size: 18px;
  font-weight: 700;
  color: var(--orange-700);
  line-height: 1.1;
}

.hero-badge .hb-count small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

/* ---------- 指标条 ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--orange);
  opacity: 0.55;
}

.stat-card .stat-label {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.stat-card .stat-value {
  margin-top: 5px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-card .stat-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}

.stat-card .stat-foot {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- 首页主网格 ---------- */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.category-card {
  display: flex;
  gap: 13px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  min-height: 116px;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 102, 42, 0.4);
  box-shadow: var(--shadow-md);
}

.category-thumb {
  display: block;
  width: 74px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(145deg, #f6d2ae, #cf8a56);
  position: relative;
}

.category-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.category-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.category-body h3 {
  margin: 1px 0 3px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-body h3 a:hover {
  color: var(--orange-700);
}

.category-count {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--paper);
  border-radius: 5px;
  padding: 1px 6px;
  font-weight: 400;
}

.category-body p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-links {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 8px;
}

.category-links a {
  font-size: 11px;
  color: var(--ink-2);
  background: var(--paper);
  border-radius: 5px;
  padding: 2px 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-links a:hover {
  background: var(--orange-50);
  color: var(--orange-700);
}

/* ---------- 排行 ---------- */
.rank-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.rank-tabs {
  display: flex;
  padding: 10px 12px 0;
  gap: 6px;
  border-bottom: 1px solid var(--line-soft);
}

.rank-tab {
  border: 0;
  background: transparent;
  padding: 8px 12px 10px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.rank-tab[data-active="true"] {
  color: var(--orange-700);
  border-color: var(--orange);
  font-weight: 600;
}

.rank-list {
  padding: 6px 8px 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 7px;
  border-radius: 8px;
}

.rank-row:hover {
  background: var(--orange-50);
}

.rank-no {
  font-size: 11px;
  color: var(--muted-2);
  text-align: center;
  font-weight: 600;
}

.rank-row:nth-child(-n + 3) .rank-no {
  color: var(--orange-700);
}

.rank-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-name small {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-left: 5px;
  font-weight: 400;
}

.rank-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.rank-price {
  font-size: 12px;
  color: var(--ink-2);
}

.change {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.change.up {
  color: var(--up);
}

.change.down {
  color: var(--down);
}

.change.flat {
  color: var(--muted);
}

.rank-empty {
  padding: 30px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 热门品种 ---------- */
.hot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hot-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.hot-card:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 102, 42, 0.38);
  box-shadow: var(--shadow-md);
}

.hot-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hot-name {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-cat {
  font-size: 10px;
  color: var(--muted);
  background: var(--paper);
  border-radius: 4px;
  padding: 0 5px;
  flex-shrink: 0;
}

.hot-price {
  margin-top: 7px;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.hot-price strong {
  font-size: 20px;
  letter-spacing: -0.4px;
}

.hot-price span {
  font-size: 10.5px;
  color: var(--muted);
}

.hot-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--muted);
}

/* ---------- 空状态提示 ---------- */
.empty-note {
  font-size: 12px;
  color: var(--muted);
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.5);
  grid-column: 1 / -1;
}

/* ---------- 品种页 ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.breadcrumb a:hover {
  color: var(--orange-700);
}

.breadcrumb .sep {
  color: var(--muted-2);
}

.product-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(255, 251, 243, 0.98), rgba(255, 240, 224, 0.75));
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.product-head::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 102, 42, 0.14), transparent 65%);
  pointer-events: none;
}

.product-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.product-title-row h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

.badge.orange {
  background: var(--orange-50);
  border-color: var(--orange-100);
  color: var(--orange-700);
}

.product-meta {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.product-price-block {
  text-align: right;
  position: relative;
  z-index: 1;
}

.product-price-block .pp-label {
  font-size: 11.5px;
  color: var(--muted);
}

.product-price-block .pp-value {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -1.8px;
  line-height: 1.05;
  color: var(--orange-700);
}

.product-price-block .pp-value small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 4px;
}

.product-price-block .pp-change {
  margin-top: 4px;
  font-size: 12.5px;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.detail-stat {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}

.detail-stat .ds-label {
  font-size: 10.5px;
  color: var(--muted);
}

.detail-stat .ds-value {
  margin-top: 3px;
  font-size: 19px;
  font-weight: 700;
}

.detail-stat .ds-value small {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 2px;
}

.detail-stat .ds-sub {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 1px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  position: sticky;
  top: 78px;
  z-index: 20;
  box-shadow: 0 4px 18px rgba(96, 62, 24, 0.05);
}

.type-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.type-tab {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.type-tab b {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}

.type-tab:hover {
  background: var(--paper);
}

.type-tab[data-active="true"] {
  background: var(--orange-50);
  border-color: var(--orange-100);
  color: var(--orange-700);
  font-weight: 600;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 2px;
}

.select,
.text-input {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  outline: 0;
}

.select:focus,
.text-input:focus {
  border-color: rgba(232, 102, 42, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 102, 42, 0.1);
}

.toolbar .text-input {
  width: 150px;
}

.toolbar-spacer {
  margin-left: auto;
}

.toolbar .count-note {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-scroll {
  overflow: auto;
  max-height: 760px;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.quote-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbf7f0;
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.quote-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.quote-table tbody tr:hover {
  background: #fffaf2;
}

.quote-table .idx {
  color: var(--muted-2);
  font-size: 11px;
  width: 38px;
}

/* ---------- 表头排序 ---------- */
.quote-table th.sortable,
.rank-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.quote-table th.sortable:hover,
.rank-table th.sortable:hover {
  color: var(--orange-700);
}

.quote-table th.sortable.is-active,
.rank-table th.sortable.is-active {
  color: var(--orange-700);
  font-weight: 600;
}

.sort-ind {
  display: inline-block;
  margin-left: 3px;
  font-size: 10px;
  opacity: 0.65;
}

.quote-table th.sortable.is-active .sort-ind,
.rank-table th.sortable.is-active .sort-ind {
  opacity: 1;
}

.link-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.link-btn:hover {
  color: var(--orange-700);
}

.market-cell {
  max-width: 340px;
}

.market-cell .m-name {
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-cell .m-city {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.region-cell {
  white-space: nowrap;
  color: var(--ink-2);
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot.origin {
  background: var(--orange);
}

.dot.sales {
  background: var(--blue);
}

.dot.distribution {
  background: var(--purple);
}

.dot.unknown {
  background: var(--muted-2);
}

.type-badge.origin {
  color: #a84314;
  background: #fff0e2;
  border-color: #ffddc2;
}

.type-badge.sales {
  color: #245b77;
  background: #eaf4f9;
  border-color: #d3e8f2;
}

.type-badge.distribution {
  color: #5d4385;
  background: #f2edfa;
  border-color: #e3d8f4;
}

.type-badge.unknown {
  color: #6f675c;
  background: #f4f1eb;
  border-color: #e8e2d8;
}

.price-cell {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.price-cell small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 2px;
}

.diff-cell,
.day-cell {
  white-space: nowrap;
  font-size: 12px;
}

.diff-cell .bar-track {
  width: 58px;
  height: 4px;
  border-radius: 3px;
  background: var(--line-soft);
  display: inline-block;
  vertical-align: middle;
  margin-right: 7px;
  overflow: hidden;
}

.diff-cell .bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f3b184, var(--orange));
}

.diff-cell .bar-fill.below {
  background: linear-gradient(90deg, #93c5ad, #3d9368);
}

.empty-cell {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- 侧栏 ---------- */
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
}

.side-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.side-card h3 span {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
}

.side-sub {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--muted);
}

.trend-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.trend-legend {
  display: flex;
  gap: 12px;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 6px;
}

.trend-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 4px;
}

.trend-empty {
  padding: 24px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.province-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}

.province-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 62px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  padding: 2px 0;
  cursor: pointer;
}

.province-row:hover .p-name {
  color: var(--orange-700);
}

.p-name {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-bar {
  height: 6px;
  border-radius: 4px;
  background: var(--line-soft);
  overflow: hidden;
}

.p-bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #f6bc96, var(--orange));
}

.p-value {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
}

.p-value small {
  display: block;
  font-weight: 400;
  font-size: 9.5px;
  color: var(--muted-2);
}

.note-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-list li {
  display: flex;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

.note-list .dot {
  margin-top: 5px;
}

.side-note {
  margin: 10px 0 0;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.6;
  border-top: 1px dashed var(--line);
  padding-top: 9px;
}

/* ---------- 品类页 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-head h1 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.5px;
}

.page-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cat-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.cat-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbf7f0;
}

.cat-block-head h3 {
  margin: 0;
  font-size: 14px;
}

.cat-block-head span {
  font-size: 10.5px;
  color: var(--muted);
}

.cat-var-list {
  max-height: 320px;
  overflow: auto;
  padding: 4px 6px;
}

.cat-var-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 12.5px;
}

.cat-var-row:hover {
  background: var(--orange-50);
}

.cat-var-row .cv-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-var-row .cv-sub {
  font-size: 10px;
  color: var(--muted);
  margin-left: 5px;
}

.cat-var-row .cv-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.cat-var-row .cv-price small {
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 400;
}

.cat-var-row.is-empty {
  opacity: 0.55;
}

.cat-var-row.is-empty .cv-price {
  color: var(--muted);
  font-weight: 400;
}

/* ---------- 榜单页 ---------- */
.rank-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.rank-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.rank-block-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fbf7f0;
}

.rank-block-head h2 {
  margin: 0;
  font-size: 16px;
}

.rank-block-head span {
  font-size: 11px;
  color: var(--muted);
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.rank-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.rank-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.rank-table tbody tr:hover {
  background: var(--orange-50);
}

.rank-table .no {
  color: var(--muted-2);
  width: 34px;
}

.rank-table .price {
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- 加载 / 空状态 ---------- */
.skeleton {
  background: linear-gradient(90deg, #f3ede4 25%, #faf6ef 37%, #f3ede4 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 10px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.sk-hero {
  height: 330px;
  border-radius: 20px;
}

.sk-row {
  height: 70px;
  margin-top: 10px;
}

.loading-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--orange-50);
  border: 1px solid var(--orange-100);
  border-radius: 12px;
  color: var(--orange-700);
  font-size: 12.5px;
  margin-top: 14px;
}

.loading-note .spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(232, 102, 42, 0.25);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.progress-track {
  height: 4px;
  background: rgba(232, 102, 42, 0.16);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.empty-state {
  padding: 50px 20px;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-state h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.6);
  padding: 26px 22px 18px;
  margin-top: 20px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  gap: 40px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  gap: 10px;
  font-size: 13px;
}

.footer-brand strong {
  font-size: 15px;
}

.footer-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  max-width: 320px;
  line-height: 1.6;
}

.footer-meta {
  max-width: 520px;
  color: var(--muted);
  font-size: 11.5px;
}

.footer-meta p {
  margin: 0 0 5px;
  line-height: 1.6;
}

.footer-bottom {
  max-width: var(--max);
  margin: 18px auto 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-size: 10.5px;
}

/* ---------- 弹窗 ---------- */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(34, 27, 18, 0.45);
  backdrop-filter: blur(3px);
}

.modal-panel {
  position: relative;
  background: var(--card);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  padding: 26px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  max-height: 86vh;
  overflow: auto;
}

.modal-panel h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}

.modal-close:hover {
  color: var(--orange-700);
  border-color: var(--orange);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.about-grid section {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 12px 14px;
}

.about-grid h3 {
  margin: 0 0 4px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.about-grid p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.62;
}

.about-sub {
  margin: 18px 0 4px;
  font-size: 14px;
}

.about-note {
  margin: 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}

.modal-source {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.modal-source a {
  color: var(--orange-700);
  border-bottom: 1px dashed var(--orange-100);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: rgba(32, 29, 24, 0.92);
  color: #fff8ee;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 120;
  max-width: 80vw;
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-visual {
    min-height: 0;
    max-width: 620px;
  }

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

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

  .side-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

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

@media (max-width: 860px) {
  .main-nav {
    display: none;
  }

  .header-inner {
    gap: 14px;
    padding: 0 16px;
  }

  .app-shell {
    padding: 20px 16px 30px;
  }

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

  .category-grid,
  .rank-page-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .product-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .product-price-block {
    text-align: left;
  }

  .product-price-block .pp-value {
    font-size: 40px;
  }

  .toolbar {
    position: static;
  }

  .side-stack {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    gap: 18px;
  }
}

@media (max-width: 560px) {
  .brand-text small {
    display: none;
  }

  .data-status {
    display: none;
  }

  .hero h1 {
    font-size: 33px;
  }

  .hero-lead {
    font-size: 13.5px;
  }

  .search-box .search-btn {
    padding: 9px 13px;
  }

  .hot-grid,
  .stat-strip {
    grid-template-columns: 1fr;
  }

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

  .quote-table .hide-sm {
    display: none;
  }

  .toolbar .text-input {
    width: 100%;
  }

  .toolbar-spacer {
    margin-left: 0;
  }

  .market-cell {
    max-width: 180px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 5px;
  }
}
