/* 最大公约数计算器 - 样式 */

html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

/* ========== App 主体 ========== */
#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

#app-title {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  margin: 0 0 12px 0;
}

#app-subtitle {
  font-size: 15px;
  color: #64748b;
  text-align: center;
  margin: 0 0 28px 0;
  line-height: 1.6;
}

/* ========== 输入区域 ========== */
#input-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-label {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  min-width: 56px;
  flex-shrink: 0;
}

.number-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 16px;
  font-family: 'Courier New', monospace;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease;
  min-width: 0;
}

.number-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-remove-input {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  color: #94a3b8;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-remove-input:hover:not(:disabled) {
  background: #fee2e2;
  color: #ef4444;
}

.btn-remove-input:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ========== 操作按钮 ========== */
#action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.btn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: #3b82f6;
  color: #ffffff;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-outline {
  background: transparent;
  color: #64748b;
  border-color: #cbd5e1;
}

.btn-outline:hover {
  background: #f8fafc;
  color: #475569;
}

/* ========== 错误消息 ========== */
#error-message {
  padding: 12px 16px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

#error-message.hidden {
  display: none;
}

/* ========== 结果区域 ========== */
#result-section {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 2px solid #6ee7b7;
  border-radius: 12px;
}

#result-section.hidden {
  display: none;
}

#result-title {
  font-size: 18px;
  font-weight: 700;
  color: #065f46;
  margin: 0 0 12px 0;
}

#result-value {
  text-align: center;
}

.result-formula {
  font-size: 24px;
  font-family: 'Courier New', monospace;
  color: #1e293b;
  margin-bottom: 8px;
  word-break: break-all;
}

.result-gcd-value {
  color: #059669;
  font-weight: 700;
  font-size: 32px;
}

.result-description {
  font-size: 14px;
  color: #475569;
}

/* ========== 步骤展示区域 ========== */
#steps-section {
  margin-bottom: 24px;
}

#steps-section.hidden {
  display: none;
}

#steps-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px 0;
}

#steps-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-round {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-round-title {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.step-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.step-table th {
  background: #f8fafc;
  padding: 8px 10px;
  text-align: center;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.step-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  font-family: 'Courier New', monospace;
  color: #334155;
}

.step-table tr:last-child td {
  border-bottom: none;
}

.step-final td {
  background: #f0fdf4;
  font-weight: 600;
  color: #065f46;
}

.remainder-zero {
  color: #059669;
  font-weight: 700;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  #app {
    padding: 20px 14px;
  }

  #app-title {
    font-size: 24px;
  }

  .result-formula {
    font-size: 20px;
  }

  .result-gcd-value {
    font-size: 28px;
  }

  .btn {
    padding: 10px 18px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  #app {
    padding: 16px 10px;
  }

  #app-title {
    font-size: 22px;
  }

  #app-subtitle {
    font-size: 14px;
  }

  .input-row {
    flex-wrap: wrap;
  }

  .input-label {
    min-width: 50px;
  }

  .number-input {
    font-size: 15px;
    padding: 10px 12px;
  }

  #action-buttons {
    flex-direction: column;
  }

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

  .step-table {
    font-size: 12px;
  }

  .step-table th,
  .step-table td {
    padding: 6px 6px;
  }

  .result-formula {
    font-size: 18px;
  }

  .result-gcd-value {
    font-size: 24px;
  }
}
