:root {
  --bg: #f4f1ea;
  --bg2: #ebe6dc;
  --card: #fffdf8;
  --ink: #3f3c38;
  --muted: #7d776e;
  --line: #e5dfd4;
  --accent: #4f7a66;
  --accent-soft: #e4efe8;
  --hp: #c45c4a;
  --hg: #c9953a;
  --sa: #6d6aad;
  --chip: #f7f3eb;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
body {
  background:
    radial-gradient(900px 420px at 50% -8%, #fffaf0 0%, transparent 70%),
    var(--bg);
}
.parchment {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px 22px 72px;
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px 0 12px;
  background: linear-gradient(180deg, #f4f1ea 70%, rgba(244,241,234,0));
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid #cfe0d6;
}
h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: .04em;
  color: var(--ink);
  font-weight: 700;
}
.sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.search-wrap { position: relative; margin: 14px 0 10px; }
#q {
  width: 100%;
  font-size: 16px;
  padding: 11px 14px 11px 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237d776e' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3-3'/></svg>") no-repeat 12px 50%;
  color: var(--ink);
  outline: none;
}
#q:focus { border-color: #9bb9ab; box-shadow: 0 0 0 3px rgba(79,122,102,.15); }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  max-height: 360px;
  overflow: auto;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(50,40,20,.08);
}
.suggest button {
  display: flex; gap: 10px; align-items: center;
  width: 100%; text-align: left;
  border: 0; background: transparent;
  padding: 8px 12px; cursor: pointer; color: var(--ink);
}
.suggest button:hover, .suggest button.active { background: var(--accent-soft); }
.suggest img { width: 36px; height: 36px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.chip, #modFilter {
  background: var(--chip);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
}
.chip.on { background: var(--accent-soft); color: #2f5a48; border-color: #b7d0c4; }
#modFilter { border-radius: 8px; max-width: 220px; background: #fff; }

.hero { padding: 4px 0 10px; min-height: 0; }
.hero-card, .hero-simple {
  display: flex; gap: 22px; align-items: flex-start;
  background: none;
  border: 0;
  padding: 4px 0 12px;
  flex-wrap: wrap;
}
.ibox {
  width: 220px;
  flex: 0 0 220px;
  text-align: center;
}
.ibox-icon img { width: 84px; height: 84px; object-fit: contain; }
.ibox h2 { margin: 6px 0 0; font-size: 20px; }
.ibox-en { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.ibox-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  margin-top: 8px;
}
.ibox-table th {
  color: var(--muted);
  font-weight: 500;
  width: 38%;
  padding: 3px 8px 3px 0;
  vertical-align: top;
}
.ibox-table td { padding: 3px 0; color: var(--ink); }
.ibox-table code { font-size: 12px; color: var(--muted); }
.hero-text h2 { margin: 0 0 4px; font-size: 26px; color: var(--ink); }
.hero-text p { margin: 8px 0 0; color: #5c5852; max-width: 760px; line-height: 1.6; }
.muted { color: var(--muted); font-size: 13px; }
.d-en, .d-id { color: var(--muted); font-size: 13px; }

.tri {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin: 6px 0 4px;
}
.tri-i {
  min-width: auto;
  background: none;
  border: 0;
  padding: 0;
}
.tri-i span { display: block; font-size: 12px; color: var(--muted); }
.tri-i b { font-size: 22px; font-weight: 700; }
.tri-i.hp b { color: var(--hp); }
.tri-i.hg b { color: var(--hg); }
.tri-i.sa b { color: var(--sa); }

.stats {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 8px 0 4px;
}
.stat {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
}
.stat em { font-style: normal; color: var(--muted); font-size: 12px; }
.funcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.func {
  background: var(--accent-soft);
  color: #2f5a48;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

.results { display: flex; flex-direction: column; gap: 18px; }
.group-title { display: none; }
.recipe-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 2px 0 6px;
  background: none;
  border: 0;
  border-radius: 0;
}
.row-meta {
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  padding-left: 4px;
}
.ings, .prod, .mid {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.mid { margin: 0 6px; min-width: 110px; justify-content: center; }

.item {
  width: 96px;
  text-align: center;
  cursor: pointer;
  background: none; border: 0; color: inherit;
  padding: 0;
}
.item:hover img { transform: scale(1.04); }
.frame {
  width: 72px; height: 72px;
  margin: 0 auto 4px;
  background: #fff;
  border: 0;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.frame img {
  width: 58px; height: 58px;
  object-fit: contain;
}
.item .label {
  font-size: 12px;
  color: var(--ink);
  line-height: 1.3;
}
.station {
  display: flex; flex-direction: column; align-items: center;
  min-width: 100px;
  cursor: pointer;
  background: none; border: 0; color: inherit;
}
.station img {
  width: 72px; height: 72px; object-fit: contain;
}
.station .sname {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.handcraft {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}
.arrows {
  width: 36px; height: 22px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 22'><path d='M4 11h24' stroke='%239aa197' stroke-width='2' fill='none'/><path d='M22 5l8 6-8 6' stroke='%239aa197' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
}
.arrows.left { transform: scaleX(-1); }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  border: 1px solid var(--line);
}
.cook-stats { font-size: 12px; color: var(--muted); margin-top: 4px; }
.empty {
  padding: 36px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  padding: 4px 0 20px;
}
.browse-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.browse-grid.compact .item { width: 88px; }
.browse-grid.compact .frame { width: 64px; height: 64px; }
.browse-grid.compact .frame img { width: 56px; height: 56px; }
.hint { margin: 4px 0 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.text-link {
  background: none; border: 0; padding: 0; margin: 0 2px;
  color: var(--accent); font: inherit; font-weight: 700;
  text-decoration: underline; cursor: pointer;
}
.need {
  width: 100%;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

@media (max-width: 720px) {
  .frame, .item { width: 80px; }
  .frame { width: 68px; height: 68px; }
  .frame img { width: 52px; height: 52px; }
  h1 { font-size: 18px; }
}
