* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #04111f; color: #d8e6f3;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 13px; }
body { display: flex; flex-direction: column; }

.toolbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  background: #0a2238; border-bottom: 1px solid #1d4262; flex-wrap: wrap; }
.title { font-size: 18px; color: #ffd166; letter-spacing: 4px; margin-right: 8px; }
.toolbar label { display: flex; align-items: center; gap: 6px; }
.toolbar input, .toolbar select, .toolbar button { background: #12314f; color: #d8e6f3;
  border: 1px solid #2c5b84; border-radius: 4px; padding: 4px 8px; font: inherit; }
.toolbar input { width: 110px; }
.toolbar button { cursor: pointer; }
.toolbar button:hover { background: #1a4268; }
.spd-wrap { display: inline-flex; gap: 4px; }
.spd.active { background: #2f7bbf; border-color: #5aa9ff; }
.clock { font-variant-numeric: tabular-nums; color: #ffd166; }
.hint { color: #6f8fa8; font-size: 12px; }

main { flex: 1; display: flex; min-height: 0; }
.stage { flex: 1; position: relative; min-width: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  cursor: crosshair; }
#result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(6, 22, 40, 0.94); border: 1px solid #5aa9ff; border-radius: 8px;
  padding: 18px 26px; text-align: center; min-width: 320px; }
#result h2 { margin: 0 0 8px; color: #ffd166; }
#result button { margin-top: 8px; background: #2f7bbf; color: #fff; border: 0;
  border-radius: 4px; padding: 6px 16px; cursor: pointer; font: inherit; }

aside { width: 340px; overflow-y: auto; background: #071a2d; border-left: 1px solid #1d4262;
  padding: 10px; }
aside h3 { margin: 14px 0 6px; font-size: 14px; color: #ffd166; }
.side h3 { margin: 6px 0 2px; font-size: 14px; }
.side.s0 h3 { color: #5aa9ff; }
.side.s1 h3 { color: #ff7a6b; }
.side p { margin: 0 0 6px; color: #8fb0c9; }
.ship { display: grid; grid-template-columns: 1fr 58px 70px; gap: 6px; align-items: center;
  padding: 3px 4px; border-radius: 3px; cursor: pointer; }
.ship:hover { background: #10304d; }
.ship.sel { background: #1d4a70; }
.ship.dead { opacity: 0.35; text-decoration: line-through; }
.ship .cls { color: #8fb0c9; font-size: 12px; }
.ship .bar { height: 6px; background: #1b2e40; border-radius: 3px; overflow: hidden; }
.ship .bar i { display: block; height: 100%; background: #7dff8a; }
#log div { padding: 2px 0; border-bottom: 1px dashed #15324d; }
#log .s0 { color: #5aa9ff; }
#log .s1 { color: #ff7a6b; }
#log .neutral { color: #8fb0c9; }

.account { display: inline-flex; gap: 6px; align-items: center; color: #8fb0c9; }
.account button { background: #12314f; color: #d8e6f3; border: 1px solid #2c5b84; border-radius: 4px; padding: 2px 8px; font: inherit; cursor: pointer; }
.login { background: #0c2740; border: 1px solid #1d4262; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; }
.login h3 { margin: 0 0 6px; }
.login .row { display: flex; gap: 6px; margin: 6px 0; }
.login input { flex: 1; min-width: 0; background: #071a2d; color: #d8e6f3; border: 1px solid #2c5b84; border-radius: 4px; padding: 4px 6px; font: inherit; }
.login button { background: #2f7bbf; color: #fff; border: 0; border-radius: 4px; padding: 4px 10px; font: inherit; cursor: pointer; white-space: nowrap; }
.login .msg { color: #ffd166; min-height: 1em; margin: 4px 0 0; }
.records { background: #0c2740; border: 1px solid #1d4262; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; font-size: 12px; }
.records h3 { margin: 0 0 6px; }
.records div { padding: 2px 0; border-bottom: 1px dashed #15324d; }

@media (max-width: 800px) {
  main { flex-direction: column; }
  aside { width: auto; max-height: 40%; }
  .hint { display: none; }
}
