/* 全局调试工具样式 */

/* 调试模式下的全局样式 - 移除背景色 */
html.debug-mode {
  /* 不添加全局背景色，保持页面原有的显示效果 */
}

/* 调试控制面板 */
.debug-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10001;
  font-family: sans-serif;
  font-size: 14px;
  color: #eee;
}

.debug-panel-tab {
  width: 40px;
  height: 40px;
  background-color: rgba(52, 152, 219, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: absolute;
  bottom: 0;
  right: 0;
  transition: all 0.3s ease;
}

.debug-panel-tab:hover {
  background-color: rgba(52, 152, 219, 1);
  transform: scale(1.1);
}

.debug-panel-tab-icon {
  font-weight: bold;
  font-size: 12px;
}

.debug-panel-content {
  position: absolute;
  bottom: 50px;
  right: 0;
  background-color: rgba(42, 42, 42, 0.98);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 15px;
  width: 250px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  max-height: 60vh;
  overflow-y: auto;
}

.debug-panel-content.active {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.debug-panel-title {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 15px;
  color: #3498db;
  text-align: center;
  border-bottom: 1px solid #444;
  padding-bottom: 10px;
}

.debug-intro {
  color: #bbb;
  font-size: 12px;
  text-align: center;
  margin-bottom: 15px;
  font-style: italic;
}

.debug-tool {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-tool-label {
  margin-left: 10px;
  flex-grow: 1;
}

.debug-toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

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

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

input:checked + .debug-toggle-slider {
  background-color: #2ecc71;
}

input:focus + .debug-toggle-slider {
  box-shadow: 0 0 1px #2ecc71;
}

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

.debug-components-info {
  margin-top: 15px;
}

.debug-components-title {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 10px;
  color: #e67e22;
}

.debug-components-list {
  max-height: 150px;
  overflow-y: auto;
  font-size: 12px;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 5px;
  border-radius: 4px;
}

.debug-component-item {
  padding: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-component-name {
  font-weight: bold;
  color: #3498db;
}

.debug-component-props {
  margin-top: 3px;
  color: #bbb;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debug-panel-footer {
  margin-top: 15px;
  font-size: 11px;
  text-align: center;
  color: #777;
}

/* 设备信息显示 */
.debug-device-info {
  position: fixed;
  top: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 6px 10px;
  font-size: 12px;
  font-family: monospace;
  z-index: 10000;
  display: none;
}

/* 调试信息显示 */
.debug-info {
  position: fixed;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.7);
  color: #2ecc71;
  padding: 6px 10px;
  font-size: 12px;
  font-family: monospace;
  z-index: 10000;
  display: none;
}

/* 网格覆盖层 - 减轻网格颜色 */
.debug-grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background-size: 100px 100px;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 255, 0.05) 1px, transparent 1px);
  display: none;
}

/* 组件信息部分 */
.debug-components-section {
  margin-top: 20px;
}

#debug-components-list {
  max-height: 300px;
  overflow-y: auto;
  background-color: rgba(20, 20, 20, 0.6);
  border-radius: 4px;
  padding: 8px;
}

.debug-no-components {
  padding: 10px;
  text-align: center;
  color: #95a5a6;
  font-style: italic;
}

.debug-component-item {
  margin-bottom: 12px;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.2);
  padding-bottom: 10px;
}

.debug-component-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.debug-component-name {
  font-weight: bold;
  color: #e74c3c;
  margin-bottom: 5px;
}

.debug-component-info {
  padding-left: 10px;
  font-size: 13px;
}

.debug-component-property {
  margin: 4px 0;
}

.debug-property-name {
  color: #9b59b6;
}

.debug-property-value {
  color: #3498db;
}

.debug-no-info {
  color: #95a5a6;
  font-style: italic;
  padding: 5px 0;
}

/* 元素轮廓样式 - 减轻轮廓效果 */
html.debug-outlines * {
  outline: 1px dashed rgba(255, 0, 0, 0.15) !important;
}

html.debug-outlines *:hover {
  outline: 1px solid rgba(255, 0, 0, 0.4) !important;
}

/* 为React组件添加特殊的边界显示 - 减轻样式影响 */
html.debug-mode [data-debug-component] {
  position: relative;
}

html.debug-mode [data-debug-component]:before {
  content: attr(data-debug-component);
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(41, 128, 185, 0.6);
  color: white;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  z-index: 9995;
  pointer-events: none;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .debug-panel {
    width: 250px;
  }
  
  .debug-device-info {
    font-size: 10px;
  }
  
  .debug-info {
    font-size: 10px;
    max-width: 70%;
  }
}

html.debug-mode .debug-info {
  display: block;
}

html.debug-grid .debug-grid-overlay {
  display: block;
}

/* 设备模拟器信息 */
html.debug-device .debug-device-info {
  display: block;
}

