/* ==========================================================================
   Minecraft Search 复刻版 — 设计系统
   ========================================================================== */
:root {
  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --bg-sunken: #eceef2;
  --border: #d9dde4;
  --border-strong: #c2c8d2;
  --text: #171a1f;
  --text-muted: #5d646f;
  --text-faint: #636b79;
  --brand: #2f9e44;
  --brand-strong: #1d6a31;
  --brand-soft: #e6f6ea;
  --accent: #6741d9;
  --accent-soft: #efeafd;
  --danger: #c92a2a;
  --warn: #e8590c;
  --info: #1971c2;
  --shadow-sm: 0 1px 2px rgba(16, 20, 28, .06), 0 1px 3px rgba(16, 20, 28, .05);
  --shadow-md: 0 4px 12px rgba(16, 20, 28, .08), 0 2px 4px rgba(16, 20, 28, .04);
  --shadow-lg: 0 12px 32px rgba(16, 20, 28, .14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
:root[data-theme="dark"] {
  --bg: #0f1115;
  --bg-elev: #171a21;
  --bg-sunken: #0a0c10;
  --border: #272c36;
  --border-strong: #363d4a;
  --text: #e8eaee;
  --text-muted: #a2aab8;
  --text-faint: #6f7787;
  --brand: #51cf66;
  --brand-strong: #3fb950;
  --brand-soft: #16281c;
  --accent: #9775fa;
  --accent-soft: #1e1830;
  --danger: #ff6b6b;
  --warn: #ffa94d;
  --info: #4dabf7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .9em; }
code, pre { font-family: var(--mono); }
img { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.hidden { display: none !important; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--text); font-size: 1.02rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .cube {
  width: 24px; height: 24px; border-radius: 6px; flex: 0 0 24px;
  background: linear-gradient(140deg, var(--brand) 0%, #2b8a3e 55%, #5c7cfa 100%);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.25);
}
.nav { display: flex; gap: 2px; align-items: center; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 11px; border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: .89rem; font-weight: 600; white-space: nowrap;
}
.nav a:hover { background: var(--bg-sunken); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand-strong); }
.header-actions { display: flex; gap: 6px; align-items: center; }
.iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-muted);
  cursor: pointer; font-size: .95rem; padding: 0; line-height: 1;
}
.iconbtn:hover { background: var(--bg-sunken); color: var(--text); }
.langbtn { width: auto; padding: 0 10px; font-weight: 700; font-size: .82rem; }

/* ---------- Search ---------- */
.searchbar { position: relative; flex: 1; max-width: 420px; }
.searchbar input {
  width: 100%; padding: 8px 12px 8px 34px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-sunken); color: var(--text); font-size: .9rem;
}
.searchbar input:focus { outline: 2px solid var(--brand); outline-offset: -1px; background: var(--bg-elev); }
.searchbar .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: .85rem; pointer-events: none; }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 80;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-height: 62vh; overflow: auto; padding: 5px;
}
.suggest a { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--radius-sm); color: var(--text); }
.suggest a:hover, .suggest a.sel { background: var(--brand-soft); text-decoration: none; }
.suggest .cat { margin-left: auto; font-size: .72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Hero ---------- */
.hero { padding: 52px 0 30px; text-align: center; }
.hero .kicker { color: var(--brand-strong); font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { margin: 10px 0 14px; }
.hero p.lead { max-width: 720px; margin: 0 auto 22px; color: var(--text-muted); font-size: 1.04rem; }
.hero .hero-search { max-width: 560px; margin: 0 auto; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); transition: transform .13s ease, box-shadow .13s ease, border-color .13s;
  display: block; color: inherit;
}
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); text-decoration: none; }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--text-muted); font-size: .89rem; margin: 0; }
.card .tool-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-strong); font-size: 1.1rem; margin-bottom: 11px;
}
.card.tool { display: flex; flex-direction: column; }

.panel {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 1.08rem; margin-bottom: 12px; }

/* ---------- Form ---------- */
label.fld { display: block; font-size: .82rem; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; letter-spacing: .01em; }
input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--text); font-size: .92rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 90px; font-family: var(--mono); font-size: .88rem; }
.field { margin-bottom: 13px; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); font-size: .9rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg-sunken); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev);
  font-size: .82rem; cursor: pointer; color: var(--text-muted); font-weight: 600; user-select: none;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.color { position: relative; padding-left: 24px; }
