:root {
  color-scheme: light;
  --ink: #1f2328;
  --muted: #667085;
  --line: #d8dee8;
  --panel: #f7f9fb;
  --accent: #126f83;
  --accent-2: #8a5a12;
  --danger: #b42318;
  --ok: #137333;
  --bg: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.topbar {
  height: 112px;
  position: relative;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  background: #fbfcfd;
}

h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-right {
  display: grid;
  gap: 8px;
  justify-items: end;
  padding-top: 18px;
}

.site-actions {
  position: absolute;
  top: 8px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 24px;
}

.visitor-stat {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.feedback-open {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
  border-color: #b7d5db;
  color: var(--accent);
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 8px;
  min-width: 420px;
}

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

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

.layout {
  height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: 300px minmax(437px, 532px) minmax(420px, 1fr);
  min-height: 620px;
}

.filters, .results, .detail {
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow: auto;
  padding: 16px;
  min-width: 0;
}

.detail {
  border-right: 0;
  border-left: 1px solid var(--line);
  background: #fff;
  padding: 18px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field span {
  font-size: 12px;
  font-weight: 700;
  color: #344054;
}

input, select, textarea, button {
  font: inherit;
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

textarea { resize: vertical; min-height: 132px; }

button {
  border: 1px solid #a7b3c3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  cursor: pointer;
}

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

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.36);
  padding: 16px;
}

.modal.open {
  display: flex;
}

.modal-panel {
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
  padding: 16px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.feedback-form textarea {
  min-height: 118px;
}

.feedback-status {
  min-height: 20px;
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.feedback-status.success {
  color: var(--ok);
}

.feedback-status.error {
  color: var(--danger);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

button.primary:hover {
  color: #fff;
  border-color: #0f5d6f;
  background: #0f5d6f;
}

.mobile-back {
  display: none;
  align-items: center;
  margin: 0 0 14px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.check input { width: auto; }

.note {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 16px;
}

.note h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.warn h2 { color: var(--danger); }

.results {
  overflow: auto;
  background: #fff;
  padding: 16px;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
}

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

.product-card {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  min-height: 188px;
}

.product-card.active { outline: 2px solid var(--accent); border-color: var(--accent); }

.structure-box {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  min-height: 188px;
  border-right: 1px solid var(--line);
}

.structure-box img {
  max-width: 100%;
  max-height: 164px;
  object-fit: contain;
}

.card-body {
  padding: 12px;
  min-width: 0;
}
.card-body h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
}

.meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: #475467;
  font-size: 11px;
  background: #fff;
}

.pill.ok { color: var(--ok); border-color: #98d6ac; background: #f1fbf4; }
.pill.warn { color: var(--accent-2); border-color: #dfc28a; background: #fff8e8; }
.pill.danger { color: var(--danger); border-color: #f0a8a0; background: #fff1f0; }

.empty-detail {
  color: var(--muted);
  font-size: 14px;
  padding: 24px 0;
}

.detail h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.25;
}

.detail-code {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 13px;
}

.detail-image {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0 16px;
  min-height: 220px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.detail-image img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.kv {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 8px 12px;
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; overflow-wrap: anywhere; }

.identifier-list {
  margin: 0;
  padding-left: 18px;
}

.identifier-list li {
  margin-bottom: 6px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.detail-section {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.detail-section p, .detail-section li {
  font-size: 13px;
  line-height: 1.55;
  color: #384250;
}

.detail-section .research-text {
  margin: 0 0 8px;
  line-height: 1.65;
}

.detail-section .research-text:last-child {
  margin-bottom: 0;
}

.detail-section ul {
  margin: 0;
  padding-left: 18px;
}

.source-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-list li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fbfcfd;
}

.source-list strong {
  display: block;
  font-size: 12px;
  color: #344054;
  margin-bottom: 4px;
}

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

.pdf-library {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
}

.pdf-library h2 {
  margin: 0 0 8px;
  font-size: 13px;
}

.pdf-library a {
  display: block;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  border: 1px solid #b7d5db;
  border-radius: 6px;
  background: #fff;
  padding: 7px 8px;
  margin-bottom: 6px;
}

.pdf-evidence-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdf-evidence-list li {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  padding: 9px 10px;
}

.pdf-evidence-list strong,
.pdf-evidence-list span,
.pdf-evidence-list em,
.pdf-evidence-list small {
  display: block;
}

.pdf-evidence-list strong {
  margin-bottom: 3px;
  color: #344054;
  font-size: 12px;
}

.pdf-evidence-list span {
  color: #384250;
  font-size: 12px;
  line-height: 1.45;
}

.pdf-evidence-list em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.pdf-evidence-list small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.pdf-page-links {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.pdf-page-links a {
  color: var(--accent);
  text-decoration: none;
  border: 1px solid #b7d5db;
  border-radius: 6px;
  background: #fff;
  padding: 4px 7px;
  font-size: 12px;
}

.wechat-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.wechat-section-head h3 {
  margin: 0;
}

.wechat-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.wechat-list {
  display: grid;
  gap: 14px;
}

.wechat-card {
  border: 1px solid #cfe0e6;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfeff 0%, #f7fbfc 100%);
  padding: 12px;
}

.wechat-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.wechat-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.35;
}

.wechat-card h4 a {
  color: #0f4e5c;
  text-decoration: none;
}

.wechat-card h4 a:hover {
  text-decoration: underline;
}

.wechat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.wechat-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 2px 7px;
}

.wechat-card-layout {
  display: grid;
  grid-template-columns: minmax(132px, 38%) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.wechat-hero {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.wechat-hero img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  display: block;
  background: #fff;
}

.wechat-hero figcaption {
  border-top: 1px solid var(--line);
  padding: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wechat-summary {
  margin: 0 0 8px;
  color: #263642;
  font-size: 13px;
  line-height: 1.6;
}

.wechat-relevance {
  border-left: 3px solid #94c7cf;
  background: #fff;
  padding: 7px 8px;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #344054;
}

.wechat-relevance strong {
  display: block;
  color: #0f5f6f;
  margin-bottom: 2px;
}

.wechat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 0;
}

.wechat-tags span {
  border: 1px solid #c8d7de;
  border-radius: 999px;
  padding: 2px 7px;
  background: #eef7f8;
  color: #0f5f6f;
  font-size: 12px;
}

.wechat-insights {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.wechat-insight {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 9px 10px;
}

.wechat-insight h5 {
  margin: 0 0 6px;
  font-size: 12px;
  color: #344054;
}

.wechat-insight ul {
  margin: 0;
  padding-left: 18px;
}

.wechat-insight li {
  font-size: 12px;
  line-height: 1.5;
}

.wechat-source-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
  border: 1px solid #b7d5db;
  border-radius: 6px;
  padding: 5px 8px;
  background: #fff;
}

.wechat-card.no-image .wechat-card-layout {
  grid-template-columns: 1fr;
}

.ref-note {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.ref-pdf-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}

.ref-pdf-links span {
  color: var(--muted);
  font-size: 11px;
}

.ref-pdf-links a {
  color: var(--accent);
  text-decoration: none;
  border: 1px solid #b7d5db;
  border-radius: 6px;
  background: #fff;
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1.35;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.links a {
  color: var(--accent);
  text-decoration: none;
  border: 1px solid #b7d5db;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .layout { height: auto; min-height: 0; display: block; }
  .detail { display: none; border-left: 0; min-height: 100vh; }
  body.mobile-detail-open { background: #fff; }
  body.mobile-detail-open .topbar,
  body.mobile-detail-open .filters,
  body.mobile-detail-open .results { display: none; }
  body.mobile-detail-open .layout { display: block; height: auto; min-height: 100vh; }
  body.mobile-detail-open .detail { display: block; width: 100%; padding: 14px; overflow: visible; }
  body.mobile-detail-open .mobile-back { display: inline-flex; }
  body.mobile-detail-open .detail-image { min-height: 180px; padding: 12px; }
  body.mobile-detail-open .detail-image img { max-height: 240px; }
  body.mobile-detail-open .kv { grid-template-columns: 90px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .topbar { height: auto; align-items: flex-start; flex-direction: column; padding: 14px; }
  .topbar-right { width: 100%; justify-items: stretch; padding-top: 0; }
  .site-actions { position: static; justify-content: space-between; }
  .summary { width: 100%; min-width: 0; }
  .layout { height: auto; min-height: 0; display: block; }
  .filters, .results { border: 0; }
  .filters { border-bottom: 1px solid var(--line); }
  .grid { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 1fr; grid-template-rows: 154px auto; min-height: 292px; }
  .structure-box { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; }
  .structure-box img { max-height: 126px; }
  .wechat-section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .wechat-card-layout { grid-template-columns: 1fr; }
  .wechat-hero img { height: 180px; }
}
