/* ===== 力学受力分析工具 - 样式文件 ===== */

/* 全局样式 */
.force-analysis-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  font-family: 'Microsoft YaHei', sans-serif;
}

.force-analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
}

.force-analysis-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.back-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.back-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* 主布局 */
.force-analysis-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .force-analysis-main {
    grid-template-columns: 1fr;
  }
}

/* 卡片样式 */
.force-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.force-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f0f0f0;
}

.force-card-header .icon {
  font-size: 1.5rem;
}

.force-card-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.1rem;
}

/* 力类型选择 */
.force-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.force-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.force-type-btn:hover {
  border-color: #667eea;
  background: #f5f3ff;
}

.force-type-btn.active {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.force-type-btn .icon {
  font-size: 1.25rem;
}

.force-type-btn .label {
  font-size: 0.75rem;
}

/* 力属性输入 */
.force-props-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.875rem;
  color: #666;
}

.form-group input,
.form-group select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

/* 添加力按钮 */
.add-force-btn {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 1rem;
  transition: all 0.3s;
}

.add-force-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 已添加力列表 */
.force-list {
  margin-top: 1rem;
}

.force-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border-left: 4px solid #667eea;
}

.force-item .info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.force-item .name {
  font-weight: 600;
  color: #333;
}

.force-item .detail {
  font-size: 0.8rem;
  color: #666;
}

.force-item .remove-btn {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

/* 画布区域 */
.diagram-canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  max-height: 400px;
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

.diagram-canvas-container canvas {
  width: 100%;
  height: 100%;
}

/* 场景选择 */
.scene-selector {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.scene-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.scene-btn:hover {
  border-color: #667eea;
}

.scene-btn.active {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

/* 分析结果 */
.analysis-result {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.analysis-result h4 {
  margin: 0 0 0.75rem 0;
  color: #0369a1;
}

.analysis-result .force-equation {
  font-family: 'Courier New', monospace;
  background: white;
  padding: 0.75rem;
  border-radius: 4px;
  margin: 0.5rem 0;
  border-left: 3px solid #667eea;
}

.analysis-result .conclusion {
  font-weight: 600;
  color: #059669;
}

/* 坐标系选择 */
.coordinate-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.coord-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
}

.coord-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* 分解合成结果 */
.decomposition-result {
  margin-top: 1rem;
}

.decomp-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.decomp-item .arrow {
  color: #667eea;
  font-weight: bold;
}

/* 模板卡片 */
.template-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.template-card .title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.template-card .desc {
  font-size: 0.875rem;
  color: #666;
}

/* 计算器面板 */
.calc-panel {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.calc-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.calc-input-row label {
  min-width: 80px;
  font-size: 0.875rem;
}

.calc-input-row input {
  flex: 1;
  min-width: 60px;
  padding: 0.4rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.calc-btn {
  padding: 0.5rem 1.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.calc-result {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.75rem;
  font-family: 'Courier New', monospace;
}

/* 标签页 */
.force-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.force-tab {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.force-tab:hover {
  border-color: #667eea;
}

.force-tab.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* 状态指示器 */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.status-indicator.static {
  background: #dcfce7;
  color: #166534;
}

.status-indicator.uniform {
  background: #dbeafe;
  color: #1e40af;
}

.status-indicator.accelerated {
  background: #fef3c7;
  color: #92400e;
}

/* 公式显示 */
.formula-box {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
  font-family: 'Times New Roman', serif;
  font-size: 1.1rem;
}

.formula-box .formula {
  font-size: 1.25rem;
  color: #333;
}

.formula-box .explanation {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.5rem;
}

/* 响应式 */
@media (max-width: 768px) {
  .force-analysis-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .force-types-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .force-props-form {
    grid-template-columns: 1fr;
  }
}
