/* 「联系我们」弹窗（js/contact.js，docs/32）：首页和 app.html 共用。只依赖两边都有的颜色变量，缺了就用后面的缺省值。
   手机（≤ 640px）上全屏；所有按钮至少 44px 高；输入框字号 16px（iOS 不会在聚焦时放大页面）。 */

/* 页脚里的「联系我们」：看起来是链接，实际是按钮 */
.ct-link { background: none; border: 0; padding: 6px 2px; margin: 0; font: inherit; color: var(--accent2, #60a5fa); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 0; }
.ct-link:hover { color: var(--text, #e4e8ef); }
.ct-link:focus-visible { outline: 2px solid var(--accent2, #60a5fa); outline-offset: 2px; border-radius: 4px; }

.ct-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--sh-scrim, rgba(8, 10, 14, .75)); overflow: auto; overscroll-behavior: contain; }
.ct-box { width: 480px; max-width: 100%; max-height: 100%; overflow: auto; background: var(--panel, #161b25); color: var(--text, #e4e8ef); border: 1px solid var(--line, #262d3b); border-radius: 12px; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; font: 14px/1.5 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; outline: none; }
.ct-box h2 { margin: 0; font-size: 18px; line-height: 1.3; color: var(--text, #e4e8ef); display: block; }
.ct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ct-x { flex: none; width: 44px; height: 44px; margin: -8px -10px -8px 0; padding: 0; background: none; border: 0; border-radius: 8px; color: var(--muted, #7f8aa0); font-size: 26px; line-height: 1; cursor: pointer; }
.ct-x:hover { color: var(--text, #e4e8ef); background: var(--panel2, #1d2330); }
.ct-who { margin: 0; color: var(--muted, #7f8aa0); }
.ct-label { margin-top: 4px; font-weight: 600; color: var(--text, #e4e8ef); }

.ct-kinds { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ct-kinds legend { padding: 0; margin-bottom: 6px; font-weight: 600; width: 100%; }
.ct-kind { position: relative; flex: 1 1 0; min-width: 96px; }
.ct-kind input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ct-kind span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line, #262d3b); border-radius: 8px; background: var(--panel2, #1d2330); color: var(--text, #e4e8ef); text-align: center; }
.ct-kind input:checked + span { border-color: var(--accent, #2563eb); background: var(--sh-tint-accent-strong, rgba(37, 99, 235, .22)); font-weight: 600; }
.ct-kind input:focus-visible + span { outline: 2px solid var(--accent2, #60a5fa); outline-offset: 2px; }
.ct-kinds.bad .ct-kind span { border-color: var(--down, #ef5350); }

.ct-text, .ct-input { width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; font-size: 16px; line-height: 1.5; color: var(--text, #e4e8ef); background: var(--bg, #0b0e14); border: 1px solid var(--line, #262d3b); border-radius: 8px; }
.ct-text { min-height: 140px; resize: vertical; }
.ct-input { min-height: 44px; }
.ct-text:focus, .ct-input:focus { outline: 2px solid var(--accent2, #60a5fa); outline-offset: 1px; border-color: var(--accent2, #60a5fa); }
.ct-text.bad, .ct-input.bad { border-color: var(--down, #ef5350); }
.ct-count { align-self: flex-end; margin-top: -4px; font-size: 12px; color: var(--muted, #7f8aa0); font-variant-numeric: tabular-nums; }
.ct-count.over { color: var(--down, #ef5350); font-weight: 600; }
.ct-hint { margin: 0; font-size: 12px; color: var(--muted, #7f8aa0); }
.ct-hint a { color: var(--accent2, #60a5fa); text-decoration: underline; text-underline-offset: 2px; }
.ct-err { padding: 8px 10px; border-radius: 8px; background: var(--sh-tint-down-soft, rgba(239, 83, 80, .14)); border: 1px solid var(--sh-danger-line, rgba(239, 83, 80, .5)); color: var(--sh-danger-fg, #ffb4b2); }
.ct-thanks p { margin: 4px 0 0; color: var(--text2, var(--text, #e4e8ef)); font-size: 15px; }

.ct-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.ct-btn { min-height: 44px; min-width: 96px; padding: 0 20px; font: inherit; font-weight: 600; border-radius: 8px; cursor: pointer; border: 1px solid var(--line, #262d3b); background: var(--panel2, #1d2330); color: var(--text, #e4e8ef); }
.ct-btn:hover { border-color: var(--muted, #7f8aa0); }
.ct-send { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: var(--sh-on-fill, #fff); }
.ct-send:hover { background: var(--sh-accent-hi, #1d4ed8); border-color: var(--sh-accent-hi, #1d4ed8); }
.ct-btn:disabled { opacity: .6; cursor: default; }
.ct-btn:focus-visible { outline: 2px solid var(--accent2, #60a5fa); outline-offset: 2px; }

/* 蜜罐：挪到屏幕外（不用 display:none，部分机器人会跳过隐藏的输入框）；读屏和键盘都到不了 */
.ct-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 640px) {
  /* 所有「联系我们」入口（首页 / 练习台页脚、账号页按钮）在手机上至少 44px 高 */
  [data-contact-open] { min-height: 44px; }
  .ct-link { display: inline-flex; align-items: center; padding: 0 4px; }
  .ct-overlay { padding: 0; align-items: stretch; }
  .ct-box { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .ct-text { min-height: 160px; flex: 1 1 auto; }
  .ct-btns { position: sticky; bottom: 0; background: var(--panel, #161b25); padding-top: 8px; }
  .ct-btn { flex: 1 1 0; }
}
