:root {
  --bg: #070910;
  --bg-2: #0d1322;
  --panel: rgba(255,255,255,.08);
  --panel-strong: rgba(255,255,255,.13);
  --line: rgba(255,255,255,.14);
  --text: #f7f2e8;
  --muted: #aeb7c8;
  --gold: #f6c762;
  --gold-2: #ffe0a0;
  --jade: #51f2c0;
  --red: #e24b52;
  --shadow: 0 24px 80px rgba(0,0,0,.45);
  --radius: 28px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(226,75,82,.26), transparent 34rem),
    radial-gradient(circle at 88% 8%, rgba(81,242,192,.16), transparent 30rem),
    linear-gradient(135deg, #06070c 0%, #0c1020 52%, #130c0f 100%);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; border-radius: 999px; filter: blur(8px); pointer-events: none; opacity: .45; z-index: -1; }
.ambient-one { width: 46rem; height: 46rem; background: radial-gradient(circle, rgba(246,199,98,.2), transparent 65%); top: 6rem; right: -18rem; }
.ambient-two { width: 34rem; height: 34rem; background: radial-gradient(circle, rgba(226,75,82,.18), transparent 62%); bottom: -12rem; left: -10rem; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 64px);
  backdrop-filter: blur(18px);
  background: rgba(7,9,16,.68);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 235px; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px;
  font-family: "Noto Serif TC", serif; font-weight: 900; color: #1c1202;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 10px 38px rgba(246,199,98,.25);
}
.brand strong { display: block; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 26px; color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--gold-2); }
.ghost-btn, .secondary-btn, .stage-actions button, .chips button {
  border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.07);
  border-radius: 999px; padding: 11px 16px; transition: .2s ease;
}
.ghost-btn:hover, .secondary-btn:hover, .stage-actions button:hover, .chips button:hover { transform: translateY(-1px); border-color: rgba(246,199,98,.55); background: rgba(246,199,98,.11); }
main { width: min(1520px, calc(100% - 36px)); margin: 0 auto 64px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) 430px; gap: 30px; padding: 76px 0 42px; align-items: stretch; }
.hero-copy, .avatar-card, .search-panel, .results-panel, .page-stage, .insight-panel .glass-card {
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.045)); box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.hero-copy { border-radius: 38px; padding: clamp(32px, 5vw, 72px); position: relative; overflow: hidden; }
.hero-copy:after { content: ""; position: absolute; inset: auto -12% -40% 32%; height: 65%; background: radial-gradient(circle, rgba(246,199,98,.20), transparent 62%); pointer-events: none; }
.eyebrow { margin: 0 0 10px; color: var(--gold); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; }
h1 { margin: 0; max-width: 950px; font-size: clamp(42px, 6vw, 82px); line-height: .92; letter-spacing: -.07em; }
.lede { max-width: 810px; color: #d6deea; font-size: clamp(17px, 1.8vw, 21px); line-height: 1.6; margin: 28px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.primary-btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 20px; border-radius: 999px; color: #160f04; font-weight: 850; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 14px 36px rgba(246,199,98,.22); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 42px; position: relative; z-index: 1; }
.metrics div { padding: 18px; border-radius: 20px; background: rgba(0,0,0,.22); border: 1px solid var(--line); }
.metrics strong { display: block; font-size: 29px; color: var(--gold-2); }
.metrics span { color: var(--muted); font-size: 13px; }
.avatar-card { border-radius: 38px; overflow: hidden; display: flex; flex-direction: column; min-height: 560px; }
.video-shell { flex: 1; min-height: 290px; position: relative; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(81,242,192,.25), rgba(10,17,30,.9) 58%), linear-gradient(145deg, rgba(246,199,98,.12), transparent); }
.scanline { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.035), rgba(255,255,255,.035) 1px, transparent 1px, transparent 7px); opacity: .6; }
.avatar-orb { position: relative; width: 172px; height: 172px; border-radius: 50%; background: radial-gradient(circle at 40% 28%, #fff, var(--jade) 14%, #0f7465 42%, #08151e 68%); box-shadow: 0 0 0 18px rgba(81,242,192,.05), 0 0 90px rgba(81,242,192,.42); }
.avatar-orb span { position: absolute; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; inset: -16px; animation: pulse 4s infinite ease-in-out; }
.avatar-orb span:nth-child(2) { inset: -34px; animation-delay: .6s; }
.avatar-orb span:nth-child(3) { inset: -54px; animation-delay: 1.1s; }
@keyframes pulse { 50% { transform: scale(1.05); opacity: .35; } }
.video-label { position: absolute; bottom: 18px; left: 18px; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid var(--line); padding: 9px 12px; color: var(--muted); font-size: 12px; }
.avatar-dialogue { padding: 24px; }
.avatar-dialogue h2 { margin: 0 0 10px; letter-spacing: -.03em; }
.avatar-dialogue p { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.search-panel { margin-top: 10px; border-radius: var(--radius); padding: 24px; display: grid; grid-template-columns: minmax(260px,1fr) minmax(280px,560px) 150px; gap: 18px; align-items: center; }
.search-panel h2 { margin: 0; font-size: 32px; letter-spacing: -.04em; }
.searchbox, .jumpbox { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.18); border-radius: 20px; padding: 12px 16px; }
.searchbox span, .jumpbox span { color: var(--gold); font-weight: 800; font-size: 13px; }
.searchbox input, .jumpbox input { flex: 1; min-width: 0; color: var(--text); border: 0; outline: 0; background: transparent; }
.filter-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding: 4px 2px; }
.filter-strip button { border: 1px solid var(--line); color: #e8eef9; background: rgba(255,255,255,.065); border-radius: 999px; padding: 10px 13px; }
.filter-strip button:hover, .filter-strip button.active { border-color: rgba(81,242,192,.6); background: rgba(81,242,192,.13); color: #fff; }
.workspace { display: grid; grid-template-columns: 320px minmax(0, 1fr) 330px; gap: 20px; margin-top: 20px; align-items: start; }
.results-panel, .page-stage, .insight-panel .glass-card { border-radius: var(--radius); }
.results-panel { overflow: hidden; max-height: 840px; position: sticky; top: 92px; }
.panel-head { display: flex; justify-content: space-between; padding: 18px; border-bottom: 1px solid var(--line); }
.panel-head small { color: var(--muted); }
.result-list { display: grid; gap: 10px; padding: 12px; overflow: auto; max-height: 775px; }
.result-card { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px; border-radius: 18px; border: 1px solid transparent; background: rgba(255,255,255,.045); text-align: left; color: inherit; }
.result-card.active, .result-card:hover { border-color: rgba(246,199,98,.52); background: rgba(246,199,98,.09); }
.result-card img { width: 72px; height: 88px; object-fit: cover; border-radius: 12px; background: #fff; }
.empty-state { padding: 18px; border-radius: 18px; background: rgba(0,0,0,.22); border: 1px solid var(--line); color: var(--muted); line-height: 1.5; }
.empty-state strong { color: var(--text); }
.result-card strong { display: block; font-size: 13px; line-height: 1.25; }
.result-card small { display: block; color: var(--muted); margin-top: 5px; line-height: 1.35; }
.page-stage { min-height: 840px; overflow: hidden; }
.stage-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.stage-toolbar p { margin: 0 0 4px; color: var(--gold); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 850; }
.stage-toolbar h3 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.stage-actions { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.stage-actions button { width: 38px; height: 38px; padding: 0; font-size: 22px; }
.page-wrap { height: 770px; overflow: auto; padding: 26px; display: grid; place-items: start center; background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(0,0,0,.18)); }
.image-shell { position: relative; width: var(--page-width, 78%); height: auto; border-radius: 20px; box-shadow: 0 30px 90px rgba(0,0,0,.48), 0 0 0 1px rgba(255,255,255,.1); background: #fff; overflow: hidden; }
#pageImage { display: block; width: 100%; height: auto; border-radius: 20px; background: #fff; }
.highlight-layer { position: absolute; inset: 0; pointer-events: none; }
.term-hit { position: absolute; z-index: 2; border-radius: 4px; background: rgba(255, 214, 0, .58); outline: 3px solid rgba(255, 140, 0, .9); box-shadow: 0 0 0 1px rgba(255,255,255,.7), 0 0 24px rgba(255, 199, 0, .75); animation: hitPulse 1.8s ease-in-out infinite; }
@keyframes hitPulse { 50% { background: rgba(255, 238, 0, .82); outline-color: rgba(255, 111, 0, 1); box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 0 32px rgba(255, 199, 0, .95); } }
.insight-panel { display: grid; gap: 20px; position: sticky; top: 92px; }
.glass-card { padding: 22px; }
.glass-card h3 { margin: 0 0 10px; font-size: 23px; letter-spacing: -.03em; }
.glass-card p { color: var(--muted); line-height: 1.55; }
.route-steps { display: grid; gap: 10px; margin-top: 18px; }
.route-steps div { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(0,0,0,.2); border: 1px solid var(--line); color: #dce5f2; }
.route-steps span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(246,199,98,.16); color: var(--gold-2); font-weight: 900; }
.compact { background: linear-gradient(135deg, rgba(226,75,82,.12), rgba(255,255,255,.055)) !important; }
@media (max-width: 1180px) {
  .hero, .workspace { grid-template-columns: 1fr; }
  .results-panel, .insight-panel { position: static; }
  .result-list { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); max-height: none; }
}
@media (max-width: 780px) {
  .nav { display: none; }
  .topbar { padding-inline: 16px; }
  .ghost-btn { display: none; }
  .hero { padding-top: 34px; }
  .metrics, .search-panel { grid-template-columns: 1fr; display: grid; }
  .page-wrap { height: 620px; padding: 14px; }
  .image-shell { width: var(--page-width, 100%); }
}
