:root {
  --bg: #12161e;
  --panel: #161c28;
  --panel-2: #1e2736;
  --row: #283446;
  --text: #f2f5fa;
  --muted: #96a5b9;
  --accent: #78c8a0;
  --line: #e6ecf5;
  --danger: #c45a5a;
  --ready: #1c6e46;
  --hud: rgba(18, 24, 34, 0.88);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100vh;
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(2100px, 100vw);
  height: 100vh;
  max-height: 100vh;
  background: #0e1218;
}

.map-pane {
  position: relative;
  overflow: hidden;
  background: #0a0d12;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.map-stage {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
}

.map-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  pointer-events: none;
}

/* 标记层与图片同比例铺满 contain 区域：用 aspect-ratio 盒子对齐 */
.map-frame {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(100%, calc(100vh * 1600 / 1200));
  aspect-ratio: 1600 / 1200;
  max-height: 100%;
}

.map-frame img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

#markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.marker-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  max-width: 220px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(24, 32, 48, 0.92);
  color: #f5f8fc;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.marker-leader {
  display: block;
  margin-top: 0;
  overflow: visible;
}

.marker-leader line,
.marker-leader circle {
  stroke: var(--line);
  stroke-width: 1.5;
  fill: var(--line);
}

.marker-leader circle[fill="none"] {
  fill: none;
}

.marker:hover .marker-tag {
  background: rgba(40, 56, 78, 0.96);
}

.marker.is-ready .marker-tag {
  background: rgba(28, 110, 70, 0.92);
}

.marker.is-ready .marker-leader line,
.marker.is-ready .marker-leader circle {
  stroke: #5adc96;
  fill: #5adc96;
}

.marker.is-ready .marker-leader circle[fill="none"] {
  fill: none;
}

.marker.is-pulse .marker-tag {
  animation: pulse 1s ease-in-out infinite;
}

.marker.is-locked .marker-tag {
  background: rgba(140, 40, 40, 0.92);
}

.marker.is-locked .marker-leader line,
.marker.is-locked .marker-leader circle {
  stroke: #e66464;
  fill: #e66464;
}

.marker.is-locked .marker-leader circle[fill="none"] {
  fill: none;
}

.marker.is-focus {
  z-index: 6;
}

.marker.is-focus .marker-tag {
  background: rgba(56, 130, 210, 0.95);
  box-shadow: 0 0 0 3px rgba(90, 170, 255, 0.55);
  animation: focus-pulse 1.1s ease-in-out infinite;
}

.marker.is-focus .marker-leader line,
.marker.is-focus .marker-leader circle {
  stroke: #7ec4ff;
  fill: #7ec4ff;
}

.marker.is-focus .marker-leader circle[fill="none"] {
  fill: none;
}

@keyframes focus-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.08);
    filter: brightness(1.2);
  }
}

@keyframes pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.25);
  }
}

.player-panel {
  flex-shrink: 0;
  z-index: 5;
  margin: 0;
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, #141b26 0%, #10161f 100%);
  border-top: 1px solid #243044;
}

.player-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.player-panel-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.player-panel-title {
  font-size: 15px;
  color: #d5e0ee;
  font-weight: 600;
}

.player-title {
  color: #e6c86e;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.company-scale {
  color: #7ec8e8;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.stat-value.title-value {
  color: #e6c86e;
}

.stat-value.scale-value {
  color: #7ec8e8;
}

.player-panel-hint {
  color: #c8b070;
  font-size: 12px;
  text-align: right;
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.corp-upgrade-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(40, 52, 70, 0.55);
  border: 1px solid rgba(74, 106, 181, 0.35);
}

.corp-upgrade-row .detail-hint {
  margin: 0;
  flex: 1;
  min-width: 180px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(40, 52, 70, 0.55);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
}

.stat-value {
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value.accent {
  color: var(--accent);
}

.user-chip {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-radius: 8px;
  background: rgba(24, 34, 48, 0.92);
  color: #d7e2f0;
  font-size: 13px;
}

.user-chip[hidden] {
  display: none !important;
}

.user-chip button {
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  background: #3a4a60;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.user-chip button:hover {
  background: #4a5d78;
}

.reset-btn {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 6;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: #5a4646;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.reset-btn:hover {
  background: #6e5555;
}

.time-controls {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 280px);
}

.time-date {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(18, 26, 38, 0.92);
  color: #e8f0ff;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.time-speed-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(18, 26, 38, 0.88);
}

.time-btn {
  border: 0;
  border-radius: 7px;
  padding: 6px 12px;
  background: transparent;
  color: #9eb0c4;
  cursor: pointer;
  font-size: 13px;
  min-width: 44px;
}

.time-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.time-btn.is-active {
  background: #2f6f55;
  color: #fff;
}

.time-btn[data-speed='0'].is-active {
  background: #8a4a4a;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 16, 0.78);
  backdrop-filter: blur(4px);
}

.auth-overlay[hidden] {
  display: none !important;
}

.auth-card {
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 24px 22px;
  border-radius: 16px;
  background: #1a2433;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.auth-card h2 {
  margin: 0;
  font-size: 24px;
}

