/* ================================================================
   藏宝阁数据平台 — 轻盈白昼
   Fonts: JetBrains Mono (数字) + Noto Sans SC (中文)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* ===== Design Tokens ===== */
:root {
  --bg:           #F5F8FF;
  --bg-card:      #FFFFFF;
  --bg-hover:     #EDF3FF;
  --bg-input:     #FFFFFF;
  --bg-stripe:    rgba(15,23,42,0.03);

  --jade:         #10A37F;
  --jade-l:       #34C28F;
  --jade-dim:     rgba(16,163,127,0.14);
  --jade-glow:    0 0 20px rgba(16,163,127,0.2);

  --gold:         #F59E0B;
  --gold-l:       #FBBF24;
  --gold-dim:     rgba(245,158,11,0.14);

  --red:          #EF4444;
  --red-dim:      rgba(239,68,68,0.12);

  --blue:         #3B82F6;
  --blue-dim:     rgba(59,130,246,0.12);

  --purple:       #8B5CF6;
  --purple-dim:   rgba(139,92,246,0.12);

  --text:         #111827;
  --text-mid:     #4B5563;
  --text-muted:   #6B7280;

  --border:       rgba(15,23,42,0.12);
  --border-s:     rgba(15,23,42,0.06);
  --border-jade:  rgba(16,163,127,0.28);

  --shadow-sm:    0 1px 3px rgba(15,23,42,0.07), 0 3px 8px rgba(15,23,42,0.04);
  --shadow-md:    0 2px 6px rgba(15,23,42,0.08), 0 8px 20px rgba(15,23,42,0.06);
  --shadow-lg:    0 4px 12px rgba(15,23,42,0.10), 0 14px 30px rgba(15,23,42,0.06);

  --ink:          #111827;
  --ink-mid:      #4B5563;
  --ink-light:    #6B7280;
  --blue-ink:     #3B82F6;
  --vermilion:    #F97316;
  --amber:        #D97706;

  --radius:       10px;
  --radius-sm:    6px;
  --radius-xs:    3px;

  --font-body:    'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(100,160,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,160,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ===== Navbar ===== */
#mainNav {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 24px;
  gap: 0;
  max-width: 1600px;
  margin: 0 auto;
}

/* 品牌区 */
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding-right: 24px;
  border-right: 1px solid var(--border);
  margin-right: 4px;
  flex-shrink: 0;
}
.brand-seal {
  width: 32px; height: 32px;
  background: var(--jade-dim);
  border: 1px solid var(--border-jade);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--jade);
  font-size: .9rem;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
  line-height: 1;
}
.brand-tagline {
  font-family: var(--font-body);
  font-size: .68rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1;
  margin-top: 3px;
}

/* 导航链接 */
.nav-collapse {
  flex: 1;
  display: flex;
  align-items: stretch;
}
.nav-links {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0; padding: 0;
  gap: 0;
}
.nav-links li { display: flex; }
.nav-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  font-size: .88rem;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.nav-links a i { font-size: .9rem; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active {
  color: var(--jade);
  border-bottom-color: var(--jade);
  font-weight: 600;
}

/* 右侧状态区 */
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 20px;
  margin-left: auto;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.freshness-dot {
  width: 6px; height: 6px;
  background: var(--jade);
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  animation: pulse-dot 2s infinite;
  box-shadow: 0 0 6px var(--jade);
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}
.freshness-text {
  font-size: .76rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}
.server-tag {
  font-size: .74rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(245,166,35,0.25);
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  letter-spacing: .02em;
}

/* Mobile toggler */
.nav-toggler {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-mid);
}
@media (max-width: 768px) {
  .nav-toggler { display: flex; align-items: center; }
  .nav-collapse {
    display: none;
    flex: none;
    position: absolute;
    top: 54px; left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    z-index: 999;
  }
  .nav-collapse.open { display: block; }
  .nav-links { flex-direction: column; }
  .nav-links a { padding: 10px 24px; border-bottom: none; }
  .nav-links a.active { background: var(--jade-dim); color: var(--jade); }
  .nav-right { padding: 10px 24px; border-left: none; border-top: 1px solid var(--border); }
}

/* ===== Layout ===== */
.main-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 1.1em;
  background: var(--jade);
  border-radius: 2px;
  vertical-align: text-bottom;
  box-shadow: var(--jade-glow);
}
.page-meta {
  font-size: .78rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}

