:root {
	color-scheme: dark;
	--bg: #101625;
	--surface: #192238;
	--surface-raised: #202b44;
	--line: #35405b;
	--text: #f5f4f0;
	--muted: #aab4c9;
	--accent: #a5b1ff;
	--accent-strong: #7889ff;
	--peach: #ffaf94;
	--success: #87d8ad;
	font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
	font-size: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--peach); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.site-shell { max-width: 1600px; min-height: 100vh; margin: auto; padding: 0 clamp(16px, 3.6vw, 58px); }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: .88rem; font-weight: 700; letter-spacing: .04em; text-decoration: none; }
.brand-mark { width: 24px; height: 24px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; transform: rotate(-12deg); }
.brand-mark i { display: block; background: var(--accent); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--peach); }
.topbar-right { display: flex; align-items: center; gap: 24px; }
.lang-toggle { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .75rem; font-weight: 600; letter-spacing: .04em; transition: background-color .15s, border-color .15s, color .15s; }
.lang-toggle:hover { background: #324165; border-color: var(--accent); }
.lang-toggle .lang-active { color: var(--text); font-weight: 700; }
.lang-toggle .lang-divider { color: var(--line); font-weight: 400; user-select: none; }
.connection { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #e4b065; box-shadow: 0 0 0 4px #e4b0651f; }
.connection[data-state="online"] .connection-dot { background: var(--success); box-shadow: 0 0 0 4px #87d8ad1f; }
.connection[data-state="offline"] .connection-dot { background: var(--peach); box-shadow: 0 0 0 4px #ffaf941f; }
.back-link { font-size: .84rem; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--text); }
.intro { padding: clamp(32px, 5vw, 70px) 0 clamp(30px, 3.5vw, 52px); }
.eyebrow, .section-kicker, .section-label-row span, .board-dimensions, .coordinates, .footer, .zoom-label { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .1em; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: .73rem; font-weight: 700; }
.eyebrow-line { width: 22px; height: 2px; background: var(--accent); }
h1 { margin: 13px 0 10px; font-size: clamp(2.15rem, 5vw, 4.6rem); line-height: 1.13; letter-spacing: -.065em; font-weight: 800; }
h1 em { color: var(--peach); font-style: normal; }
.intro p { margin: 0; color: var(--muted); font-size: clamp(.91rem, 1.2vw, 1.04rem); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(315px, 360px); gap: 20px; align-items: start; }
.board-panel, .side-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 40px #050a1533; }
.board-panel { padding: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 2px 3px 18px; }
.section-kicker { margin: 0 0 5px; color: var(--accent); font-size: .69rem; font-weight: 800; }
h2, h3 { margin: 0; }
.panel-heading h2 { font-size: 1.15rem; }
.board-dimensions { margin-left: 9px; color: var(--muted); font-size: .67rem; font-weight: 500; white-space: nowrap; }
.board-actions { display: flex; gap: 5px; align-items: center; }
.board-actions button { min-width: 44px; height: 44px; color: var(--text); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 9px; }
.board-actions button:hover { background: #324165; }
.icon-button { font-size: 1.25rem; line-height: 1; }
.board-actions .zoom-label { min-width: 64px; font-size: .67rem; letter-spacing: 0; }
.board-wrap { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border: 1px solid #4d5871; border-radius: 8px; background: #f8f6ef; background-image: linear-gradient(45deg, #e8e8e8 25%, transparent 25%), linear-gradient(-45deg, #e8e8e8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e8e8e8 75%), linear-gradient(-45deg, transparent 75%, #e8e8e8 75%); background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; }
#board { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#board:active { cursor: grabbing; }
.board-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #26324a; background: #faf9f0ed; font-size: .92rem; font-weight: 700; pointer-events: none; }
.board-loading[hidden] { display: none; }
.board-footer { display: flex; justify-content: space-between; gap: 16px; padding: 15px 3px 1px; font-size: .75rem; color: var(--muted); }
.coordinates { white-space: nowrap; color: var(--accent); font-size: .72rem; }
.side-panel { overflow: hidden; }
.side-section { padding: 21px 23px; border-bottom: 1px solid var(--line); }
.side-section:last-child { border: 0; }
.side-title-row, .section-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tiny-star { font-size: 1.28rem; color: var(--peach); }
.side-intro h2 { margin-top: 8px; font-size: 1.42rem; letter-spacing: -.035em; }
.side-intro p { margin: 7px 0 0; color: var(--muted); font-size: .86rem; }
.section-label-row { margin-bottom: 13px; }
.section-label-row h3 { font-size: .9rem; }
.section-label-row span { color: var(--muted); font-size: .65rem; white-space: nowrap; }
.palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.swatch { width: 100%; min-height: 44px; aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 8px; background: var(--swatch); box-shadow: inset 0 0 0 1px #0002; }
.swatch:hover { transform: translateY(-2px); }
.swatch[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--peach); }
.coordinate-inputs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.coordinate-inputs label { display: flex; align-items: center; gap: 9px; padding: 9px 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.coordinate-inputs input { width: 100%; min-width: 0; background: transparent; border: 0; color: var(--text); outline: 0; font-family: inherit; }
.coordinate-inputs label:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #a5b1ff33; }
.paint-button { width: 100%; min-height: 48px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; background: var(--accent); border: 0; border-radius: 9px; color: #111a35; font-size: .88rem; font-weight: 800; }
.paint-button:hover:not(:disabled) { background: #bdc5ff; }
.paint-button:disabled { cursor: not-allowed; opacity: .5; }
.paint-hint, .invite-feedback { min-height: 20px; margin: 10px 0 0; color: var(--muted); font-size: .76rem; }
.invite-section { background: #1c2740; }
.invite-form { display: flex; gap: 7px; }
.invite-form input { width: 0; flex: 1; min-height: 44px; padding: 0 11px; background: #111a2d; border: 1px solid var(--line); border-radius: 8px; color: var(--text); outline: 0; font-size: .85rem; }
.invite-form input:focus { border-color: var(--accent); }
.invite-form button { min-width: 65px; min-height: 44px; border: 1px solid var(--accent); border-radius: 8px; color: var(--accent); background: transparent; font-size: .82rem; font-weight: 700; }
.invite-form button:hover { background: #a5b1ff1a; }
.invite-feedback[data-error="true"] { color: var(--peach); }
.activity-section { padding-bottom: 15px; }
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid #ffffff12; color: var(--muted); font-size: .78rem; }
.recent-list li:first-child { border: 0; }
.recent-color { width: 12px; height: 12px; flex: 0 0 12px; background: var(--swatch); border-radius: 3px; box-shadow: 0 0 0 1px #ffffff33; }
.recent-time { margin-left: auto; font-family: ui-monospace, Consolas, monospace; font-size: .69rem; white-space: nowrap; }
.recent-list .empty-activity { color: var(--muted); }
.footer { display: flex; justify-content: space-between; gap: 16px; padding: 32px 0 30px; color: var(--muted); font-size: .65rem; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }
@media (max-width: 1000px) { .workspace { grid-template-columns: minmax(0, 1fr) 310px; } .side-section { padding: 18px; } }
@media (max-width: 780px) { .workspace { grid-template-columns: 1fr; } .side-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .side-section { border-right: 1px solid var(--line); } .activity-section, .placement-section { border-right: 0; } }
@media (max-width: 560px) { .topbar { height: 64px; } .brand { font-size: .76rem; } .topbar-right { gap: 12px; } .back-link { display: none; } .lang-toggle { height: 28px; padding: 0 7px; font-size: .7rem; } .intro { padding: 35px 0 27px; } .workspace { gap: 14px; } .board-panel { padding: 12px; border-radius: 13px; } .panel-heading { padding-bottom: 12px; } .panel-heading h2 { font-size: 1rem; } .board-dimensions { display: none; } .board-footer { flex-direction: column; gap: 4px; font-size: .7rem; } .side-panel { display: block; border-radius: 13px; } .side-section { border-right: 0; } .swatch { min-height: 44px; } .footer { flex-direction: column; gap: 4px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
