/* 过洋牵星：夜航。底色靛黑；星、刻线、文字用骨白；板顶对上星的那一刻用金。 */
:root {
	--night: #04070f;
	--panel: rgba(6, 10, 20, .8);
	--panel-solid: #070b16;
	--line: rgba(236, 226, 204, .14);
	--line-2: rgba(236, 226, 204, .28);
	--bone: #ece2cc;
	--bone-2: rgba(236, 226, 204, .76);
	--bone-3: rgba(236, 226, 204, .52);
	--gold: #f2c46d;
	--serif: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
	--edge: clamp(16px, 3vw, 44px);
	--pw: 360px;
	--side: calc(var(--pw) + var(--edge) + 16px);
	--mid: calc((100vw - var(--side)) / 2);
}
* { box-sizing: border-box; }
html { background: var(--night); color: var(--bone); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--bone); font: 400 15px/1.7 var(--serif); }
button, input, output { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------------- 星空舞台 */
.stage { position: fixed; inset: 0; overflow: hidden; background: var(--night); }
.sky { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; }
.stage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--grain, none), radial-gradient(120% 90% at 38% 62%, transparent 52%, rgba(0, 0, 0, .5) 100%); background-size: 180px 180px, 100% 100%; opacity: .9; }

.head { position: absolute; z-index: 2; left: var(--edge); top: var(--edge); max-width: min(23em, calc(var(--mid) - 140px)); pointer-events: none; }
.title { margin: 0; font: 900 clamp(34px, 3.5vw, 52px)/1.08 var(--serif); letter-spacing: .26em; color: var(--bone); text-shadow: 0 2px 30px rgba(0, 0, 0, .7); }
.lead { margin: 16px 0 0; font-size: 15px; line-height: 1.9; color: var(--bone-2); text-shadow: 0 1px 14px rgba(0, 0, 0, .9); text-wrap: pretty; }

