* {
  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 {
  text-align: center;
  margin-bottom: 25px;
}

h1 {
  font-size: 32px;
  margin-bottom: 5px;
}

.subtitle {
  font-size: 18px;
  font-weight: 300;
  max-width: 95%;
  margin: 0 auto;
  line-height: 1.6;
}

.card {
  background: white;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.calculator-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
}

.shape-selector {
  flex: 1;
  min-width: 300px;
}

.shape-params {
  flex: 1;
  min-width: 400px;
}

.shape-results {
  flex: 1;
  min-width: 400px;
}

.shapes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.shape-option {
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f9f9f9;
  height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.shape-option:hover {
  border-color: #4a90e2;
  background: #f0f7ff;
}

.shape-option.active {
  border-color: #4a90e2;
  background: #e6f0ff;
  box-shadow: 0 5px 15px rgba(74, 144, 226, 0.2);
}

.shape-emoji {
  font-size: 36px;
  margin-bottom: 10px;
}

.shape-name {
  font-weight: 600;
  font-size: 16px;
}

.param-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

input,
select {
  width: 100%;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border 0.3s;
}

input:focus,
select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.precision-select {
  display: flex;
  align-items: center;
  gap: 15px;
}

.precision-select select {
  flex: 1;
}

.btn-calculate {
  background: linear-gradient(to right, #4a90e2, #5fa3f0);
  color: white;
  border: none;
  padding: 16px 30px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
}

.btn-calculate:hover {
  background: linear-gradient(to right, #3a80d2, #4a90e2);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(74, 144, 226, 0.4);
}

.formula-display {
  background: #f8f9fa;
  border-left: 4px solid #4a90e2;
  padding: 20px;
  border-radius: 8px;
  margin: 25px 0;
  font-size: 28px;
  line-height: 1.6;
  font-family: 'Courier New', monospace;
}

.result-display {
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: 10px;
  margin-top: 20px;
}

.result-value {
  font-size: 40px;
  font-weight: 700;
  color: #1a73e8;
  margin: 20px 0;
}

.instructions {
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.instructions h3 {
  margin-bottom: 15px;
  color: #e65100;
  display: flex;
  align-items: center;
  gap: 10px;
}

.instructions ul {
  padding-left: 20px;
}

.instructions li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.shape-diagram {
  text-align: center;
  margin: 20px 0;
  font-size: 100px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 10px;
}

/* 输入容器 */
.input-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 形状选择下拉框 */
.shape-select {
  width: 100%;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  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='currentColor' 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 10px center;
  background-size: 1em;
}

/* 形状展示区域 */
.shape-diagram-container {
  text-align: center;
  padding: 0 20px;
  background: #f8f9fa;
  border-radius: 10px;
}

.shape-diagram {
  font-size: 100px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 输入字段组 */
.param-group {
  margin-bottom: 15px;
}

/* 计算按钮 */
.btn-calculate {
  margin-top: 10px;
}

.shape-icon {
  width: 160px;
  height: 160px;
  color: #4a90e2;
  /* 统一图标颜色 */
}

.shape-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
}

/* 下拉菜单中的SVG图标 */
.shape-select option {
  padding-left: 30px;
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 20px;
}

/* 为每个选项添加背景图标 */
.shape-select option[value="circle"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%234a90e2' stroke-width='2' fill='none'/%3E%3C/svg%3E");
}

footer {
  text-align: center;
  padding: 20px;
  color: #8a8a8a;
  margin-top: 10px;
  font-size: 0.9rem;
}
