* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #f1f2f3;
}

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

.main{
  width: 100%;
  display: flex;
  gap: 20px;
}

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

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

header  .subtitle {
  font-size: 1.1rem;
  max-width: 95%;
  margin: 0 auto;
  opacity: 0.9;
}

.card {
  flex: 1;
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.formula-card{
  flex: 1.2;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f1f2f3;
}

h2 i {
  font-size: 1.8rem;
}

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

.input-row {
  margin-bottom: 20px;
}

.container label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2c3e50;
  font-size: 1.15rem;
}

.container select,.container input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  background: white;
}

.container select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
}

.container select:focus,.container input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

.button-group {
  display: flex;
  gap: 15px;
  margin: 30px 0 20px;
}

.container button {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 10px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.calculate-btn {
  background: linear-gradient(to right, #3498db, #2980b9);
  color: white;
}

.calculate-btn:hover {
  background: linear-gradient(to right, #2980b9, #2573a7);
  transform: translateY(-3px);
}

.copy-btn {
  background: linear-gradient(to right, #2ecc71, #27ae60);
  color: white;
}

.copy-btn:hover {
  background: linear-gradient(to right, #27ae60, #219d54);
  transform: translateY(-3px);
}

.clear-btn {
  background: linear-gradient(to right, #e74c3c, #c0392b);
  color: white;
}

.clear-btn:hover {
  background: linear-gradient(to right, #c0392b, #a93226);
  transform: translateY(-3px);
}

.result-section {
  margin-top: 0px;
  padding: 15px;
  background: #e8f4fc;
  border-radius: 12px;
  border-left: 5px solid #3498db;
}

.result-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2980b9;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.shape-diagram {
  text-align: center;
  margin: 20px 0;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s ease;
}

.shape-svg {
  width: 200px;
  height: 200px;
  fill: #3498db;
  stroke: #2c3e50;
  stroke-width: 2;
  transition: all 0.3s ease;
}

.formula-section {
  flex-grow: 1;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 12px;
}

.formula-title {
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.katex-formula {
  text-align: center;
  padding: 15px;
  font-size: 1.5rem;
  background: white;
  border-radius: 12px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #eee;
}

.instruction-section {
  margin-top: 30px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
}

.examples-box,.instruction-box{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

.example,.instruction{
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
  border: 1px solid #eee;
}

.example-title, .instruction-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: #2980b9;
}

.instruction-box{
  grid-template-columns: 1fr 1fr;
}

.instruction ul {
  padding-left: 25px;
  margin-top: 15px;
}

.instruction li {
  margin-top: 10px;
}

footer {
  text-align: center;
  padding: 10px;
  margin-top: 10px;
  color: #7f8c8d;
  font-size: 1rem;
}

.input-row.hidden {
  display: none;
}

.param-input {
  position: relative;
}

.param-input span {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #7f8c8d;
  font-weight: 500;
}

.shape-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin-top: 10px;
  font-size: 1.1rem;
}