.auth-sub {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.auth-card label,
.create-shop label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.auth-card input,
.create-shop input,
.create-shop select {
  border: 1px solid #33445c;
  border-radius: 8px;
  padding: 10px 12px;
  background: #121925;
  color: var(--text);
  font-size: 15px;
}

.auth-error,
.create-shop-error {
  min-height: 18px;
  color: #e07a7a;
  font-size: 13px;
}

.auth-card button[type='submit'],
.create-shop button[type='submit'] {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: #38aa78;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.auth-card button[type='submit']:disabled,
.create-shop button[type='submit']:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-switch {
  border: 0;
  background: transparent;
  color: #8eb4dc;
  cursor: pointer;
  font-size: 13px;
  padding: 4px;
}

.create-shop {
  margin: 0 16px 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  max-height: 46%;
  overflow: auto;
  overscroll-behavior: contain;
}

.create-shop[hidden] {
  display: none !important;
}

.create-shop-title {
  font-size: 15px;
  font-weight: 600;
}

.shop-type-label {
  color: var(--muted);
  font-size: 12px;
}

.shop-attr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-attr-tab {
  border: 1px solid #33445c;
  border-radius: 999px;
  background: #121925;
  color: #c4cfdb;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.shop-attr-tab:hover {
  border-color: #5a7a9a;
}

.shop-attr-tab.is-active {
  border-color: #78c8a0;
  background: rgba(56, 170, 120, 0.18);
  color: #dff7ea;
}

.shop-attr-tab.is-locked,
.shop-attr-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
  background: #0c1016;
  color: #7a8490;
}

.shop-attr-tab.is-unavailable {
  opacity: 0.55;
  cursor: pointer;
  border-style: dashed;
}

.shop-level-panel,
.shop-name-pool,
.shop-asset-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-level-btn,
.shop-name-chip {
  border: 1px solid #3a4258;
  border-radius: 6px;
  background: #1c2233;
  color: #e8ecf5;
  padding: 5px 9px;
  font-size: 12px;
  cursor: pointer;
}

.shop-level-btn.is-selected,
.shop-name-chip.is-selected {
  border-color: #78c8a0;
  background: rgba(56, 170, 120, 0.16);
  color: #dff7ea;
}

.shop-level-btn.is-locked,
.shop-level-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  text-decoration: line-through;
}

#shopCustomNameInput {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #3a4258;
  background: #1c2233;
  color: #e8ecf5;
  font-size: 13px;
}

.shop-type-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 160px;
  overflow: auto;
}

.shop-type-btn {
  border: 1px solid #33445c;
  border-radius: 8px;
  padding: 10px 10px 8px;
  background: #121925;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.shop-type-btn:hover {
  border-color: #5a7a9a;
  background: #182233;
}

.shop-type-btn.is-selected {
  border-color: #78c8a0;
  background: rgba(56, 170, 120, 0.16);
}

.shop-type-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-type-meta {
  color: #78c8ff;
  font-size: 11px;
}

.create-shop-selected {
  color: #c8d2dc;
  font-size: 12px;
}

.create-shop-name-hint {
  color: #8a96a8;
  font-size: 12px;
}

.create-shop-cost {
  color: #8cdcb4;
  font-size: 13px;
}

.side-panel {
  background: var(--panel);
  border-left: 1px solid #243044;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#buildingPanel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#buildingPanel[hidden] {
  display: none !important;
}

.buyout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 12px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(88, 60, 18, 0.35), rgba(40, 28, 10, 0.5));
  border: 1px solid rgba(255, 200, 90, 0.35);
}
.buyout-bar .buyout-info { min-width: 0; flex: 1; }
.buyout-bar .buyout-price { font-weight: 700; color: #ffd98a; font-size: 13px; }
.buyout-bar .buyout-sub { color: rgba(255, 235, 200, 0.75); font-size: 11px; margin-top: 2px; }
.buyout-bar .buyout-actions { display: flex; align-items: center; gap: 10px; }
.buyout-bar .buyout-toggle { display: inline-flex; align-items: center; gap: 4px; color: #ffe9c4; font-size: 12px; white-space: nowrap; }
.buyout-bar .buyout-btn {
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #2a1c08;
  background: linear-gradient(180deg, #ffd98a, #f0b64c);
  cursor: pointer;
  white-space: nowrap;
}
.buyout-bar .buyout-btn.is-sell {
  background: rgba(255, 255, 255, 0.14);
  color: #ffd98a;
  border: 1px solid rgba(255, 200, 90, 0.4);
}

#employeesPanel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#employeesPanel[hidden] {
  display: none !important;
}

.employees-side-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.employees-side-head h1 {
  margin: 0;
  font-size: 18px;
}

.employees-side-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8b94ad;
}

.employees-side-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 12px 16px;
}

/* 主窗口员工列表 */
.employees-main {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(12, 16, 24, 0.94);
  backdrop-filter: blur(6px);
  padding: 12px 14px 14px;
  min-height: 0;
}

.employees-main[hidden] {
  display: none !important;
}

.employees-main-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.employees-main-head h2 {
  margin: 0;
  font-size: 18px;
}

.employees-main-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8b94ad;
}

.employees-main-close {
  border: 0;
  background: #2a3145;
  color: #cdd4e6;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.employees-main-stats {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.emp-stat {
  background: #1a2232;
  border: 1px solid #2f364a;
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 0;
}

.emp-stat span {
  display: block;
  font-size: 10px;
  color: #8b94ad;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-stat b {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.employees-main-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.employees-main-toolbar input,
.employees-main-toolbar select,
.emp-tool-btn {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #3a4258;
  background: #1c2233;
  color: #e8ecf5;
}

.employees-main-toolbar input[type='search'] {
  min-width: 160px;
  flex: 1;
}

.emp-tool-btn {
  cursor: pointer;
}

.emp-tool-btn:hover {
  border-color: #5a7a9a;
}

.emp-tool-btn.is-accent {
  border-color: #4d8a6a;
  color: #78c8a0;
}

.emp-tool-btn.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.emp-tool-btn.emp-tool-hr {
  border-color: #4a7a5a;
  color: #9dceb0;
}

.employees-main-seats {
  flex-shrink: 0;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #161c28;
  border: 1px solid #2f364a;
  border-radius: 10px;
}

.emp-seats-label {
  font-size: 11px;
  color: #8b94ad;
  margin-bottom: 6px;
}

.emp-seats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emp-seat-chip {
  border: 1px solid #3a4258;
  background: #232a3c;
  color: #e8ecf5;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.emp-seat-chip b {
  margin-left: 6px;
  color: #8cdcb4;
}

.emp-seat-chip.is-locked {
  opacity: 0.5;
}

.emp-seats-detail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.emp-seat-mini {
  background: #232a3c;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.emp-seat-mini.is-locked {
  opacity: 0.55;
}

.emp-seat-mini button {
  margin-top: 4px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #3d4660;
  background: #1c2233;
  color: #9ec4e8;
  cursor: pointer;
  align-self: flex-start;
}

.employees-main-extras {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #aeb6c9;
}

.emp-extra-block {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
}

.emp-extra-title {
  color: #8b94ad;
  flex-shrink: 0;
}

.emp-shop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.emp-shop-chip {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #232a3c;
  color: #cdd4e6;
}

.emp-shop-chip.is-stopped {
  background: rgba(196, 90, 90, 0.25);
  color: #f0a0a0;
}

.emp-shop-chip.is-full {
  background: rgba(120, 200, 160, 0.18);
  color: #b8ebd0;
}

.employees-main-list-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #2f364a;
  border-radius: 10px;
  background: #121824;
}

