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

/* ── App 主体 ── */
#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#app-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

#app-subtitle {
  text-align: center;
  font-size: 15px;
  color: #666;
  margin-bottom: 24px;
}

/* ── 卡片 ── */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 24px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8f0fe;
}

/* ── 输入组 ── */
.input-group {
  margin-bottom: 20px;
}

.input-group:last-of-type {
  margin-bottom: 0;
}

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

.input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.input-field {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  font-size: 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fafbfc;
  color: #1a1a2e;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}

.input-field:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fff;
}

.input-field:disabled {
  background: #eef0f2;
  color: #999;
  cursor: not-allowed;
}

.input-custom {
  max-width: 140px;
}

.input-slider {
  flex: 2;
  min-width: 150px;
  height: 6px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.input-select {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  font-size: 15px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fafbfc;
  color: #1a1a2e;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.input-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.input-hint {
  display: block;
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

/* ── 结果展示 ── */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #f9fafb;
  transition: background 0.2s;
}

.result-row:last-of-type {
  margin-bottom: 16px;
}

.result-row:hover {
  background: #f3f4f6;
}

.result-label {
  font-size: 15px;
  color: #555;
  font-weight: 500;
}

.result-value {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
}

/* ── 利息高亮 ── */
.result-highlight {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
}

.result-highlight .result-value {
  color: #ea580c;
  font-size: 20px;
}

.result-highlight:hover {
  background: #fff3e0;
}

/* ── 节省金额 ── */
.result-save {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
}

.result-save .result-value {
  color: #16a34a;
}

.result-save:hover {
  background: #ecfdf5;
}

/* ── 提示框 ── */
.tip-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  margin-top: 8px;
}

.tip-icon {
  font-size: 20px;
  line-height: 1.4;
  flex-shrink: 0;
}

.tip-text {
  font-size: 14px;
  color: #1e40af;
  line-height: 1.6;
  margin: 0;
}

/* ── 错误提示 ── */
.error-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 8px;
  margin-bottom: 16px;
}

.error-icon {
  font-size: 20px;
  line-height: 1.4;
  flex-shrink: 0;
}

.error-text {
  font-size: 14px;
  color: #dc2626;
  line-height: 1.6;
  margin: 0;
}

/* ── Fork 按钮 ── */
#__fork {
  text-align: center;
  margin: 24px 0;
}

#__fork button {
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 500;
  color: #3b82f6;
  background: #fff;
  border: 1.5px solid #3b82f6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

#__fork button:hover {
  background: #3b82f6;
  color: #fff;
}

/* ── 应用简介 / 场景 / 常见问题 ── */
#features, #scenarios, #FAQ {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

#features h2, #scenarios h2, #FAQ h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 12px;
}

#features p {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
  margin: 0;
}

#scenarios ul {
  padding-left: 20px;
  margin: 0;
}

#scenarios li {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 6px;
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  margin-top: 16px;
}

#FAQ dt:first-of-type {
  margin-top: 0;
}

#FAQ dd {
  font-size: 14px;
  color: #666;
  line-height: 1.7;
  margin: 0 0 4px 0;
}

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

.page-info {
  font-size: 13px;
  color: #999;
}

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

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

/* ── 响应式：移动端 ── */
@media (max-width: 480px) {
  #app {
    padding: 16px 12px;
  }

  #app-title {
    font-size: 22px;
  }

  #app-subtitle {
    font-size: 14px;
  }

  .card {
    padding: 16px;
  }

  .input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .input-field, .input-select, .input-custom {
    width: 100%;
    max-width: none;
  }

  .result-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .result-value {
    font-size: 16px;
  }

  .result-highlight .result-value {
    font-size: 18px;
  }
}