@media (max-width: 768px) {
  .debug-device-info:after {
    content: "移动设备 (<768px)";
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  .debug-device-info:after {
    content: "平板设备 (768-992px)";
  }
}

@media (min-width: 993px) {
  .debug-device-info:after {
    content: "桌面设备 (>992px)";
  }
}

/* 组件轮廓 - 减轻样式影响，使用更轻量的标签 */
html.debug-mode [class*="component-"],
html.debug-mode [class*="Container"],
html.debug-mode [class*="wrapper"],
html.debug-mode [class*="section"],
html.debug-mode [class*="card"],
html.debug-mode [class*="box"] {
  position: relative;
}

html.debug-mode [class*="component-"]::before,
html.debug-mode [class*="Container"]::before,
html.debug-mode [class*="wrapper"]::before,
html.debug-mode [class*="section"]::before,
html.debug-mode [class*="card"]::before,
html.debug-mode [class*="box"]::before {
  content: attr(class);
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(0, 0, 255, 0.4);
  color: white;
  font-size: 10px;
  padding: 2px 5px;
  z-index: 9996;
  pointer-events: none;
  /* 添加一些样式使标签更易读 */
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 0 0 3px 0;
}

html.debug-mode [class*="component-"],
html.debug-mode [class*="Container"],
html.debug-mode [class*="wrapper"],
html.debug-mode [class*="section"],
html.debug-mode [class*="card"],
html.debug-mode [class*="box"] {
  outline: 1px dashed rgba(0, 0, 255, 0.3);
  outline-offset: -1px;
}

/* 标尺样式 */
.debug-ruler {
  position: fixed;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: none;
  pointer-events: none;
}

.debug-ruler-h {
  height: 20px;
  width: 100%;
  top: 0;
  left: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.debug-ruler-v {
  width: 20px;
  height: 100%;
  top: 0;
  left: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}

/* 测量标记 */
.debug-measure {
  position: fixed;
  border: 1px dashed rgba(255, 255, 255, 0.8);
  background-color: rgba(255, 255, 255, 0.1);
  z-index: 9998;
  display: none;
  pointer-events: none;
}

/* 元素检查器样式 */
.debug-inspecting {
  outline: 2px dashed #ff3d00 !important;
  background-color: rgba(255, 61, 0, 0.05) !important;
}

.debug-inspector-info {
  position: fixed;
  background-color: rgba(42, 42, 42, 0.95);
  border: 1px solid #444;
  border-radius: 4px;
  color: #eee;
  padding: 12px;
  font-size: 12px;
  font-family: monospace;
  z-index: 10001;
  max-width: 320px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  display: none;
  max-height: 80vh;
  overflow-y: auto;
}

.debug-inspector-info div {
  margin-bottom: 5px;
}

.debug-inspector-info b {
  color: #2ecc71;
}

.inspector-help {
  font-style: italic;
  color: #bbb;
  font-size: 11px;
}

.inspector-note {
  font-style: italic;
  color: #bbb;
  font-size: 11px;
  border-top: 1px solid #555;
  padding-top: 5px;
  margin-top: 5px;
}

.inspector-details {
  margin-top: 10px;
  border-top: 1px solid #555;
  padding-top: 10px;
}

.inspector-detail {
  margin-bottom: 3px;
}

/* 类名列表样式 */
.inspector-classes ul,
.inspector-classes-detailed ul {
  margin: 5px 0 10px 0;
  padding-left: 20px;
  list-style-type: none;
}

.inspector-classes li,
.inspector-classes-detailed li {
  background-color: rgba(45, 152, 218, 0.2);
  border: 1px solid rgba(45, 152, 218, 0.5);
  border-radius: 3px;
  padding: 2px 6px;
  display: inline-block;
  margin: 2px;
  font-size: 11px;
  color: #fff;
}

.inspector-classes-detailed ul {
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid #444;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 5px;
  border-radius: 3px;
}

.inspector-component, 
.inspector-source {
  color: #e67e22;
  font-weight: bold;
}

/* 帮助提示样式 */
.debug-help-tips {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(42, 42, 42, 0.98);
  border: 1px solid #444;
  border-radius: 4px;
  color: #eee;
  padding: 15px;
  font-size: 13px;
  font-family: sans-serif;
  z-index: 10001;
  width: 300px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  display: none;
}

.debug-help-header {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 10px;
  color: #2ecc71;
  text-align: center;
}

.debug-help-content p {
  margin: 8px 0;
  line-height: 1.4;
}

.debug-help-content b {
  color: #3498db;
}

/* 调试工具样式 */
/* 元素轮廓 */
.debug-outlines *:not(.debug-panel, .debug-panel *, .debug-grid-overlay, .debug-device-info, .debug-info, .debug-ruler, .debug-measure, .debug-inspector-info, .debug-help-tips) {
  outline: 1px solid rgba(255, 0, 0, 0.2) !important;
}

/* 调试时的类名检查器 */
.debug-class-inspector [class]:hover:not(.debug-panel, .debug-panel *, .debug-grid-overlay, .debug-device-info, .debug-info, .debug-ruler, .debug-measure, .debug-inspector-info, .debug-help-tips) {
  position: relative;
  outline: 2px dashed rgba(0, 128, 255, 0.7) !important;
  background-color: rgba(0, 128, 255, 0.05) !important;
}

/* 新增动画效果 */
@keyframes debug-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.debug-panel, 
.debug-info, 
.debug-device-info, 
.debug-help-tips,
.debug-inspector-info {
  animation: debug-fade-in 0.3s ease-in-out;
}

/* 工具名称悬停效果 */
.debug-tool-label {
  transition: color 0.2s ease;
}

.debug-tool:hover .debug-tool-label {
  color: #2ecc71;
} 