:root {
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --ink: #1c2422;
  --muted: #5b655f;
  --line: #d9d2c5;
  --teal: #0f6b78;
  --teal-dark: #0b4f59;
  --amber: #8a5a12;
  --warn: #8b3d2a;
  --ok: #1f6b4a;
  --chip: #e8f3f1;
  --shadow: 0 10px 30px rgba(28, 36, 34, 0.08);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.5 "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  min-height: 100dvh;
}
a { color: var(--teal-dark); }
img { max-width: 100%; height: auto; display: block; }
.top {
  background: var(--teal-dark);
  color: #f6fffd;
  padding: 14px 16px 10px;
  padding-top: max(14px, env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: 0.02em; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  color: #e8fffb;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 14px;
}
.nav a.active, .nav a:hover { background: #fff; color: var(--teal-dark); }
.eyebrow { margin: 8px 0 0; font-size: 12px; color: #d7efe9; }
.app { max-width: 1100px; margin: 0 auto; padding: 16px; padding-bottom: 48px; }
.foot { max-width: 1100px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 12px; }
h1 { font-size: 1.45rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 20px 0 8px; }
.lede, .note, .muted { color: var(--muted); }
.note { font-size: 13px; background: #fff7e8; border: 1px solid #ead7b0; padding: 10px 12px; border-radius: 12px; }
.searchbar, .panel, .card, .detail-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.searchbar { padding: 12px; display: grid; gap: 8px; }
input, select, button, textarea {
  font: inherit;
  font-size: 16px;
}
input[type="search"], select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.filters { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 720px) {
  .filters { grid-template-columns: 1fr 1fr 1fr; }
}
.btn {
  appearance: none;
  border: 0;
  background: var(--teal);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}
.btn.secondary { background: #efe8da; color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  background: var(--chip);
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
.chip.warn { background: #f8e8e4; color: var(--warn); }
.chip.amber { background: #f4ead6; color: var(--amber); }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }
.card { overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.card .thumb, .hero-img {
  background: #ecf0ee;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.card img, .hero-img img { width: 100%; height: 180px; object-fit: contain; background: #f2f4f3; }
.hero-img img { height: auto; max-height: 360px; }
.placeholder {
  color: var(--muted);
  font-size: 14px;
  padding: 24px;
  text-align: center;
}
.card-body, .panel { padding: 12px; }
.kicker { font-size: 12px; color: var(--muted); }
.card h3, .detail-card h2 { margin: 4px 0; font-size: 1.05rem; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.field-group { margin-top: 18px; }
.field-table, .sheet-table, .ship-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.field-table th, .field-table td, .sheet-table th, .sheet-table td, .ship-table th, .ship-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.field-table th { width: 38%; color: var(--muted); font-weight: 550; }
.scroll { overflow: auto; -webkit-overflow-scrolling: touch; max-height: 70dvh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sheet-table { min-width: 720px; }
.sheet-table th { position: sticky; top: 0; background: #edf4f3; z-index: 1; }
.compare { display: grid; gap: 12px; }
@media (min-width: 800px) { .compare { grid-template-columns: 1fr 1fr; } }
.diff { background: #fff4d6; }
.hero { display: grid; gap: 16px; }
@media (min-width: 800px) { .hero { grid-template-columns: 1.1fr 1fr; } }
.picker { display: grid; gap: 8px; }
.list-choice {
  display: block;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.hl { background: #e7f6c8; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.err { color: var(--warn); }
