/* Helper Tools — dark by default, warm and low-glare. */
:root {
  color-scheme: dark;
  --bg: #17181a;
  --surface: #1e1f22;
  --surface-2: #25272b;
  --border: #303237;
  --text: #d5d2ca;
  --text-strong: #ebe8e0;
  --muted: #8e8b84;
  --accent: #d6a45c;
  --accent-ink: #17181a;
  --radius: 6px;
  --max: 880px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Header / footer */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 12px; }
.logo { font-weight: 600; color: var(--text-strong); letter-spacing: .01em; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--accent); font-weight: 600; }
.nav { display: flex; gap: 18px; font-size: .92rem; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text-strong); text-decoration: none; }
.site-footer { margin-top: 56px; padding: 20px 0 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; }
.site-footer a { color: var(--muted); }

/* Typography */
main { padding: 20px 0; }
h1 { font-size: 1.7rem; line-height: 1.3; margin: 6px 0; color: var(--text-strong); font-weight: 650; }
h2 { font-size: 1.15rem; margin: 36px 0 8px; color: var(--text-strong); font-weight: 600; }
h3 { font-size: 1rem; margin: 20px 0 4px; color: var(--text-strong); font-weight: 600; }
.lead { color: var(--muted); margin: 0 0 20px; }
.prose { max-width: 680px; }
.crumbs { font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
code, .num { font-family: var(--mono); font-size: .95em; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }

/* Home lists */
.section-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 32px 0 10px; }
.tool-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.tool-list li { border-bottom: 1px solid var(--border); }
.tool-list a { display: flex; justify-content: space-between; gap: 16px; padding: 12px 2px; color: var(--text-strong); }
.tool-list a:hover { text-decoration: none; background: var(--surface); }
.tool-list span { color: var(--muted); font-size: .9rem; text-align: right; }
.tool-list .soon { display: flex; justify-content: space-between; padding: 12px 2px; color: var(--muted); }
.pair-groups { columns: 3 200px; column-gap: 28px; }
.pair-group { break-inside: avoid; margin-bottom: 18px; }
.pair-group h3 { margin: 0 0 4px; font-size: .9rem; color: var(--muted); font-weight: 500; }
.pair-group ul { list-style: none; margin: 0; padding: 0; }
.pair-group li { padding: 2px 0; font-size: .95rem; }

/* Converter */
.tabs { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: -4px 0 16px; border-bottom: 1px solid var(--border); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 10px; cursor: pointer; font: inherit; font-size: .92rem; margin-bottom: -1px; }
.tab:hover { color: var(--text-strong); }
.tab[aria-selected="true"] { color: var(--text-strong); border-bottom-color: var(--accent); }
.conv-row { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 12px; align-items: end; }
.field label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-strong); font: inherit;
}
.field input { font-family: var(--mono); font-size: 1.15rem; }
.field select { margin-top: 8px; font-size: .95rem; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }
.unit-tag { margin-top: 8px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); font-size: .95rem; }
.swap {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  color: var(--muted); font-size: 1.1rem; cursor: pointer; margin-bottom: 50px;
}
.swap:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.result-line { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-family: var(--mono); font-size: .95rem; color: var(--text-strong); word-break: break-word; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: .85rem; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); font-family: var(--mono); }
.data-table td:first-child { font-family: inherit; }
.data-table.mono td:first-child { font-family: var(--mono); }
.data-table tr:nth-child(even) td { background: rgba(255,255,255,.015); }
.formula-box { background: var(--surface); border-left: 3px solid var(--accent); padding: 10px 14px; margin: 10px 0; font-family: var(--mono); color: var(--text-strong); border-radius: 0 var(--radius) var(--radius) 0; }
.related { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; list-style: none; }
@media (max-width: 600px) {
  .conv-row { grid-template-columns: 1fr; }
  .swap { margin: 0 auto; transform: rotate(90deg); }
  h1 { font-size: 1.45rem; }
  .nav { gap: 14px; font-size: .88rem; }
}

/* Ads: reserve space to avoid layout shift */
.ad-slot { margin: 28px 0; min-height: 100px; text-align: center; overflow: hidden; }
.ad-slot::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--muted); margin-bottom: 4px; letter-spacing: .08em; text-transform: uppercase; }
.conv-row.simple .swap { margin-bottom: 0; }
@media (max-width: 600px) { .conv-row.simple .swap { margin: 0 auto; } }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.calc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.calc-foot .result-line { flex: 1; }
.btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); border-radius: var(--radius); padding: 7px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.btn:hover { color: var(--text-strong); border-color: var(--accent); }
.field input.derived { color: var(--accent); border-style: dashed; }
.dropzone { display: block; border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px 16px; text-align: center; cursor: pointer; background: var(--surface-2); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone strong { display: block; color: var(--accent); font-weight: 600; }
.dropzone span { color: var(--muted); font-size: .92rem; }
.h-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 16px 0 6px; font-size: .92rem; color: var(--muted); }
.seg { border: 0; padding: 0; margin: 0; display: flex; gap: 14px; align-items: center; }
.seg legend { float: left; margin-right: 12px; }
.seg label { color: var(--text-strong); cursor: pointer; }
.h-q { display: flex; align-items: center; gap: 10px; }
.h-q input { accent-color: var(--accent); width: 140px; }
.h-list { list-style: none; padding: 0; margin: 10px 0 14px; }
.h-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.h-list .h-name { color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.h-list .h-status { color: var(--muted); white-space: nowrap; }
.h-list .h-err .h-status { color: #d77c6a; }
.btn-primary { color: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: .4; cursor: default; }
@media (max-width: 600px) { .h-list li { flex-direction: column; gap: 2px; } }
.seg input { accent-color: var(--accent); }
.salary-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.salary-out { margin-top: 10px; }
.salary-out tr.hl td { color: var(--accent); }
.salary-out td:last-child { text-align: right; }
.muted-small { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }
