/* ============================================================
   BEXAUR 內容層樣式(文章 / 工具 / 合規頁)
   沿用 styles.css 的金 / 奶油 / 深色 token,全站一致
   ============================================================ */

/* --- 首屏註冊卡(hero 內) --- */
.reg-hero {
  width: min(560px, 100%);
  margin-top: 26px;
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--acid) 60%, var(--line));
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.reg-hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--mint-dark);
  font-size: 13px;
  font-weight: 950;
}

.reg-hero-label::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint-dark);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint) 34%, transparent);
}

.reg-code-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
}

.reg-code {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 8px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-family: "JetBrains Mono", "SFMono-Regular", ui-monospace, Consolas, monospace;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 3px;
}

.copy-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease;
}

.copy-btn:hover {
  transform: translateY(-1px);
}

.copy-btn.is-copied {
  background: var(--mint-dark);
  color: #ffffff;
}

.reg-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 14px 20px;
  border: 1px solid var(--acid);
  border-radius: 999px;
  background: var(--acid);
  color: var(--acid-ink);
  font-size: 16px;
  font-weight: 950;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--acid) 30%, transparent);
  transition:
    transform 160ms ease,
    background-color 160ms ease;
}

.reg-cta-btn:hover {
  transform: translateY(-1px);
  background: #f4dfa5;
}

.reg-benefit {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.reg-benefit strong {
  color: var(--orange);
  font-weight: 950;
}

.reg-foot {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* --- 文章 / 工具內複用的註冊卡 --- */
.reg-cta {
  margin: 40px 0;
  padding: 26px 28px;
  border: 1px solid color-mix(in srgb, var(--acid) 50%, var(--line));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 12% 16%, color-mix(in srgb, var(--acid) 16%, transparent), transparent 46%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.reg-cta h3 {
  margin-bottom: 8px;
  font-size: 21px;
}

.reg-cta > p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 15px;
}

.reg-cta .reg-code-row {
  max-width: 430px;
}

/* --- 麵包屑 --- */
.breadcrumb {
  padding: 20px max(20px, calc((100vw - var(--max)) / 2)) 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--ink);
}

.breadcrumb span {
  color: var(--line-strong);
  margin: 0 6px;
}

/* --- 內容主體版心 --- */
.content-main {
  padding: 22px max(20px, calc((100vw - var(--max)) / 2)) 40px;
}

.article {
  width: min(760px, 100%);
  margin: 0 auto;
}

.article-kicker {
  margin: 0 0 12px;
  color: var(--mint-dark);
  font-size: 13px;
  font-weight: 950;
}

.article h1 {
  font-size: 42px;
  line-height: 1.08;
  margin-bottom: 18px;
}

.article-dek {
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.6;
  font-weight: 600;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.byline .author {
  color: var(--ink);
  font-weight: 950;
}

.byline .dot {
  color: var(--line-strong);
}

.article-cover {
  margin: 26px 0;
}

.article-cover img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.article-cover figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* 目錄 */
.toc {
  margin: 26px 0;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.toc p {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 28px;
}

.toc li {
  margin-bottom: 7px;
  break-inside: avoid;
}

.toc a {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.toc a:hover {
  color: var(--mint-dark);
  text-decoration: underline;
}

/* 文章正文排版 */
.prose {
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink-soft);
}

.prose h2 {
  margin: 44px 0 16px;
  font-size: 29px;
  line-height: 1.22;
  scroll-margin-top: 90px;
}

.prose h3 {
  margin: 30px 0 12px;
  font-size: 21px;
  scroll-margin-top: 90px;
}

.prose p {
  margin: 0 0 18px;
}

.prose a:not(.reg-cta-btn):not(.button) {
  color: var(--mint-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose a:hover {
  color: var(--ink);
}

.prose strong {
  color: var(--ink);
  font-weight: 900;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 9px;
}

.prose blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--acid);
  color: var(--ink);
}

/* callout 提示框 */
.callout {
  margin: 24px 0;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mint-dark);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.callout.warn {
  border-left-color: var(--orange);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

/* 表格 */
.table-scroll {
  margin: 24px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.prose table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
}

.prose thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 950;
  text-align: left;
}

.prose th,
.prose td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose tbody tr:last-child td {
  border-bottom: 0;
}

/* 資料來源 */
.sources {
  margin: 34px 0 0;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 14px;
}

.sources p {
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 950;
}

.sources ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.sources li {
  margin-bottom: 7px;
}

.sources a {
  color: var(--mint-dark);
  word-break: break-word;
}

/* 更新記錄 */
.changelog {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.article-faq {
  margin-top: 40px;
}

.article-faq h2 {
  margin-bottom: 8px;
}

/* 上一篇 / 相關閱讀 */
.related {
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.related p.related-h {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.related-grid a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.related-grid a:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

/* --- 工具頁 --- */
.tool-app {
  width: min(760px, 100%);
  margin: 24px auto 0;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.field .hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field input[type="number"],
.field input[type="text"],
.field select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}

.field input:focus,
.field select:focus {
  outline: 2px solid color-mix(in srgb, var(--acid) 66%, transparent);
  outline-offset: 1px;
  border-color: var(--acid);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.switch-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--mint-dark);
}

.tool-result {
  margin-top: 8px;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--mint) 40%, var(--line));
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--mint) 14%, transparent), transparent 42%),
    var(--surface-2);
}

