/* ==========================================================================
   Red marketplace redesign — inspired by IBC 八方.
   Loaded after broker.css on every page. Deep oxblood hero, bright red CTAs,
   amber accents, white cards, rounded corners and soft elevation.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Noto+Sans+TC:wght@400;500;700;900&family=Noto+Sans+SC:wght@400;500;700;900&display=swap');

:root {
  /* ---- red palette ---- */
  --ink: #7a0000;
  --blue: #e60000;
  --blue-2: #ff1a1a;
  --brass: #8f0000;
  --brass-bg: #ffecec;
  --paper: #ffffff;
  --mist: #fff7f7;
  --mist-2: #ffecec;
  --line: #f3d6d6;
  --line-2: #e8bcbc;
  --bk-text: #2a1010;
  --bk-muted: #6b4a4a;
  --ok: #0d7a45;
  --ok-bg: #e8f6ee;
  --err: #b42318;
  --serif: 'Inter', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
  --sans: 'Inter', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --num: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
  --bk-wrap: 1200px;
  --r: 10px;

  /* ---- legacy token remap ---- */
  --primary: #e60000;
  --primary-dark: #b30000;
  --primary-darker: #7a0000;
  --primary-light: #ffe5e5;
  --primary-50: #fff5f5;
  --secondary: #7a0000;
  --accent: #8f0000;
  --accent-dark: #6b0000;
  --accent-light: #b30000;
  --accent-glow: rgba(143, 0, 0, 0.18);
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --bg-dark: #5c0000;
  --bg-cream: #fff1f1;
  --bg-warm: #ffecec;
  --text-primary: #2a1010;
  --text-secondary: #6b4a4a;
  --text-light: #8a6b6b;
  --text-gold: #8f0000;
  --border: #f3d6d6;
  --border-light: #ffecec;
  --border-gold: rgba(143, 0, 0, 0.35);
  --success: #0d7a45;
  --error: #b42318;
  --warning: #b45309;
  --info: #e60000;
  --color-buy: #e60000;
  --color-buy-dark: #b30000;
  --color-buy-light: #fff5f5;
  --color-sell: #7a0000;
  --color-sell-dark: #5c0000;
  --color-sell-light: #fff1f1;
  --color-wanted: #8f0000;
  --color-wanted-dark: #6b0000;
  --color-wanted-light: #ffecec;
  --font-display: var(--sans);
  --font-body: var(--sans);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(122, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(122, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(122, 0, 0, 0.12);
  --shadow-xl: 0 24px 60px rgba(122, 0, 0, 0.18);
  --container-width: 1200px;
}

body {
  background: var(--paper);
  color: var(--bk-text);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ---- top bar ---- */
.ib-topbar { background: #5c0000; color: #ffe3e3; font-size: 0.82rem; }
.ib-topbar-in { display: flex; align-items: center; gap: 18px; min-height: 36px; flex-wrap: wrap; }
.ib-topbar a { color: #fff; text-decoration: none; }
.ib-topbar a:hover { color: #ffd9a8; }
.ib-tb-item { display: inline-flex; align-items: center; gap: 6px; }
.ib-tb-item::before { content: "✓"; color: #ffd9a8; font-weight: 800; }
.ib-tb-spacer { flex: 1; }

/* ---- header ---- */
.navbar { background: #fff; border-bottom: 1px solid var(--line); }
.brand-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; background: #fff; flex: none; }
.footer-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: #fff; display: block; margin-bottom: 10px; }
.brand-icon {
  background: linear-gradient(135deg, var(--blue), var(--ink));
  border: 0; box-shadow: inset 0 -3px 0 var(--brass);
  width: 42px; height: 42px; display: inline-grid; place-items: center;
  border-radius: 10px; font-size: 0.95rem;
}
.nav-brand .brand-copy b { font-family: var(--sans); font-weight: 900; }
.nav-links a { font-weight: 600; }
.nav-links a:hover, .nav-links a.active { color: var(--blue); background: var(--primary-50); }
.nav-links a.nav-cta, .nav-links a.btn-outline-light { background: var(--blue); border-color: var(--blue); color: #fff !important; }
.nav-links a.nav-cta:hover, .nav-links a.btn-outline-light:hover { background: var(--ink); border-color: var(--ink); }
.lang-switch button.active, .lang-switch button:hover { background: var(--blue); }

/* ---- buttons ---- */
.bk-btn, .btn {
  border-radius: 10px;
  border-width: 2px;
  font-weight: 700;
}
.bk-btn { background: var(--blue); border-color: var(--blue); box-shadow: 0 6px 18px rgba(180, 35, 24, 0.28); }
.bk-btn:hover { background: var(--ink); border-color: var(--ink); }
.bk-btn--brass { background: var(--brass); border-color: var(--brass); box-shadow: 0 6px 18px rgba(201, 138, 46, 0.28); }
.bk-btn--brass:hover { background: #6b0000; border-color: #6b0000; }
.bk-btn--ghost { background: #fff; color: var(--blue) !important; border-color: var(--line); box-shadow: none; }
.bk-btn--ghost:hover { background: var(--primary-50); border-color: var(--blue); color: var(--blue) !important; }
.bk-btn--light { background: #fff; color: var(--ink) !important; border-color: #fff; }
.bk-band .bk-btn--ghost, .bk-hero .bk-btn--ghost { background: transparent; color: #fff !important; border-color: rgba(255,255,255,.5); }
.bk-band .bk-btn--ghost:hover, .bk-hero .bk-btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff !important; }
.btn-primary, .btn-buy { background: var(--blue); border-color: var(--blue); }
.btn-primary:hover, .btn-buy:hover { background: var(--ink); border-color: var(--ink); }
.btn-sell { background: var(--color-sell); border-color: var(--color-sell); }
.btn-sell:hover { background: var(--ink); border-color: var(--ink); }
.btn-wanted { background: var(--brass); border-color: var(--brass); }

/* ---- hero ---- */
.bk-hero {
  background:
    radial-gradient(900px 500px at 10% -20%, rgba(230, 0, 0, 0.45), transparent),
    linear-gradient(160deg, #4a0000 0%, #7a0000 48%, #a30000 100%);
}
.bk-hero::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.bk-hero h1 { font-weight: 900; letter-spacing: -0.03em; }
.bk-eyebrow { color: #ffd9a8; }
.bk-hero .bk-lead { color: #f3cfc9; }

/* ---- homepage hero (IBC layout) ---- */
.ib-hero {
  position: relative; overflow: hidden; color: #f3cfc9; padding: 64px 0 76px;
  background:
    radial-gradient(900px 500px at 10% -20%, rgba(230, 0, 0, 0.45), transparent),
    linear-gradient(160deg, #4a0000 0%, #7a0000 48%, #a30000 100%);
}
.ib-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.ib-hero-in {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
}
.ib-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 900; letter-spacing: -0.03em; margin-bottom: 16px; }
.ib-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffd9a8; padding: 6px 12px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 18px;
}
.ib-lead { color: #f3cfc9; font-size: 1.1rem; line-height: 1.8; max-width: 620px; }
.ib-search {
  display: flex; gap: 8px; background: #fff; padding: 8px; border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.20); margin-top: 26px; max-width: 640px;
}
.ib-search select, .ib-search input {
  flex: 1; min-width: 0; border: 0; background: var(--mist); border-radius: 8px;
  padding: 0 12px; height: 46px; font: inherit; color: var(--bk-text);
}
.ib-search .bk-btn { height: 46px; padding: 0 18px; white-space: nowrap; }
.ib-assure { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; list-style: none; padding: 0; color: #f3cfc9; font-size: 0.88rem; }
.ib-assure li::before { content: "✓"; color: #ffd9a8; margin-right: 6px; font-weight: 800; }

.ib-dual { display: grid; gap: 16px; }
.ib-track {
  display: block; background: #fff; border-radius: 18px; padding: 24px 26px;
  color: var(--bk-text); text-decoration: none; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  border-top: 5px solid var(--blue); transition: transform 0.2s, box-shadow 0.2s;
}
.ib-track:hover { transform: translateY(-3px); color: var(--bk-text); box-shadow: 0 26px 60px rgba(0, 0, 0, 0.24); }
.ib-track-sell { border-top-color: var(--brass); }
.ib-track-kicker { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); }
.ib-track-sell .ib-track-kicker { color: var(--brass); }
.ib-track strong { display: block; font-size: 1.3rem; color: var(--ink); margin: 4px 0 6px; font-weight: 900; }
.ib-track p { color: var(--bk-muted); margin-bottom: 14px; font-size: 0.93rem; }
.ib-track .bk-btn { width: 100%; }

/* ---- stats ---- */
.ib-stats { background: #fff; border-bottom: 1px solid var(--line); }
.ib-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.ib-stats-grid > div { padding: 26px 12px; border-right: 1px solid var(--line); }
.ib-stats-grid > div:last-child { border-right: 0; }
.ib-stats-grid strong { display: block; font-size: clamp(1.4rem, 2.6vw, 2rem); color: var(--blue); font-weight: 900; font-variant-numeric: tabular-nums; }
.ib-stats-grid span { color: var(--bk-muted); font-size: 0.9rem; }

/* ---- sections ---- */
.ib-section { padding: 76px 0; }
.ib-section-alt { background: var(--mist); }
.ib-sec-head { max-width: 720px; margin-bottom: 34px; }
.ib-sec-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 900; }
.ib-sec-head p { color: var(--bk-muted); margin-top: 8px; }
.ib-sec-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; max-width: none; flex-wrap: wrap; }

/* ---- industry / licence grid ---- */
.ib-ind-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ib-ind-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  color: var(--bk-text); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.ib-ind-card:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: var(--shadow-md); color: var(--bk-text); }
.ib-ind-num {
  width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50);
  color: var(--blue); display: grid; place-items: center; font-weight: 900; font-size: 1.1rem; margin-bottom: 4px;
}
.ib-ind-card strong { color: var(--ink); font-size: 1.02rem; font-weight: 800; }
.ib-ind-card small { color: var(--bk-muted); flex: 1; font-size: 0.86rem; }
.ib-ind-link { color: var(--blue); font-weight: 700; font-size: 0.84rem; }

/* ---- trust / NDA ---- */
.ib-trust-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; }
.ib-nda {
  background: linear-gradient(160deg, #5c0000, #7a0000);
  color: #f3cfc9; border-radius: 18px; padding: 32px; position: relative; overflow: hidden;
}
.ib-nda h2 { color: #fff; }
.ib-nda p { color: #ecc4be; }
.ib-lock {
  width: 64px; height: 64px; border-radius: 50%; border: 2px dashed rgba(255, 217, 168, 0.6);
  display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 14px; color: #ffd9a8;
}
.ib-ticks { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.ib-ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ib-ticks li::before { content: "✓"; color: var(--brass); font-weight: 900; line-height: 1.5; }
.ib-team { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow-sm); }
.ib-team h2 { font-size: 1.35rem; }
.ib-team p { color: var(--bk-muted); }

/* ---- bk cards red polish ---- */
.bk-entry { border-radius: 16px; box-shadow: var(--shadow-sm); }
.bk-entry:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); }
.bk-entry-foot { background: var(--mist); border-radius: 0 0 16px 16px; }
.bk-entry-top h3 a { color: var(--ink); }
.bk-entry-top h3 a:hover { color: var(--blue); }
.bk-stamp b { color: #7a0000; border-color: var(--brass); background: var(--brass-bg); }
.bk-entry--wanted .bk-stamp b { color: var(--blue); border-color: var(--blue); background: var(--primary-50); }
.bk-facts dd { color: var(--ink); }
.bk-facts > div:nth-child(2) dd { color: var(--blue); font-size: 1.06rem; }
.bk-sheet, .bk-contact-card, .bk-price-box, .bk-points { border-radius: 16px; box-shadow: var(--shadow-sm); }
.bk-price-box { background: var(--brass-bg); border-color: var(--brass); }
.bk-broker-strip { border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }

/* ---- footer ---- */
.footer { background: #5c0000; }
.footer-brand h3 { font-family: var(--sans); font-weight: 900; }
.footer-links h4, .footer-contact h4 { color: #ffd9a8; }
.footer-company { color: #ffd9a8 !important; }
.footer-bottom { color: #c99b96; }
.footer-bottom a { color: #ffd9a8; }

/* ---- responsive ---- */
@media (max-width: 1080px) {
  .ib-ind-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .ib-hero-in, .ib-trust-grid { grid-template-columns: 1fr; gap: 32px; }
  .ib-section { padding: 56px 0; }
  .ib-stats-grid { grid-template-columns: 1fr 1fr; }
  .ib-stats-grid > div:nth-child(2) { border-right: 0; }
  .ib-stats-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .ib-hero { padding: 44px 0 52px; }
  .ib-search { flex-direction: column; }
  .ib-search select, .ib-search .bk-btn { width: 100%; }
  .ib-ind-grid { grid-template-columns: 1fr; }
  .ib-topbar .hide-sm { display: none; }
}

/* ---- guide page heroes ---- */
.page-hero, .info-page .page-hero { background: linear-gradient(145deg, #4a0000 0%, #7a0000 100%); }

/* ---- dark page heads (listings, detail, wanted) ---- */
.bk-page-head {
  background: linear-gradient(160deg, #4a0000 0%, #7a0000 52%, #a30000 100%);
  border-bottom: 0;
}
.bk-page-head h1 { color: #fff; }
.bk-page-head .bk-lead, .bk-page-head .bk-poster { color: #f3cfc9; }
.bk-page-head .bk-crumbs, .bk-page-head .bk-crumbs a { color: #f0c9c3; }
.bk-page-head .bk-eyebrow { color: #ffd9a8; }
.bk-page-head .bk-stamp b { background: rgba(255,255,255,.10); color: #ffd9a8; border-color: rgba(255,217,168,.5); }
