@charset "UTF-8";
:root {
  --ink: #202b28;
  --muted: #606b66;
  --green: #164d43;
  --green-hover: #103e35;
  --paper: #fff;
  --surface: #f6f7f5;
  --selected: #eaf1ed;
  --line: #dce1dc;
  --control: #a7b2aa;
  --focus: #9b681b;
  --error: #a53623;
  --error-surface: #fff4ef;
  --radius: 6px;
  --result-font: "Songti TC", "Noto Serif TC", serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: not-allowed; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
button:not(:disabled):active { filter: brightness(.9); }
a { color: var(--green); text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button, input, select, textarea, a { outline-offset: 4px; -webkit-tap-highlight-color: transparent; }
:is(button, input, select, textarea, a, summary):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.site-header, main, footer { width: min(100%, 1184px); margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.site-header { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--ink); font-size: 23px; font-weight: 750; }
.brand small { font-size: 13px; font-weight: 500; color: var(--muted); }
.site-header nav { display: flex; gap: 28px; font-size: 14px; }
.site-header nav a { padding: 16px 0; text-decoration: none; color: var(--muted); }
.site-header nav a[aria-current] { color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 8px; }
.hero { padding: 32px 0 28px; }
h1 { font-size: clamp(28px, 3.2vw, 36px); line-height: 1.4; margin: 0 0 8px; font-weight: 700; text-wrap: balance; }
h2 { font-size: 20px; line-height: 1.5; text-wrap: balance; }
.hero p, .lead { color: var(--muted); font-size: 15px; line-height: 1.8; margin: 0; }
.tool { border-top: 2px solid var(--ink); }
.tool-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 24px; }
.tabs button { min-height: 56px; padding: 16px 4px; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; }
.tabs button.active { color: var(--green); border-bottom-color: var(--green); }
.tabs button:hover { color: var(--green); }
.tabs span { font-size: 12px; margin-left: 4px; font-weight: 400; }
.local-note { color: var(--muted); font-size: 12px; }
.tool-body { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.input-panel { min-width: 0; padding: 28px 32px 32px 0; border-right: 1px solid var(--line); }
.result-panel { min-width: 0; padding: 28px 0 32px 32px; }
.field-row, .label-row, .result-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-row label, .label-row label { font-size: 14px; font-weight: 600; }
select {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 44px 10px 14px;
  border: 1px solid var(--control);
  border-radius: var(--radius);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23202b28' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
select:hover:not(:disabled) { border-color: var(--green); background-color: var(--surface); }
select:focus-visible { border-color: var(--green); }
select:disabled { color: var(--muted); background-color: var(--surface); border-color: var(--line); cursor: not-allowed; }
.hint { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 8px 0 16px; }
#purpose-help { margin: 8px 0 24px; }
.check { display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: 14px; margin: -12px 0 16px; }
.check input { accent-color: var(--green); width: 18px; height: 18px; }
.label-row { margin-bottom: 8px; }
.text-button { background: transparent; color: var(--green); font-size: 13px; padding: 8px 4px; min-height: 44px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.number-input, textarea, .repair-form input { border: 1px solid var(--control); background: var(--paper); color: var(--ink); border-radius: var(--radius); width: 100%; min-width: 0; padding: 12px 16px; }
.number-input { font-size: 26px; min-height: 64px; font-variant-numeric: tabular-nums; }
.number-input::placeholder { color: var(--muted); font-size: 22px; }
textarea { resize: vertical; font-size: 16px; line-height: 1.8; max-width: 100%; }
.error { color: var(--error); font-size: 13px; line-height: 1.7; }
.error:empty { display: none; }
input[aria-invalid=true] { border-color: var(--error); background: var(--error-surface); }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.examples button { background: transparent; color: var(--green); padding: 8px 0; min-height: 44px; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.panel-title { font-size: 15px; font-weight: 600; margin: 0 0 20px; }
#empty-result { background: var(--surface); padding: 24px; min-height: 196px; display: flex; flex-direction: column; justify-content: center; }
#empty-result p, #invalid-result p { font-size: 14px; line-height: 1.9; color: var(--muted); margin: 4px 0; }
#empty-result .empty-title { color: var(--ink); font-size: 16px; }
#invalid-result { padding: 24px 0; }
#invalid-result h2 { font-size: 18px; }
.result-label > span, .secondary-result span, .verify > span { color: var(--muted); font-size: 13px; }
.copy-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--green); border-radius: var(--radius); padding: 10px 16px; min-height: 44px; background: var(--green); color: var(--paper); font-size: 13px; font-weight: 600; text-decoration: none; }
.copy-button:hover:not(:disabled) { background: var(--green-hover); }
.copy-button.inline { margin-top: 16px; font-size: 14px; }
.primary-result { font-family: var(--result-font); font-size: clamp(28px, 3vw, 36px); line-height: 1.7; letter-spacing: 1px; margin: 12px 0 24px; overflow-wrap: anywhere; }
.secondary-result { border-top: 1px solid var(--line); padding: 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.secondary-result > div { min-width: 0; }
.secondary-result p { font-size: 16px; line-height: 1.8; margin: 8px 0 0; overflow-wrap: anywhere; }
.secondary-result .text-button { white-space: nowrap; }
.verify { border-top: 1px solid var(--line); padding-top: 16px; }
.verify strong { display: block; font-size: 20px; margin: 8px 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#place-values { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.place-piece { display: inline-flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.place-piece b { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.place-piece small { color: var(--muted); font-size: 12px; }
.verify .hint { margin-bottom: 0; }
.verify .hint:empty { display: none; }
.tool-bottom { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; font-size: 12px; color: var(--muted); }
.copy-status { font-size: 14px; line-height: 1.6; color: var(--green); margin: 0; }
.copy-status:not(:empty) { padding: 12px 0; }
.fallback { background: var(--surface); border-left: 3px solid var(--green); padding: 24px; margin: 16px 0; }
.fallback h2 { font-size: 18px; margin-top: 0; }
.fallback p { font-size: 14px; line-height: 1.8; }
.batch-format { display: flex; align-items: center; gap: 16px; font-size: 14px; margin-top: 16px; }
.batch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.outline-button { border: 1px solid var(--control); border-radius: var(--radius); background: var(--paper); color: var(--green); padding: 10px 12px; min-height: 44px; font-size: 13px; }
.outline-button:hover:not(:disabled) { background: var(--surface); border-color: var(--green); }
#batch-summary { margin: 0 0 16px; font-size: 14px; line-height: 1.8; }
.batch-rows { max-height: 440px; overflow: auto; scrollbar-gutter: stable; }
.batch-row { display: flex; gap: 12px; padding: 16px 4px; border-top: 1px solid var(--line); }
.line-number { min-width: 24px; padding-top: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.row-content { min-width: 0; flex: 1; }
.row-source { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; margin-bottom: 4px; }
.row-content strong { font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; font-weight: 500; }
.batch-row.error { background: var(--error-surface); }
.repair-form { display: flex; gap: 8px; }
.repair-form input { padding: 8px; font-size: 16px; }
.repair-form button { flex-shrink: 0; }
.row-content p { margin: 8px 0 0; }
.reference-section { margin-top: 24px; padding: 24px 0 32px; border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-title h2 { margin: 0; }
.section-title a { font-size: 13px; }
.digit-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.digit-grid > div { text-align: center; padding: 16px 4px; }
.digit-grid > div + div { border-left: 1px solid var(--line); }
.digit-grid span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.digit-grid strong { font-size: 25px; font-family: var(--result-font); font-weight: 500; }
.faq { max-width: 800px; padding: 8px 0 56px; }
.faq h2 { margin: 0 0 12px; }
details { border-bottom: 1px solid var(--line); }
summary { padding: 16px 0; font-size: 15px; line-height: 1.8; cursor: pointer; font-weight: 500; }
details p { margin: 0 0 20px; font-size: 14px; color: var(--muted); line-height: 1.9; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.footer-brand { font-size: 16px; font-weight: 700; text-decoration: none; }
.footer-brand span { margin-left: 12px; font-size: 12px; font-weight: 400; color: var(--muted); }
footer > div { display: flex; gap: 20px; flex-wrap: wrap; }
.article { max-width: 800px; margin: 0 auto; padding: 32px 0 64px; line-height: 1.9; }
.article h1 { font-size: 32px; margin: 24px 0 16px; }
.article h2 { margin-top: 32px; }
.article p, .article li { font-size: 15px; color: var(--ink); }
.article .lead { color: var(--muted); font-size: 17px; }
.breadcrumb { font-size: 13px !important; margin: 0 0 24px; }
.article .digit-grid { margin: 28px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
th { background: var(--surface); font-weight: 600; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); min-width: 100px; }
td { overflow-wrap: anywhere; }
td:first-child { font-variant-numeric: tabular-nums; }
.not-found { padding: 80px 0 120px; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 10; padding: 12px; background: var(--green); color: var(--paper); }
.skip-link:focus { top: 12px; }
@media (max-width: 800px) {
  .site-header, main, footer { padding-left: 24px; padding-right: 24px; }
  .site-header nav { gap: 20px; font-size: 13px; }
  .tool-body { grid-template-columns: 1fr; }
  .input-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 0; }
  .result-panel { padding: 24px 0; }
  .local-note { display: none; }
  select { font-size: 16px; }
  #empty-result { min-height: 132px; }
  .digit-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .digit-grid > div:nth-child(6) { border-left: 0; }
  .digit-grid > div:nth-child(n+6) { border-top: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .site-header, main, footer { padding-left: 16px; padding-right: 16px; }
  .site-header { padding-top: 20px; padding-bottom: 0; flex-wrap: wrap; gap: 12px; }
  .site-header nav { width: 100%; justify-content: space-between; gap: 12px; }
  .site-header nav a { padding: 12px 0 16px; }
  .hero { padding: 24px 0; }
  .hero p { font-size: 14px; }
  .tabs { gap: 24px; }
  .tabs button { font-size: 14px; }
  .number-input { font-size: 24px; }
  .primary-result { font-size: 28px; }
  .tool-bottom { flex-wrap: wrap; }
  .section-title { flex-wrap: wrap; gap: 8px; }
  .reference-section { margin-top: 16px; }
  .faq { padding-bottom: 40px; }
  footer { align-items: flex-start; flex-direction: column; gap: 16px; }
  .article h1 { font-size: 28px; }
  .article ul { padding-left: 24px; }
}
@media (forced-colors: active) {
  select { -webkit-appearance: auto; appearance: auto; background-image: none; padding-right: 14px; }
}
