:root {
  --bg: #eceef1;
  --box: #fff;
  --line: #dcdfe4;
  --line-2: #eef0f2;
  --ink: #23272f;
  --ink-2: #4a505c;
  --muted: #959ba6;
  --slate: #3b4252;
  --slate-2: #2c3240;
  --pin: #fffbea;
  --price-bg: #e9eef7;
  --price: #2d3e5f;
  --ok: #2f7d4f;
  --warn: #a86b12;
  --bad: #b8392b;
  --brand: #F26522;
  --brand-2: #D9531A;
  --brand-soft: #FFF1E9;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); line-height: 1.55;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.wrap { width: min(1040px, 100% - 24px); margin: 0 auto; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid #5b7bd5; outline-offset: 2px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--slate); color: #fff; border: 1px solid var(--slate); border-radius: 4px;
  padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--slate-2); }
.btn--sm { padding: 5px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn--ghost:hover { background: #f5f6f8; }
.btn--ok { background: var(--ok); border-color: var(--ok); }
.btn--brand { background: var(--brand); border-color: var(--brand); }
.btn--brand:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn--ok:hover { background: #276b43; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: #3d5a9e; cursor: pointer; }
.linkbtn:hover, .a:hover { text-decoration: underline; }
.a { color: #3d5a9e; }

input, select, textarea {
  font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid #cfd4db; border-radius: 4px;
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #7d8ba5; box-shadow: 0 0 0 3px rgba(91, 123, 213, .15); }
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }

/* ---------- header ---------- */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top__in { display: flex; align-items: center; gap: 22px; height: 52px; }
.logo { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.logo__mark { width: 34px; height: 34px; margin-left: -4px; }
.logo__cn { font-weight: 800; font-size: 20px; letter-spacing: 2px; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 5px 10px; border-radius: 4px; font-size: 14px; color: var(--ink-2); }
.nav a:hover { background: #f1f2f4; }
.nav a.active { background: var(--slate); color: #fff; }
.top__search { width: 220px; border-radius: 15px; background: #f3f4f6; border-color: #e3e6ea; padding: 5px 13px; font-size: 13px; }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--ink-2); }
.top__right a.active { color: var(--ink); font-weight: 600; }

/* ---------- layout ---------- */
#app { display: grid; grid-template-columns: 1fr 260px; gap: 18px; padding-top: 18px; align-items: start; }
#app.single { grid-template-columns: 1fr; }
.main { min-width: 0; }
.side { display: grid; gap: 14px; }
.box { background: var(--box); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.box + .box { margin-top: 14px; }
.box__h { padding: 11px 14px; border-bottom: 1px solid var(--line-2); font-size: 14px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.box__h b { color: var(--ink); font-size: 15px; }
.box__b { padding: 14px; font-size: 14px; }
.box__b p + p { margin-top: 6px; }

/* ---------- hall ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.tabs button { background: none; border: 0; font: inherit; font-size: 14px; padding: 3px 10px; border-radius: 3px; color: var(--ink-2); cursor: pointer; }
.tabs button:hover { background: #f1f2f4; }
.tabs button.on { background: var(--slate); color: #fff; }

.row { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); align-items: center; }
.row:last-child { border-bottom: 0; }
.row:hover { background: #fafbfc; }
.row__t { font-size: 15.5px; color: var(--ink); line-height: 1.4; word-break: break-word; }
.row:visited .row__t { color: #6b7280; }
.row--closed .row__t { color: var(--muted); }
.meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.node { background: #f0f1f3; color: #666b75; padding: 0 6px; border-radius: 3px; }
.price { background: var(--price-bg); color: var(--price); font-weight: 600; font-size: 13px; border-radius: 10px; padding: 2px 10px; white-space: nowrap; }
.row--closed .price { background: #f0f1f3; color: #a2a7b0; font-weight: 500; }
.empty { padding: 40px 14px; text-align: center; color: var(--muted); font-size: 14px; }

.av { width: 42px; height: 42px; border-radius: 4px; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 17px; flex: none; }
.av--sm { width: 22px; height: 22px; font-size: 12px; border-radius: 3px; }

/* ---------- side ---------- */
.side .btn { margin-top: 12px; }
.cats a { display: flex; justify-content: space-between; padding: 7px 14px; border-bottom: 1px solid var(--line-2); font-size: 14px; color: var(--ink-2); }
.cats a:last-child { border-bottom: 0; }
.cats a:hover { background: #fafbfc; }
.cats a.on { color: var(--ink); font-weight: 600; }
.side .gcard { font-size: 12px; }

/* ---------- topic ---------- */
.topic__h { padding: 16px 16px 14px; border-bottom: 1px solid var(--line-2); display: flex; gap: 14px; align-items: flex-start; }
.topic__h h1 { font-size: 21px; line-height: 1.4; font-weight: 600; }
.topic__h .price { font-size: 15px; padding: 4px 12px; margin-left: auto; }
.topic__b { padding: 16px; font-size: 15px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; color: #333842; }
.topic__f { padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; background: #fafbfc; }
.contact { font-size: 16px; font-weight: 600; word-break: break-all; }
.dots { letter-spacing: 3px; color: #b5bac3; }
.st { font-size: 13px; font-weight: 600; }
.st--open { color: var(--ok); }
.st--taken { color: var(--warn); }
.st--done, .st--cancelled { color: var(--muted); }

/* ---------- forms ---------- */
.form { padding: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }
.field small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); margin: 2px 0 16px; }
.check input { width: auto; }
.vb { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 3px; background: #f0f1f3; color: #7b818c; white-space: nowrap; }
.vb--approved { background: #e3f1e8; color: var(--ok); }
.vb--pending { background: #fbf0dc; color: var(--warn); }
.vb--rejected { background: #f8e3e0; color: var(--bad); }
.demo { margin-top: 12px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; padding: 9px 14px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .act { display: flex; gap: 6px; justify-content: flex-end; }

.rules ul { margin: 0; padding: 14px 14px 14px 32px; display: grid; gap: 8px; font-size: 14.5px; color: #3a3f4a; }

/* ---------- shop ---------- */
.shop__note { padding: 12px 14px 0; font-size: 14px; color: var(--ink-2); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.trip { display: inline-flex; align-items: center; gap: 6px; background: #eef3fb; color: #2d4a7c; font-weight: 600; font-size: 13px; padding: 2px 10px; border-radius: 12px; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; padding: 14px; }

.gcard {
  position: relative; aspect-ratio: 1.586; border-radius: 13px; padding: 14px 16px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; text-align: left;
  color: #fff; border: 0; font: inherit; cursor: pointer; width: 100%;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .15), 0 6px 16px rgba(30, 35, 50, .14);
}
.gcard:hover { box-shadow: 0 1px 1px rgba(0, 0, 0, .15), 0 10px 24px rgba(30, 35, 50, .22); }
.gcard::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, 0) 38%);
}
.gcard__top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.gcard__brand { font-size: 11.5px; font-weight: 600; opacity: .85; letter-spacing: .5px; }
.gcard__icon { width: 54px; opacity: .9; }
.gcard__mid { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.chip {
  width: 34px; height: 25px; border-radius: 5px; flex: none;
  background:
    linear-gradient(90deg, transparent 32%, rgba(90, 70, 20, .35) 32% 35%, transparent 35% 65%, rgba(90, 70, 20, .35) 65% 68%, transparent 68%),
    linear-gradient(0deg, transparent 45%, rgba(90, 70, 20, .35) 45% 55%, transparent 55%),
    linear-gradient(135deg, #f1dc9c, #c9a453 55%, #e6cc85);
}
.gcard__title { font-size: 17px; font-weight: 700; line-height: 1.2; }
.gcard__emb { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: 2px; opacity: .9; margin-top: 3px; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.gcard__bot { display: flex; justify-content: space-between; align-items: flex-end; position: relative; z-index: 1; gap: 8px; }
.gcard__sub { font-size: 11.5px; opacity: .85; line-height: 1.5; }
.gcard__price { font-size: 24px; font-weight: 800; line-height: 1; white-space: nowrap; }
.gcard__price small { font-size: 12px; font-weight: 600; opacity: .85; margin-left: 2px; }

.t-silver {
  color: #22262d;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .18) 0 1px, transparent 1px 3px),
    linear-gradient(135deg, #f3f4f6 0%, #c8cdd5 45%, #eef0f3 62%, #b5bbc5 100%);
}
.t-silver .gcard__emb { text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.t-black { background: radial-gradient(120% 90% at 10% 0%, #4a4d54 0%, #232428 55%, #121315 100%); }
.t-midnight { background: radial-gradient(120% 90% at 10% 0%, #34507f 0%, #182848 55%, #0c1428 100%); }
.t-teal { background: radial-gradient(120% 90% at 10% 0%, #2a8a86 0%, #105a5c 55%, #083b3e 100%); }
.t-rose { background: radial-gradient(120% 90% at 10% 0%, #e0708a 0%, #b23a5b 55%, #7d1f3c 100%); }
.t-sky { background: radial-gradient(120% 90% at 10% 0%, #5a9be0 0%, #2a64b0 55%, #173f78 100%); }
.t-amber { background: radial-gradient(120% 90% at 10% 0%, #f0b04a 0%, #cc7a16 55%, #94520a 100%); }

.carry { position: absolute; right: 2px; top: 10px; width: 50%; opacity: .95; z-index: 0; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal__bg { position: absolute; inset: 0; background: rgba(20, 24, 32, .45); }
.modal__box { position: relative; width: min(400px, 100%); background: #fff; border-radius: 6px; padding: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal__box .gcard { cursor: default; }
.modal__list { margin: 16px 0 6px; font-size: 14px; }
.modal__list div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.modal__list div:last-child { border: 0; }
.modal__x { position: absolute; top: -12px; right: -12px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); font-size: 18px; cursor: pointer; color: var(--ink-2); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--slate-2); color: #fff; padding: 9px 18px; border-radius: 4px; font-size: 14px; }

/* ---------- footer ---------- */
.foot { display: flex; gap: 18px; flex-wrap: wrap; padding: 28px 0 40px; font-size: 13px; color: var(--muted); align-items: center; }
.foot__brand { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-2); font-weight: 600; }
.foot__mark { width: 22px; height: 22px; color: var(--ink-2); }

/* ---------- 首页品牌 + 信任 ---------- */
.intro { display: grid; grid-template-columns: auto 1fr; gap: 18px 20px; padding: 20px; align-items: center; }
.intro__tile { width: 64px; height: 64px; border-radius: 15px; background: var(--brand); display: grid; place-items: center; }
.intro__tile svg { width: 50px; height: 50px; color: #fff; --parcel: #1F2430; }
.intro h1 { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.intro h1 small { font-size: 15px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 10px; }
.intro__desc { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.trust { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-2); padding-top: 16px; gap: 14px; }
.trust div { display: grid; grid-template-columns: 22px 1fr; gap: 2px 10px; font-size: 13px; color: var(--muted); }
.trust svg { width: 22px; height: 22px; color: var(--brand); grid-row: span 2; }
.trust b { color: var(--ink); font-size: 14px; font-weight: 600; }
.stats { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); background: var(--brand-soft); border-radius: 4px; padding: 7px 12px; }
.stats b { color: var(--brand-2); font-size: 15px; margin: 0 2px; }
.foot a:hover { color: var(--ink-2); }
#mode button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  #app { grid-template-columns: 1fr; }
  .side { order: 2; }
  .top__search { display: none; }
}
@media (max-width: 560px) {
  .trust { grid-template-columns: 1fr; }
  .intro { padding: 16px; }
  .intro__tile { width: 52px; height: 52px; border-radius: 12px; }
  .intro__tile svg { width: 40px; height: 40px; }
  .intro h1 small { display: block; margin: 4px 0 0; }
  .top__in { gap: 10px; }
  .logo { font-size: 15px; }
  .nav a { padding: 5px 7px; }
  .top__right { gap: 10px; }
  .row { grid-template-columns: 36px 1fr; padding: 11px 12px; }
  .row .price { grid-column: 2; justify-self: start; margin-top: -2px; }
  .av { width: 36px; height: 36px; font-size: 15px; }
  .grid2 { grid-template-columns: 1fr; }
  .topic__h { flex-wrap: wrap; }
  .topic__h .price { margin-left: 0; }
  .gcards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
