:root {
  color-scheme: dark;
  --bg: #080c0e;
  --surface: #101619;
  --surface2: #171e20;
  --line: #354044;
  --text: #e6e8df;
  --muted: #a0aaa6;
  --soft: #73807c;
  --green: #73c8bd;
  --green2: #387e79;
  --gold: #d5aa58;
  --red: #c86d56;
  --blue: #7eafc2;
}

body {
  background: #080c0e;
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

.shell { max-width: 1640px; padding: 0 22px 30px; }
.topbar { height: 56px; border-color: #384347; }
.mark { border: 0; border-radius: 0; color: var(--green); background: #182022; }
.brand strong { font-size: 13px; letter-spacing: 0; }
.brand small { color: #748581; letter-spacing: 1px; font-size: 9px; }
.top-right { gap: 12px; }
.local-pill { color: #aebbb6; }
.dot { background: var(--green); box-shadow: 0 0 8px #67c4b4; }
.icon-btn, .quiet-btn, .primary-btn, .danger-btn {
  border-radius: 2px;
  background: #151d20;
  border-color: #465257;
  padding: 6px 10px;
}
.primary-btn { background: #256f70; border-color: #49a29c; color: #f2f5ed; }
.primary-btn:hover { background: #328482; }
.header-strip {
  min-height: 54px;
  padding: 10px 0;
  border-bottom: 1px solid #343e40;
}
.eyebrow { color: var(--green); letter-spacing: 1.4px; }
.header-strip h1 { font-size: 16px; font-weight: 600; }
.header-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; }
.run-hud { display: flex; align-items: center; justify-content: center; gap: 0; min-width: 0; }
.run-hud span { min-width: 66px; display: flex; align-items: baseline; justify-content: center; gap: 7px; padding: 4px 10px; border-left: 1px solid #394446; }
.run-hud i { color: #8f9d98; font-style: normal; font-size: 9px; white-space: nowrap; }
.run-hud b { color: #e5e0cc; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.workspace {
  grid-template-columns: 258px minmax(0, 1fr) 300px;
  gap: 10px;
  margin-top: 10px;
}
.panel {
  border-radius: 2px;
  border-color: #394346;
  background: rgb(13 18 20 / 94%);
}
.panel-head {
  min-height: 42px;
  padding: 9px 12px;
  background: #11181b;
  border-color: #394346;
}
.panel-head h2 { font-size: 12px; letter-spacing: .2px; }
.panel-head small { color: #82928e; }
.panel-body { padding: 11px 12px; }
.state-panel { background: rgb(12 17 19 / 95%); }
.section-label { color: #83aaa1; letter-spacing: 1px; }
.rule { background: #303b3d; margin: 11px 0; }
.field label, .checkline { color: #a6b1ad; }
.field input, .field select, .field textarea, .search,
.node-table select, .node-table input, .inventory-box textarea {
  background: #0a1012;
  border-color: #3a4649;
  border-radius: 2px;
}
.field input:focus, .field select:focus, .field textarea:focus,
.loot-controls input:focus, .loot-controls select:focus { border-color: var(--green); }
.floor-tabs { gap: 3px; }
.floor-btn {
  border-radius: 1px;
  border-color: #3b4548;
  background: #0b1113;
}
.floor-btn.active {
  color: #f0dfaf;
  border-color: #a9894d;
  background: #3a3020;
}
.goal-btn {
  border-radius: 1px;
  border-color: #3a4548;
  background: #0d1416;
}
.goal-btn.active {
  color: #d9ebe2;
  border-color: #4e9f94;
  background: #173432;
}
.compact-add, .tag { border-radius: 2px; }
.center-panel { position: relative; overflow: hidden; background: #0b1012; }
.center-panel > .panel-head { position: relative; z-index: 4; }
.map-tools button { border-radius: 2px; }
.dropzone {
  min-height: clamp(330px, 37vw, 510px);
  background-color: #101714;
  background-image: url("../assets/blackflow-canopy.jpg");
  background-size: cover;
  background-position: center 52%;
  border-color: #344143;
}
.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgb(5 10 12 / 54%);
  z-index: 1;
}
.dropzone img { z-index: 0; }
.drop-hint { z-index: 2; color: #b8c5bf; }
.drop-hint strong { color: #e1e6dc; text-shadow: 0 1px 8px #000; }
.drop-hint span { max-width: 420px; color: #a6b2ac; text-shadow: 0 1px 5px #000; }
.dropzone.has-image::before { background: rgb(5 9 10 / 13%); }
.dropzone.has-image .drop-hint { z-index: 3; background: rgb(5 10 12 / 68%); }
.map-meta {
  position: absolute;
  z-index: 3;
  top: 43px;
  left: 11px;
  right: 11px;
  min-height: 33px;
  padding: 7px 10px;
  border: 1px solid rgb(131 159 151 / 28%);
  background: rgb(7 12 14 / 82%);
  color: #b7c1bb;
  backdrop-filter: blur(6px);
}
.map-meta strong { color: #d7ded5; }
.node-toolbar { margin: 0 0 7px; }
.table-wrap { max-height: 250px; overflow: auto; }
.node-table { min-width: 450px; }
.node-table th { background: #11181a; color: #93a19c; }
.node-table td { border-color: #2b3538; }
.node-foot { border-color: #313d3f; }
.right-panel { top: 10px; }
.results { padding: 8px; gap: 6px; }
.result-card {
  border-radius: 2px;
  border-color: #364144;
  background: #11181b;
}
.result-card.best { border-color: #58a69a; background: #122321; }
.rank { color: #81c9bd; }
.result-card h3 { font-size: 12px; }
.chip { border-radius: 2px; border-color: #43504f; }
.chip.confirmed { border-color: #987b44; color: #e1c77f; }
.feedback-btn { border-radius: 2px; }
.confidence { border-color: #354043; color: #889792; }
.bottom-grid { gap: 10px; margin-top: 10px; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); }
.inventory-box textarea { min-height: 46px; }
.tag { background: #172020; border-color: #42514e; }
.sample-row { border-color: #303a3d; }
.sample-row span:last-child { color: #9fada7; }
.loot-panel { margin-top: 10px; }
.loot-controls { background: #0d1315; border-color: #374144; }
.loot-controls select, .loot-controls input { border-radius: 2px; background: #080e10; border-color: #394548; }
.loot-note { color: #93a09a; }
.loot-event { border-color: #303b3d; }
.loot-event h3 { color: #d8ddd6; font-weight: 600; }
.loot-choice { border-bottom: 1px solid rgb(54 65 66 / 40%); }
.loot-choice em { color: #d9b96b; }
.loot-choice em.owned { color: #82918b; }
.footer { border-color: #354043; color: #7f8c87; }
.footer a { color: #8ec6b8; }
.toast { border-radius: 2px; background: #172526; border-color: #4b9288; }
.modal { border-radius: 2px; }
.modal-head { background: #11181b; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .right-panel { grid-column: 1 / -1; }
  .results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .empty-results { grid-column: 1 / -1; }
  .map-meta { top: 43px; }
}

@media (max-width: 760px) {
  .shell { padding: 0 10px 24px; }
  .topbar { height: 52px; }
  .top-right { gap: 6px; }
  .header-strip { min-height: 48px; padding: 8px 0; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .run-hud { grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; }
  .run-hud span { min-width: 76px; justify-content: flex-start; padding-left: 8px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .center-panel { grid-row: 1; }
  .state-panel { grid-row: 2; }
  .right-panel { grid-row: 3; grid-column: auto; }
  .dropzone { min-height: 300px; }
  .map-meta { left: 7px; right: 7px; top: 42px; font-size: 9px; }
  .results { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
  .loot-controls { grid-template-columns: 1fr; }
  .loot-choice { grid-template-columns: minmax(0, 1fr) auto; }
  .loot-choice span { grid-column: 1 / -1; }
  .loot-choice em { grid-column: 2; grid-row: 1; }
  .node-foot { align-items: flex-start; }
  .node-foot .quiet-btn { min-width: 132px; white-space: nowrap; }
}

@media (max-width: 390px) {
  .shell { padding-right: 8px; padding-left: 8px; }
  .brand strong { font-size: 11px; }
  .brand small { font-size: 8px; }
  .local-pill { font-size: 9px; }
  .top-actions { gap: 4px; }
  .top-actions .icon-btn { padding: 5px 7px; }
}
