/* 漢一試算器樣式 han1-calc.css
 * 所有 class 都以 .h1c- 開頭，不會影響網站其他元素。
 * 顏色用變數定義，agent 可以改成網站現有的色票變數。
 */
.h1c {
  --h1c-bg: #0b111c;
  --h1c-card: #121a28;
  --h1c-line: rgba(255, 255, 255, .14);
  --h1c-line-strong: rgba(255, 255, 255, .45);
  --h1c-text: #f2f2f2;
  --h1c-muted: #a9b0bb;
  --h1c-accent: #d9b56c;
  --h1c-accent-ink: #1a1408;
  --h1c-btn: #f2f2f2;
  --h1c-btn-ink: #111;
  --h1c-radius: 999px;
  color: var(--h1c-text);
  font-family: inherit;
  line-height: 1.6;
}
.h1c *, .h1c *::before, .h1c *::after { box-sizing: border-box; }

.h1c-field { margin: 0 0 26px; border: 0; padding: 0; min-width: 0; }
.h1c-label { display: block; font-size: 13px; font-weight: 700; color: var(--h1c-text); margin: 0 0 10px; }
.h1c-hint { font-size: 12.5px; color: var(--h1c-muted); margin: -4px 0 10px; }

/* 滑桿 */
.h1c-range { width: 100%; accent-color: var(--h1c-accent); height: 24px; cursor: pointer; }
.h1c-range-value { font-size: 22px; font-weight: 700; margin-top: 6px; }

/* 膠囊選項 */
.h1c-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.h1c-pill { position: relative; }
.h1c-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.h1c-pill span {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--h1c-line-strong);
  border-radius: var(--h1c-radius); font-size: 13px; font-weight: 600; color: var(--h1c-text);
  transition: background .15s, color .15s, border-color .15s; cursor: pointer; user-select: none;
}
.h1c-pill input:checked + span { background: var(--h1c-accent); border-color: var(--h1c-accent); color: var(--h1c-accent-ink); }
.h1c-pill input:focus-visible + span { outline: 2px solid var(--h1c-accent); outline-offset: 2px; }

/* 方案卡片 */
.h1c-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.h1c-cards.h1c-cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.h1c-card { position: relative; display: block; }
.h1c-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.h1c-card .h1c-card-body {
  display: block; height: 100%; padding: 14px 14px 12px; border: 1px solid var(--h1c-line-strong);
  border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s;
}
.h1c-card .h1c-card-title { display: block; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.h1c-card .h1c-card-desc { display: block; font-size: 12.5px; color: var(--h1c-muted); line-height: 1.5; }
.h1c-card input:checked + .h1c-card-body { border-color: var(--h1c-accent); background: rgba(217, 181, 108, .1); }
.h1c-card input:checked + .h1c-card-body .h1c-card-title { color: var(--h1c-accent); }
.h1c-card input:focus-visible + .h1c-card-body { outline: 2px solid var(--h1c-accent); outline-offset: 2px; }
.h1c-note { font-size: 12.5px; color: var(--h1c-muted); margin-top: 8px; }

/* 數字選擇 */
.h1c-steppers { display: flex; flex-wrap: wrap; gap: 18px; }
.h1c-stepper { display: inline-flex; align-items: center; border: 1px solid var(--h1c-line-strong); border-radius: var(--h1c-radius); }
.h1c-stepper button {
  width: 36px; height: 36px; border: 0; background: none; color: var(--h1c-text); font-size: 18px; cursor: pointer; border-radius: var(--h1c-radius);
}
.h1c-stepper button:hover { color: var(--h1c-accent); }
.h1c-stepper output { min-width: 56px; text-align: center; font-weight: 700; font-size: 14px; }
.h1c-input-num {
  width: 90px; padding: 8px 12px; border: 1px solid var(--h1c-line-strong); border-radius: var(--h1c-radius);
  background: transparent; color: var(--h1c-text); font: inherit; font-size: 14px;
}

/* 進階收合 */
.h1c-details { border-top: 1px solid var(--h1c-line); padding-top: 14px; margin-bottom: 26px; }
.h1c-details summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--h1c-text); }
.h1c-details[open] summary { margin-bottom: 16px; }

/* 按鈕 */
.h1c-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.h1c-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 22px;
  border-radius: var(--h1c-radius); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; font-family: inherit;
}
.h1c-btn-primary { background: var(--h1c-btn); color: var(--h1c-btn-ink); }
.h1c-btn-line { background: #D6B46C; color: #09111E; }
.h1c-btn-ghost { border-color: var(--h1c-accent); color: var(--h1c-accent); background: transparent; }
.h1c-btn:hover { filter: brightness(1.08); }

/* 結果 */
.h1c-result { margin-top: 28px; padding: 24px; border: 1px solid #D6B46C; border-radius: 14px; background: #09111E; }
.h1c-result[hidden] { display: none; }
.h1c-result-label { font-size: 13px; color: var(--h1c-muted); margin: 0 0 4px; }
.h1c-result-total { font-size: clamp(26px, 4vw, 34px); font-weight: 800; color: var(--h1c-accent); margin: 0; line-height: 1.25; }
.h1c-result-total small { font-size: 14px; font-weight: 600; color: var(--h1c-muted); margin-left: 4px; }
.h1c-result-sub { margin: 6px 0 0; font-size: 14px; }
.h1c-result-cond { margin: 12px 0 0; font-size: 12.5px; color: var(--h1c-muted); }
.h1c-excludes { margin: 14px 0 0; font-size: 12.5px; color: var(--h1c-muted); border-top: 1px solid #D6B46C; padding-top: 12px; }

.h1c-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 13.5px; }
.h1c-table th, .h1c-table td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--h1c-line); vertical-align: top; }
.h1c-table th { font-weight: 700; color: var(--h1c-muted); font-size: 12.5px; }
.h1c-table td:last-child, .h1c-table th:last-child { text-align: right; white-space: nowrap; }
.h1c-table tr.h1c-row-total td { font-weight: 800; color: var(--h1c-accent); border-bottom: 0; }
.h1c-table tr.h1c-row-muted td { color: var(--h1c-muted); }
.h1c-table tr.h1c-row-design td:first-child { color: var(--h1c-accent); }
.h1c-bar { display: block; height: 4px; border-radius: 2px; background: var(--h1c-accent); opacity: .7; margin-top: 5px; }

@media (max-width: 720px) {
  .h1c-cards, .h1c-cards.h1c-cards-4 { grid-template-columns: 1fr; }
  .h1c-result { padding: 18px 16px; }
  .h1c-btn { width: 100%; }
}

/* ---------- 價格表（靜態 HTML 用） ---------- */
.h1c-price { width: 100%; border-collapse: collapse; color: var(--h1c-text, #f2f2f2); }
.h1c-price caption { caption-side: bottom; text-align: left; padding-top: 16px; font-size: 13px; color: var(--h1c-muted, #a9b0bb); line-height: 1.8; }
.h1c-price th, .h1c-price td { text-align: left; padding: 22px 12px 22px 0; border-bottom: 1px solid var(--h1c-line, rgba(255,255,255,.14)); }
.h1c-price thead th { font-size: 13px; font-weight: 700; padding: 14px 12px 14px 0; }
.h1c-price tbody th { font-weight: 700; font-size: 16px; }
.h1c-price td { font-weight: 700; font-size: 16px; white-space: nowrap; }
.h1c-price td b { color: var(--h1c-accent, #d9b56c); font-weight: 700; }
@media (max-width: 720px) {
  .h1c-price-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .h1c-price { min-width: 640px; }
}