.emp-table-head,
.emp-row {
  display: grid;
  grid-template-columns: 1.2fr 1.3fr 1.4fr 0.5fr 0.7fr;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  font-size: 12px;
}

.emp-table-head {
  position: sticky;
  top: 0;
  background: #1a2232;
  color: #8b94ad;
  border-bottom: 1px solid #2f364a;
  z-index: 1;
}

.emp-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #232a3c;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.emp-row:hover {
  background: #1a2232;
}

.emp-row.is-active {
  background: rgba(120, 200, 160, 0.14);
  box-shadow: inset 3px 0 0 #78c8a0;
}

.emp-row-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.emp-row-name strong {
  font-size: 13px;
}

.emp-row-name em {
  font-style: normal;
  font-size: 11px;
}

.emp-quality {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.emp-row-talent,
.emp-row-status {
  color: #aeb6c9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emp-row-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.emp-detail-card {
  background: #1a2232;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.emp-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.emp-detail-grid div span {
  display: block;
  font-size: 11px;
  color: #8b94ad;
}

.emp-detail-grid div b {
  font-size: 13px;
}

.emp-detail-actions {
  margin-bottom: 14px;
}

.emp-detail-actions h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #cdd4e6;
}

.emp-detail-actions button,
.emp-detail-actions select,
.emp-detail-raise input {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #3d4660;
  background: #1c2233;
  color: #e8ecf5;
  margin: 0 6px 6px 0;
  cursor: pointer;
}

.emp-detail-assign,
.emp-detail-raise {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.emp-detail-raise input {
  width: 110px;
  cursor: text;
}

.emp-table-head-staff,
.emp-row-staff {
  grid-template-columns: 1.4fr 1.2fr 0.8fr 0.6fr;
  cursor: default;
}

.emp-row-staff {
  width: 100%;
}

.emp-row-staff.is-stopped {
  background: rgba(196, 90, 90, 0.08);
}

.emp-row-staff.is-full {
  background: rgba(120, 200, 160, 0.06);
}

.emp-shop-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emp-shop-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.9fr) minmax(0, 1.4fr);
  gap: 12px 14px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #2f364a;
  background: #161c2a;
}

.emp-shop-card.is-stopped {
  background: rgba(196, 90, 90, 0.08);
  border-color: rgba(196, 90, 90, 0.28);
}

.emp-shop-card.is-full {
  background: rgba(120, 200, 160, 0.05);
}

.emp-shop-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.emp-shop-card-main strong {
  font-size: 14px;
  color: #e8ecf5;
}

.emp-shop-meta,
.emp-shop-staff {
  font-size: 12px;
  color: #aeb6c9;
}

.emp-shop-staff b {
  color: #e8ecf5;
  font-weight: 600;
}

.emp-shop-cap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.emp-shop-cap-label {
  font-size: 11px;
  color: #8b93a8;
  letter-spacing: 0.02em;
}

.emp-shop-cap-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
}

.emp-cap-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #3d4660;
  background: #243044;
  color: #e8ecf5;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.emp-cap-btn:hover:not(:disabled) {
  background: #2c3a52;
}

.emp-cap-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.emp-cap-input {
  width: 64px;
  text-align: center;
  font-size: 13px;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid #3d4660;
  background: #1c2233;
  color: #e8ecf5;
}

.emp-shop-cap-range {
  font-size: 11px;
  font-style: normal;
  color: #7d869c;
}

.emp-shop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}

.emp-shop-act {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #3d4660;
  background: #243044;
  color: #e8ecf5;
  cursor: pointer;
}

.emp-shop-act:hover:not(:disabled) {
  background: #2c3a52;
  border-color: #4d5874;
}

.emp-shop-act:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .emp-shop-card {
    grid-template-columns: 1fr;
  }
}

.emp-policy-card {
  background: #1a2232;
  border: 1px solid #2f364a;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.emp-policy-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.emp-policy-card .detail-hint {
  margin: 0 0 10px;
}

.emp-policy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.emp-policy-row label {
  font-size: 12px;
  color: #aeb6c9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.emp-policy-row input[type='number'] {
  width: 72px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #3d4660;
  background: #1c2233;
  color: #e8ecf5;
}

.emp-policy-row button,
.emp-policy-card > button {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #3d4660;
  background: #243044;
  color: #e8ecf5;
  cursor: pointer;
}

.emp-policy-row button:hover,
.emp-policy-card > button:hover {
  border-color: #5a7a9a;
}

