:root {
  --navy: #0b1f3a;
  --navy-2: #14345c;
  --blue: #1f6feb;
  --paper: #f4f7fb;
  --card: #ffffff;
  --line: #d5deea;
  --gold: #c4a35a;
  --ink: #142033;
  --muted: #4d6078;
  --ok: #0f7a4a;
  --bad: #9d2c2c;
  --shadow: 0 8px 24px rgba(11, 31, 58, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans", "Noto Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 12.75px;
  line-height: 1.3;
}
a { color: var(--navy-2); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.top { background: var(--navy); color: #fff; padding: 2px 8px; position: sticky; top: 0; z-index: 20; }
.top-row { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; overflow-x: auto; }
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: 0.04em; font-size: 13px; white-space: nowrap; flex: 0 0 auto; }
.menu-toggle { margin: 0; flex: 0 0 auto; }
header.top .btn.push {
  background: #fff;
  color: #142033;
  border: 1px solid #fff;
  height: 26px;
  line-height: 24px;
  padding: 0 10px;
  font-size: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
header.top .btn.push.on {
  background: var(--gold);
  color: #142033;
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.28);
}
.brand span { color: var(--gold); }
header.top a.market-nav {
  background: var(--gold);
  color: #142033;
  height: 26px;
  line-height: 24px;
  padding: 0 10px;
  font-size: 12px;
  flex: 0 0 auto;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
}
header.top a.market-nav.on { box-shadow: inset 0 2px 0 rgba(0,0,0,0.28); }
header.top a.prequal-nav {
  background: transparent;
  color: #fff;
  border: 1px solid var(--gold);
  height: 26px;
  line-height: 22px;
  padding: 0 10px;
  font-size: 12px;
  flex: 0 0 auto;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
}
header.top a.prequal-nav.on { background: var(--gold); color: #142033; }
.idx-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.idx-photos img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; display: block; }
.idx-frame { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
body.idx { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.idx main { flex: 1 1 auto; min-height: 0; display: flex; }
body.idx .idx-frame { flex: 1 1 auto; min-height: 0; }
table.data td.wrap { white-space: normal; }
.tools { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; margin-left: auto; flex: 0 0 auto; }
.langtools { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; margin-right: 18px; }
.loginbar { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
.loginbar input { width: 128px; height: 28px; padding: 4px 8px; border-radius: 4px; border: 0; font-size: 13px; }
.who { font-size: 11px; white-space: nowrap; }
.who a { color: #fff; }
.menu { display: flex; gap: 3px; overflow-x: auto; padding: 0; flex: 1 1 auto; min-width: 0; }
.menu a, .menu button.locked {
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 0 7px;
  height: 18px;
  line-height: 16px;
  white-space: nowrap;
  font-size: 11px;
}
.menu a.active, .menu a:hover { background: #fff; color: var(--navy); }
.menu button.locked { opacity: 0.55; cursor: not-allowed; }
.btn, button.btn {
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 3px 8px;
  height: 20px;
  line-height: 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}
.btn.es { background: #fff; color: var(--navy); letter-spacing: 0.04em; padding: 0 6px; height: 18px; line-height: 18px; font-size: 10px; }
.btn.light { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn.gold { background: var(--gold); color: #142033; }
.btn.small { padding: 0 6px; height: 20px; line-height: 20px; font-size: 11px; }
.btn.bad { background: var(--bad); }
select.langpick, .langpick select, #lang-select {
  background: #fff;
  color: var(--navy);
  border: 0;
  border-radius: 4px;
  padding: 0 3px;
  height: 18px;
  font-size: 10px;
  max-width: 86px;
}

.banner { margin: 4px 8px 0; padding: 4px 8px; border-radius: 6px; background: #fff7e8; border: 1px solid #efd7a4; font-size: 12px; }
.flash { margin: 4px 8px 0; padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.flash.ok { background: #e7f6ee; color: var(--ok); }
.flash.bad { background: #fdecec; color: var(--bad); }

.stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 6px;
}
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; box-shadow: var(--shadow); }
.panel h1, .panel h2, .panel h3 { margin: 0 0 3px; line-height: 1.15; }
h1 { font-size: 1.05rem; color: var(--navy); }
h2 { font-size: 0.92rem; color: var(--navy); }
.muted { color: var(--muted); font-size: 0.85em; }
.col-side { font-size: 12.75px; }
.col-side h1 { font-size: 14px; }
.col-side h2 { font-size: 13px; }
.col-side p, .col-side .muted { margin: 2px 0; font-size: 12.75px; }
.lead-form label, .stack label, .formgrid label { display: block; font-size: 12px; font-weight: 700; margin: 3px 0 1px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
select, textarea {
  padding: 2px 6px;
  border: 1px solid #b7c3d4;
  border-radius: 4px;
  background: #fff;
  line-height: 1.15;
  font-size: 12px;
}
.lead-form input:not([type="checkbox"]):not([type="hidden"]),
.lead-form select, .lead-form textarea,
.stack input, .stack select, .stack textarea,
.formgrid input, .formgrid select, .formgrid textarea {
  width: 100%;
  height: 20px;
  padding: 1px 6px;
}
textarea, .lead-form textarea, .stack textarea, .formgrid textarea { height: auto; min-height: 44px; }
.top input, .top select { border: 0; }
header.top .loginbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]) {
  color: #142033;
  background: #fff;
  caret-color: #142033;
  -webkit-text-fill-color: #142033;
  width: 128px;
  height: 28px;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 18px;
}
header.top .loginbar input::placeholder { color: #5c6b80; opacity: 1; }
header.top .loginbar input:-webkit-autofill {
  -webkit-text-fill-color: #142033;
  box-shadow: 0 0 0 1000px #fff inset;
}
header.top .loginbar .btn { background: var(--gold); color: #142033; height: 28px; line-height: 28px; }
.checks { display: flex; flex-direction: column; gap: 1px; font-size: 12px; margin: 3px 0; }
.checks label { font-weight: 500; display: flex; gap: 4px; align-items: center; margin: 0; white-space: nowrap; }
.checks input { width: 13px; height: 13px; margin: 0; flex: 0 0 auto; }
.trust { display: flex; flex-wrap: nowrap; gap: 3px; margin-top: 4px; overflow-x: auto; }
.chip {
  background: #e8eef8;
  color: var(--navy);
  border-radius: 999px;
  padding: 0 6px;
  height: 18px;
  line-height: 16px;
  font-size: 11px;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip.on { background: var(--navy); color: #fff; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.col-main { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 4px; min-height: 0; }
.showcase {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  max-height: 72.6vh;
}
.showcase-info {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 72.6vh;
  order: 2;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}
.showcase-info h2 { margin: 0 0 4px; font-size: 15px; }
.showcase-meta, .showcase-details, .showcase-text { margin: 0 0 4px; font-size: 12px; line-height: 1.3; }
.showcase-text { color: var(--muted); }
.showcase-thumbs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 6px;
  margin-top: 6px;
  width: 100%;
  align-content: start;
}
.showcase-thumbs img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: var(--navy);
  display: block;
}
.film {
  position: relative;
  flex: 0 0 auto;
  order: 1;
  background: #081422;
  border-radius: 8px;
  overflow: hidden;
  width: min(75.02%, calc(72.6vh * 16 / 9));
  max-height: 72.6vh;
  aspect-ratio: 16 / 9;
  height: auto;
}
.film img { width: 100%; height: 100%; object-fit: contain; object-position: center center; display: block; background: #081422; }
.filmbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.25); }
.filmbar span { display: block; height: 3px; width: 0; background: var(--gold); }
.film button[data-pause] {
  position: absolute; right: 6px; top: 6px;
  background: rgba(11,31,58,0.72); color: #fff; border: 0; border-radius: 999px; padding: 1px 6px; font-size: 11px; cursor: pointer;
}
.filmcap { position: absolute; left: 8px; bottom: 8px; color: #fff; font-size: 0.75rem; text-shadow: 0 1px 2px #000; }

.filterbar { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0 0 3px; min-height: 20px; overflow-x: auto; }
.filterbar .prompt { margin: 0; white-space: nowrap; font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.filters { display: flex; flex-wrap: nowrap; gap: 3px; margin: 0; }
.inv-panel { display: flex; flex-direction: column; min-height: 0; padding: 4px 6px; }
.inv-scroll { overflow: auto; max-height: 520px; flex: 1 1 auto; min-height: 0; }
.inv-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 1px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  font-size: 12px;
  line-height: 1.15;
}
.inv-line { display: flex; align-items: center; gap: 8px; white-space: nowrap; min-width: 0; }
.inv-line > b, .inv-line > span:not(.inv-details) { flex: 0 0 auto; }
.inv-details { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.inv-year { color: var(--muted); }
.inv-row img, .ph {
  width: 36px; height: 24px; object-fit: cover; border-radius: 3px; background: var(--navy);
}
.ph { display: block; }
.inv-row b { color: var(--navy); }
.price { font-weight: 800; color: var(--navy); white-space: nowrap; }

.wrap { padding: 6px; display: grid; gap: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.stat { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font-size: 1.35rem; color: var(--navy); }
.stat span { color: var(--muted); font-size: 0.75rem; }
.browse-tall, .browse {
  max-height: 1120px;
  overflow: scroll;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
}
table.data { width: 100%; border-collapse: collapse; min-width: 720px; }
table.data th, table.data td { padding: 2px 5px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 12px; white-space: nowrap; }
table.data img { width: 36px; height: 24px; object-fit: cover; border-radius: 3px; display: block; }
table.data th { position: sticky; top: 0; background: var(--navy); color: #fff; z-index: 1; }
table.data tr:nth-child(even) td { background: #f7faff; }
.group td { background: #e7eef8 !important; font-weight: 800; color: var(--navy); }
.formgrid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.gallery { display: grid; grid-template-columns: 1fr; gap: 8px; }
.gallery .heroimg { width: 100%; height: 240px; object-fit: cover; border-radius: 10px; background: var(--navy); }
.thumbs { display: flex; gap: 6px; overflow-x: auto; }
.thumbs img { width: 84px; height: 60px; object-fit: cover; border-radius: 6px; cursor: pointer; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.facts span { background: #e8eef8; border-radius: 6px; padding: 4px 8px; font-size: 0.82rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chart { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
footer.site { padding: 3px 8px; color: var(--muted); font-size: 11px; }
footer.site a { color: var(--navy); }

body.home { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.home main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
body.home .stage { flex: 1 1 auto; min-height: 0; height: auto; }
body.home .banner, body.home .flash { flex: 0 0 auto; }

@media (min-width: 900px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(268px, 312px);
    min-height: 0;
  }
  .col-main { order: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .col-side { order: 2; overflow: auto; min-height: 0; }
  .film { height: auto; max-height: 72.6vh; }
  .showcase { max-height: 72.6vh; }
  .inv-scroll { max-height: none; height: 100%; }
  .formgrid { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1.4fr 0.8fr; align-items: start; }
  .span2 { grid-column: 1 / -1; }
}
@media (max-width: 899px) {
  body.home { height: auto; overflow: auto; }
  .top-row { overflow-x: auto; }
  .loginbar input, header.top .loginbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]) { width: 96px; }
  .showcase { flex-direction: column; max-height: none; }
  .film { width: min(100%, calc(72.6vh * 16 / 9)); }
  .showcase-info { max-height: none; }
}
