/* ========== 全局样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 20px;
}

/* ========== 头部 ========== */
.header {
  margin-bottom: 48px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 24px;
}

.header h1 {
  font-size: 28px;
  color: #111827;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.header p {
  font-size: 14px;
  color: #6b7280;
  margin-top: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
  transition: color 0.15s;
}

.back-link:hover {
  color: #2563eb;
}

/* ========== 工具卡片网格 ========== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tool-card {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  display: block;
}

.tool-card:hover {
  border-color: #2563eb;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.tool-icon svg {
  width: 24px;
  height: 24px;
  color: #2563eb;
}

.tool-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
}

.tool-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
}

/* ========== 计算器页面 ========== */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  color: #111827;
  font-weight: 600;
}

.calculator {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 32px;
  max-width: 860px;
  margin: 0 auto;
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 768px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

/* 输入表单 */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #374151;
  margin-bottom: 6px;
}

.form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  min-width: 0;
  background: #fff;
  color: #111827;
}

.form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-unit {
  color: #9ca3af;
  font-size: 13px;
  white-space: nowrap;
}

.radio-group {
  display: flex;
  gap: 8px;
}

.radio-option {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  color: #374151;
  user-select: none;
  background: #fff;
}

.radio-option.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #2563eb;
}

.radio-option:hover:not(.active) {
  border-color: #9ca3af;
}

.calc-btn {
  width: 100%;
  padding: 10px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 8px;
}

.calc-btn:hover {
  background: #1d4ed8;
}

.calc-btn:active {
  background: #1e40af;
}

/* 结果展示 */
.result-panel {
  background: #fafbfc;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 20px;
}

.result-panel h3 {
  color: #111827;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.result-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.result-label {
  color: #6b7280;
  font-size: 13px;
}

.result-value {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.result-value.secondary {
  font-size: 15px;
  color: #374151;
}

.result-value.tertiary {
  font-size: 15px;
  color: #059669;
}

/* 还款明细表 */
.detail-section {
  margin-top: 28px;
}

.detail-section h3 {
  color: #111827;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

.table-wrapper {
  max-height: 360px;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.detail-table thead {
  position: sticky;
  top: 0;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.detail-table th,
.detail-table td {
  padding: 10px 14px;
  text-align: right;
  color: #374151;
  font-variant-numeric: tabular-nums;
}

.detail-table th {
  font-weight: 600;
  color: #374151;
  font-size: 12px;
}

.detail-table th:first-child,
.detail-table td:first-child {
  text-align: center;
  color: #6b7280;
}

.detail-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

/* 空状态 */
.empty-state {
  text-align: center;
  color: #9ca3af;
  padding: 40px 20px;
  font-size: 13px;
}

/* 说明提示 */
.hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 6px;
  line-height: 1.5;
}

/* 下拉框 */
.form-select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #111827;
  min-width: 0;
  cursor: pointer;
}

.form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 次要按钮 */
.btn-secondary {
  padding: 8px 16px;
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  border-color: #2563eb;
  color: #2563eb;
}

/* 突出数字展示 */
.highlight-num {
  font-size: 32px;
  font-weight: 600;
  color: #2563eb;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.result-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.tag-thin { background: #eff6ff; color: #2563eb; }
.tag-normal { background: #ecfdf5; color: #059669; }
.tag-overweight { background: #fffbeb; color: #d97706; }
.tag-obese { background: #fef2f2; color: #dc2626; }

/* 汇率表输入框 */
.rate-input {
  width: 120px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  text-align: right;
  outline: none;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.rate-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========== 页脚导航 ========== */
.site-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer a {
  color: #6b7280;
  font-size: 13px;
  transition: color 0.15s;
}

.site-footer a:hover {
  color: #2563eb;
}

/* ========== 静态内容页 ========== */
.static-page {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 40px;
  max-width: 760px;
  margin: 0 auto;
}

.static-page h1 {
  font-size: 22px;
  color: #111827;
  font-weight: 600;
  margin-bottom: 8px;
}

.static-page .page-meta {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.static-page h2 {
  font-size: 16px;
  color: #111827;
  font-weight: 600;
  margin: 24px 0 10px;
}

.static-page p,
.static-page li {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.8;
}

.static-page ul {
  margin: 8px 0 8px 20px;
}

.static-page a {
  color: #2563eb;
}

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

.contact-email {
  font-size: 18px;
  font-weight: 600;
  color: #2563eb;
}