.topbar { position: absolute; z-index: 2; right: var(--edge); top: var(--edge); display: flex; align-items: stretch; gap: 10px; }
.look { display: flex; border: 1px solid var(--line-2); background: var(--panel); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.look__b { display: flex; flex-direction: column; align-items: flex-start; min-width: 96px; padding: 7px 15px 8px; border: 0; background: none; color: var(--bone-2); text-align: left; transition: background .2s, color .2s; }
.look__b + .look__b { border-left: 1px solid var(--line); }
.look__b b { font: 700 16px/1.3 var(--serif); letter-spacing: .16em; }
.look__b span { font-size: 12px; line-height: 1.5; letter-spacing: .08em; color: var(--bone-3); }
.look__b[aria-pressed="true"] { background: var(--bone); color: #0a0d16; }
.look__b[aria-pressed="true"] span { color: rgba(10, 13, 22, .62); }
.look__b:hover:not([aria-pressed="true"]) { background: rgba(236, 226, 204, .08); color: var(--bone); }
.info-btn { padding: 0 16px; border: 1px solid var(--line-2); background: var(--panel); color: var(--bone-2); font-size: 14px; letter-spacing: .24em; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.info-btn:hover { color: var(--bone); border-color: var(--bone-3); }

/* ---------------- 牵星板、象牙块、读数 */
.kit { position: fixed; z-index: 3; left: var(--mid); bottom: 16px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - var(--side) - 24px); display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 14px; background: var(--panel); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.read { width: 0; min-width: 100%; margin: 0 0 2px; min-height: 1.7em; font-size: 15px; line-height: 1.7; color: var(--bone-2); transition: color .25s; }
.read b { color: var(--bone); font-weight: 700; }
.read.is-hit { color: var(--bone); }
.read.is-hit b { color: var(--gold); }
.kit__row { display: flex; align-items: flex-end; gap: 14px; min-width: 0; }
.kit__k { flex: none; width: 82px; margin: 0 0 2px; font: 700 14px/1.3 var(--serif); letter-spacing: .14em; color: var(--bone); }
.kit__k small { display: block; margin-top: 3px; font-weight: 400; font-size: 11.5px; letter-spacing: .06em; color: var(--bone-3); }
.rack { display: flex; align-items: flex-end; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-top: 4px; }
.rack::-webkit-scrollbar { display: none; }
.board { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-width: 24px; padding: 0; border: 0; background: none; color: var(--bone-3); font: 500 11px/1 var(--serif); }
.board i { --s: calc(18px + var(--n) * 2.4px); display: block; width: var(--s); height: var(--s); border: 1px solid rgba(236, 226, 204, .2); border-top: 2px solid rgba(236, 226, 204, .55); background: linear-gradient(160deg, #2b2119, #110d0a 72%); transition: transform .18s, border-color .18s, box-shadow .18s; }
.board:hover i { transform: translateY(-3px); border-color: rgba(236, 226, 204, .45); }
.board[aria-checked="true"] { color: var(--gold); }
.board[aria-checked="true"] i { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 6px 18px -6px rgba(242, 196, 109, .55); }
.ivory { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 30px; padding: 3px 12px; border: 1px solid var(--line-2); background: none; font-size: 13px; letter-spacing: .1em; color: var(--bone-2); transition: background .18s, color .18s, border-color .18s; }
.chip:hover { color: var(--bone); border-color: var(--bone-3); }
.chip[aria-checked="true"] { background: #efe6d2; border-color: #efe6d2; color: #17120d; }

/* ---------------- 海图、船位、记录 */
.sea { position: fixed; z-index: 3; right: var(--edge); top: calc(var(--edge) + 64px); bottom: 16px; width: var(--pw); display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 18px; background: var(--panel); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); scrollbar-width: thin; scrollbar-color: rgba(236, 226, 204, .22) transparent; }
.sea > * { flex: none; }
.sea__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sea__t, .recs__t { margin: 0; font: 700 15px/1.3 var(--serif); letter-spacing: .24em; color: var(--bone); }
.route { display: flex; border: 1px solid var(--line-2); }
.route button { padding: 4px 9px; border: 0; background: none; font-size: 12.5px; letter-spacing: .02em; color: var(--bone-3); }
.route button + button { border-left: 1px solid var(--line); }
.route button[aria-pressed="true"] { background: rgba(236, 226, 204, .14); color: var(--bone); }
.route button:hover { color: var(--bone); }

.chart svg { display: block; width: 100%; height: auto; cursor: crosshair; background: #060c18; }
.chart .land { fill: #131d30; stroke: rgba(236, 226, 204, .42); stroke-width: .6; stroke-linejoin: round; }
.chart .eq line { stroke: rgba(236, 226, 204, .16); stroke-width: .6; }
.chart .eq text, .chart .zl text { font: 500 9px/1 var(--serif); }
.chart .eq text { fill: rgba(236, 226, 204, .4); }
.chart .zl line { stroke: rgba(242, 196, 109, .26); stroke-width: .6; stroke-dasharray: 2 3; }
.chart .zl text { fill: rgba(242, 196, 109, .6); }
.chart .zl .is-b line { stroke: var(--gold); stroke-width: 1.2; stroke-dasharray: none; }
.chart .zl .is-b text { fill: var(--gold); font-weight: 700; font-size: 10px; }
.chart .rt { fill: none; stroke: rgba(236, 226, 204, .3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .rt.is-on { stroke: rgba(236, 226, 204, .85); stroke-width: 1.4; stroke-dasharray: none; }
.chart .rt-hit { fill: none; stroke: transparent; stroke-width: 14; }
.chart .port circle { fill: var(--bone); }
.chart .port text { fill: var(--bone); font: 500 11px/1 var(--serif); letter-spacing: .04em; paint-order: stroke; stroke: rgba(6, 12, 24, .92); stroke-width: 3px; }
.chart .ship .hull { fill: var(--gold); stroke: #060c18; stroke-width: 1; }
.chart .ship .halo { fill: rgba(242, 196, 109, .16); stroke: rgba(242, 196, 109, .55); stroke-width: .8; }
.chart__cap { margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: var(--bone-3); }
.chart__cap i { font-style: normal; color: rgba(242, 196, 109, .82); }

.ctl { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 0 10px; margin-top: 12px; }
.ctl__k { font: 700 13px/1 var(--serif); letter-spacing: .16em; color: var(--bone); }
.ctl__v { grid-column: 2; display: flex; justify-content: space-between; gap: 8px; min-height: 1.6em; font-size: 12.5px; line-height: 1.6; color: var(--bone-3); }
.ctl__v b { font-weight: 500; color: var(--bone); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, rgba(236, 226, 204, .2), rgba(236, 226, 204, .55), rgba(236, 226, 204, .2)); }
input[type="range"]::-moz-range-track { height: 2px; background: rgba(236, 226, 204, .38); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -8px; border-radius: 50%; background: #0a0f1c; border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(242, 196, 109, .35); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #0a0f1c; border: 2px solid var(--gold); }

.recs { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.recs__n { margin: 6px 0 0; font-size: 12.5px; line-height: 1.75; color: var(--bone-3); }
.recs__l { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.rec { display: block; width: 100%; padding: 9px 12px 10px; border: 1px solid var(--line); background: rgba(236, 226, 204, .03); text-align: left; transition: border-color .2s, background .2s; }
.rec:hover { border-color: var(--line-2); background: rgba(236, 226, 204, .06); }
.rec[aria-pressed="true"] { border-color: rgba(242, 196, 109, .7); background: rgba(242, 196, 109, .07); }
.rec__src { display: block; font-size: 12px; letter-spacing: .03em; color: var(--bone-3); }
.rec__v { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 3px; font: 500 14px/1.55 var(--serif); letter-spacing: .04em; color: var(--bone-2); }
.rec__v i { font-style: normal; font-weight: 700; color: var(--gold); }
.task { margin: 8px 0 0; padding: 10px 12px; border-left: 2px solid var(--gold); background: rgba(242, 196, 109, .06); font-size: 13.5px; line-height: 1.8; color: var(--bone-2); }
.task[hidden] { display: none; }
.task b { color: var(--bone); }
.task .ok { color: var(--gold); font-weight: 700; }
.task__x { display: block; margin-top: 6px; padding: 0; border: 0; background: none; font-size: 12.5px; color: var(--bone-3); text-decoration: underline; text-underline-offset: 3px; }
.task__x:hover { color: var(--bone); }

/* ---------------- 说明 */
.notes { position: fixed; inset: 0; z-index: 20; display: flex; justify-content: flex-end; background: rgba(2, 4, 10, .55); }
.notes[hidden] { display: none; }
.qx-modal .wk-pill { display: none; }
.notes__in { position: relative; width: min(540px, 100%); height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 34px 34px 56px; background: #090e1a; border-left: 1px solid var(--line); font-size: 14.5px; line-height: 1.95; color: var(--bone-2); }
.notes__in h2 { margin: 28px 0 8px; font: 700 17px/1.4 var(--serif); letter-spacing: .2em; color: var(--bone); }
.notes__in h2:first-of-type { margin-top: 0; }
.notes__in p { margin: 0 0 12px; }
.notes__in ul { margin: 0; padding-left: 1.2em; }
.notes__in li { margin: 0 0 6px; }
.notes__src { font-size: 13px; color: var(--bone-3); }
.notes__x { position: absolute; right: 12px; top: 10px; width: 40px; height: 40px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--bone-2); }
.notes__x:hover { color: var(--bone); }
.nojs { position: fixed; left: 0; right: 0; top: 45%; text-align: center; }

@media (max-width: 1199px) {
	:root { --pw: 320px; }
	.lead { font-size: 14px; }
}
@media (max-width: 1400px) {
	.kit { bottom: 64px; }   /* 让开左下角「在展馆中查看」的小标签 */
}

/* ---------------- 窄屏、竖屏：星空钉在上面，板在它下面，海图往下滚 */
@media (max-width: 900px), (max-aspect-ratio: 1/1) {
	:root { --edge: 12px; --stage-h: max(48vh, 300px); --stage-h: max(48svh, 300px); }
	.stage { position: sticky; top: 0; z-index: 4; height: var(--stage-h); }
	.head { left: 14px; top: 12px; max-width: none; }
	.title { font-size: 25px; letter-spacing: .2em; }
	.lead { display: none; }
	.topbar { right: 10px; top: 10px; gap: 6px; }
	.look__b { min-width: 0; padding: 5px 10px 6px; }
	.look__b b { font-size: 13.5px; letter-spacing: .1em; }
	.look__b span { font-size: 10.5px; }
	.info-btn { padding: 0 10px; font-size: 12.5px; letter-spacing: .14em; }
	.kit { position: sticky; z-index: 3; top: var(--stage-h); left: auto; bottom: auto; transform: none; width: auto; max-width: none; gap: 7px; padding: 9px 12px 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--panel-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
	.read { min-height: 3.1em; margin: 0; font-size: 13.5px; line-height: 1.55; }
	.kit__row { gap: 10px; }
	.kit__row:first-of-type .kit__k { display: none; }
	.kit__k { width: auto; font-size: 12.5px; letter-spacing: .1em; }
	.kit__k small { display: none; }
	.rack { flex: 1; gap: 3px; justify-content: space-between; padding-top: 2px; }
	.board { font-size: 10px; }
	.board i { --s: calc(11px + var(--n) * 1.55px); }
	.chip { min-height: 28px; padding: 2px 9px; font-size: 12.5px; letter-spacing: .04em; }
	.ivory { gap: 5px; flex-wrap: nowrap; }
	.sea { position: relative; z-index: 1; right: auto; top: auto; bottom: auto; width: auto; overflow: visible; padding: 14px 14px 96px; border: 0; background: #060a14; -webkit-backdrop-filter: none; backdrop-filter: none; }
	.sea__head { order: 0; }
	.chart { order: 2; }
	.ctl { order: 3; }
	.ctl.ctl--ship { order: 1; margin-top: 0; margin-bottom: 10px; }
	.recs { order: 4; }
	.notes__in { padding: 26px 20px 56px; }
	.kit > *, .sea > * { width: 100%; max-width: 560px; margin-inline: auto; }
	.kit > .read { min-width: 0; }
}
/* ---------------- 横放的手机、矮窗口：星空固定在左边，板架和海图在右边一栏，整页往下滚 */
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
	:root { --pw: 330px; --edge: 12px; }
	.qx { padding-left: calc(100% - var(--pw)); }
	.stage { position: fixed; inset: 0; z-index: 0; height: auto; }
	.head { left: 14px; top: 10px; max-width: none; }
	.title { font-size: 24px; letter-spacing: .2em; }
	.lead { display: none; }
	.topbar { left: 14px; right: auto; top: 48px; gap: 6px; }
	.look__b { min-width: 0; padding: 4px 10px 5px; }
	.look__b b { font-size: 13px; letter-spacing: .1em; }
	.look__b span { font-size: 10.5px; }
	.info-btn { padding: 0 10px; font-size: 12.5px; letter-spacing: .14em; }
	.kit { position: relative; z-index: 3; top: auto; left: auto; bottom: auto; transform: none; width: auto; max-width: none; gap: 7px; padding: 10px 12px; border: 0; border-left: 1px solid var(--line); background: var(--panel-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
	.read { min-height: 3.1em; margin: 0; font-size: 13px; line-height: 1.55; }
	.kit__row { gap: 8px; }
	.kit__row:first-of-type .kit__k { display: none; }
	.kit__k { width: auto; font-size: 12px; letter-spacing: .1em; }
	.kit__k small { display: none; }
	.rack { flex: 1; gap: 2px; justify-content: space-between; padding-top: 2px; }
	.board { min-width: 22px; font-size: 10px; }
	.board i { --s: calc(9px + var(--n) * 1.4px); }
	.chip { min-height: 26px; padding: 2px 7px; font-size: 12px; letter-spacing: 0; }
	.ivory { gap: 4px; flex-wrap: nowrap; }
	.sea { position: relative; z-index: 3; top: auto; right: auto; bottom: auto; width: auto; overflow: visible; padding: 12px 12px 80px; border: 0; border-left: 1px solid var(--line); background: #060a14; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
