:root { --background-image: url('pic/map/湖北.jpg'); }
body { margin: 0; overflow: hidden; position: relative; }
body::before { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-image: var(--background-image); background-size: cover; background-position: center; background-repeat: no-repeat; opacity: 0.5; z-index: -1; }

/* 编号显示开关 */
.toggle-switch {
  position: fixed;
  top: 50px;
  right: 30px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch label {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #2196F3;
}

input:focus + .toggle-slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 12px;
  color: #333;
  font-weight: 500;
}

/* 信息展示图层 */
.info-panel {
  position: fixed;
  top: 10px;
  left: 320px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 10px;
  z-index: 100;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-item {
  display: inline-block;
  margin-right: 20px;
  color: #333;
}

.info-item span {
  font-weight: bold;
  color: #0066CC;
}

/* 选中展示图层 */
.selected-panel {
  position: fixed;
  top: 10px;
  left: 900px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px 15px;
  z-index: 200;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 150px;
  max-height: 400px;
  overflow-y: auto;
}

.selected-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.selected-title {
  font-weight: bold;
  color: #333;
  font-size: 16px;
}

.minimize-btn {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.minimize-btn:hover {
  background: rgba(0, 0, 0, 0.2);
}

.selected-panel.minimized {
  max-height: 40px;
  overflow: hidden;
}

.selected-panel.minimized #selectedUnitsList {
  display: none;
}

.selected-unit-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 3px;
  border-left: 3px solid #0066CC;
}

.selected-unit-icon {
  width: 32px;
  height: 32px;
  background-size: cover;
  background-position: center;
  margin-right: 10px;
  border-radius: 3px;
}

.selected-unit-info {
  flex: 1;
}

.selected-unit-name {
  font-weight: bold;
  color: #333;
  font-size: 14px;
}

.selected-unit-properties {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.selected-unit-remove {
  width: 20px;
  height: 20px;
  background: rgba(255, 87, 87, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 8px;
}

.selected-unit-remove:hover {
  background: rgba(255, 87, 87, 1);
}
canvas { display: block; }
.map-switcher { position: fixed; top: 10px; right: 20px; z-index: 100; }
.map-select { padding: 8px 16px; background: rgba(255, 255, 255, 0.8); border: 1px solid #ccc; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.3s; min-width: 120px; }
.map-select:hover { background: rgba(255, 255, 255, 1); }

/* 左侧作战单元列表卡片 */
.unit-panel {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid #ccc;
  padding: 10px;
  box-sizing: border-box;
  overflow-y: auto;
  z-index: 99;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.unit-panel.show {
  transform: translateX(0);
}

.unit-panel h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: #333;
  text-align: center;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
}

.unit-item {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  padding: 4px;
  background: #f5f5f5;
  border-radius: 3px;
}

.unit-icon {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  margin-right: 8px;
}

.unit-info {
  flex: 1;
}

.unit-name {
  font-weight: bold;
  color: #333;
  margin-bottom: 2px;
  font-size: 14px;
}

.unit-properties {
  font-size: 12px;
  color: #666;
  line-height: 1.1;
}

/* 动作按钮样式 */
.action-buttons {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-btn {
  padding: 6px 10px;
  background: rgba(0, 102, 204, 0.9);
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.action-btn:hover {
  background: rgba(0, 102, 204, 1);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:active {
  transform: translateY(0);
}

/* 选中面板最小化状态下隐藏动作按钮 */
.selected-panel.minimized .action-buttons {
  display: none;
}

/* 右侧功能面板样式 */
.right-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  z-index: 100;
}

.function-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.function-btn {
  width: 15px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  background-color: #0066CC;
  color: white;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.3s ease;
}

.function-btn:hover {
  background-color: #004080;
}

.btn-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.btn-arrow {
  font-size: 18px;
}

/* 比分裁决抽屉面板样式 */
.score-drawer {
  position: fixed;
  top: 50%;
  right: -320px; /* 初始隐藏在右侧 */
  width: 320px;
  height: auto;
  background-color: transparent;
  z-index: 200;
  transition: right 0.3s ease;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-drawer.show {
  right: 40px; /* 显示时的位置，留出功能按钮的空间 */
}

.score-table {
  width: 90%;
  max-width: 252px;
}

.score-row {
  display: flex;
  margin-bottom: 2px;
  height: 50px;
}

.score-cell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: bold;
  position: relative;
  overflow: hidden;
}

.score-cell.red {
  background-color: #FF0000;
}

.score-cell.blue {
  background-color: #0066CC;
}

.score-cell.center {
  background-color: #1a3b5d;
}

/* 红色单元格斜边效果 */
.score-cell.red::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 50px solid transparent;
  border-right: 30px solid #1a3b5d;
}

/* 蓝色单元格斜边效果 */
.score-cell.blue::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-top: 50px solid transparent;
  border-left: 30px solid #1a3b5d;
}

/* 日志区域样式 */
.log-panel {
  position: fixed;
  bottom: -400px; /* 初始隐藏在底部 */
  left: 0;
  width: 100%;
  height: 400px;
  background-color: rgba(10, 10, 20, 0.95);
  z-index: 250;
  transition: bottom 0.3s ease;
  display: flex;
  flex-direction: column;
}

.log-panel.show {
  bottom: 0;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #1a3b5d;
  color: white;
  border-bottom: 1px solid #0066CC;
}

.log-header h3 {
  margin: 0;
  font-size: 16px;
}

.log-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.log-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: white;
}

.log-table th,
.log-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-table th {
  background-color: rgba(255, 255, 255, 0.1);
  font-weight: bold;
}

.log-table tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.log-table .red {
  color: #FF0000;
}

.log-table .blue {
  color: #0066CC;
}