/* 探鸽API-DEMO统一样式 - 简洁专业风格 */

/* 基础样式 */
body {
  background-color: #f5f7fa;
  min-height: 100vh;
  font-size: 12pt;
  color: #2c3e50;
  line-height: 1.5;
}

.container-xl {
  padding-top: 0.5rem;
  padding-bottom: 0.75rem;
  max-width: 1400px;
}

/* 表单样式 */
.form-label {
  color: #34495e;
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 0.2rem;
}

.form-control,
.form-control-sm,
.form-select {
  border: 1px solid #e1e8ed;
  border-radius: 4px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  font-size: 13px;
  padding: 0.2rem 0.4rem;
  background-color: #fff;
}

.form-control:focus,
.form-control-sm:focus,
.form-select:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: #95a5a6;
}

/* 按钮样式 */
.btn {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background-color: #3498db;
  color: #fff;
}

.btn-primary:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-info {
  background-color: #1abc9c;
  color: #fff;
}

.btn-info:hover {
  background-color: #16a085;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(26, 188, 156, 0.3);
}

.btn-danger {
  background-color: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  background-color: #c0392b;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
  background-color: #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
  color: #fff;
}

/* 内容区域（卡片） */
.rows {
  background: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 0.5rem;
  border: 1px solid #e8ecef;
}

/* 输入组样式 */
.input-group-text {
  background-color: #f8f9fa;
  border: 1px solid #e1e8ed;
  color: #34495e;
  font-weight: 500;
  font-size: 13px;
  padding: 0.2rem 0.5rem;
}

/* 链接样式 */
a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 13px;
}

a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* 表格样式 */
.table {
  background: #fff;
  font-size: 13px;
  margin-bottom: 0;
}

.table thead th {
  background-color: #f8f9fa;
  color: #2c3e50;
  border-bottom: 2px solid #e1e8ed;
  font-weight: 600;
  padding: 0.5rem 0.4rem;
  font-size: 13px;
  white-space: nowrap;
}

.table tbody td {
  padding: 0.4rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f3f5;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table-sm thead th,
.table-sm tbody td {
  padding: 0.4rem;
}

/* 表格容器 */
#deviceTable,
#serviceTable,
#tableDeviceInfo,
#tableServiceInfo {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e8ecef;
}

/* Textarea样式 */
textarea.form-control {
  font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
  background-color: #f8f9fa;
  border: 1px solid #e1e8ed;
  resize: vertical;
}

textarea.form-control:focus {
  background-color: #fff;
}

/* 段落样式 */
p {
  margin-bottom: 0.5rem;
  font-size: 13px;
  color: #5a6c7d;
}

/* 提示文本 */
.tip {
  font-size: 13px;
  color: #7f8c8d;
  margin: 0.5rem 0;
  padding: 0.25rem 0;
}

/* 列间距 */
.col,
[class*="col-"] {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* 标题样式 */
.title {
  font-weight: 600;
  color: #2c3e50;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 14px;
}

/* 文本颜色工具类增强 */
.text-success {
  color: #27ae60 !important;
  font-weight: 500;
}

.text-danger {
  color: #e74c3c !important;
  font-weight: 500;
}

.text-warning {
  color: #f39c12 !important;
  font-weight: 500;
}

.text-secondary {
  color: #95a5a6 !important;
}

.text-primary {
  color: #3498db !important;
  font-weight: 500;
}

.text-info {
  color: #1abc9c !important;
  font-weight: 500;
}

/* 表格文字换行 */
#tableDeviceInfo table,
#tableServiceInfo table {
  table-layout: fixed;
  width: 100%;
}

#tableDeviceInfo table td,
#tableDeviceInfo table th,
#tableServiceInfo table td,
#tableServiceInfo table th {
  word-break: break-all;
  word-wrap: break-word;
  white-space: normal;
  overflow-wrap: break-word;
}

/* 圆形图片 */
.rounded-circle {
  border: 2px solid #e1e8ed;
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
  /* 基础布局 */
  body {
    font-size: 14px;
  }

  .container-xl {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* 内容区域 */
  .rows {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  /* 表单优化 */
  .form-label {
    font-size: 14px;
    margin-bottom: 0.25rem;
  }

  .form-control,
  .form-control-sm,
  .form-select {
    font-size: 14px;
    padding: 0.5rem;
    min-height: 44px; /* iOS 最小触摸尺寸 */
  }

  textarea.form-control {
    font-size: 13px;
    padding: 0.5rem;
  }

  /* 按钮优化 */
  .btn,
  .btn-sm {
    font-size: 14px;
    padding: 0.5rem 1rem;
    min-height: 44px; /* iOS 最小触摸尺寸 */
    white-space: nowrap;
  }

  /* 输入组优化 */
  .input-group-text {
    font-size: 13px;
    padding: 0.5rem;
  }

  .input-group {
    flex-wrap: nowrap;
  }

  /* 链接优化 */
  a {
    font-size: 14px;
  }

  p {
    font-size: 14px;
  }

  /* 表格优化 */
  .table {
    font-size: 12px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .table thead th {
    font-size: 12px;
    padding: 0.5rem 0.25rem;
  }

  .table tbody td {
    font-size: 12px;
    padding: 0.5rem 0.25rem;
  }

  /* 列优化 - 移动端自动换行 */
  .row {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
  }

  .col,
  [class*="col-"] {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    margin-bottom: 0.5rem;
  }

  /* 响应式列 - 移动端全宽 */
  .row.g-3.align-items-end > div[class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* 按钮容器 */
  .row.g-3.align-items-end > div[class*="col-"]:last-child {
    margin-top: 0.5rem;
  }

  /* 文本区域 */
  textarea {
    min-height: 150px;
  }

  /* 提示信息 */
  .tip {
    font-size: 13px;
  }

  /* 表格容器 */
  #deviceTable,
  #serviceTable,
  #tableDeviceInfo,
  #tableServiceInfo {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 隐藏不必要的列标签 */
  .input-group-prepend {
    min-width: auto;
  }
}

/* 加载状态优化 */
.tip:empty {
  display: none;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}
