/* =========================================================================
   联系我们（contact.html → /contact；11-16 用户定，约定见 docs/联系表单.md）
   - 版式：≥1024 左栏（标题 + 一句话说明，下面是几条须知）+ 右栏表单卡片，整体最宽 1080（同法律页）；
     761–1023 单栏（标题 → 表单 → 须知），最宽 720；≤760 手机：表单卡片铺满屏宽（同首页时间线 / 法律页）。
   - 卡片沿用全站 .mod；主色只用 --ac*；控件 6px 圆角；错误色固定红（不用 --eq-up/down：那两个会随「红涨绿跌」对调）。
   - 类名避开 share / social / ad / banner / sponsor / promo（广告拦截规则，见 web/README.md）。
   ========================================================================= */

.t1 { --ct-err: var(--eq-red); }
[data-theme="dark"] .t1 { --ct-err: var(--eq-red-d); }

/* ---------- 版式 ---------- */
.ct { padding-top: 32px; padding-bottom: 64px; }
.ct-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "head card" "notes card";
  gap: 0 48px; align-items: start; max-width: 1080px; margin: 0 auto; }
.ct-head { grid-area: head; padding-top: 6px; }
.ct-card { grid-area: card; min-width: 0; margin: 0; padding: 30px 34px 28px; }
.ct-notes { grid-area: notes; }

.ct .ct-h1 { font: 600 34px/1.25 var(--eq-font-display); letter-spacing: 0; }
html:not([data-lang="zh"]) .ct .ct-h1 { letter-spacing: -.015em; }
.ct .ct-lead { margin-top: 12px; font-size: 15px; line-height: 1.75; color: var(--fg-2); }
.ct .ct-notes { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.ct-notes li { position: relative; padding-left: 16px; font-size: 13.5px; line-height: 1.7; color: var(--fg-2); }
.ct-notes li::before { content: ""; position: absolute; left: 2px; top: .8em; width: 5px; height: 5px; border-radius: 50%; background: var(--fg-3); }

/* ---------- 字段 ---------- */
.ct-fs, .ct-kf { margin: 0; padding: 0; border: 0; min-width: 0; }
.ct-f + .ct-f, .ct-fs > .ct-ts { margin-top: 24px; }   /* Turnstile 前面隔着蜜罐（不是 .ct-f），单独给间距 */
.ct-lb { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ct-lt { padding: 0; font-size: 14px; font-weight: 600; color: var(--fg); }
.ct-kf > legend { margin-bottom: 8px; }
.ct-opt { font-size: 12.5px; color: var(--fg-3); white-space: nowrap; }
.ct-count { font-size: 12px; color: var(--fg-3); white-space: nowrap; }
.ct-count.is-over { color: var(--ct-err); font-weight: 600; }

/* 类型：原生 radio 盖在分段按钮上（透明），样子同全站 .seg */
.ct-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: calc(var(--eq-radius) + 3px); background: var(--surface-3); }
.ct-kind { position: relative; display: block; min-width: 0; }
.ct-kind input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ct-kind > span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 4px 8px; border-radius: var(--eq-radius);
  font-size: 13.5px; font-weight: 500; line-height: 1.25; text-align: center; color: var(--fg-2); transition: background .12s, color .12s, box-shadow .12s; }
.ct-kind:hover > span { color: var(--fg); }
.ct-kic { display: inline-flex; flex: none; width: 15px; height: 15px; opacity: .85; }
.ct-kic svg { width: 100%; height: 100%; }
.ct-kind input:checked + span .ct-kic { opacity: 1; color: var(--ac-text); }
.ct-kind input:checked + span { background: var(--seg-on); color: var(--fg); font-weight: 600; box-shadow: var(--sh-1); }
.ct-kind input:focus-visible + span { outline: 2px solid var(--ac); outline-offset: 1px; }
.ct .ct-khint { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--fg-3); }

