/* 计算工具页面专用样式 */
.calculator {
  max-width: 400px;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.calculator-display {
  margin-bottom: 20px;
}

.display-input {
  width: 100%;
  height: 60px;
  font-size: 2rem;
  text-align: right;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  padding: 0 15px;
  background: #f8f9fa;
  font-family: monospace;
}

.calculator-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.calc-btn {
  height: 50px;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.calc-btn.number {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #e1e5e9;
}

.calc-btn.number:hover {
  background: #e9ecef;
}

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

.calc-btn.operator:hover {
  background: #5a6fd8;
}

.calc-btn.clear {
  background: #dc3545;
  color: white;
}

.calc-btn.clear:hover {
  background: #c82333;
}

.calc-btn.equals {
  background: #28a745;
  color: white;
}

.calc-btn.equals:hover {
  background: #218838;
}

.calc-btn.zero {
  grid-column: span 2;
}

.scientific-buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.calc-btn.function {
  background: #6c757d;
  color: white;
  font-size: 0.9rem;
  height: 40px;
}

.calc-btn.function:hover {
  background: #5a6268;
}

.unit-converter {
  max-width: 600px;
}

.conversion-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.conversion-input {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conversion-arrow {
  font-size: 2rem;
  color: #667eea;
  font-weight: bold;
}

.conversion-result {
  background: #e3f2fd;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
  text-align: center;
  color: #1976d2;
}

.percentage-calculator {
  max-width: 700px;
}

.percentage-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #667eea;
}

.percentage-section h4 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.percentage-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.percentage-row span {
  font-weight: 500;
  color: #666;
  white-space: nowrap;
}

.percentage-row .form-input,
.percentage-row .form-select {
  width: 120px;
  flex-shrink: 0;
}

.result-display {
  background: #667eea;
  color: white;
  padding: 8px 15px;
  border-radius: 5px;
  font-weight: bold;
  min-width: 80px;
  text-align: center;
}

.formulas {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.formula-item {
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
  border-left: 3px solid #667eea;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .calculator {
    max-width: 100%;
  }

  .conversion-row {
    flex-direction: column;
    align-items: stretch;
  }

  .conversion-arrow {
    text-align: center;
    transform: rotate(90deg);
  }

  .percentage-row {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .percentage-row .form-input,
  .percentage-row .form-select {
    width: 100%;
  }

  .scientific-buttons {
    grid-template-columns: repeat(3, 1fr);
  }

  .calc-btn.function {
    font-size: 0.8rem;
  }
}
