/* 统一的管理运筹学系统样式文件 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.container:hover {
  transform: translateY(-2px);
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjUiPgo8cmVjdCB3aWR0aD0iNSIgaGVpZ2h0PSI1IiBmaWxsPSIjZmZmZmZmMTAiPjwvcmVjdD4KPHBhdGggZD0iTTAgNUw1IDBaTTYgNEw0IDZaTS0xIDFMMSAtMVoiIHN0cm9rZT0iI2ZmZmZmZjIwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KPC9zdmc+');
  opacity: 0.1;
  animation: moveBg 20s linear infinite;
}

@keyframes moveBg {
  0% { transform: translateX(0); }
  100% { transform: translateX(5px); }
}

.header h1 {
  font-size: 28px;
  font-weight: bold;
  position: relative;
  z-index: 1;
  margin: 0;
}

.content {
  padding: 30px;
}

.section {
  margin-bottom: 40px;
  padding: 25px;
  background-color: #f9f9f9;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
}

.section:hover {
  background-color: #f5f5f5;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #667eea;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: white;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
  z-index: -1;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background-color: #667eea;
  color: white;
}

.btn-primary:hover {
  background-color: #5a6fd8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

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

.btn-info {
  background-color: #17a2b8;
  color: white;
}

.btn-info:hover {
  background-color: #138496;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.table-container {
  overflow-x: auto;
  margin-bottom: 25px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
}

th, td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: center;
  transition: all 0.2s ease;
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

tr:hover td {
  background-color: #f5f5f5;
}

.input-sm {
  width: 100px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
  transition: all 0.3s ease;
}

.input-sm:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.input-md {
  width: 200px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.input-md:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.method-options,
.model-options {
  margin: 25px 0;
}

.method-option,
.model-option {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: white;
  transition: all 0.3s ease;
}

.method-option:hover,
.model-option:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.method-option label,
.model-option label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #555;
}

.method-option input[type="radio"],
.model-option input[type="radio"] {
  margin-right: 10px;
}

.parameter-input {
  margin-left: 30px;
  margin-top: 15px;
}

.parameter-input label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

.parameter-input input {
  width: 180px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.parameter-input input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.probability-input {
  margin-left: 30px;
  margin-top: 15px;
}

.probability-input table {
  width: 100%;
  border-collapse: collapse;
}

.probability-input th,
.probability-input td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
}

.result-section {
  padding: 30px;
  border-top: 1px solid #eee;
  margin-top: 40px;
  background-color: #f9f9f9;
}

.result-content {
  background-color: white;
  padding: 25px;
  border-radius: 8px;
  margin-top: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.result-item {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.result-item strong {
  color: #667eea;
  font-weight: 600;
}

.result-summary {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #e7f3ff;
  border-left: 4px solid #667eea;
  border-radius: 6px;
}

.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 8px;
  padding: 10px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
}

.success-message {
  color: #28a745;
  font-size: 14px;
  margin-top: 8px;
  padding: 10px;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    margin: 10px;
    border-radius: 8px;
  }

  .header {
    padding: 20px;
  }

  .header h1 {
    font-size: 24px;
  }

  .content {
    padding: 20px;
  }

  .section {
    padding: 20px;
    margin-bottom: 30px;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .parameter-input {
    margin-left: 20px;
  }

  .probability-input {
    margin-left: 20px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 20px;
  }

  .content {
    padding: 15px;
  }

  .section {
    padding: 15px;
  }

  .section-title {
    font-size: 18px;
  }

  .form-group input {
    padding: 10px;
  }

  .btn {
    padding: 8px 16px;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.card-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #667eea;
}

/* 数轴样式 */
.number-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  padding: 10px 0;
  border-top: 2px solid #ddd;
  border-bottom: 2px solid #ddd;
}

.number-line .point {
  position: relative;
  text-align: center;
  flex: 1;
}

.number-line .point::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background-color: #667eea;
  border-radius: 50%;
}

.number-line .point .label {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #666;
}

/* 矩阵样式 */
.matrix-container {
  overflow-x: auto;
  margin: 20px 0;
}

.matrix {
  display: inline-block;
  border-collapse: collapse;
}

.matrix th,
.matrix td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
  min-width: 60px;
}

.matrix th {
  background-color: #f8f9fa;
  font-weight: 600;
}

/* 特殊按钮样式 */
.btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.btn-grid .btn {
  text-align: center;
  padding: 8px;
  font-size: 12px;
}

/* 输入组样式 */
.input-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-group input {
  flex: 1;
}

.input-group .btn {
  white-space: nowrap;
}