/*
  test-module-1.css - 3D MOSFET 仿真模块样式

  仅包含模块特定的样式，通用仿真参数样式已移至 module-generic.css
*/

/* ========== 页面容器 ========== */
.test-module-1-page {
  padding: 32px 28px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-sizing: border-box;
  height: auto;
  min-height: auto;
  max-height: none;
  overflow: visible;
  contain: none !important;
  position: relative;
}

.test-module-1-page *,
.test-module-1-page *::before,
.test-module-1-page *::after {
  contain: none !important;
}

.main-content:has(.test-module-1-page) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* ========== 顶部标题栏 ========== */
.test-module-1-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 0;
}

.test-module-1-title-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-module-1-main-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.test-module-1-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
}

.test-module-1-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========== 顶部操作按钮 ========== */
.test-module-1-header-btn {
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.test-module-1-header-btn:hover:not(:disabled) {
  background: var(--color-bg-secondary);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.test-module-1-header-btn:active:not(:disabled) {
  transform: translateY(0);
}

.test-module-1-header-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== 主体内容区域 ========== */
.test-module-1-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.test-module-1-single-column-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}

.test-module-1-visual-panel-top {
  width: 100%;
}

.test-module-1-params-panel-bottom {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-bg-card);
  border-radius: 16px;
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.test-module-1-submit-section-bottom {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 12px;
}

/* ========== 器件结构预览 - 可折叠 ========== */
.test-module-1-visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 28px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border-light);
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  transition: all 0.2s ease;
  user-select: none;
}

.test-module-1-visual-header::before {
  display: none;
}

.test-module-1-visual-header:hover {
  background: var(--color-bg-secondary);
  transform: none;
  box-shadow: none;
  border-color: var(--color-border-light);
}

.test-module-1-visual-header .collapse-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  background: transparent;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 10px;
  flex-shrink: 0;
}

.test-module-1-visual-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: 0.02em;
}

.test-module-1-visual-title h3 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.test-module-1-visual-header.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.test-module-1-visual-content {
  overflow: hidden;
  transition: opacity 0.25s ease;
  opacity: 1;
}

.test-module-1-visual-content.collapsed {
  display: none;
}

/* ========== 刷新按钮 ========== */
.test-module-1-refresh-btn {
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-module-1-refresh-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary-light);
  background: var(--color-primary-alpha-8);
}

/* ========== 图例区域 ========== */
.test-module-1-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 14px 22px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-light);
  flex-wrap: wrap;
}

.test-module-1-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.legend-dot.channel {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.legend-dot.source-drain {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.legend-dot.oxide {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.legend-dot.gate {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.legend-label {
  font-size: 11px;
}

/* ========== 3D 画布容器 ========== */
.test-module-1-canvas-container {
  width: 100%;
  min-height: 420px;
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-input) 100%);
  position: relative;
  overflow: hidden;
}

.test-module-1-canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ========== 右侧可视化面板 ========== */
.test-module-1-visual-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: auto !important;
  overflow: visible !important;
}

/* ========== 可视化卡片 ========== */
.test-module-1-visual-card {
  background: var(--color-bg-card);
  border-radius: 16px;
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

/* ========== 响应式适配 ========== */
@media (max-width: 1000px) {
  .test-module-1-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .test-module-1-page {
    padding: 20px 16px;
    gap: 20px;
  }

  .test-module-1-header {
    flex-direction: column;
    align-items: stretch;
  }

  .test-module-1-main-title {
    font-size: 18px;
  }

  .test-module-1-submit-section {
    flex-direction: column;
  }

  .test-module-1-legend {
    gap: 12px;
    padding: 12px 16px;
  }

  .test-module-1-canvas-container {
    min-height: 350px;
  }
}
