/* 村口生活 · 共享设计变量（管理端 + 用户端共用）
   方向：奶白 + 象牙白 + 柔和杏橙 + 炭黑主按钮（用户选定参考图）
   本文件只放「token + 通用原语」，页面布局分别由各端 CSS 维护，避免互相污染。
   无绿、无深蓝、无渐变；真实照片与高德底图保留原色。 */

:root {
  /* 中性奶白 */
  --bg: #F5F3EC;            /* 奶白页面底 */
  --paper: #F5F3EC;
  --card: #FFFEFA;          /* 象牙白卡片 */
  --bg-2: #ECE9E1;          /* 次级背景 */
  --ink: #262622;           /* 主文字 15.1:1 */
  --ink-2: #68675F;         /* 次要 5.6:1 */
  --ink-3: #706D64;         /* 弱文字 4.7:1 */
  --placeholder: #9A968C;   /* 占位符（补充信息） */
  --line: #E4E0D6;          /* 分割线 */
  --line-strong: #D8D3C7;   /* 较强边框 */

  /* 柔和杏橙 */
  --accent: #F5AA78;        /* 杏橙：选中/当前步骤/强调填充（配深字） */
  --accent-strong: #9A4A12; /* 深杏橙：小字号强调文字 6.2:1 */
  --accent-soft: #FCE5D5;   /* 选中浅底 */
  --on-accent: #262622;     /* 杏橙上的深字 7.9:1（禁止白字） */

  /* 炭黑主按钮 */
  --charcoal: #262622;
  --on-charcoal: #FFFFFF;   /* 炭黑白字 15.2:1 */

  /* 语义 */
  --danger: #B3261E;        /* 危险（白字 6.5:1） */
  --danger-soft: #F9E8E5;

  --r-lg: 20px;             /* 卡片圆角 */
  --r-md: 12px;             /* 按钮/输入圆角 */
  --r-sm: 10px;
  --tap-h: 48px;            /* 主按钮高度 */
  --shadow-sm: 0 1px 3px rgba(38,38,34,.06);
  --shadow-md: 0 2px 8px rgba(38,38,34,.08);

  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { touch-action: manipulation; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 按钮（炭黑主按钮 / 杏橙次强调 / ghost 弱化） ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap-h); padding: 0 18px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ink);
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--charcoal); border-color: var(--charcoal); color: var(--on-charcoal); }
.btn.primary:active { background: #1A1A17; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.accent:active { background: #EF9C63; }
.btn.ghost { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:active { background: #F2F0EA; }
.btn.danger { color: var(--danger); border-color: #E3B8B4; }
.btn.danger:active { background: var(--danger-soft); }
.btn.block { width: 100%; }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-strong); outline-offset: 2px;
}

/* ---------- 表单 ---------- */
input, select, textarea {
  width: 100%; min-height: var(--tap-h);
  border: 1px solid var(--line-strong); background: var(--card);
  border-radius: var(--r-md); padding: 10px 12px;
  font-size: 16px; color: var(--ink); touch-action: manipulation;
}
textarea { min-height: 72px; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-strong); }
label { display: block; margin: 14px 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
label > input, label > select, label > textarea { margin-top: 6px; }
.req { color: var(--danger); margin-left: 2px; }
.field-hint { display: block; margin: 4px 0 0; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.field-error { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--danger); }
input.invalid, textarea.invalid, select.invalid { border-color: var(--danger); }

/* ---------- 状态（文字 + 符号，不依赖颜色） ---------- */
.st { font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.st-published { color: var(--ink); }
.st-draft { color: var(--ink-2); }
.st-offline, .st-archived { color: var(--ink-3); }
.st-dirty { color: var(--accent-strong); }

/* ---------- toast ---------- */
#toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  max-width: 86%; z-index: 999; background: var(--charcoal); color: #fff;
  padding: 12px 18px; border-radius: var(--r-md); font-size: 14px; text-align: center;
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
#toast.show { opacity: 1; }
#toast.ok { background: var(--charcoal); }
#toast.err { background: var(--danger); }

/* ---------- 空态 ---------- */
.empty-state { text-align: center; color: var(--ink-2); padding: 40px 20px; font-size: 14px; }
.empty-state .ic {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong);
  font-size: 24px; font-weight: 700;
}
.empty-state p { margin: 6px 0 0; color: var(--ink-3); }