.emp-policy-row button:disabled,
.emp-policy-card > button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.emp-policy-card.is-primary {
  border-color: #5a8fd4;
  background: linear-gradient(180deg, #1d2a44 0%, #1a2232 100%);
}

.emp-policy-card.is-primary > button,
.emp-policy-card.is-primary .emp-policy-row button {
  background: #2f5fa0;
  border-color: #4a7ec8;
}

.emp-cta-banner {
  margin: 8px 12px 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(240, 180, 80, 0.12);
  border: 1px solid rgba(240, 180, 80, 0.35);
  color: #f0d9a8;
  font-size: 13px;
  line-height: 1.45;
}

.market-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
}

.market-board-outlook {
  grid-column: 1 / -1;
}

.market-board-card {
  background: #1a2232;
  border: 1px solid #2f364a;
  border-radius: 10px;
  padding: 14px;
}

.market-board-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.market-board-card p {
  margin: 0 0 8px;
  font-size: 13px;
  color: #cdd4e6;
  line-height: 1.5;
}

.market-board-mix {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.market-board-mix div span {
  display: block;
  font-size: 11px;
  color: #8b94ad;
}

.market-board-mix div b {
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 1200px) {
  .employees-main-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .emp-table-head:not(.emp-table-head-staff),
  .emp-row:not(.emp-row-staff) {
    grid-template-columns: 1.2fr 1fr 1.2fr 0.6fr;
  }
  .emp-table-head:not(.emp-table-head-staff) span:nth-child(4),
  .emp-row:not(.emp-row-staff) .emp-row-num:nth-child(4) {
    display: none;
  }
  .market-board {
    grid-template-columns: 1fr;
  }
}

.overview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #2f364a;
}

.overview-name {
  font-weight: 600;
  font-size: 13px;
}

.overview-income {
  font-variant-numeric: tabular-nums;
  color: #8cdcb4;
  white-space: nowrap;
}


.shop-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.shop-detail[hidden] {
  display: none !important;
}

.shop-detail-head {
  margin: 16px 16px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--panel-2);
  flex-shrink: 0;
}

.shop-back-btn {
  border: 0;
  background: transparent;
  color: #9ec4e8;
  padding: 0;
  margin: 0 0 8px;
  cursor: pointer;
  font-size: 13px;
}

.shop-back-btn:hover {
  color: #c8e0f5;
}

.shop-detail-head h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
}

.shop-detail-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.shop-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px 0;
  flex-shrink: 0;
}

.shop-tab {
  border: 1px solid #33445c;
  border-radius: 999px;
  background: #121925;
  color: #c4cfdb;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.shop-tab:hover {
  border-color: #5a7a9a;
}

.shop-tab.is-active {
  border-color: #78c8a0;
  background: rgba(56, 170, 120, 0.18);
  color: #dff7ea;
}

.shop-detail-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 16px 16px;
}

.shop-detail-error {
  flex-shrink: 0;
  min-height: 18px;
  padding: 0 16px 12px;
  color: #e88a8a;
  font-size: 13px;
}

.detail-card {
  background: var(--row);
  border-radius: 12px;
  padding: 16px;
}

.detail-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.detail-card p {
  margin: 0 0 10px;
  color: #d5dde8;
  font-size: 14px;
  line-height: 1.5;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
}

.detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
}

.detail-accent {
  color: var(--accent);
  font-weight: 600;
}

.detail-hint {
  color: #8a9bb0 !important;
  font-size: 12px !important;
  margin-top: 12px !important;
}

.detail-upgrade-cta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #2e374c;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-upgrade-list {
  margin: 8px 0 12px;
  padding-left: 1.2em;
  list-style: disc;
  color: #8a9bb0;
  font-size: 12px;
  line-height: 1.5;
}

.detail-action {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #2a6b4d;
  color: #f2fff8;
  font-size: 14px;
  cursor: pointer;
}

.detail-action:hover:not(:disabled) {
  background: #34855e;
}

.detail-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.detail-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-log {
  background: var(--row);
  border-radius: 10px;
  padding: 12px 14px;
}

.detail-log-main {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
}

.detail-log-kind {
  flex-shrink: 0;
  color: #78c8ff;
  font-size: 12px;
  min-width: 2.5em;
}

.detail-log-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.side-header {
  margin: 16px 16px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--panel-2);
  flex-shrink: 0;
}

.side-header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
}

.side-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.shop-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  margin-top: 12px;
  padding: 0 16px 12px;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.building-units-block {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(40, 60, 90, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}

.building-units-block .units-head h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.unit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
}

.unit-row.is-mine {
  outline: 1px solid rgba(46, 125, 90, 0.35);
}

.unit-name {
  font-weight: 600;
  font-size: 14px;
}

.unit-meta {
  font-size: 12px;
  color: #667788;
  margin-top: 2px;
}

.unit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.unit-actions button {
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.shop-empty {
  margin: 48px 8px;
  text-align: center;
  color: #78879b;
  font-size: 16px;
  line-height: 1.6;
}

.shop-empty[hidden] {
  display: none !important;
}

.shop-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--row);
}

.shop-row.is-mine {
  outline: 1px solid rgba(120, 200, 160, 0.35);
  cursor: pointer;
  transition: background 0.15s ease, outline-color 0.15s ease;
}

.shop-row.is-mine:hover {
  background: #314257;
}

.shop-row.is-mine:focus-visible {
  outline: 2px solid #78c8a0;
}

.shop-name {
  font-size: 16px;
  margin-bottom: 4px;
}

.shop-owner {
  font-size: 13px;
  color: #9ec4e8;
  margin-bottom: 4px;
}

.shop-addr {
  font-size: 12px;
  color: var(--muted);
}

.shop-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.shop-cat {
  color: #78c8ff;
  font-size: 13px;
  white-space: nowrap;
}

