.chart-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: #fafafa;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #f0f0f0;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin-bottom: 12px;
}

.chart-container {
  position: relative;
  height: 220px;
}

.config-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.config-tab {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  user-select: none;
}

.config-tab:hover { color: #333; }
.config-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.config-content {
  display: none;
}

.config-content.active {
  display: block;
}

.config-item {
  margin-bottom: 20px;
}

.config-label {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.config-desc {
  font-size: 13px;
  color: #999;
  margin-top: 6px;
}

.config-input {
  padding: 10px 12px;
  border: 2px solid rgba(58, 134, 255, 0.3);
  border-radius: 8px;
  font-size: 14px;
  width: 140px;
  transition: all 0.3s ease;
}

.config-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.15);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.form-row label {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.switch-btn {
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.switch-btn::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-btn.active {
  background: var(--success);
}

.switch-btn.active::after {
  left: 22px;
}

.question-type-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  cursor: grab;
  user-select: none;
}

.type-item:active { cursor: grabbing; }

.type-item.dragging {
  opacity: 0.5;
  background: #e9ecef;
}

.type-handle {
  font-size: 18px;
  color: #999;
  cursor: grab;
}

.type-name {
  flex: 1;
  font-weight: 500;
}

.type-enabled {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
}

.type-enabled input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.custom-type-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.custom-type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff7e6;
  border-radius: 10px;
  border: 1px solid #ffe7ba;
  margin-bottom: 8px;
}

.custom-type-item input {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.class-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #f0f8ff;
  border-radius: 10px;
  border: 1px solid #d6eaff;
}

.quantity-input {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
}

.quantity-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(58, 134, 255, 0.15);
}

.score-input {
  width: 70px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
}

.score-input:focus {
  outline: none;
  border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.15);
}

.wrong-item {
  padding: 14px;
  background: #fff1f0;
  border-radius: 10px;
  border: 1px solid #ffa39e;
  margin-bottom: 10px;
}

.wrong-question {
  font-size: 15px;
  font-weight: 600;
  color: #cf1322;
  margin-bottom: 8px;
}

.wrong-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #666;
  flex-wrap: wrap;
}

.wrong-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pk-status-waiting { color: #faad14; font-weight: 600; }
.pk-status-fighting { color: #52c41a; font-weight: 600; }
.pk-status-finished { color: #999; }

.device-status-normal { color: #52c41a; font-weight: 600; }
.device-status-revoked { color: #ff4d4f; font-weight: 600; }

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.online-dot.online { background: #52c41a; box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.2); }
.online-dot.offline { background: #d9d9d9; }