/* 黃金價格查詢與換算；共用元件沿用 site.css */
main.wrap:has(#gp-root) { max-width: 1400px; }
#gp-root { min-width: 0; }
.gp-notice { background: #fff7e6; border: 2px solid var(--warn); border-radius: 10px; padding: 10px 14px; font-size: 1.05rem; margin: .5rem 0 .75rem; overflow-wrap: anywhere; }
.gp-notice strong { color: #7c2d12; }
.gp-calcs { display: grid; grid-template-columns: 1fr; gap: 0 16px; align-items: start; }
.gp-card { min-width: 0; margin: .75rem 0; }
.gp-card .step-title { margin-top: .6rem; }
.gp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.gp-row > * { min-width: 0; }
.gp-card .qr-field input[type=text], .gp-card .qr-field input[type=date] { min-width: 0; max-width: 100%; font-size: 1.1rem; }
.gp-card .qr-field input[type=date] { display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; background: #fff; color: var(--fg); }
.gp-table { table-layout: auto; }
.gp-table th { width: 38%; }
.gp-table td { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gp-hint-top { margin-top: 0; }
.gp-fill { margin: 8px 0; }
.gp-fill .btn { width: 100%; text-align: center; line-height: 1.35; padding-top: 6px; padding-bottom: 6px; }
.gp-result { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 4px; }
.gp-basis { background: #fff7e6; border-left: 4px solid var(--warn); padding: 8px 12px; border-radius: 6px; font-size: 1rem; margin: .5rem 0; }
.gp-hist { padding-bottom: 20px; }
.gp-hist-grid { display: grid; grid-template-columns: 1fr; gap: 8px 24px; }
.gp-hist-grid > * { min-width: 0; }
.gp-datebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.gp-datebar .qr-field { flex: 1 1 100%; margin-bottom: 0; }
.gp-datebar .btn { flex: 1 1 140px; }
.gp-dnote { background: var(--soft); border-radius: 8px; padding: 8px 12px; font-size: 1rem; margin: .5rem 0; overflow-wrap: anywhere; }
.gp-h3 { margin: 1rem 0 .4rem; }
.gp-ranges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.gp-ranges .btn { min-height: 40px; padding: 0 12px; }
.gp-ranges .btn[aria-pressed="true"] { background: var(--brand); color: #fff; }
.gp-legend { font-size: .95rem; color: var(--muted); margin: 6px 0; }
.gp-lg { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 4px; }
.gp-lg-sell { border-color: #b45309; }
.gp-lg-buy { border-color: #1d4ed8; }
.gp-readout { min-height: 3em; background: var(--soft); border-radius: 8px; padding: 6px 12px; margin: 6px 0; font-size: 1rem; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gp-chart { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; touch-action: pan-y; user-select: none; -webkit-user-select: none; overflow: hidden; }
.gp-chart:focus-visible { outline: 3px solid #93b4ff; }
.gp-svg { display: block; max-width: 100%; }
.gp-grid { stroke: #e3e6ea; stroke-width: 1; }
.gp-axis { stroke: #888; stroke-width: 1; }
.gp-tick { fill: #444; font-size: 12px; font-family: inherit; }
.gp-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.gp-line-sell { stroke: #b45309; }
.gp-line-buy { stroke: #1d4ed8; stroke-width: 1.6; }
.gp-cross { stroke: #555; stroke-width: 1; stroke-dasharray: 3 3; }
.gp-dot { stroke: #fff; stroke-width: 1.5; }
.gp-dot-sell { fill: #b45309; }
.gp-dot-buy { fill: #1d4ed8; }
.gp-yearscroll { border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
.gp-years { margin: 0; min-width: 640px; }
.gp-years th, .gp-years td { white-space: nowrap; text-align: right; }
.gp-years tbody th { width: auto; text-align: center; }
.gp-years small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.3; }
.gp-content { max-width: 960px; }
.gp-content .table-scroll, .gp-content table { max-width: 100%; }
/* 多欄版面只在支援 :has 的瀏覽器啟用（寬版 1400px 容器靠 :has 才放得開；不支援時維持單欄 760px） */
@supports selector(:has(*)) {
  @media (min-width: 1000px) {
    .gp-calcs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .gp-hist-grid { grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); }
  }
}
.gp-nw { white-space: nowrap; }
.gp-card .status:empty { display: none; }
@media (min-width: 1200px) {
  .gp-card { padding-left: 22px; padding-right: 22px; }
  .gp-years th, .gp-years td { padding: 10px 14px; }
}
@media (max-width: 480px) {
  #gp-d-table th, #gp-d-table td { padding: 6px 5px; font-size: .92rem; }
  #gp-d-table td { white-space: nowrap; }
  #gp-d-table th:first-child { width: 30%; }
  .gp-row { grid-template-columns: 1fr 1fr; }
  .gp-table th { width: 40%; }
  .gp-notice { font-size: 1rem; }
}
.gp-table th small { display: block; }