.shop-income {
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.shop-mine-tag {
  color: #e6c86e;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  width: min(440px, 90vw);
  background: #1e2837;
  border-radius: 16px;
  padding: 28px 24px 22px;
  text-align: center;
}

.modal-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.modal-card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.modal-actions button {
  border: 0;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 15px;
  cursor: pointer;
  color: #fff;
}

.btn-ok {
  background: #38aa78;
}

.btn-cancel {
  background: #5a6478;
}

@media (max-width: 1200px) {
  .player-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .player-panel-title-wrap {
    flex-wrap: wrap;
  }
}

@media (max-width: 1100px) {
  .time-controls {
    top: 56px;
    max-width: calc(100% - 32px);
  }

  .time-date {
    font-size: 12px;
    padding: 6px 12px;
  }

  .time-btn {
    min-width: 36px;
    padding: 5px 8px;
    font-size: 12px;
  }
}

/* 竖屏窄屏：地图在上、侧栏在下 */
@media (max-width: 960px) and (orientation: portrait) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(34dvh, 42dvh) minmax(0, 1fr) auto auto;
    height: 100dvh;
  }

  .side-panel {
    border-left: 0;
    border-top: 1px solid #243044;
  }

  .player-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .player-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-panel-hint {
    text-align: left;
  }
}

@media (max-width: 560px) and (orientation: portrait) {
  .player-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* —— 总部面板 —— */
.hq-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.hq-panel[hidden] {
  display: none !important;
}
.hq-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 12px 8px;
  border-bottom: 1px solid #2a3348;
}
.hq-tab {
  appearance: none;
  border: 1px solid #3a455c;
  background: #1a2030;
  color: #c5cde0;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
}
.hq-tab.is-active {
  border-color: #6b8cff;
  color: #e8ecf5;
  background: #243055;
}
.hq-body {
  flex: 1;
  overflow: auto;
  padding: 10px 12px 16px;
}
.hq-card { display: flex; flex-direction: column; gap: 12px; }
.hq-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.hq-stat-grid div {
  background: #1a2030;
  border: 1px solid #2e374c;
  padding: 8px 10px;
  border-radius: 6px;
}
.hq-stat-grid span {
  display: block;
  font-size: 11px;
  color: #8b94ad;
  margin-bottom: 2px;
}
.hq-stat-grid b { font-size: 13px; color: #e8ecf5; }
.hq-progress-bar {
  height: 8px;
  background: #1a2030;
  border-radius: 4px;
  overflow: hidden;
}
.hq-progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3d7eff, #6bcf8e);
}
.hq-ready { color: #6bcf8e; font-size: 13px; }
.hq-upgrade {
  border: 1px solid #2e374c;
  border-radius: 6px;
  padding: 10px;
  background: #161b28;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hq-upgrade-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  color: #e8ecf5;
}
.hq-upgrade-head span { color: #8b94ad; font-size: 12px; }
.hq-upgrade-reason { font-size: 12px; color: #c9a66b; margin: 0; }
.hq-upgrade-reason.is-ok { color: #6bcf8e; }
.hq-upgrade-btn {
  appearance: none;
  border: 1px solid #4a6ab5;
  background: #243055;
  color: #e8ecf5;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
}
.hq-upgrade-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #3d4660;
  background: #1c2233;
}
.hq-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.hq-quick button,
.hq-fac-actions button,
.hq-org-rec button,
.hq-routine-card button {
  appearance: none;
  border: 1px solid #3d4660;
  background: #1c2233;
  color: #e8ecf5;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.hq-org-tier {
  border: 1px solid #2e374c;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  background: #161b28;
}
.hq-org-tier.is-locked { opacity: 0.55; }
.hq-org-tier.is-full { border-color: #4a7a5a; }
.hq-org-tier-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
  color: #aeb6c9;
}
.hq-org-seat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0;
  border-top: 1px solid #243044;
  font-size: 12px;
}
.hq-org-seat-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hq-org-seat-main em { font-style: normal; color: #8b94ad; font-size: 11px; }
.hq-org-rec { display: flex; flex-wrap: wrap; gap: 4px; }
.hq-fac-list, .hq-routine-catalog { display: flex; flex-direction: column; gap: 8px; }
.hq-fac-card, .hq-routine-card {
  border: 1px solid #2e374c;
  border-radius: 6px;
  padding: 8px 10px;
  background: #161b28;
  font-size: 12px;
}
.hq-fac-card.is-locked { opacity: 0.55; }
.hq-fac-head, .hq-routine-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
}
.hq-fac-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.hq-fac-actions select {
  font-size: 12px;
  padding: 4px 6px;
  background: #1c2233;
  color: #e8ecf5;
  border: 1px solid #3d4660;
  border-radius: 4px;
  max-width: 160px;
}
.hq-routine-queue { margin-bottom: 10px; }
.hq-routine-item {
  padding: 6px 8px;
  background: #1a2030;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 12px;
}

/* 主窗口店铺列表 */
.shops-main {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(12, 16, 24, 0.94);
  backdrop-filter: blur(6px);
  padding: 12px 14px 14px;
  min-height: 0;
}

.shops-main[hidden] {
  display: none !important;
}

.shops-main-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.shops-main-head h2 {
  margin: 0;
  font-size: 18px;
}

.shops-main-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8b94ad;
}

.shops-main-close {
  border: 0;
  background: #2a3145;
  color: #cdd4e6;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.shops-main-stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.shops-main-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.shops-main-toolbar input,
.shops-main-toolbar select {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #3a4258;
  background: #1c2233;
  color: #e8ecf5;
}

.shops-main-toolbar input[type='search'] {
  min-width: 160px;
  flex: 1;
}

.shops-main-list-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #2f364a;
  border-radius: 10px;
  background: #121824;
}

.invest-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(8, 10, 16, 0.72);
  padding: 16px;
}

.invest-overlay[hidden] {
  display: none !important;
}

.invest-dialog {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #161c28;
  border: 1px solid #2f364a;
  border-radius: 12px;
  padding: 14px 16px;
}

.invest-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.invest-dialog-head h3 {
  margin: 0;
  font-size: 16px;
}

