/* ========== 基础样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.header {
  background: #2c3e50;
  color: white;
  padding: 16px 20px;
  text-align: center;
  border-bottom: 3px solid #34495e;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
}

.content {
  padding: 20px 30px 30px 30px;
}

.hidden {
  display: none;
}

/* ========== 上传区域 ========== */
.upload-area {
  border: 2px dashed #95a5a6;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #fafafa;
}

.upload-area:hover {
  border-color: #7f8c8d;
  background: #f0f0f0;
}

.upload-area.dragover {
  background: #ecf0f1;
  border-color: #34495e;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

/* ========== 按钮样式 ========== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  margin: 4px;
}

.btn-primary {
  background: #2c3e50;
  color: white;
}

.btn-primary:hover {
  background: #34495e;
}

.btn-secondary {
  background: #7f8c8d;
  color: white;
}

.btn-secondary:hover {
  background: #95a5a6;
}

.btn-danger {
  background: #c0392b;
  color: white;
}

.btn-danger:hover {
  background: #e74c3c;
}

.btn-success {
  background: #27ae60;
  color: white;
}

.btn-success:hover {
  background: #2ecc71;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== 核心操作区 ========== */
.core-actions {
  margin: 15px 0;
  padding: 12px 15px;
  background: white;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.core-actions-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ========== 信息框 ========== */
.info-box {
  background: #e7f3ff;
  border-left: 4px solid #0277bd;
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
  font-size: 13px;
  color: #01579b;
}

.warning-box {
  background: #fff3cd;
  border-left: 4px solid #ff9800;
  padding: 12px 15px;
  margin: 15px 0;
  border-radius: 4px;
  font-size: 13px;
  color: #e65100;
}

/* ========== 次要信息区 ========== */
.secondary-info {
  margin: 15px 0;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.secondary-info-header {
  background: #f8f9fa;
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.2s;
}

.secondary-info-header:hover {
  background: #e9ecef;
}

.secondary-info-title {
  font-size: 13px;
  font-weight: 600;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 6px;
}

.secondary-info-toggle {
  font-size: 12px;
  color: #6c757d;
}

.secondary-info-content {
  padding: 12px 15px;
  background: white;
  font-size: 13px;
  color: #666;
  display: none;
}

.secondary-info-content.show {
  display: block;
}

/* ========== 统计信息 ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.stat-item {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid #e9ecef;
}

.stat-number {
  font-size: 20px;
  font-weight: bold;
  color: #2c3e50;
  margin: 4px 0;
}

.stat-label {
  font-size: 11px;
  color: #6c757d;
}

/* ========== 文件列表 ========== */
.file-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 10px;
  background: #fafafa;
}

.file-item {
  padding: 6px 8px;
  margin: 4px 0;
  background: white;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 10px;
  border: 1px solid #e9ecef;
}

.file-item:hover {
  background: #f8f9fa;
}

/* ========== 表格样式 ========== */
.meta-table {
  margin-top: 15px;
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  background: #2c3e50;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}

tr:hover {
  background: #f8f9fa;
}

.tag {
  font-family: 'Courier New', monospace;
  color: #2c3e50;
  font-weight: 600;
}

.sensitive {
  background: #fff3cd;
}

.sensitive-badge {
  display: inline-block;
  background: #ffc107;
  color: #856404;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.value-preview {
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== 输入框 ========== */
input[type="text"] {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
}

input[type="text"]:focus {
  outline: none;
  border-color: #2c3e50;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ========== 搜索框 ========== */
.search-box {
  margin: 15px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-box input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: #2c3e50;
}

/* ========== 进度条 ========== */
.progress-bar {
  width: 100%;
  height: 30px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin: 20px 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #2c3e50;
  transition: width 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.skip-info {
  font-size: 12px;
  color: #c0392b;
  margin-top: 5px;
  text-align: center;
}

/* ========== Tab 标签页 ========== */
.tab-container {
  display: flex;
  gap: 0;
  margin: 0 0 15px 0;
  border-bottom: 2px solid #dee2e6;
}

.tab {
  padding: 12px 24px;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: #6c757d;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab:hover {
  color: #495057;
  background: #f8f9fa;
}

.tab.active {
  color: #2c3e50;
  border-bottom-color: #2c3e50;
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ========== 切换按钮 ========== */
.toggle-btn {
  background: #6c757d;
  color: white;
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background: #5a6268;
}

/* ========== 区块标题 ========== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 12px 0;
  padding: 10px 0;
  border-bottom: 2px solid #2c3e50;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
}

.tiny-note {
  color: #6c757d;
  font-size: 12px;
  margin-top: 8px;
}

/* ========== 骨架屏动画 ========== */
.skeleton {
  display: inline-block;
  width: 90px;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 37%, #e9ecef 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
  vertical-align: middle;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* ========== 图像查看器 ========== */
.viewer-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

.viewer-panel {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.viewer-header {
  background: #2c3e50;
  color: white;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* 新增：标题内联切换标签 */
.viewer-tabs-inline {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.viewer-mode-tab {
  font-size: 12px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: #dfe6e9;
  background: rgba(255, 255, 255, 0.14);
  user-select: none;
  transition: all 0.15s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.viewer-mode-tab:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.viewer-mode-tab.active {
  background: #ffffff;
  color: #2c3e50;
  font-weight: 700;
  border-color: #ffffff;
}

.viewer-canvas {
  width: 100%;
  height: 400px;
  background: #000;
  display: block;
}

.viewer-controls {
  background: #f8f9fa;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.viewer-controls label {
  font-size: 12px;
  color: #495057;
  margin-right: 5px;
}

.viewer-controls input[type="range"] {
  flex: 1;
  min-width: 150px;
}

.viewer-info {
  background: #f8f9fa;
  padding: 8px 12px;
  font-size: 11px;
  color: #6c757d;
  border-top: 1px solid #dee2e6;
}

#viewer3d {
  cursor: grab;
}

#viewer3d:active {
  cursor: grabbing;
}

/* ========== 图像查看模式容器（2D/3D 二选一） ========== */
.viewer-container-single {
  margin-top: 10px;
}

/* 保留旧类，避免历史DOM报错；即使不再使用也不影响 */
.viewer-mode-switch {
  display: none;
}

.viewer-mode-switch .btn.active {
  background: #2c3e50;
  color: #fff;
}

/* #viewer2DContainer .viewer-controls {
  display: none;
} */

.guide-box {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background-color: #ffffff;
  color: #333;
  line-height: 1.7;
}

.guide-box h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 20px;
  color: #1f2937;
}

.step-list {
  padding-left: 22px;
  margin: 0;
}

.step-list li {
  margin-bottom: 24px;
}

.step-list strong {
  color: #111827;
  font-size: 16px;
}

.step-list p {
  margin: 6px 0;
}

.step-list code {
  padding: 2px 6px;
  border-radius: 4px;
  background-color: #f3f4f6;
  color: #dc2626;
}

.step-list a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.step-list a:hover {
  text-decoration: underline;
}

.image-placeholder {
  margin-top: 10px;
  padding: 12px;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  background-color: #f8fafc;
  text-align: center;
  height: auto;
  min-height: unset;
  overflow: visible;
}

.guide-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  margin: 0 auto;
}
