/* ===================================================================
   Exchange Rate Calculator Style — USTaxZH
   =================================================================== */

:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #1c2b24; /* 同步主站字色 */
  --ink-soft: #45564c;
  --muted: #65758b;
  --line: #cbc8ba; /* 同步主站边框线 var(--rule) */
  --blue: #2f5d48; /* 同步主站账簿绿 var(--ledger) */
  --blue-soft: #e4ece6; /* 同步主站 var(--ledger-tint) */
  --danger: #8c3b2e; /* 同步主站 var(--alert) */
  --shadow: 0 10px 30px rgba(28, 43, 36, 0.06);
  --radius: 8px;
}

/* 强制计算器及其表单内部全部使用清晰、现代的无衬线等宽及系统字体，解决字体怪异问题 */
.shell,
.shell select,
.shell input,
.shell button,
.mock-input,
.rate-details-panel strong,
.formula,
.data-table,
.tool-intro,
.review-meta,
.tax-warning {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shell {
  width: min(900px, calc(100% - 32px));
  margin: 30px auto 60px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.15;
  color: var(--ink);
  font-family: var(--font-display);
}

.subtitle {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.review-meta {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 10px 0 20px;
}

.tool-intro {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 20px 0 24px;
}

.lang-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 6px;
  padding: 8px 14px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 22px;
  padding: 24px 28px;
}

.calculator-card {
  padding: 28px;
  margin-top: 0; /* 第一张卡片不加间距 */
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.mode {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 6px;
  padding: 12px 10px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.field.full {
  grid-column: 1 / -1;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 0 13px;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 93, 72, 0.12);
}

.amount-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.amount-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 93, 72, 0.12);
}

.amount-wrap span {
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #f6f8fb;
  border-right: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink-soft);
}

.amount-wrap input {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 18px;
  font-weight: 600;
}

/* 只读输入框与复制按钮样式 */
.amount-wrap.is-readonly {
  grid-template-columns: auto 1fr auto; /* 预留给复制按钮 */
  background: #f6f8fb;
  border-color: var(--line);
  cursor: not-allowed;
}

.mock-input {
  display: flex;
  align-items: center;
  width: 100%;
  height: 46px;
  padding: 0 13px;
  font-size: 18px;
  font-weight: 650;
  color: var(--ink);
  background: #f6f8fb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  height: 32px;
  margin-right: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
}

.copy-btn:active {
  transform: scale(0.95);
}

/* 汇率与日期虚线展示面板 - 升级为 3 列 */
.rate-details-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
  padding: 18px 22px;
  background: #fcfcf9;
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

.detail-val {
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
}

.formula {
  margin: 14px 2px 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.error {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 6px;
  background: #fff0ee;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
}

/* 警示框样式 */
.tax-warning {
  margin-top: 18px;
  padding: 16px 20px;
  background: #fff9e6;
  border-left: 4px solid #f0a020;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #735105;
}

.tax-warning strong {
  color: #b25900;
}

/* 数据来源页卡列表样式 */
.source-card ul {
  margin: 12px 0;
  padding-left: 20px;
}

.source-card li {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 8px;
}

.source-card li:last-child {
  margin-bottom: 0;
}

.data-updated {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.card h2 {
  margin: 0 0 18px;
  font-size: clamp(17px, 3.5vw, 20px);
  color: var(--ink);
  font-family: var(--font-display);
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.usage-grid div {
  padding: 18px;
  border-radius: 6px;
  background: #fdfdfc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
}

.usage-grid h3 {
  font-size: 15px;
  color: var(--ink);
  margin: 0;
  font-weight: 700;
}

.usage-grid p {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

.footnote {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

/* 常见场景表格与FAQ样式 */
.table-wrap {
  overflow-x: auto;
  margin: 14px 0 0;
}

.faq-section h3 {
  font-size: 15px;
  color: var(--ink);
  margin: 18px 0 6px;
  font-weight: 700;
}

.faq-section h3:first-of-type {
  margin-top: 0;
}

.faq-section p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 16px;
}

.faq-section p:last-child {
  margin-bottom: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .shell {
    margin-top: 24px;
  }
  .topbar {
    align-items: flex-start;
  }
  .calculator-card {
    padding: 18px;
  }
  .mode-grid {
    grid-template-columns: 1fr;
  }
  .form-grid,
  .rate-details-panel,
  .usage-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .card {
    padding: 18px;
  }
}