.invest-dialog-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8b94ad;
}

.invest-dialog-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invest-unit-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1e2736;
}

.invest-unit-card .invest-prospects {
  grid-column: 1 / -1;
}

.invest-shop-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invest-shop-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #2f364a;
  border-radius: 8px;
  background: #121824;
  color: inherit;
  cursor: pointer;
}

.invest-shop-btn span {
  font-size: 12px;
  color: #8b94ad;
}

.emp-tool-btn.is-danger {
  background: #5a3030;
  color: #f0d0d0;
}

.shop-table-head,
.shop-row-main {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1.5fr 0.7fr 0.7fr;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  font-size: 12px;
}

.shop-table-head {
  position: sticky;
  top: 0;
  background: #1a2232;
  color: #8b94ad;
  border-bottom: 1px solid #2f364a;
  z-index: 1;
}

.shop-row-main {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #232a3c;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.shop-row-main:hover {
  background: #1a2232;
}

.shop-row-main.is-active {
  background: rgba(120, 200, 160, 0.14);
  box-shadow: inset 3px 0 0 #78c8a0;
}

.shop-row-name,
.shop-row-loc,
.shop-row-ops {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shop-row-name strong {
  font-size: 13px;
}

.shop-row-name em,
.shop-row-loc em,
.shop-row-ops em {
  font-style: normal;
  font-size: 11px;
  color: #8b94ad;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-row-income {
  font-variant-numeric: tabular-nums;
  color: #8cdcb4;
  font-weight: 600;
}

.shop-status-open {
  color: #8cdcb4;
}

.shop-status-stop {
  color: #e0a0a0;
}

.shop-locate-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: #243044;
  color: #9ec4e8;
  font-size: 11px;
  border: 1px solid #3a5270;
}

.shop-locate-chip:hover {
  background: #2d3f58;
}

.shops-hint-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.shops-hint-panel[hidden] {
  display: none !important;
}

.shops-hint-body {
  padding: 0 16px 16px;
}

.shop-locate-btn {
  margin-top: 10px;
  border: 1px solid #3a5270;
  background: #243044;
  color: #9ec4e8;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.shop-locate-btn:hover {
  background: #2d3f58;
}

.shop-locate-btn[hidden] {
  display: none !important;
}

.detail-grid-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.detail-grid-wide > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
}

@media (max-width: 1200px) {
  .shops-main-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .shop-table-head,
  .shop-row-main {
    grid-template-columns: 1.3fr 1.2fr 0.7fr 0.7fr;
  }
  .shop-table-head span:nth-child(3),
  .shop-row-ops {
    display: none;
  }
}

/* 主窗口个人档案 */
.profile-main {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(12, 16, 24, 0.94);
  backdrop-filter: blur(6px);
  padding: 12px 14px 14px;
  min-height: 0;
}

.profile-main[hidden] {
  display: none !important;
}

.profile-main-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.profile-main-head h2 {
  margin: 0;
  font-size: 18px;
}

.profile-main-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8b94ad;
}

.profile-main-close {
  border: 0;
  background: #2a3145;
  color: #cdd4e6;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.profile-main-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

/* 主窗口个人活动（demo 整合） */
.activity-main {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(12, 16, 24, 0.94);
  backdrop-filter: blur(6px);
  padding: 12px 14px 14px;
  min-height: 0;
}

.activity-main[hidden] {
  display: none !important;
}

.activity-main-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.activity-main-head h2 {
  margin: 0;
  font-size: 18px;
}

.activity-main-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8b94ad;
}

.activity-main-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #3d4660;
  background: #243044;
  color: #e8ecf5;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.activity-main-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.activity-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.activity-side[hidden] {
  display: none !important;
}

.activity-side-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 14px;
}

.pa-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pa-stat {
  background: #161c2a;
  border: 1px solid #2f364a;
  border-radius: 10px;
  padding: 12px;
}

.pa-stat span {
  display: block;
  font-size: 12px;
  color: #8b94ad;
  margin-bottom: 4px;
}

.pa-stat b {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.pa-stat b.accent {
  color: #78c8a0;
}

.pa-section {
  background: #161c2a;
  border: 1px solid #2f364a;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.pa-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.pa-decisions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.pa-decision {
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #3d4660;
  background: #1a2232;
  color: #e8ecf5;
  cursor: pointer;
}

.pa-decision b {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.pa-decision strong {
  display: block;
  font-size: 22px;
  color: #78c8a0;
  margin-bottom: 4px;
}

.pa-decision small {
  color: #8b94ad;
  font-size: 12px;
  line-height: 1.35;
}

.pa-decision.is-active {
  border-color: #4d8a6a;
  background: #163126;
  box-shadow: inset 0 0 0 1px rgba(120, 200, 160, 0.25);
}

.pa-running-card {
  border: 1px solid #2f364a;
  border-radius: 10px;
  padding: 12px;
  background: #121824;
}

.pa-running-card.is-on {
  border-color: #3d6a55;
  background: #163126;
}

.pa-running-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.pa-running-head em {
  font-style: normal;
  font-size: 11px;
  color: #8fa0b8;
}

.pa-running-card.is-on .pa-running-head em {
  color: #78c8a0;
}

.pa-running-head b {
  font-size: 15px;
}

.pa-running-meta {
  font-size: 12px;
  color: #9aabbf;
  margin-bottom: 8px;
}

.pa-progress {
  height: 4px;
  border-radius: 999px;
  background: #1d2636;
  overflow: hidden;
}

.pa-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: #78c8a0;
  transform: scaleX(0);
  transform-origin: left center;
}

.pa-hint {
  margin-top: 10px;
}

.pa-recent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pa-recent-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2f364a;
  background: #121824;
  font-size: 13px;
}

.pa-recent-item span {
  color: #8b94ad;
  font-size: 12px;
  white-space: nowrap;
}

.pa-side-block {
  margin-bottom: 14px;
}

.pa-side-block h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.pa-log {
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
  color: #8b94ad;
  line-height: 1.55;
  border: 1px solid #2f364a;
  border-radius: 8px;
  padding: 8px 10px;
  background: #121824;
}

.pa-log div {
  border-bottom: 1px dashed #243044;
  padding: 4px 0;
}

.pa-log .log-empty {
  border: 0;
  opacity: 0.7;
}

@media (max-width: 720px) {
  .pa-decisions {
    grid-template-columns: 1fr;
  }
}

.profile-hero {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.profile-vehicle-slots {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.profile-vehicle-slots .profile-media {
  aspect-ratio: 16 / 9;
  min-height: 0;
}

.profile-vehicle-slots .profile-media img,
.profile-vehicle-slots .profile-media-ph {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
}

.profile-attr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-attr {
  border: 1px solid #2f364a;
  border-radius: 10px;
  background: #151b28;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-attr b {
  font-size: 14px;
}

.profile-attr em {
  font-style: normal;
  font-size: 11px;
  color: #8b94ad;
}

.profile-routine-row,
.profile-slot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 8px;
}

.profile-routine-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 8px;
}

.profile-routine-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  min-height: 62px;
  padding: 8px 10px;
}

.profile-routine-btn b {
  font-size: 13px;
  font-weight: 600;
}

.profile-routine-btn small {
  font-size: 11px;
  line-height: 1.35;
  color: #8b94ad;
}

.profile-decision-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.profile-decision {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #3d4660;
  background: #1a2232;
  color: #e8ecf5;
  cursor: pointer;
}

.profile-decision b {
  font-size: 13px;
}

.profile-decision strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: #78c8a0;
}

.profile-decision small {
  font-size: 11px;
  line-height: 1.35;
  color: #8b94ad;
}

.profile-decision.is-active {
  border-color: #4d8a6a;
  background: #163126;
  box-shadow: inset 0 0 0 1px rgba(120, 200, 160, 0.25);
}

.profile-decision:hover {
  border-color: #53627f;
}

@media (max-width: 720px) {
  .profile-decision-row {
    grid-template-columns: 1fr;
  }
}

.profile-routine-btn.is-done {
  opacity: 0.55;
}

.profile-routine-btn.is-planned {
  border-color: #4d6a9a;
  background: #1c2a40;
}

.profile-routine-btn.is-locked {
  opacity: 0.45;
}

.profile-plan-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 10px;
}

.profile-plan-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2f364a;
  background: #161c2a;
}

.profile-plan-item.is-done {
  opacity: 0.65;
}

.profile-plan-ord {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: #243044;
  color: #c9d2e6;
}

.profile-plan-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-plan-info b {
  font-size: 13px;
}

.profile-plan-info small {
  font-size: 11px;
  color: #8b94ad;
}

.profile-plan-move {
  display: flex;
  gap: 4px;
}

.profile-plan-move button {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #3d4660;
  background: #243044;
  color: #e8ecf5;
  cursor: pointer;
}

.profile-plan-move button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.profile-plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.profile-slot-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #8b94ad;
}

.profile-slot-pick select {
  min-width: 140px;
  background: #151b28;
  color: #e8ecf5;
  border: 1px solid #2f364a;
  border-radius: 8px;
  padding: 6px 8px;
}

.profile-sec-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cdd4e6;
  margin: 8px 0;
}

.profile-garage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.profile-garage-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  border: 1px solid #2f364a;
  border-radius: 8px;
  padding: 6px 8px;
  background: #151b28;
}

.profile-garage-item.is-locked {
  opacity: 0.62;
}

.profile-garage-item b {
  display: block;
  font-size: 12px;
}

.profile-garage-item span {
  font-size: 11px;
  color: #8b94ad;
}

.profile-garage-ops {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.profile-side-garage h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.profile-exp-bar {
  margin: 8px 0;
}

.fin-quest.is-locked {
  opacity: 0.7;
}

.profile-media {
  border: 1px solid #2f364a;
  border-radius: 12px;
  background: #151b28;
  overflow: hidden;
  position: relative;
  min-height: 140px;
}

.profile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 140px;
}

.profile-media-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 8px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.55);
  color: #d5dceb;
}

.profile-media-ph {
  height: 100%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(40, 55, 78, 0.55), rgba(18, 24, 36, 0.9)),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(255, 255, 255, 0.02) 8px,
      rgba(255, 255, 255, 0.02) 16px
    );
}

.profile-media-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px dashed #5a6a88;
  color: #9eb0d0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.profile-media-ph strong {
  font-size: 13px;
  color: #e8ecf5;
}

.profile-media-ph em {
  font-style: normal;
  font-size: 11px;
  color: #8b94ad;
}

.profile-media-vehicle {
  min-height: 140px;
}

.profile-media-vehicle img {
  object-fit: cover;
  object-position: center;
}

.profile-media-vehicle .profile-media-cap {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
}

.profile-identity {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  min-width: 0;
}

.profile-identity h2 {
  margin: 0;
  font-size: 22px;
}

.profile-identity-title {
  margin: 0;
  color: #c8e0f5;
  font-size: 14px;
}

.profile-identity-corp {
  margin: 0;
  color: #8cdcb4;
  font-size: 13px;
}

.profile-id-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  font-size: 12px;
  color: #8b94ad;
}

.profile-section {
  border: 1px solid #2f364a;
  border-radius: 12px;
  background: #121824;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.profile-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #cdd4e6;
}

.profile-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #8b94ad;
  font-weight: 600;
}

.profile-subblock {
  margin-top: 12px;
}

.profile-corp-next {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #2a3145;
}

.profile-corp-next h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.profile-corp-next p {
  margin: 0 0 4px;
  font-size: 12px;
  color: #aeb6c9;
}

