* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #ffffff;
  color: #000000;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  display: flex;
  flex-direction: row;
  gap: 15px;
  max-width: 1350px;
  width: 100%;
  height: 95vh;
}

@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }
}

.main-section {
  flex: 1;
  min-height: 0;
  background: #f5f5f5;
  border-radius: 16px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e0e0;
  gap: 10px;
}

.header {
  font-size: 1.2rem;
  font-weight: 600;
  color: #000000;
}

.visualization-area {
  flex: 1;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 250px;
}

#canvas {
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: block;
}

.results-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 13px 13px;
  border: 1px solid #e0e0e0;
  max-height: 500px;
  overflow-y: auto;
}

.stats-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 15px;
  border: 1px solid #e0e0e0;
  max-height: 500px;
}

@media (max-width: 1100px) {
  .stats-section {
    padding: 15px;
  }
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
}

@media (max-width: 1200px) {
  .results-grid {
    gap: 10px;
  }
}

@media (max-width: 900px) {
  .results-grid {
    gap: 8px;
  }
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  font-size: 0.9rem;
  color: #666666;
  font-weight: 500;
}

.result-value {
  font-size: 1rem;
  color: #000000;
  font-weight: 600;
}

.violation {
  color: #ff0000;
  font-weight: 700;
}

.controls-section {
  flex: 0 0 auto;
  width: 320px;
  background: #f5f5f5;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border: 1px solid #e0e0e0;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .controls-section {
    width: 100%;
    max-height: 400px;
  }
}

.controls-header {
  font-size: 1.5rem;
  font-weight: 600;
  color: #000000;
}

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

.control-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #666666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label input[type="number"] {
  margin-left: auto;
}

.control-value {
  color: #000000;
  font-weight: 600;
}

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

input[type="number"] {
  width: 70px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #000000;
  background: transparent;
  text-align: center;
  margin-left: auto;
}

input[type="number"]:focus {
  outline: none;
  background: #ffffff;
  border: 1px solid #000000;
}

.slider-container {
  flex: 1;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e0e0e0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #000000;
  cursor: pointer;
  transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #333333;
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #000000;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
  background: #333333;
  transform: scale(1.1);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #000000;
  margin-top: 5px;
}

.button-group {
  display: flex;
  gap: 10px;
}

button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #000000;
  color: #ffffff;
}

button:hover {
  background: #333333;
}

.info-text {
  font-size: 0.85rem;
  color: #666666;
  line-height: 1.5;
  padding: 10px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.inequality-box {
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid #000000;
  margin: 5px 0;
  min-height: 120px;
}

.inequality-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.inequality-formula {
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: #000000;
  margin: 5px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.stat-box {
  background: #f9f9f9;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  color: #666666;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: #000000;
}