/* ===== Stat Cards ===== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.c-red::after   { background: var(--red);  box-shadow: 0 0 12px var(--red); }
.stat-card.c-green::after { background: var(--jade); box-shadow: 0 0 12px var(--jade); }
.stat-card.c-amber::after { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.stat-card.c-blue::after  { background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-jade);
}

.stat-card .card-icon {
  font-size: 1.25rem;
  margin-bottom: 12px;
  display: block;
  opacity: .7;
}
.stat-card.c-red    .card-icon { color: var(--red); }
.stat-card.c-green  .card-icon { color: var(--jade); }
.stat-card.c-amber  .card-icon { color: var(--gold); }
.stat-card.c-blue   .card-icon { color: var(--blue); }

.stat-card .card-value {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -.02em;
}
.stat-card .card-label {
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 400;
}
.stat-card .card-sub {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-s);
  font-size: .76rem;
  color: var(--text-mid);
}

/* ===== Panel ===== */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.panel-title {
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title i { color: var(--jade); font-size: .88rem; }
.panel-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 6px;
}
.panel-title select {
  margin-left: auto;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: .76rem;
  font-family: var(--font-body);
}

/* ===== Data Tables ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}
.data-table thead th {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .78rem;
  color: var(--text-muted);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(180deg, rgba(15,23,42,0.02), transparent);
}
.data-table thead th:hover { color: var(--jade); }
.data-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-s);
  vertical-align: middle;
  color: var(--text);
  font-size: .86rem;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg-stripe); }
.data-table tbody tr:nth-child(even) td { background: var(--bg-stripe); }
.data-table tbody tr:hover td { background: var(--bg-hover) !important; }
.data-table tbody tr { transition: background .12s; }

/* 列表公共样式：图片和名称可分别交互 */
.item-list-table {
  width: 100%;
  table-layout: fixed;
  min-width: 980px;
}
.item-list-table th,
.item-list-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-list-table .list-thumb-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
.item-list-table .list-thumb {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  border-radius: 4px;
  background: var(--bg-input);
}
.item-list-table .list-thumb-empty {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: .95rem;
}
.item-list-table .list-name-link {
  color: var(--text);
  text-decoration: none;
}
.item-list-table .list-name-link:hover {
  color: var(--jade);
  text-decoration: underline;
}

.item-list-table-lingshi { min-width: 1040px; }
.item-list-table-lingshi .col-thumb { width: 52px; }
.item-list-table-lingshi .col-name { width: 230px; }
.item-list-table-lingshi .col-kind { width: 140px; }
.item-list-table-lingshi .col-level { width: 64px; }
.item-list-table-lingshi .col-price { width: 118px; }
.item-list-table-lingshi .col-refine { width: 74px; }
.item-list-table-lingshi .col-stats { width: 170px; }
.item-list-table-lingshi .col-effect { width: 230px; }
.item-list-table-lingshi .col-seller { width: 150px; }

.item-list-table-yupo { min-width: 1180px; }
.item-list-table-yupo .col-thumb { width: 52px; }
.item-list-table-yupo .col-name { width: 250px; }
.item-list-table-yupo .col-kind { width: 150px; }
.item-list-table-yupo .col-price { width: 118px; }
.item-list-table-yupo .col-addon { width: 260px; }
.item-list-table-yupo .col-seller { width: 150px; }
.item-list-table-yupo .col-time { width: 150px; }

.item-list-table-equip { min-width: 1200px; }
.item-list-table-equip .col-thumb { width: 52px; }
.item-list-table-equip .col-name { width: 220px; }
.item-list-table-equip .col-kind { width: 108px; }
.item-list-table-equip .col-level { width: 56px; }
.item-list-table-equip .col-wuxing { width: 58px; }
.item-list-table-equip .col-price { width: 112px; }
.item-list-table-equip .col-refine { width: 78px; }
.item-list-table-equip .col-teji { width: 195px; }
.item-list-table-equip .col-texiao { width: 180px; }
.item-list-table-equip .col-seller { width: 150px; }
.item-list-table-equip .col-time { width: 145px; }

/* ===== Badges ===== */
.badge-kind {
  display: inline-block;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.2);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: .72rem;
  font-family: var(--font-body);
  font-weight: 500;
}
.badge-server {
  display: inline-block;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(245,158,11,0.2);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: .72rem;
}
.badge-discount {
  display: inline-block;
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: .72rem;
  font-weight: 700;
}
.badge-tag {
  display: inline-block;
  background: var(--bg-hover);
  color: var(--text-mid);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: .72rem;
}

/* ===== Price Colors ===== */
.price-main  { font-family: var(--font-mono); font-size: 1rem; font-weight: 600; color: var(--gold); }
.price-up    { font-family: var(--font-mono); color: var(--red);  font-weight: 600; }
.price-down  { font-family: var(--font-mono); color: var(--jade); font-weight: 600; }
.price-muted { font-family: var(--font-mono); color: var(--text-muted); }

