:root {
  --ink: #eff4ef;
  --muted: #98a39b;
  --surface: #101613;
  --surface-2: #171e1a;
  --line: #303a33;
  --accent: #c8ff4b;
  --danger: #ff8a73;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { background: var(--surface); color: var(--ink); font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 84% 2%, #233129 0, transparent 27rem), var(--surface); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; max-width: var(--max); margin: auto; padding: 0 30px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand > span { display: grid; place-items: center; width: 35px; height: 35px; background: var(--accent); color: #121710; font-size: 12px; font-weight: 900; }
.brand strong { font-size: 15px; letter-spacing: .04em; }
.mode { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.mode i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(200,255,75,.4); animation: pulse 2.5s infinite; }

main { max-width: var(--max); margin: auto; padding: 0 30px 90px; }
.command { min-height: 390px; display: grid; grid-template-columns: 1fr auto; align-items: end; padding: 68px 0 54px; border-bottom: 1px solid var(--line); animation: rise .65s ease-out both; }
.eyebrow, .section-label { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1 { max-width: 760px; margin: 17px 0 0; font-size: clamp(44px, 7.3vw, 94px); line-height: .96; letter-spacing: -.055em; }
.freshness { min-width: 190px; padding-bottom: 7px; }
.freshness span, .freshness small { display: block; color: var(--muted); font-size: 12px; }
.freshness strong { display: block; margin: 8px 0; font-size: 19px; }

.query-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.query-strip button { display: flex; justify-content: space-between; padding: 24px 2px; color: var(--ink); background: none; border: 0; border-right: 1px solid var(--line); cursor: pointer; text-align: left; transition: color .2s, padding .2s; }
.query-strip button:not(:first-child) { padding-left: 24px; }
.query-strip button:last-child { border-right: 0; }
.query-strip button:hover { color: var(--accent); padding-right: 10px; }

.result { display: grid; grid-template-columns: 190px 1fr; gap: 30px; padding: 54px 0; border-bottom: 1px solid var(--line); }
.result-content { min-height: 106px; opacity: 1; transform: translateY(0); transition: opacity .2s, transform .2s; }
.result-content.loading { opacity: .35; transform: translateY(5px); }
.result-content strong { font-size: clamp(22px, 3vw, 36px); letter-spacing: -.025em; }
.result-content p { max-width: 760px; color: var(--muted); line-height: 1.75; }
.result-content pre { overflow: auto; color: #cbd5cd; white-space: pre-wrap; font-size: 13px; line-height: 1.55; }
.error { color: var(--danger) !important; }

.tools { padding: 72px 0 30px; }
.tools-heading { display: grid; grid-template-columns: 1fr 390px; gap: 40px; align-items: end; margin: 18px 0 38px; }
h2 { margin: 0; font-size: clamp(30px, 4vw, 55px); line-height: 1.02; letter-spacing: -.045em; }
.tools-heading p, .scope { color: var(--muted); line-height: 1.7; }
.tool-list { border-top: 1px solid var(--line); }
.tool-list a, .tool-list span { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; min-height: 82px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); transition: padding .22s, color .22s; }
.tool-list a:hover { padding-left: 12px; color: var(--accent); }
.tool-list em { color: var(--muted); font-style: normal; font-size: 12px; }
.tool-list b { font-size: 20px; }
.tool-list small { color: var(--muted); }

.ask { margin-top: 64px; padding: 42px 0; display: grid; grid-template-columns: 340px 1fr; gap: 24px 60px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ask h2 { margin-top: 14px; font-size: 36px; }
.ask form { display: flex; align-self: end; border-bottom: 1px solid var(--ink); }
.ask input { flex: 1; min-width: 0; padding: 17px 0; color: var(--ink); background: none; border: 0; outline: none; font-size: 19px; }
.ask button, dialog button { padding: 12px 18px; color: #11170f; background: var(--accent); border: 0; font-weight: 800; cursor: pointer; }
.scope { grid-column: 2; margin: 0; font-size: 12px; }

dialog { width: min(430px, calc(100% - 36px)); padding: 0; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); }
dialog::backdrop { background: rgba(5,8,6,.78); backdrop-filter: blur(7px); }
dialog form { display: grid; gap: 22px; padding: 35px; }
dialog h2 { font-size: 31px; }
dialog label, dialog small { display: grid; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
dialog input { width: 100%; padding: 13px; color: var(--ink); background: #0d120f; border: 1px solid var(--line); outline: none; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(200,255,75,0); } 100% { box-shadow: 0 0 0 0 rgba(200,255,75,0); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 760px) {
  .topbar { height: 62px; padding: 0 18px; }
  main { padding: 0 18px 60px; }
  .command { min-height: 330px; grid-template-columns: 1fr; gap: 45px; padding: 50px 0 34px; }
  h1 { font-size: clamp(45px, 14vw, 68px); }
  .freshness { min-width: 0; }
  .query-strip { grid-template-columns: 1fr; }
  .query-strip button, .query-strip button:not(:first-child) { padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .query-strip button:last-child { border-bottom: 0; }
  .result { grid-template-columns: 1fr; gap: 25px; }
  .tools-heading { grid-template-columns: 1fr; gap: 15px; }
  .tool-list a, .tool-list span { grid-template-columns: 50px 1fr auto; }
  .ask { grid-template-columns: 1fr; }
  .scope { grid-column: 1; }
}
