/* ============================================================
   卡卡回来了 · MVP V0.1
   设计令牌 —— 与 UI/DESIGN_SPEC.md 一致
   （感谢费等业务数据以冻结文档 V0.1.3 为准）
   ============================================================ */
:root {
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --text-primary: #23262E;
  --text-secondary: #6B7079;
  --text-muted: #6E747A;
  --line: #ECE8E2;
  --accent: #F97316;
  --accent-strong: #C2410C;
  --accent-soft: #FFE9D8;
  --blue: #3B6FE0;
  --blue-soft: #EAF2FE;
  --success: #35A15C;
  --success-soft: #E8F6EC;
  --error: #D64545;
  --radius-md: 16px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Noto Sans SC", "PingFang SC", -apple-system, BlinkMacSystemFont,
    "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 单列、居中、大留白，390px 基准 */
.app {
  max-width: 390px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* 屏幕容器 */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: enter .28s ease both;
}
.screen--home   { padding: 28px 24px 32px; }
.screen--result { padding: 48px 24px 32px; }
.screen--done   { padding: 24px; justify-content: center; text-align: center; }

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   Hero —— 品牌 + IP + 标题
   ============================================================ */
.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.brand { font-size: 15px; font-weight: 700; letter-spacing: 2px; color: var(--accent-strong); }
.title { font-size: 34px; font-weight: 700; line-height: 1.25; }
.subtitle { font-size: 16px; font-weight: 400; color: var(--text-secondary); }

/* IP 光环 + 卡卡信鸽 */
.ip-halo {
  width: 156px; height: 156px; border-radius: 50%;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
}
.ip { width: 108px; height: 108px; display: block; }
.ip--small { width: 120px; height: 120px; }

/* ============================================================
   Form
   ============================================================ */
.form { margin-top: 32px; display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field .label { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.field .control {
  height: 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 16px;
  display: flex; align-items: center;
}
.field input {
  width: 100%; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 16px; font-weight: 400;
  color: var(--text-primary);
}
.field input::placeholder { color: var(--text-muted); }
.helper { font-size: 13px; font-weight: 400; color: var(--text-muted); }

/* 输入框后缀按钮（尾号 X 输入） */
.field-suffix {
  flex-shrink: 0;
  margin-left: 12px;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.field-suffix:active { background: var(--accent-soft); }

/* 输入框聚焦：外框变主色（不用蓝色 outline） */
.field .control:focus-within { border-color: var(--accent); }
.field .submission-code:focus { border-color: var(--accent); outline: none; }

/* 错误态：边框变红、提示变红、举例隐藏 */
.field.error .control { border-color: var(--error); }
.field.error .submission-code { border-color: var(--error); }
.helper.error { color: var(--error); }
#screen-overlay { text-align: center; margin-top: 12px; }
#screen-overlay .btn { margin-top: 8px; }
.field.error input::placeholder { color: transparent; }

/* ============================================================
   Button / Primary
   ============================================================ */
.btn {
  width: 100%; height: 56px;
  border: none; border-radius: var(--radius-md);
  background: var(--accent-strong);
  color: #FFFFFF; font-size: 16px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .06s ease, opacity .2s ease, background .2s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { background: var(--accent-soft); color: var(--accent-strong); cursor: not-allowed; }
.btn--block { margin-top: 8px; }
.btn--ghost {
  margin-top: 8px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--line);
  font-weight: 600;
}
.btn--danger {
  background: var(--error);
}
.btn--danger:active { background: #B83A3A; }

/* 恢复入口保持次级操作；证件码可换行选择，适配手机粘贴和手动复制。 */
.text-action {
  display: block; width: 100%; min-height: 44px;
  border: 0; background: transparent; color: var(--text-secondary);
  font: inherit; font-size: 14px; text-align: center; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer;
}

/* 备案号：工信部要求首页底部展示并链接至备案系统 */
.beian {
  display: block; margin-top: 4px; padding: 6px 0;
  color: var(--text-secondary); font-size: 12px; line-height: 1.6;
  text-align: center; text-decoration: none;
}
.beian:hover { text-decoration: underline; text-underline-offset: 3px; }
.beian:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.submission-code {
  width: 100%; min-width: 0; padding: 16px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text-primary);
  font: inherit; font-size: 16px; line-height: 1.6;
  overflow-wrap: anywhere; word-break: break-all;
}

/* 键盘焦点可见（P-20）：≥2px 焦点环，与背景对比度≥3:1 */
.btn:focus-visible,
.text-action:focus-visible,
.role-choice-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* 我的提交列表 */
.submission-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.submission-item--changed {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.submission-changed {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
}
.submission-row {
  display: flex; justify-content: space-between;
  font-size: 15px;
  gap: 16px;
}
.submission-label { color: var(--text-secondary); }
.submission-progress { color: var(--accent-strong); font-weight: 700; }
.empty-hint { text-align: center; color: var(--text-muted); font-size: 14px; }
.empty-state { text-align: center; padding: 20px 0; }
.empty-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.support-email { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 16px; }

/* 我的提交：主操作始终位于可见区域底部，并避开全面屏安全区 */
.screen--submissions {
  padding-bottom: calc(136px + env(safe-area-inset-bottom));
}
.submissions-action {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(100%, 390px);
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--bg);
}
.submissions-action .support-email { margin-top: 10px; }

/* S2.5 角色选择按钮（主文案 + 副文案） */
.role-btn {
  flex-direction: column;
  height: auto;
  padding: 18px 16px;
  gap: 4px;
}
.role-main { font-size: 16px; font-weight: 700; }
.role-sub { font-size: 13px; font-weight: 400; opacity: .85; }

/* S3 未找到：身份选择（我是失主 / 我要归还） */
.role-choice {
  display: flex;
  gap: 10px;
}
.role-choice-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s ease;
}
.role-choice-item.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.role-choice-item input { display: none; }

/* 身份选择错误提示（与手机号辅助说明/错误提示样式一致） */
.role-choice + .helper.error {
  margin-top: -10px;   /* 紧贴按钮下方 */
}

/* 查询中 ··· 三点动画 */
.dots { display: inline-flex; }
.dot { display: inline-block; animation: blink 1.2s infinite; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ============================================================
   结果页
   ============================================================ */
.result-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.result-title { font-size: 28px; font-weight: 700; }
.result-summary {
  font-size: 16px; font-weight: 600; color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 22px;
  letter-spacing: 1px;
}
.result-sub { font-size: 16px; font-weight: 400; color: var(--text-secondary); }

/* ============================================================
   支付页金额 + 费用分解
   ============================================================ */
.amount { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.fee-note { font-size: 15px; font-weight: 400; color: var(--text-secondary); }
.fee-note:empty { display: none; }
.fee-breakdown {
  font-size: 13px; font-weight: 400; color: var(--text-muted);
  text-align: center; margin-top: 4px;
}

/* ============================================================
   查看手机号
   ============================================================ */
.phone-label { font-size: 15px; font-weight: 400; color: var(--text-secondary); }
.phone-number { font-size: 34px; font-weight: 700; color: var(--text-primary); letter-spacing: 2px; }
.phone-hint { font-size: 15px; font-weight: 400; color: var(--text-secondary); text-align: center; }
.info-note {
  display: flex;
  align-items: center;   /* 改 flex-start → center */
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  justify-content: center;
  margin-top: 12px;
}
.info-note svg {
  flex-shrink: 0;
  /* margin-top: 2px;  ← 删除或注释掉这行 */
  width: 16px;   /* 新增：限制宽 */
  height: 16px;  /* 新增：限制高 */
}

/* ============================================================
   完成页（Check 光环）
   ============================================================ */
.check-halo {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--success-soft);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.check-halo svg { width: 44px; height: 44px; }
.check-halo--waiting { background: var(--accent-soft); }
.done-title { font-size: 24px; font-weight: 700; }
.done-sub { font-size: 16px; font-weight: 400; color: var(--text-secondary); margin-top: 6px; }
.done-foot { font-size: 14px; font-weight: 400; color: var(--text-muted); margin-top: 28px; }

/* 等待与完成状态和“匹配成功”页共用同一顶部位置与节奏。 */
.screen--progress {
  padding: 48px 24px 32px;
  justify-content: flex-start;
}
.screen--progress .check-halo {
  width: 156px;
  height: 156px;
  margin-bottom: 16px;
}
.screen--progress > .ip-halo { margin: 0 auto 16px; }
.screen--progress .done-title { font-size: 28px; }
.screen--progress .done-sub { margin-top: 16px; }
.screen--progress .done-foot { margin-top: 16px; }

/* ============================================================
   底部信任信息
   ============================================================ */
.trust {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}
.trust-item {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 400; color: var(--text-secondary);
  white-space: nowrap;
}
.trust-item svg { width: 14px; height: 14px; flex-shrink: 0; }

/* 屏幕底部留白（信任信息贴底） */
.screen--home .trust { margin-top: auto; padding-top: 32px; }

.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.6; margin: 16px 0; text-align: left; }
.consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; accent-color: #c44000; }
.submission-item .btn { margin-top: 16px; }

/* ============================================================
   隐私政策页（privacy.html）
   ============================================================ */
.screen--doc { padding: 24px 24px 40px; justify-content: flex-start; }
.doc-title { font-size: 28px; font-weight: 700; margin-top: 8px; }
.doc-meta { font-size: 13px; font-weight: 400; color: var(--text-muted); margin-top: 8px; }

.doc { margin-top: 24px; }
.doc h2 { font-size: 18px; font-weight: 700; margin-top: 32px; }
.doc h3 { font-size: 15px; font-weight: 600; margin-top: 20px; }
.doc p { font-size: 15px; font-weight: 400; color: var(--text-secondary); margin-top: 10px; }
.doc strong { color: var(--text-primary); font-weight: 600; }
.doc ul, .doc ol { margin-top: 10px; padding-left: 22px; }
.doc ul { list-style: disc; }
.doc ol { list-style: decimal; }
.doc li { font-size: 15px; font-weight: 400; color: var(--text-secondary); margin-top: 6px; }

/* 条目卡：手机上比三列表格更好读，用于「收集什么 / 共享给谁」这类成组信息 */
.doc-card {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.doc-card + .doc-card { margin-top: 8px; }
.doc .doc-card p { margin-top: 4px; font-size: 14px; }
.doc-card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.doc-key { display: inline-block; min-width: 60px; font-size: 13px; color: var(--text-muted); }

/* 「不收集 / 不存在」清单：用 × 标记，避免用 emoji 破坏正式文档语气 */
.doc-list--no { list-style: none; padding-left: 0; }
.doc-list--no li { position: relative; padding-left: 20px; }
.doc-list--no li::before {
  content: '×'; position: absolute; left: 0; top: 0;
  color: var(--error); font-weight: 700;
}

.screen--doc .text-action { margin-top: 32px; }

/* 离线提示横幅 */
.offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  background: #F5C542;
  color: #5C4400;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
}
