* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #f1f2f3;
}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1560px;
  min-width: 1240px;
  margin: 20px auto;
  color: #333;
}

.container *{
  box-sizing: border-box;
}

header {
  margin-bottom: 20px;
  text-align: center;
}

header h1 {
  font-size: 2.2rem;
  margin-bottom: 5px;
}

header .description {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
}

.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #eaeaea;
  padding: 0;
}

.tab {
  padding: 20px 50px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 500;
  color: #555;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab.active {
  color: #2575fc;
  border-bottom: 3px solid #2575fc;
  background: rgba(37, 117, 252, 0.05);
}

.tab:hover:not(.active) {
  background: rgba(0, 0, 0, 0.03);
}

.content-area {
  padding: 20px;
  min-height: 500px;
  background: #fff;
}

.calculator-section {
  display: none;
}

.calculator-section.active {
  display: block;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.fraction-input {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
  border: 1px solid #eaeaea;
}

.integer-part {
  width: 150px;
  padding: 10px;
  font-size: 1.2rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
  margin-right: 10px;
}

.fraction-part {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 10px;
}

.numerator,
.denominator {
  width: 160px;
  padding: 10px;
  font-size: 1.2rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
}

.numerator {
  border-bottom: none;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.denominator {
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.fraction-line {
  height: 1px;
  width: 100%;
  background: #333;
  margin: 3px 0;
}

.operator {
  font-size: 2rem;
  font-weight: bold;
  color: #2575fc;
  margin: 0 20px;
  min-width: 80px;
  text-align: center;
}

.controls {
  display: flex;
  gap: 15px;
  margin: 30px 0;
}

.btn {
  padding: 14px 28px;
  font-size: 1.1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn.calculate {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
}

.btn.clear {
  background: #f8f9fa;
  color: #666;
  border: 1px solid #ddd;
}

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

.result-container {
  background: #f0f7ff;
  border-radius: 12px;
  padding: 25px;
  margin-top: 30px;
  border: 1px solid #d0e6ff;
  display: none;
}

.result-title {
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: #2575fc;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-content {
  font-size: 1.4rem;
  font-weight: 500;
  color: #2c3e50;
  min-height: 60px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.instruction {
  background: #f8f9fa;
  border-left: 4px solid #2575fc;
  padding: 20px;
  border-radius: 0 8px 8px 0;
  margin: 30px 0;
}

.instruction h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.instruction p {
  line-height: 1.7;
  margin: 10px 0;
}

.decimal-input {
  padding: 14px 20px;
  font-size: 1.2rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  width: 300px;
}

.comparison-result {
  font-size: 1.8rem;
  font-weight: bold;
  color: #e74c3c;
  margin-top: 20px;
}

.fraction-display {
  display: flex;
  align-items: center;
  font-size: 1.8rem;
  font-weight: 500;
  margin: 10px 0;
}

.fraction-display .integer {
  margin-right: 10px;
}

.fraction-display .fraction {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 5px;
}

.fraction-display .numerator {
  border-bottom: 2px solid #333;
  padding: 10px 20px;
}

.fraction-display .denominator {
  padding: 10px 20px;
}

.error-message {
  color: #e74c3c;
  margin-top: 10px;
  font-weight: 500;
}

footer {
  text-align: center;
  padding: 20px;
  color: #777;
}

.examples {
  margin-top: 20px;
  font-size: 0.95rem;
  color: #666;
}

.examples span {
  display: inline-block;
  background: #eef5ff;
  padding: 5px 10px;
  border-radius: 6px;
  margin: 0 5px;
  cursor: pointer;
  border: 1px solid #d0e6ff;
}
