html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

/* 主应用容器 */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* 卡片容器 */
.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* 标题区域 */
#app-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px 0;
}

#app-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: #888;
  margin: 0 0 28px 0;
}

/* 输入区域通用样式 */
.input-section {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

/* 输入框通用样式 */
.input-wrapper {
  display: flex;
  align-items: center;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color 0.2s;
}

.input-wrapper:focus-within {
  border-color: #3498db;
}

.input-wrapper input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 12px 0;
  background: transparent;
  color: #333;
}

.unit-label {
  font-size: 0.85rem;
  color: #888;
  margin-right: 8px;
  white-space: nowrap;
}

.unit-toggle {
  background: #f0f4f8;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.unit-toggle:hover {
  background: #e0e8f0;
}

/* 性别选择按钮组 */
.toggle-group {
  display: flex;
  gap: 12px;
}

.toggle-btn {
  flex: 1;
  padding: 12px 0;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  font-size: 1rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn:hover {
  border-color: #3498db;
  color: #3498db;
}

.toggle-btn.active {
  background: #3498db;
  border-color: #3498db;
  color: #ffffff;
}

/* 结果展示区域 */
#result-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #f0f0f0;
}

#result-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
}

#result-display {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

/* 环形进度条 */
.ring-container {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.ring-bg {
  fill: none;
  stroke: #e8ecf1;
  stroke-width: 8;
}

.ring-progress {
  fill: none;
  stroke: #3498db;
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-dasharray: 314.159;
  stroke-dashoffset: 314.159;
  transition: stroke-dashoffset 0.5s ease, stroke 0.5s ease;
}

.ring-value {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.bfp-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1;
}

.bfp-percent-sign {
  font-size: 1rem;
  color: #888;
  margin-top: 2px;
}

/* 体脂分类标签 */
.category-tag {
  text-align: center;
  display: inline-block;
  margin: 0 auto 16px;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #3498db;
}

#bfp-category {
  display: table;
  margin-left: auto;
  margin-right: auto;
}

/* 分类进度条 */
.class-bar {
  position: relative;
  height: 32px;
  background: #e8ecf1;
  border-radius: 8px;
  overflow: visible;
  margin-top: 8px;
}

.class-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(to right, #3498db, #2ecc71, #f1c40f, #e67e22, #e74c3c);
  transition: width 0.5s ease;
}

.class-bar-indicator {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 40px;
  background: #1a1a2e;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: left 0.5s ease;
  transform: translateX(-50%);
}

.class-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.class-bar-labels span {
  font-size: 0.65rem;
  color: #999;
  text-align: center;
  flex: 1;
}

.class-bar-labels span.active-label {
  color: #1a1a2e;
  font-weight: 700;
}

/* 改编按钮区域 */
#__fork {
  text-align: center;
  margin: 20px 0;
}

#__fork button {
  background: #f0f4f8;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

#__fork button:hover {
  background: #e0e8f0;
  color: #333;
}

/* 应用简介区域 */
#features {
  max-width: 480px;
  margin: 0 auto 24px;
  padding: 0 16px;
}

#features h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}

#features p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.8;
}

/* 应用场景区域 */
#scenarios {
  max-width: 480px;
  margin: 0 auto 24px;
  padding: 0 16px;
}

#scenarios h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}

#scenarios ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#scenarios li {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.8;
  padding: 6px 0;
  border-bottom: 1px solid #f5f5f5;
}

#scenarios li:last-child {
  border-bottom: none;
}

#scenarios li strong {
  color: #333;
}

/* 常见问题区域 */
#FAQ {
  max-width: 480px;
  margin: 0 auto 24px;
  padding: 0 16px;
}

#FAQ h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin-top: 14px;
  margin-bottom: 6px;
}

#FAQ dd {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.7;
  margin: 0 0 8px 0;
}

/* 页脚 */
footer {
  text-align: center;
  padding: 20px 16px;
}

.page-info {
  font-size: 0.8rem;
  color: #aaa;
}

.page-info a {
  color: #888;
  text-decoration: none;
}

.page-info a:hover {
  color: #555;
  text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 520px) {
  #app {
    padding: 12px 8px;
  }

  .card {
    padding: 24px 16px;
    border-radius: 12px;
  }

  #app-title {
    font-size: 1.4rem;
  }

  .toggle-btn {
    padding: 10px 0;
    font-size: 0.95rem;
  }

  .bfp-number {
    font-size: 1.8rem;
  }

  #bfp-svg {
    width: 130px;
    height: 130px;
  }
}