.chip.color::before { content: ""; position: absolute; left: 7px; top: 50%; transform: translateY(-50%); width: 11px; height: 11px; border-radius: 3px; background: var(--sw, #888); border: 1px solid rgba(0,0,0,.25); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-elev); }
.seg button { padding: 7px 13px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: .85rem; font-weight: 600; font-family: inherit; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--brand); color: #fff; }

/* ---------- Table ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.tbl th, table.tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
table.tbl th { color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
table.tbl tr:hover td { background: var(--bg-sunken); }
.scroll-x { overflow-x: auto; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge.j { background: var(--accent-soft); color: var(--accent); }
.badge.b { background: var(--brand-soft); color: var(--brand-strong); }
.badge.n { background: var(--bg-sunken); color: var(--text-muted); }
.badge.warn { background: #fff4e6; color: var(--warn); }
:root[data-theme="dark"] .badge.warn { background: #2c1d0d; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(70px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: .86rem; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0;
  transition: transform .22s, opacity .22s; z-index: 200; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-faint); }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Prose (SEO 说明区) ---------- */
.prose { max-width: 780px; }
.prose h2 { margin-top: 1.6em; }
.prose p, .prose li { color: var(--text-muted); }
.prose code { background: var(--bg-sunken); padding: 1px 5px; border-radius: 4px; font-size: .87em; }
details.faq { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 9px; background: var(--bg-elev); }
details.faq summary { cursor: pointer; font-weight: 700; font-size: .93rem; }
details.faq p { margin: 9px 0 0; font-size: .89rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 56px; padding: 30px 0 40px; color: var(--text-muted); font-size: .86rem; }
.footer-cols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.footer-cols h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: 6px; }
.footer-cols a { color: var(--text-muted); }

/* ---------- Item detail ---------- */
.detail-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.detail-head img { width: 68px; height: 68px; object-fit: contain; image-rendering: pixelated; }
.avatar {
  width: 68px; height: 68px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg-sunken); font-weight: 800; font-size: 1.4rem; color: var(--text-muted);
}
.stat-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat { background: var(--bg-sunken); border-radius: var(--radius-sm); padding: 9px 12px; }
.stat .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 700; }
.stat .v { font-weight: 700; font-size: .98rem; }

.item-card { display: flex; gap: 11px; align-items: center; padding: 11px; }
.item-card img, .item-card .avatar { width: 34px; height: 34px; border-radius: 8px; image-rendering: pixelated; font-size: .95rem; }
.item-card .nm { font-weight: 600; font-size: .9rem; }
.item-card .sub { font-size: .76rem; color: var(--text-faint); }

/* ---------- Map ---------- */
.map-shell { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #0a0c10; }
.map-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.map-canvas:active { cursor: grabbing; }
.map-overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.map-hud {
  position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 5;
}
.map-hud .iconbtn { background: color-mix(in srgb, var(--bg-elev) 92%, transparent); backdrop-filter: blur(6px); }
.map-status {
  position: absolute; left: 10px; bottom: 10px; z-index: 5; background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 10px; font-size: .78rem; font-family: var(--mono); color: var(--text-muted);
}
.map-legend {
  position: absolute; left: 10px; top: 10px; z-index: 5; max-width: 250px;
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; font-size: .78rem;
  max-height: 55%; overflow: auto;
}
.map-legend .lg { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.map-legend .sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 11px; border: 1px solid rgba(0,0,0,.2); }
.pin-label { font-size: .7rem; }

.copybox { display: flex; gap: 8px; align-items: stretch; }
.copybox pre {
  flex: 1; margin: 0; padding: 11px 13px; background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow-x: auto; font-size: .84rem; white-space: pre-wrap; word-break: break-all;
}

@media (max-width: 720px) {
  .header-inner { gap: 10px; }
  .nav { order: 3; width: 100%; }
  .header-inner { height: auto; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
  .searchbar { max-width: none; }
  .hero { padding: 30px 0 20px; }
}