/* ===== Filter Bar ===== */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  box-shadow: var(--shadow-sm);
}
.filter-group label {
  display: block;
  font-size: .76rem;
  font-family: var(--font-body);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 5px;
}
.filter-group select,
.filter-group input[type="number"],
.filter-group input[type="text"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: .86rem;
  font-family: var(--font-body);
  min-width: 110px;
  transition: border-color .15s, box-shadow .15s;
}
.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--jade);
  box-shadow: 0 0 0 3px var(--jade-dim);
}
.filter-group select option { background: var(--bg-card); }

/* ===== Buttons ===== */
.btn-primary-cbg {
  background: var(--jade);
  color: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-size: .86rem;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.btn-primary-cbg:hover {
  background: var(--jade-l);
  box-shadow: var(--jade-glow);
}
.btn-outline-cbg {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  font-size: .86rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-outline-cbg:hover { border-color: var(--jade); color: var(--jade); }

/* ===== Pagination ===== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-s);
  font-size: .76rem;
  color: var(--text-muted);
}
.page-btns { display: flex; gap: 4px; }
.page-btn {
  min-width: 30px; height: 30px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .78rem;
  font-family: var(--font-body);
  transition: all .12s;
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover, .page-btn.active {
  border-color: var(--jade);
  color: var(--jade);
  background: var(--jade-dim);
}
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ===== Chart Containers ===== */
.chart-box    { width: 100%; height: 320px; }
.chart-box-lg { width: 100%; height: 420px; }
.chart-box-sm { width: 100%; height: 240px; }

/* ===== Insight Cards ===== */
.insight-card {
  border-left: 3px solid var(--border);
  background: var(--bg-hover);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: .83rem;
  color: var(--text-mid);
  line-height: 1.5;
}
.insight-card.c-gold  { border-color: var(--gold);   background: var(--gold-dim); }
.insight-card.c-red   { border-color: var(--red);    background: var(--red-dim); }
.insight-card.c-green { border-color: var(--jade);   background: var(--jade-dim); }
.insight-card b { color: var(--text); }

/* ===== Loading ===== */
.loading-spin {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--jade);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Attr Grid ===== */
.attr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 16px;
  font-size: .83rem;
}
.attr-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-s);
}
.attr-label { color: var(--text-muted); }
.attr-value { color: var(--text); font-weight: 500; }
.attr-value.highlight { color: var(--jade); font-family: var(--font-mono); }

/* ===== Modal ===== */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--border-s); padding: 18px 22px; }
.modal-title  { font-family: var(--font-body); font-weight: 700; color: var(--text); }
.modal-body   { padding: 20px 22px; }
.modal-footer { border-top: 1px solid var(--border-s); padding: 14px 22px; }
.btn-close    { filter: invert(1); opacity: .5; }

/* ===== Number Display ===== */
.num-display { font-family: var(--font-mono); font-weight: 700; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--jade); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .main-wrapper { padding: 16px 14px 40px; }
  .attr-grid    { grid-template-columns: repeat(2, 1fr); }
  .chart-box    { height: 240px; }
  .stat-card .card-value { font-size: 2rem; }
}

/* ===== Yin Yang Cards ===== */
.yy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.yy-card.yin  { border-top: 2px solid var(--purple); }
.yy-card.yang { border-top: 2px solid var(--gold); }

/* ===== Item Card Grid ===== */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 12px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  position: relative;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  text-decoration: none;
  display: block;
  overflow: hidden;
}
.item-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--jade-glow), var(--shadow-md);
  border-color: var(--border-jade);
}

