:root {
  --purple: #6D40C4; --deep: #34317D; --darkest: #2A2764;
  --tint: #F3EEFD; --tint2: #EAE2FB; --line: #E4E3EC; --ink: #1D1B3A; --muted: #6B6880;
  --bg: #F6F6F9; --card: #fff; --gold: #FEBF2B;
  --radius: 16px; --shadow: 0 1px 2px rgba(20,18,50,.04), 0 6px 24px rgba(20,18,50,.07);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: 72px; }
body { font-family: Poppins, system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
a { color: var(--purple); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 58px; }
.top .logo img { height: 24px; width: auto; display: block; }
.top .crumb { color: var(--muted); font-size: 14px; border-left: 1px solid var(--line); padding-left: 12px; white-space: nowrap; text-decoration: none; }
.top .crumb b { color: var(--ink); font-weight: 600; }
.top .sp { flex: 1; }
@media (max-width: 420px) { .top .crumb .pre { display: none; } }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 18px; min-height: 46px; cursor: pointer; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--purple); color: var(--purple); }
.btn.primary { background: var(--deep); border-color: var(--deep); color: #fff; }
.btn.primary:hover { background: var(--darkest); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 13.5px; border-radius: 10px; }

/* index */
.hero { background: linear-gradient(135deg, var(--darkest), var(--deep) 55%, var(--purple)); color: #fff; padding: 48px 0 40px; }
.hero h1 { font-size: clamp(30px, 6vw, 46px); line-height: 1.1; margin: 0 0 10px; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 0 0 24px; max-width: 640px; color: rgba(255,255,255,.86); font-size: 17px; }
.search input { width: 100%; max-width: 640px; border: 0; border-radius: 14px; padding: 16px 18px; font-size: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.18); outline: 3px solid transparent; color: var(--ink); background: #fff; }
.search input:focus { outline-color: var(--gold); }

.cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; }
@media (max-width: 640px) { .cats { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scrollbar-width: none; } .chip { flex: none; } }
#results h2 { font-size: 15px; color: var(--muted); font-weight: 500; margin: 24px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; color: var(--ink); }
.chip span { color: var(--muted); font-size: 12px; }
.chip:hover { border-color: var(--purple); color: var(--purple); }
.chip.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.chip.on span { color: rgba(255,255,255,.8); }

.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 0; }
.az a { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--deep); background: #fff; border: 1px solid var(--line); }
.az a:hover { background: var(--tint); }

.letter h2 { font-size: 22px; margin: 32px 0 12px; color: var(--deep); border-bottom: 2px solid var(--tint2); padding-bottom: 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
@media (max-width: 360px) { .grid { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--purple); transform: translateY(-1px); }
.card .t { font-weight: 700; font-size: 17px; color: var(--deep); }
.card .f { font-size: 13px; color: var(--purple); font-weight: 500; margin-top: -4px; }
.card .s { font-size: 14px; color: var(--muted); line-height: 1.5; }
.card .c { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: auto; padding-top: 6px; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; margin-top: 24px; }

/* term page */
.term { padding-top: 24px; padding-bottom: 24px; }
.bc { font-size: 14px; color: var(--muted); }
.bc a { color: var(--muted); text-decoration: none; }
.bc a:hover { color: var(--purple); }
.bc span { margin: 0 4px; }
.term h1 { font-size: clamp(32px, 7vw, 48px); line-height: 1.1; margin: 10px 0 4px; color: var(--deep); font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.term .full { margin: 0 0 8px; font-size: 18px; color: var(--purple); font-weight: 500; }
.term .short { font-size: 19px; line-height: 1.55; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--purple); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow); margin: 20px 0 8px; }
.tag { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--purple); font-weight: 700; margin-bottom: 4px; }
.term h2 { font-size: 21px; margin: 32px 0 8px; color: var(--deep); }
.how { padding-left: 0; list-style: none; }
.how li { position: relative; padding-left: 28px; margin: 0 0 10px; }
.how li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 10px; height: 10px; border-radius: 3px; background: var(--purple); }
.prompt { background: var(--darkest); color: #fff; border-radius: var(--radius); padding: 4px 20px 16px; margin-top: 28px; }
.prompt .ph { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prompt h2 { color: #fff; margin: 16px 0 8px; }
.prompt pre { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Consolas, monospace; font-size: 14px; line-height: 1.6; background: rgba(255,255,255,.07); border-radius: 10px; padding: 14px 16px; margin: 0; }
.prompt .hint { font-size: 13px; color: rgba(255,255,255,.7); margin: 10px 0 0; }
.evy { background: var(--tint); border: 1px solid var(--tint2); border-radius: var(--radius); padding: 4px 20px 8px; margin-top: 28px; }
.evy h2 { margin-top: 16px; color: var(--purple); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ask { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 36px 0 8px; box-shadow: var(--shadow); }
@media (max-width: 560px) { .ask { flex-direction: column; align-items: stretch; } }
.pn { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0; }
.pn a { flex: 1; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-weight: 600; color: var(--deep); }
.pn a:hover { border-color: var(--purple); }
.pn a.r { text-align: right; }
.pn small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

.foot { border-top: 1px solid var(--line); background: #fff; margin-top: 48px; padding: 24px 0; font-size: 14px; color: var(--muted); }
.foot p { margin: 4px 0; }
.foot .links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