/* 输入框 */
.ct-in { display: block; width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--eq-radius); background: var(--bg); color: var(--fg);
  font: inherit; font-size: 15px; line-height: 1.6; transition: border-color .12s, box-shadow .12s; }
[data-theme="dark"] .ct-in { background: var(--canvas); }
.ct-in::placeholder { color: var(--fg-3); opacity: 1; }
.ct-in:hover { border-color: var(--eq-n300); }
[data-theme="dark"] .ct-in:hover { border-color: #46546E; }
.ct .ct-in:focus, .ct .ct-in:focus-visible { outline: none; border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-soft); }
.ct .ct-in[aria-invalid="true"] { border-color: var(--ct-err); }
.ct .ct-in[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ct-err) 14%, transparent); }
textarea.ct-in { min-height: 188px; resize: vertical; }
input.ct-in { height: 42px; }
.ct .ct-ferr { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--ct-err); }

/* 图片：点选 / 拖放区 + 缩略图 */
.ct-vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.ct-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px dashed var(--line-2); border-radius: var(--eq-radius);
  background: var(--bg-2); cursor: pointer; transition: border-color .12s, background .12s; }
[data-theme="dark"] .ct-drop { background: var(--canvas); }
.ct-drop:hover, .ct-drop.is-over { border-color: var(--ac-line); background: var(--ac-soft); }
.ct-drop.is-over { border-style: solid; }
.ct-drop:focus-within { outline: 2px solid var(--ac); outline-offset: 2px; }
.ct-drop.is-full { cursor: default; border-style: solid; }
.ct-drop.is-full:hover { border-color: var(--line-2); background: var(--bg-2); }
[data-theme="dark"] .ct-drop.is-full:hover { background: var(--canvas); }
.ct-drop.is-full .ct-drop-ic { opacity: .5; }
.ct-drop.is-full .ct-drop-h { display: none; }
.ct-drop.is-full b { color: var(--fg-2); }
.ct-drop-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--eq-radius); background: var(--surface-3); color: var(--fg-2); }
.ct-drop-ic svg { width: 20px; height: 20px; }
.ct-drop:hover .ct-drop-ic, .ct-drop.is-over .ct-drop-ic { color: var(--ac-text); }
.ct-drop-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; font-size: 13.5px; line-height: 1.5; }
.ct-drop-t b { font-weight: 600; color: var(--ac-text); }
.ct-drop-h { color: var(--fg-2); }
.ct-drop-t small { flex-basis: 100%; font-size: 12px; color: var(--fg-3); }

.ct .ct-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }   /* .ct 前缀压过全站 .t1 ul { margin: 0 } */
.ct-th { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: var(--eq-radius); background: var(--surface-3); }
.ct-th img { width: 100%; height: 100%; object-fit: cover; }
.ct-th-sz { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(11, 14, 20, .68); color: #fff; font-size: 11px; line-height: 1.5; }
.ct-th-x { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(11, 14, 20, .68); color: #fff; transition: background .12s; }
.ct-th-x:hover { background: rgba(11, 14, 20, .88); }
.ct-th-x svg { width: 14px; height: 14px; }
.ct .ct-imsg { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--ct-err); }
.ct .ct-imsg[hidden] { display: none; }

/* 蜜罐：移出屏幕（不用 display:none） */
.ct-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Turnstile：widget 65px 高（flexible = 100% 宽、最窄 300px）；加载中 / 加载失败时放一块同尺寸的占位 */
.ct-ts-box { min-height: 65px; }
.ct-ts-box:empty { min-height: 0; }
.ct-ts-note { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--fg-3); }
.ct-ts-note:not(.is-ph) { margin-top: 6px; }
.ct-ts-note.is-ph { min-height: 65px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--eq-radius); background: var(--bg-2); }
[data-theme="dark"] .ct-ts-note.is-ph { background: var(--canvas); }
.ct-ts-note.is-err { color: var(--ct-err); }
.ct-ts-note .btn { margin-left: auto; flex: none; }
.ct-spin { width: 14px; height: 14px; flex: none; border: 2px solid var(--line-2); border-top-color: var(--ac-text); border-radius: 50%; animation: ct-spin .8s linear infinite; }
@keyframes ct-spin { to { transform: rotate(360deg); } }