/* 五行顶条 */
.item-card .wuxing-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.wx-金 { background: #C8A200; box-shadow: 0 0 8px rgba(200,162,0,.45); }
.wx-木 { background: #00B87A; box-shadow: 0 0 8px rgba(0,184,122,.45); }
.wx-水 { background: #4F88E8; box-shadow: 0 0 8px rgba(79,136,232,.45); }
.wx-火 { background: #E05555; box-shadow: 0 0 8px rgba(224,85,85,.45); }
.wx-土 { background: #9B6A35; box-shadow: 0 0 8px rgba(155,106,53,.45); }

/* 状态角标 */
.item-card .status-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-size: .62rem;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  line-height: 1.5;
}
.status-on   { background: var(--jade-dim);   color: var(--jade); border: 1px solid rgba(16,163,127,.2); }
.status-off  { background: var(--bg-hover);   color: var(--text-muted); }
.status-sold { background: var(--red-dim);    color: var(--red); border: 1px solid rgba(239,68,68,.2); }

/* 图片区 */
.item-card .card-thumb {
  width: 100%;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-stripe);
  border-radius: var(--radius-sm);
  margin: 8px 0;
  overflow: hidden;
  border: 1px solid var(--border-s);
}
.item-card .card-thumb img {
  max-width: 68px;
  max-height: 68px;
  object-fit: contain;
  image-rendering: pixelated;
  transition: transform .2s;
}
.item-card:hover .card-thumb img { transform: scale(1.1); }
.item-card .card-thumb .no-img { font-size: 2rem; opacity: .2; }

/* 文字区 */
.item-card .card-name {
  font-family: var(--font-body);
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.card-thumb-link { display:block; width: 100%; text-decoration: none; }
.card-thumb-link,
.card-name-link {
  display: block;
  color: var(--text);
  text-decoration: none;
}
.card-name-link:hover { color: var(--jade); }
.card-name-link:focus-visible,
.card-thumb-link:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 1px;
}
.item-card .card-meta {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-card .card-price {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
}
.item-card .card-seller {
  font-size: .65rem;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 空状态 */
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: .88rem;
}

/* ===== CBG Hover Tooltip ===== */
#cbgTooltip {
  position: fixed;
  pointer-events: none;
  background: var(--bg-card);
  border: 1px solid var(--border-jade);
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 420px;
  z-index: 9999;
  box-shadow: var(--shadow-lg), var(--jade-glow);
  display: none;
  font-size: .82rem;
  line-height: 1.65;
}
#cbgTooltip.show { display: block; }

.tt-header {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tt-img {
  width: 64px; height: 64px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.tt-img img { max-width: 56px; max-height: 56px; object-fit: contain; image-rendering: pixelated; }
.tt-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .92rem;
  color: var(--text);
  margin-bottom: 3px;
}
.tt-subtitle { font-size: .72rem; color: var(--text-muted); }
.tt-desc { font-size: .74rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

.tt-line { display: block; }
.tt-gold  { color: var(--gold); }
.tt-green { color: var(--jade); }
.tt-blue  { color: var(--blue); }
.tt-pink  { color: var(--purple); }
.tt-white { color: var(--text); }

.tt-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-s);
  font-size: .76rem;
}
.tt-price {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
}
.tt-seller { color: var(--text-mid); font-size: .75rem; margin-top: 3px; }
.tt-link {
  display: inline-block;
  margin-top: 6px;
  font-size: .72rem;
  color: var(--jade);
  text-decoration: underline;
}

/* 视图切换按钮 */
.view-toggle { display: flex; gap: 4px; margin-left: auto; }
.view-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  font-size: .78rem;
  font-family: var(--font-body);
  transition: all .15s;
  display: flex; align-items: center; gap: 4px;
}
.view-btn.active, .view-btn:hover {
  border-color: var(--jade);
  color: var(--jade);
  background: var(--jade-dim);
}

/* ===== Item Detail Page ===== */
.detail-header {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.detail-img {
  width: 96px; height: 96px;
  background: var(--bg-input);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.detail-img img { max-width: 80px; max-height: 80px; object-fit: contain; image-rendering: pixelated; }
.detail-img .no-img { font-size: 2.2rem; opacity: .2; }
.detail-title-wrap { flex: 1; min-width: 0; }
.detail-name {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.badge-level {
  display: inline-block;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(245,158,11,.2);
  padding: 2px 9px;
  border-radius: var(--radius-xs);
  font-size: .76rem;
  font-family: var(--font-mono);
  font-weight: 600;
}
.detail-price {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}
.detail-status {
  display: inline-block;
  font-size: .76rem;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
}
.attr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-s);
  font-size: .86rem;
  gap: 12px;
}
.attr-row:last-child { border-bottom: none; }
.attr-label { color: var(--text-muted); flex-shrink: 0; }
.attr-value { color: var(--text); font-weight: 500; text-align: right; }
.attr-value.highlight { color: var(--jade); font-family: var(--font-mono); }
.attr-value.tt-blue   { color: var(--blue); }
.attr-value.tt-pink   { color: var(--purple); }
.attr-divider { height: 1px; background: var(--border); margin: 4px 0; }
.status-badge {
  display: inline-block;
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  line-height: 1.5;
}

/* ===== Panel tip ===== */
.panel-tip {
  font-size: .68rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}

@media (max-width: 576px) {
  .detail-header { flex-direction: column; }
  .detail-img { width: 72px; height: 72px; }
}