.tool-result .result-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-result .result-main .num {
  color: var(--ink);
  font-size: 40px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.01em;
}

.tool-result .result-main .lbl {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 18px;
}

.result-grid .cell {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.result-grid .cell dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.result-grid .cell dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.tool-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* --- 首頁內鏈樞紐 / 總覽 --- */
.hub-section {
  background: var(--bg);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.hub-card .tag {
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 950;
}

.hub-card h3 {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.28;
}

.hub-card p {
  margin: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.hub-more {
  margin-top: 14px;
  color: var(--mint-dark);
  font-size: 13px;
  font-weight: 950;
}

/* 資產類別 chips(signal-strip 改造用) */
.asset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.asset-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

/* 誠實編輯立場區(proof 改造,無假頭像假證言) */
.stance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stance-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.stance-card .idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--acid);
  color: var(--acid-ink);
  font-size: 14px;
  font-weight: 950;
}

.stance-card h3 {
  color: #ffffff;
  font-size: 18px;
  margin-bottom: 10px;
}

.stance-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

/* 頁尾 sitemap 多欄 */
.footer-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 20px;
  width: 100%;
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-map .col p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.footer-map .col a {
  display: block;
  min-height: auto;
  padding: 5px 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 700;
}

.footer-map .col a:hover {
  color: #ffffff;
}

.footer-legal {
  width: 100%;
  padding-top: 24px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  line-height: 1.7;
}

.footer-legal a {
  display: inline;
  min-height: auto;
  padding: 0;
  color: rgba(255, 255, 255, 0.7);
}

/* --- 內容層響應式 --- */
@media (max-width: 900px) {
  .hub-grid,
  .stance-grid {
    grid-template-columns: 1fr;
  }
  .footer-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-map .col a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 820px) {
  .article h1 {
    font-size: 32px;
  }
  .article-dek {
    font-size: 17px;
  }
  .prose {
    font-size: 16px;
  }
  .prose h2 {
    font-size: 25px;
  }
  .toc ol {
    columns: 1;
  }
  .content-main {
    padding: 18px 20px 32px;
  }
  .breadcrumb {
    padding: 16px 20px 0;
  }
  .reg-cta,
  .tool-app {
    padding: 20px;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .result-grid {
    grid-template-columns: 1fr;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .reg-code {
    font-size: 19px;
    letter-spacing: 2px;
  }
  .reg-hero {
    padding: 16px;
  }
  .tool-result .result-main .num {
    font-size: 32px;
  }
}

/* --- 首頁 hero 微調:確保註冊卡在桌面與窄螢幕首屏可見 --- */
.hero-foundry {
  align-items: start;
  padding-top: 52px;
}
.hero-copy-block h1 {
  font-size: 54px;
  line-height: 1.06;
  margin-bottom: 16px;
}
.hero-copy-block .hero-copy {
  max-width: 520px;
  margin-bottom: 18px;
  font-size: 17px;
  line-height: 1.55;
}
.hero-copy-block .reg-hero {
  margin-top: 18px;
}
@media (max-width: 1120px) {
  .hero-foundry {
    align-items: start;
  }
  /* 行動端:註冊卡排在示意圖之前,窄螢幕先看到碼與註冊 */
  .hero-copy-block {
    order: 1;
  }
  .hero-deck {
    order: 2;
  }
}
@media (max-width: 820px) {
  .hero-copy-block h1 {
    font-size: 34px;
  }
  .hero-copy-block .hero-copy {
    font-size: 16px;
  }
}


/* --- 語種切換器(header,native details 下拉) --- */
.lang-switch { position: relative; }
.lang-switch > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-1px);
}
.lang-switch > summary:hover { border-color: var(--line-strong); }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 156px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.lang-menu a {
  display: block;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}
.lang-menu a:hover { background: var(--surface-2); color: var(--ink); }
.lang-menu a[aria-current="true"] { color: var(--mint-dark); }
@media (max-width: 460px) {
  .lang-switch > summary { padding: 0 10px; }
}
