/* 图证 ProofPix · 全局设计令牌 (Coinbase 基底 + 图证定制) */
:root {
  /* 中性 */
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #EEF1F5;
  --border: #E3E7EE;
  --border-strong: #CBD2DD;
  --text: #0C1322;
  --text-2: #586172;
  --text-muted: #8B95A4;
  /* 暗面卷宗 */
  --dark-bg: #0C1322;
  --dark-panel: #131D30;
  --dark-border: #28344C;
  --text-on-dark: #E7ECF3;
  --text-on-dark-2: #9AA7BB;
  /* 双凭证色 */
  --accent: #137A57;          /* 凭证绿：系统承诺/已锚定/可信 */
  --accent-soft: #E4F1EB;
  --accent-hover: #0F6446;
  --stamp: #B3261E;           /* 印章红：人的确认/已核销/危险 */
  --stamp-soft: #FBE9E7;
  /* 状态三态 */
  --amber: #C8871A;
  --amber-text: #8A5E0C;
  --amber-soft: #FBF0DC;
  --neutral-soft: #EEF1F5;
  /* 字体 */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", Menlo, Consolas, monospace;
  /* 圆角 */
  --r-btn: 6px; --r-card: 10px; --r-modal: 14px; --r-lg: 20px; --r-stamp: 8px; --r-pill: 999px;
  /* 阴影 */
  --sh-sm: 0 1px 3px rgba(12,19,34,0.06);
  --sh-md: 0 4px 12px rgba(12,19,34,0.08);
  --sh-lg: 0 8px 24px rgba(12,19,34,0.12);
  --sh-stamp: 0 2px 6px rgba(179,38,30,0.18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-ui); color: var(--text);
  background: var(--bg); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* 顶部导航 */
.nav {
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 24px; padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}
.nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.nav .brand svg { width: 26px; height: 26px; }
.nav .links { display: flex; gap: 4px; margin-left: 8px; }
.nav .links a { padding: 6px 12px; border-radius: var(--r-btn); color: var(--text-2); font-weight: 500; font-size: 14px; }
.nav .links a.active { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav .links a:hover { color: var(--text); }
.nav .spacer { flex: 1; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--r-btn); border: 1px solid transparent;
  font-family: var(--font-ui); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--stamp); color: #fff; }
.btn-danger:hover { background: #97201a; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* 卡片 */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--sh-sm); }

/* 输入 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input, .textarea, select.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--r-btn); font-family: var(--font-ui); font-size: 14px; background: var(--surface); color: var(--text);
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 72px; }
.input:focus, .textarea:focus, select.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.error { border-color: var(--stamp); box-shadow: 0 0 0 3px var(--stamp-soft); }

/* 状态药丸 */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 600; line-height: 1;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill.sent      { background: var(--neutral-soft); color: var(--text-2); }
.pill.sent .dot { background: var(--text-muted); }
.pill.previewed { background: var(--neutral-soft); color: var(--text-2); }
.pill.previewed .dot { background: var(--text-2); }
.pill.confirmed { background: var(--stamp-soft); color: var(--stamp); }
.pill.confirmed .dot { background: var(--stamp); }
.pill.pending_verify { background: var(--amber-soft); color: var(--amber-text); }
.pill.pending_verify .dot { background: var(--amber); }
.pill.verified  { background: var(--stamp-soft); color: var(--stamp); }
.pill.verified .dot { background: var(--stamp); }
.pill.downloaded { background: var(--accent-soft); color: var(--accent); }
.pill.downloaded .dot { background: var(--accent); }
.pill.abnormal  { background: var(--stamp-soft); color: var(--stamp); }
.pill.abnormal .dot { background: var(--stamp); }

/* 印章 */
.stamp {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  border-radius: var(--r-stamp); font-weight: 800; letter-spacing: 1px;
  border: 2px double var(--stamp); color: var(--stamp); padding: 8px 14px;
  transform: rotate(-7deg); background: rgba(179,38,30,0.04);
}
.stamp.solid { background: var(--stamp); color: #fff; box-shadow: var(--sh-stamp); }
.stamp.green { border-color: var(--accent); color: var(--accent); background: rgba(19,122,87,0.04); }

/* 通用布局 */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.row { display: flex; gap: 16px; }
.grid { display: grid; gap: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1,h2,h3 { margin: 0 0 12px; letter-spacing: -0.01em; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 700; margin-bottom: 12px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--dark-panel); color: var(--text-on-dark); padding: 12px 20px; border-radius: var(--r-btn);
  font-size: 14px; box-shadow: var(--sh-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 999;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--stamp); }

/* 遮罩弹窗 */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(12,19,34,0.50);
  display: none; align-items: center; justify-content: center; z-index: 500;
  padding: 20px;
}
.modal-scrim.show { display: flex; }
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: 0 8px 24px rgba(12,19,34,0.12);
  max-width: 420px; width: 100%; padding: 24px; animation: pop .2s ease;
}
@media (max-width: 420px) {
  .modal-scrim { padding: 12px; }
  .modal { padding: 18px; border-radius: 16px; }
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 受保护水印覆盖(前端展示层，真实防护由后端烘焙水印保证) */
.protected-wrap { position: relative; overflow: hidden; border-radius: var(--r-card); background: var(--surface-2); }
.protected-wrap img { display: block; width: 100%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; pointer-events: none; }
.protected-overlay { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(12,19,34,0.06) 0 2px, transparent 2px 90px); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.pulse { animation: pulse 1.6s infinite; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }
.shake { animation: shake .4s; }