.profile-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #3a4258;
  background: #1a2232;
  color: #cdd4e6;
  font-size: 11px;
}

.profile-chip.is-on {
  border-color: #5a8a70;
  background: rgba(120, 200, 160, 0.14);
  color: #b8ebd0;
}

.profile-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.profile-side[hidden] {
  display: none !important;
}

.profile-side-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 16px;
}

.profile-side-card {
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: #151b28;
  border: 1px solid #2f364a;
  margin-bottom: 12px;
}

.profile-side-card h2 {
  margin: 8px 0 4px;
  font-size: 18px;
}

.profile-side-card p {
  margin: 0;
  font-size: 13px;
  color: #c8e0f5;
}

.profile-side-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px dashed #5a6a88;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a2232;
  color: #9eb0d0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.profile-side-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.profile-side-stats > div {
  background: #151b28;
  border: 1px solid #2f364a;
  border-radius: 8px;
  padding: 8px;
}

.profile-side-stats span {
  display: block;
  font-size: 11px;
  color: #8b94ad;
}

.profile-side-stats b {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.profile-side-corp,
.profile-side-actions {
  margin-bottom: 12px;
}

.profile-side-corp h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.profile-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 1100px) {
  .profile-hero {
    grid-template-columns: 140px 1fr;
  }
  .profile-identity {
    grid-column: auto;
    order: 0;
  }
  .profile-attr-grid {
    grid-template-columns: 1fr;
  }
}

/* 主窗口人才市场 */
.market-main {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(12, 16, 24, 0.94);
  backdrop-filter: blur(6px);
  padding: 12px 14px 14px;
  min-height: 0;
}

.market-main[hidden] {
  display: none !important;
}

.market-main-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.market-main-head h2 {
  margin: 0;
  font-size: 18px;
}

.market-main-head p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.7;
}

.market-main-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.market-main-announce {
  flex-shrink: 0;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(59, 140, 240, 0.12);
  border: 1px solid rgba(59, 140, 240, 0.25);
  max-height: 72px;
  overflow: hidden;
}

.market-announce-label {
  font-size: 11px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.market-announce-scroll {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 48px;
  overflow-y: auto;
  font-size: 12px;
}

.market-announce-empty {
  margin: 0;
  font-size: 12px;
  opacity: 0.65;
}

.market-main-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.market-main-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
  align-items: center;
}

.market-main-toolbar input,
.market-main-toolbar select {
  background: #1a2233;
  border: 1px solid #2c364c;
  color: inherit;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}

.market-main-toolbar input[type='search'] {
  min-width: 180px;
  flex: 1;
}

.market-hr-hint {
  font-size: 12px;
}

.market-main-list-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.market-batch-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9aa6bd;
}

.market-batch-count input {
  width: 72px;
}

.market-table-head,
.market-row-main {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(120px, 1fr) 90px 90px;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
}

.market-table-head {
  padding: 6px 10px;
  font-size: 11px;
  opacity: 0.55;
  position: sticky;
  top: 0;
  background: rgba(12, 16, 24, 0.96);
  z-index: 1;
}

.market-row-main {
  border: 1px solid transparent;
  background: rgba(26, 34, 51, 0.55);
  color: inherit;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 6px;
  cursor: pointer;
}

.market-row-main:hover,
.market-row-main.is-active {
  border-color: rgba(59, 140, 240, 0.55);
  background: rgba(59, 140, 240, 0.12);
}

.market-row-name {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.market-row-name strong {
  display: block;
  font-size: 14px;
}

.market-row-name em,
.market-row-talent em {
  display: block;
  font-style: normal;
  font-size: 11px;
  opacity: 0.7;
}

.market-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.market-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

.market-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.market-tag {
  font-style: normal;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.9;
}

.market-row-wage,
.market-row-hire {
  font-weight: 600;
  font-size: 13px;
}

.market-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.market-hint-panel,
.market-detail {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.market-hint-panel[hidden],
.market-detail[hidden] {
  display: none !important;
}

.market-detail-head {
  padding: 0 0 10px;
  flex-shrink: 0;
}

.market-detail-head h1 {
  margin: 8px 0 4px;
  font-size: 18px;
}

.market-detail-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding-bottom: 12px;
}

.market-outlook {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.market-outlook-row {
  display: grid;
  grid-template-columns: 88px 1fr 44px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.market-outlook-bar {
  height: 8px;
  background: #232a3c;
  border-radius: 4px;
  overflow: hidden;
}

.market-outlook-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
}

.market-outlook-row em {
  font-style: normal;
  text-align: right;
  color: #aeb6c9;
}

.market-autostaff {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cdd4e6;
  margin: 8px 0 10px;
}

.market-detail-hero {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.market-detail-bio {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.market-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.market-detail-grid > div {
  background: rgba(26, 34, 51, 0.7);
  border-radius: 8px;
  padding: 8px 10px;
}

.market-detail-grid span {
  display: block;
  font-size: 11px;
  opacity: 0.65;
  margin-bottom: 2px;
}

.market-detail-grid b {
  font-size: 13px;
}

.market-negotiate {
  background: rgba(26, 34, 51, 0.7);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.market-negotiate-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.market-negotiate input[type='range'] {
  width: 100%;
}

.market-negotiate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.market-negotiate-row input[type='number'] {
  width: 100px;
  background: #121826;
  border: 1px solid #2c364c;
  color: inherit;
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
}

.market-detail-actions {
  display: flex;
  gap: 8px;
}

.market-detail-error {
  color: #f87171;
  font-size: 12px;
  margin-top: 8px;
  min-height: 1em;
}

@media (max-width: 1100px) {
  .market-main-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .market-table-head,
  .market-row-main {
    grid-template-columns: minmax(120px, 1.2fr) minmax(90px, 1fr) 72px 72px;
  }
}
