:root { color-scheme: dark; --bg:#0b1020; --card:#141c31; --line:#2a3853; --text:#f3f6ff; --muted:#a9b7cf; --cyan:#62d9ee; --blue:#67a9ff; --purple:#aa8cff; }
* { box-sizing:border-box; }
body { margin:0; color:var(--text); background:radial-gradient(circle at 20% -12%,#182448 0,transparent 36%),var(--bg); font:16px/1.6 system-ui,-apple-system,"Hiragino Kaku Gothic ProN",Meiryo,sans-serif; }
button,input { font:inherit; }
button { cursor:pointer; }
button:focus-visible,input:focus-visible,a:focus-visible { outline:3px solid var(--cyan); outline-offset:3px; }
a { color:var(--cyan); }
.site-header { display:flex; justify-content:space-between; align-items:center; gap:16px; border-bottom:1px solid var(--line); padding:13px max(20px,calc((100vw - 1160px)/2)); }
.brand { color:var(--text); font-size:18px; font-weight:800; text-decoration:none; letter-spacing:-.03em; white-space:nowrap; }
.brand span { color:var(--purple); }
.prototype-badge { color:#d9c8ff; background:#2e2550; border:1px solid #55477d; border-radius:999px; padding:3px 10px; font-size:11px; white-space:nowrap; }
main { max-width:1160px; margin:auto; padding:46px 20px 75px; }
.intro { max-width:850px; margin-bottom:30px; }
.eyebrow { color:var(--cyan); font-size:12px; font-weight:700; letter-spacing:.12em; }
h1 { margin:4px 0 14px; font-size:clamp(30px,5vw,51px); line-height:1.16; letter-spacing:-.05em; }
.intro > p:not(.eyebrow) { color:var(--muted); margin:0 0 9px; }
.intro .source-note { font-size:12px; color:#98a9c6 !important; }
.workspace { display:grid; grid-template-columns:minmax(340px,.9fr) minmax(0,1.1fr); gap:18px; align-items:stretch; }
.card { background:linear-gradient(150deg,#17213a,#12192b); border:1px solid var(--line); border-radius:17px; padding:25px; box-shadow:0 16px 40px rgba(0,0,0,.15); }
.section-title { display:flex; align-items:center; gap:12px; margin-bottom:20px; }
.section-title span { display:grid; place-items:center; width:29px; height:29px; border-radius:9px; background:#263b62; color:var(--cyan); font-size:12px; font-weight:800; }
h2 { margin:0; font-size:18px; line-height:1.3; }
.section-title.second { margin:28px 0 12px; }
.matrix-editor,.vector-editor { display:flex; align-items:center; gap:16px; }
.matrix-symbol { font-size:24px; font-weight:700; white-space:nowrap; }
.matrix-bracket { position:relative; display:grid; grid-template-columns:repeat(2,minmax(65px,96px)); gap:10px; padding:9px 17px; }
.matrix-bracket:before,.matrix-bracket:after { content:""; position:absolute; top:0; bottom:0; width:9px; border-top:3px solid var(--purple); border-bottom:3px solid var(--purple); }
.matrix-bracket:before { left:0; border-left:3px solid var(--purple); }.matrix-bracket:after { right:0; border-right:3px solid var(--purple); }
.matrix-bracket label,.vector-editor label { display:flex; flex-direction:column; gap:3px; color:var(--muted); font-size:11px; }
input[type=number] { width:100%; min-width:0; border:1px solid #3a4b68; border-radius:8px; background:#0c152a; color:var(--text); padding:9px; font-weight:700; font-size:17px; text-align:center; }
.field-help { font-size:12px; color:var(--muted); margin:15px 0 0; }
.presets { display:flex; flex-wrap:wrap; gap:8px; margin:17px 0 8px; }
.presets button { color:#d9e4fb; background:#263450; border:1px solid #40516d; border-radius:999px; padding:6px 12px; font-size:12px; }
.presets button:hover,.presets button:focus-visible { border-color:var(--cyan); background:#314c6b; }
.vector-editor { gap:12px; }
.vector-editor > span { font-size:19px; font-weight:700; }
.vector-editor label { width:85px; }
.error { color:#ffc6bb; background:#4b242c; border-radius:8px; padding:9px 12px; font-size:12px; }
.local-progress { margin-top:24px; padding-top:14px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; }
.visual { display:flex; flex-direction:column; }
.plot-wrap { flex:1; min-height:330px; display:grid; place-items:center; border:1px solid #283854; background:radial-gradient(circle at center,#1b2944,#0d162b); border-radius:14px; overflow:hidden; }
#plot { display:block; width:min(100%,470px); height:auto; aspect-ratio:1; }
#plot .grid-line { stroke:#253751; stroke-width:.7; }#plot .axis { stroke:#7485aa; stroke-width:1.2; }
#plot .shape-before { fill:#67a9ff1c; stroke:#67a9ff; stroke-width:2; stroke-dasharray:5 4; }
#plot .shape-after { fill:#62d9ee45; stroke:#62d9ee; stroke-width:2.5; }
#plot .vector-before { stroke:#8baefe; stroke-width:2.5; }#plot .vector-after { stroke:#d8aaff; stroke-width:3.5; }
#plot .dot-before { fill:#8baefe; }#plot .dot-after { fill:#d8aaff; }#plot .origin { fill:#fff; }
.legend { display:flex; flex-wrap:wrap; gap:12px; padding:13px 0 2px; color:var(--muted); font-size:12px; }
.legend span { display:inline-flex; align-items:center; gap:7px; }.legend i { display:inline-block; width:12px; height:12px; border-radius:3px; }
.legend .before { border:2px dashed var(--blue); }.legend .after { background:var(--cyan); }
.legend .vector { background:#d8aaff; }
#plot .plot-label { fill:#bccae3; font-size:9px; }
.answer-line button:disabled { opacity:.4; cursor:not-allowed; }
.visual-note { color:var(--muted); font-size:12px; margin:8px 0 0; }
.results { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin-top:18px; }
.result-card { min-width:0; }.result-label { color:var(--cyan); font-size:12px; font-weight:750; }.result-card strong { display:block; margin:7px 0 11px; font-size:24px; line-height:1.3; overflow-wrap:anywhere; }.result-card p { color:var(--muted); font-size:12px; margin:0; }
.practice { margin-top:18px; }.practice > p { color:var(--muted); margin:0 0 16px; }.practice strong { color:var(--text); }
.answer-line { display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-weight:700; }.answer-line input { width:84px; }.answer-line button { margin-left:8px; padding:10px 18px; border:0; border-radius:8px; background:var(--cyan); color:#09202d; font-weight:800; }.answer-line button:hover { filter:brightness(1.12); }
.practice .feedback { min-height:25px; margin:12px 0 0; color:var(--muted); font-size:13px; }.feedback[data-correct=true] { color:#8df4b9; }.feedback[data-correct=false] { color:#ffd4a7; }
footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-top:27px; color:var(--muted); font-size:12px; }
@media(max-width:800px) { main { padding-top:31px; }.workspace,.results { grid-template-columns:1fr; }.visual .plot-wrap { min-height:270px; }.result-card strong { font-size:21px; } }
@media(max-width:440px) { .site-header { padding:12px 16px; }.prototype-badge { font-size:9px; }.card { padding:18px; }.matrix-bracket { grid-template-columns:repeat(2,70px); }.answer-line button { margin-left:0; width:100%; } }