/* 提交 */
.ct .ct-msg { margin-top: 20px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--ct-err) 32%, var(--bg)); border-radius: var(--eq-radius);
  background: color-mix(in srgb, var(--ct-err) 7%, var(--bg)); color: var(--ct-err); font-size: 13.5px; line-height: 1.6; }
.ct-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 22px; }
.ct-submit { height: 42px; min-width: 132px; padding: 0 26px; font-size: 14.5px; }
.ct-submit:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.ct-submit:disabled:hover { background: var(--ac); border-color: var(--ac); }
.ct-submit[aria-busy="true"] { opacity: .8; cursor: progress; }
.ct-submit[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ct-spin .7s linear infinite; }
.ct-wait { font-size: 13px; color: var(--fg-3); }
.ct .ct-agree { margin-top: 14px; font-size: 12.5px; line-height: 1.65; color: var(--fg-3); }
.ct-agree a { color: var(--ac-text); text-decoration: underline; text-decoration-color: var(--ac-line); text-underline-offset: 3px; }
.ct-agree a:hover { text-decoration-color: currentColor; }

/* 已收到 / 暂停受理 / 不可用 */
.ct-state { display: flex; flex-direction: column; align-items: center; padding: 36px 8px 28px; text-align: center; }
.ct-state-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--ac-soft); color: var(--ac-text); }
.ct-state-ic svg { width: 26px; height: 26px; }
.ct .ct-state h2 { margin-top: 18px; font: 600 22px/1.35 var(--eq-font-display); letter-spacing: 0; }
.ct-state h2:focus { outline: none; }
.ct .ct-state p { margin-top: 8px; max-width: 32em; font-size: 14.5px; line-height: 1.7; color: var(--fg-2); }
.ct-ref { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; padding: 8px 8px 8px 16px; border: 1px solid var(--line); border-radius: calc(var(--eq-radius) + 4px); background: var(--bg-2); }
[data-theme="dark"] .ct-ref { background: var(--canvas); }
.ct-ref > span { font-size: 12.5px; color: var(--fg-3); }
.ct-ref-no { font-size: 19px; font-weight: 600; letter-spacing: .08em; color: var(--fg); user-select: all; }
.ct-again { margin-top: 26px; }
.ct-ref[hidden] + .ct-again { margin-top: 22px; }

/* ---------- 断点 ---------- */
@media (max-width: 1023px) {
  .ct-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "head" "card" "notes"; max-width: 720px; }
  .ct-head { padding: 0 0 20px; }
  .ct .ct-h1 { font-size: 30px; }
  .ct .ct-notes { margin-top: 24px; padding-top: 0; border-top: 0; }
}
@media (max-width: 760px) {
  .ct { padding-top: 22px; padding-bottom: 28px; }
  .ct .ct-h1 { font-size: 26px; }
  .ct .ct-lead { font-size: 14.5px; }
  .ct-head { padding-bottom: 18px; }
  /* 手机：表单卡片铺满屏宽 */
  .ct-card { margin: 0 calc(var(--pad) * -1); padding: 22px var(--pad) 26px; border-radius: 0; border-width: 1px 0; box-shadow: none; }
  .ct .ct-notes { margin-top: 22px; }
  .ct-in { font-size: 16px; }                     /* iOS：输入框字号 < 16px 时聚焦会自动放大页面 */
  textarea.ct-in { min-height: 168px; }
  .ct-drop-h { display: none; }                   /* 手机上没有拖放 / 粘贴 */
  .ct-submit { flex: 1 1 100%; }
  .ct-wait { flex-basis: 100%; text-align: center; }
}
@media (max-width: 520px) {
  .ct-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct .ct-thumbs { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .ct-spin, .ct-submit[aria-busy="true"]::before { animation-duration: 2.4s; }
}
