/* ===========================================================================
   基础层：设计令牌 + 字体 + 重置 + 全局排版
   站点是 TIRZEC®（QUIMFA S.A. 的 Tirzepatida 防伪核验站），
   品牌两色：深蓝 #293b75 + 金 #e3c548 / 暗金 #a18a0e（取自 核验界面_demo.html）。
   =========================================================================== */

/* ── 自托管 Source Sans Pro ──────────────────────────────────────────────────
   只取实际用到的 4 个字重 × 3 个子集（latin / latin-ext / vietnamese）。
   CJK 与阿拉伯语不在该字体覆盖范围内，按 @font-face 的 unicode-range 自动
   回退到系统字体栈 —— 这两类文字交给系统的雅黑/苹方/系统阿拉伯字体反而更好看。 */

@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 300;
  src: url('/assets/fonts/source-sans-pro-latin-300-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/assets/fonts/source-sans-pro-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/assets/fonts/source-sans-pro-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/assets/fonts/source-sans-pro-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 300;
  src: url('/assets/fonts/source-sans-pro-latin-ext-300-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/assets/fonts/source-sans-pro-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/assets/fonts/source-sans-pro-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/assets/fonts/source-sans-pro-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 300;
  src: url('/assets/fonts/source-sans-pro-vietnamese-300-normal.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/assets/fonts/source-sans-pro-vietnamese-400-normal.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/assets/fonts/source-sans-pro-vietnamese-600-normal.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/assets/fonts/source-sans-pro-vietnamese-700-normal.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}

/* ── 设计令牌 ─────────────────────────────────────────────────────────────
   TIRZEC 品牌色只有两个（深蓝、金），其余是中性灰阶。
   深蓝同时当"主色"用（按钮、链接、状态文字）—— 与结果页的品牌版式一致。 */
:root {
  color-scheme: light;

  --navy: #293b75;          /* TIRZEC 深蓝，主色 */
  --navy-deep: #1d2b57;     /* 按下态 / 深色块 */
  --gold: #e3c548;          /* TIRZEC 金 */
  --brand-gold: #a18a0e;    /* 金字的可读色（纯金在白底上对比度不够） */

  --light-grey: #eaeef2;    /* 页面背景 / 卡片底 / 页脚 */
  --mid-grey: #d3d7db;
  --dark-grey: #5c6570;
  --red: #b3261e;
  --green: #1f7a4d;

  --font-ui: 'Source Sans Pro', Helvetica, Arial, 'Microsoft Yahei',
             '微软雅黑', STXihei, '华文细黑', sans-serif;

  /* 页头高度：导航是 fixed，正文靠 .nav-offset 让位，两处必须同源 */
  --nav-h: 6rem;

  --content-max: 720px;
}

/* ── 重置 ──────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ★ 必须的一条：hidden 属性靠的是浏览器默认样式里的 [hidden]{display:none}，
   而**作者样式表里的 display 会把它覆盖掉**（.modal-overlay{display:flex}
   这种）。结果是设了 hidden 的元素照样显示 —— 摄像头弹窗、超时页默认屏、
   导航菜单都踩过这个坑。用 !important 让 hidden 永远赢，避免以后新增元素再犯。 */
[hidden] {
  display: none !important;
}

html {
  /* 全站 rem 以 10px 为基准，正文尺寸写起来直观（1.7rem = 17px） */
  font-size: 62.5%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #fff;
  color: #000;
}

img {
  max-width: 100%;
}

a {
  color: var(--navy);
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* ── 全局排版 ───────────────────────────────────────────────────────────── */
body,
input,
textarea,
button {
  font-family: var(--font-ui);
}

h1 { font-weight: 300; font-size: 3.2rem; }
h2 { font-weight: 300; font-size: 2.4rem; }
h3 { font-weight: 600; font-size: 1.9rem; }
h4 { font-weight: 600; font-size: 1.7rem; }
p  { font-weight: 400; font-size: 1.7rem; line-height: 2.6rem; }

/* ── 通用 ──────────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 导航是 fixed，正文顶部要靠这个占位让开 —— 高度与 --nav-h 同源 */
.nav-offset {
  height: var(--nav-h);
  min-height: var(--nav-h);
}

/* 主按钮：胶囊形，深蓝底。inverted 用于次级动作（白底蓝边）。 */
.btn-primary {
  display: inline-block;
  border: none;
  border-radius: 3.35rem;
  background: var(--navy);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 600;
  padding: 1rem 2rem;
  text-decoration: none;
  text-align: center;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-primary.inverted {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
}

/* TIRZEC 字标：深蓝 TIR + 暗金 ZEC，供页头/页脚/结果页共用。
   demo 里的字号是 18.1cqw，这里做成可被外层 font-size 缩放的相对尺寸。 */
.wordmark {
  display: inline-flex;
  align-items: flex-start;
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.07em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .wm-tir { color: var(--navy); }
.wordmark .wm-zec { color: var(--brand-gold); }
.wordmark sup { font-size: 0.22em; letter-spacing: 0; margin: 0.1em 0 0 0.12em; }

/* 页脚是深色底时字标要反白 */
.wordmark.on-dark .wm-tir { color: #fff; }
.wordmark.on-dark .wm-zec { color: var(--gold); }

/* ── 应用内浏览器指引条 ───────────────────────────────────────────────────
   微信 / Facebook / Instagram / Line 的内置 WebView 对摄像头的行为差异很大
   （有的直接不给、有的给了但不出画面）。这一条给出唯一有效的自救动作：
   在系统浏览器里打开。它出现在扫码页（摄像头开不起来时）和超时页顶部。

   这里只定"长什么样"；扫码页是整屏布局，需要把它固定到顶部，
   那条 position 覆盖写在 css/scan.css 里。 */
.inapp-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--gold);
  color: #000;
}

.inapp-banner h2,
.inapp-banner p {
  margin: 0;
  font-size: 1.5rem;
  line-height: 2.1rem;
}

.inapp-banner h2 {
  font-weight: 700;
}

.inapp-banner button {
  flex: 0 0 auto;
  border: none;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3rem;
  padding: 6px 14px;
  font-size: 1.4rem;
  font-weight: 600;
}
