:root {
  --bg: #f3f6f8;
  --card: #ffffff;
  --ink: #16242b;
  --muted: #6c7d87;
  --line: #e5ebee;
  --accent: #0f766e;
  --accent-soft: #e6f4f1;
  --price: #c2410c;
  --shadow: 0 2px 12px rgba(18, 50, 60, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  padding-bottom: calc(28px + var(--safe-b));
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { display: block; -webkit-user-drag: none; }

.topbar {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar.sticky { position: sticky; top: 0; z-index: 20; box-shadow: 0 4px 16px rgba(15, 94, 89, .18); }
.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; letter-spacing: -.04em;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .01em; }
.topbar p { margin: 0; font-size: 12px; opacity: .78; }
.back {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255, 255, 255, .16);
  display: grid; place-items: center; font-size: 26px; line-height: 1;
}
.back:active { background: rgba(255, 255, 255, .3); }
.page-title { flex: 1; min-width: 0; }
.page-title h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-title p { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-count {
  flex: none; font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .18);
}

.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }

.hero {
  background: linear-gradient(150deg, #ffffff, #eaf5f2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.hero-tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 10px; border-radius: 999px;
}
.hero h2 { margin: 12px 0 6px; font-size: 24px; line-height: 1.3; }
.hero p { margin: 0; color: var(--muted); font-size: 13px; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 2px 12px;
}
.section-title h3 { margin: 0; font-size: 16px; }
.section-title span { color: var(--muted); font-size: 12px; }

.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow); position: relative;
  transition: transform .15s, box-shadow .15s;
}
.cat-card:active { transform: scale(.985); box-shadow: 0 1px 6px rgba(18, 50, 60, .08); }
.cat-thumbs { display: flex; height: 96px; background: #f7fafb; border-bottom: 1px solid var(--line); }
.cat-thumbs img { width: 33.333%; height: 100%; object-fit: contain; padding: 6px; background: #fff; }
.cat-thumbs img + img { border-left: 1px solid var(--line); }
.cat-thumbs .more { flex: 1; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.cat-info { padding: 11px 13px 13px; }
.cat-no { font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: .08em; }
.cat-info h3 { margin: 1px 0 2px; font-size: 16px; }
.cat-info p { margin: 0; font-size: 12px; color: var(--muted); }
.cat-arrow { position: absolute; right: 12px; bottom: 14px; color: #a7b6bd; font-size: 22px; }

.searchbar {
  background: #fff; padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.searchbox {
  max-width: 728px; margin: 0 auto; position: relative;
}
.searchbox input {
  width: 100%; height: 42px; border-radius: 12px;
  border: 1px solid #dbe4e8; background: #f6f9fa;
  padding: 0 42px 0 14px; outline: none; color: var(--ink);
}
.searchbox input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #8ea0a9; font-size: 17px; }
.searchbox input { padding-left: 38px; }
.searchbox .clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent;
  color: #8ea0a9; font-size: 20px; cursor: pointer;
}
.result-line { color: var(--muted); font-size: 12.5px; margin: 0 2px 10px; }

.cards { display: grid; gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden;
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; }
.idx {
  flex: none; min-width: 30px; height: 26px; padding: 0 7px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.card-head h2 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.price {
  flex: none; color: var(--price); font-weight: 700; font-size: 16px;
  background: #fff3ed; padding: 3px 10px; border-radius: 10px;
}
.price:empty { display: none; }
.photo {
  width: calc(100% - 28px); margin: 0 14px; height: 240px;
  border: 1px solid var(--line); border-radius: 12px; background: #f8fafb;
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  cursor: zoom-in; padding: 8px;
}
.photo img { max-width: 100%; max-height: 100%; width: auto; height: auto; min-width: 0; min-height: 0; object-fit: contain; }
.zoom-hint {
  position: absolute; right: 9px; bottom: 9px; font-size: 11px;
  color: #fff; background: rgba(12, 32, 38, .62); padding: 3px 9px; border-radius: 999px;
}
.no-photo { color: #9aabb3; font-size: 13px; }
.fields { margin: 0; padding: 10px 14px 14px; display: grid; gap: 0; }
.field { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.field:last-child { border-bottom: 0; }
.field dt { flex: none; width: 84px; color: var(--muted); font-size: 12.5px; }
.field dd { margin: 0; flex: 1; min-width: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.field:first-child dd { font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.footer { text-align: center; color: #93a3ab; font-size: 11.5px; margin-top: 26px; line-height: 1.8; }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(7, 16, 20, .985);
  display: flex; flex-direction: column; color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(10px + var(--safe-b));
}
.lightbox[hidden] { display: none; }
.lb-top {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; min-height: 52px;
}
.lb-counter { font-size: 13px; color: #9fb0b8; flex: none; }
.lb-model { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-close {
  flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 20px; cursor: pointer;
}
.lb-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none; user-select: none; position: relative;
}
.lb-stage img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; min-width: 0; min-height: 0;
  object-fit: contain; transform-origin: center center; will-change: transform;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 26px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
}
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-nav:active { background: rgba(255, 255, 255, .32); }
.lb-bottom { flex: none; text-align: center; font-size: 11.5px; color: #8fa1a9; padding: 10px 14px 2px; }

@media (min-width: 560px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .photo { height: 320px; }
  .field dt { width: 110px; }
}
