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

:root {
  --primary: #1a73e8;
  --primary-light: #e8f0fe;
  --primary-dark: #1557b0;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #e0e0e0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

.calculator {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

#title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 8px 0;
}

#subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 24px 0;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.rate-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.rate-btn {
  flex: 1;
  min-width: 60px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rate-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.rate-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.custom-rate {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.custom-rate label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.input-with-unit {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  transition: border-color 0.2s ease;
}

.input-with-unit:focus-within {
  border-color: var(--primary);
}

.input-with-unit input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 12px;
  font-size: 16px;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.input-with-unit .unit {
  padding: 0 12px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.price-inputs {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.price-inputs .form-group {
  flex: 1;
  margin-bottom: 0;
}

.swap-icon {
  display: flex;
  align-items: center;
  padding-bottom: 8px;
}

#swap-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--primary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

#swap-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

#result-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.result-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result-item {
  padding: 16px;
  border-radius: 8px;
  background: var(--bg);
}

.result-item.highlight {
  background: var(--primary-light);
  border: 1px solid var(--primary);
}

.result-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.result-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.result-item.highlight .result-value {
  color: var(--primary-dark);
}

.result-cn {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

#features h2,
#scenarios h2,
#FAQ h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

#features p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
}

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

#scenarios li {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 8px;
}

#scenarios li strong {
  color: var(--text);
}

#FAQ dl {
  margin: 0;
}

#FAQ dt {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
  margin-top: 16px;
  margin-bottom: 6px;
}

#FAQ dd {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
  margin-left: 0;
  margin-bottom: 8px;
  padding-left: 12px;
  border-left: 3px solid var(--primary-light);
}

#__fork {
  text-align: center;
  margin: 24px 0;
}

#__fork button {
  padding: 10px 28px;
  border: 2px solid var(--primary);
  border-radius: 24px;
  background: var(--card-bg);
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#__fork button:hover {
  background: var(--primary);
  color: #fff;
}

@media (max-width: 768px) {
  .calculator {
    padding: 16px 12px;
  }

  #title {
    font-size: 24px;
  }

  .card {
    padding: 16px;
  }

  .price-inputs {
    flex-direction: column;
    gap: 8px;
  }

  .swap-icon {
    align-self: center;
    transform: rotate(90deg);
    padding-bottom: 0;
  }

  .result-items {
    grid-template-columns: 1fr;
  }

  .rate-buttons {
    gap: 6px;
  }

  .rate-btn {
    padding: 8px 10px;
    font-size: 14px;
  }

  .custom-rate {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 769px) {
  #price-excl-group,
  #price-incl-group {
    flex: 1;
  }
}
