/* ============================================================
   扫码吐槽系统 · 设计系统
   现代清爽 · 深蓝主色
   ============================================================ */
:root {
  /* 品牌 */
  --primary: #1d4ed8;          /* 深蓝主色 */
  --primary-dark: #1e3a8a;     /* 深蓝-深 */
  --primary-light: #3b82f6;    /* 深蓝-亮(渐变用) */
  --primary-soft: #eff6ff;     /* 主色淡底 */
  --accent: #0ea5e9;           /* 信息点缀 */

  /* 中性 */
  --bg: #f1f5f9;               /* 页面底色 */
  --card: #ffffff;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;

  /* 语义状态色 */
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  /* 新收到(蓝) / 处理中(橙) / 已解决(绿) */
  --st-new-bg: #eff6ff;  --st-new-fg: #1d4ed8;
  --st-prog-bg: #fff7ed; --st-prog-fg: #c2410c;
  --st-done-bg: #ecfdf5; --st-done-fg: #047857;

  /* 形状 */
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.err { color: var(--danger); font-size: 13.5px; }
.ok { color: var(--ok); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ============ 通用容器 / 卡片 ============ */
.container { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.container.wide { max-width: 1080px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-top: 0; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex > .grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: #fff;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 10px 18px; font-size: 15px; font-weight: 500;
  cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--text-2); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--bg); color: var(--text); }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }

/* ============ 表单 ============ */
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 14px; }
label .req { color: var(--danger); }
input, textarea, select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 15px; font-family: inherit; color: var(--text);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}
textarea { min-height: 130px; resize: vertical; }
input[type=date] { min-width: 0; }
.form-note { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }

/* ============ 图片选择 / 缩略图 ============ */
.img-field { margin-top: 8px; }
#imgPrev { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.img-thumb { display: inline-block; }
.img-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line-strong); display: block; }
.img-del { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px;
  border-radius: 50%; border: 0; background: var(--danger); color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); }
.img-del:hover { background: #b91c1c; }
.img-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.img-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ============ 状态徽章 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.new        { background: var(--st-new-bg);  color: var(--st-new-fg); }
.badge.in_progress{ background: var(--st-prog-bg); color: var(--st-prog-fg); }
.badge.resolved   { background: var(--st-done-bg); color: var(--st-done-fg); }

/* ============ 统计卡 ============ */
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 4px;
}
.stat-card .label { color: var(--muted); font-size: 13px; }
.stat-card .value { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat-card .sub { font-size: 12.5px; color: var(--muted); }
.stat-card.blue .value { color: var(--primary); }
.stat-card.green .value { color: var(--ok); }
.stat-card.amber .value { color: var(--warn); }
.stat-card.slate .value { color: var(--text); }

/* ============ 迷你柱状统计 ============ */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 8px; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-col .bar {
  width: 100%; max-width: 40px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  transition: height .3s; min-height: 2px;
}
.bar-col .bar.empty { background: var(--line); }
.bar-col .n { font-size: 12px; font-weight: 600; color: var(--text-2); }
.bar-col .d { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* 状态分布横条 */
.dist-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.dist-row .lbl { width: 64px; font-size: 13px; color: var(--text-2); }
.dist-row .track { flex: 1; background: var(--line); border-radius: 999px; height: 10px; overflow: hidden; }
.dist-row .fill { height: 100%; border-radius: 999px; }
.dist-row .val { width: 36px; text-align: right; font-weight: 600; font-size: 14px; }

/* ============================================================
   用户端（扫码落地 / 表单 / 成功）
   ============================================================ */
.pub { background: #eef2f7; }
.pub .page { max-width: 560px; margin: 0 auto; padding: 0 14px 40px; }

/* 顶部渐变横幅 */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
  color: #fff; padding: 30px 20px 46px; text-align: center;
}
.hero .badge-logo {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 5px 14px; font-size: 13px;
  backdrop-filter: blur(4px); margin-bottom: 14px;
}
.hero h1 { color: #fff; margin: 0 0 8px; font-size: 24px; letter-spacing: .5px; }
.hero p { color: rgba(255,255,255,.9); margin: 0 auto; max-width: 420px; font-size: 14.5px; }
.hero .hero-icon { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 14px;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; }

/* 悬浮在主内容上盖住横幅底 */
.pub .page { margin-top: -22px; position: relative; }
.hero + .pub .page { margin-top: -22px; }

/* 落地页主卡 */
.landing-main { text-align: center; }
.landing-main .cta { font-size: 17px; padding: 14px 32px; margin-top: 8px; border-radius: 10px;
  box-shadow: 0 8px 20px rgba(29,78,216,.25); }
.landing .feat { display: flex; gap: 10px; align-items: center; padding: 10px 4px;
  color: var(--text-2); font-size: 14px; }
.landing .feat svg { flex: none; color: var(--primary); }
.landing-privacy { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }

/* 表单 */
.form-card { padding: 24px; border-radius: var(--r-lg); }
.form-card h2 { margin: 0 0 4px; font-size: 19px; }
.form-head { margin-bottom: 6px; }
.form-hint { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.form-mylink { display: inline-block; margin: 2px 0 10px; font-size: 13px; font-weight: 500;
  color: var(--primary); text-decoration: none; }
.form-mylink:hover { text-decoration: underline; }
.foot-actions { margin-top: 18px; }

/* 成功页 */
.success-wrap { text-align: center; padding: 34px 10px; }
.success-ico {
  width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--ok-soft); display: flex; align-items: center; justify-content: center;
}
.success-wrap h1 { color: var(--ok); font-size: 22px; }

/* 我的提交记录页 */
.my-item { text-align: left; }
.my-item .entry-content { white-space: pre-wrap; }
.my-item .img-row img { width: 72px; height: 72px; }

/* ============================================================
   后台 · 侧边栏布局
   ============================================================ */
body.admin { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 232px; flex: none;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5e1; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex; align-items: center; justify-content: center;
}
.sidebar .brand .name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.sidebar .brand .sub { font-size: 11px; color: #64748b; }
.sidebar nav { padding: 12px 10px; flex: 1; }
.sidebar nav .nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: #64748b; padding: 14px 10px 6px; }
.sidebar nav a.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0;
  border-radius: var(--r-sm); color: #cbd5e1; font-size: 14px;
  text-decoration: none; transition: background .12s, color .12s;
}
.sidebar nav a.nav-item svg { flex: none; opacity: .8; }
.sidebar nav a.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.nav-item.active { background: rgba(59,130,246,.18); color: #fff; }
.sidebar nav a.nav-item .cnt {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 11px;
  border-radius: 999px; padding: 0 7px; font-weight: 600; line-height: 17px; min-width: 18px; text-align: center;
}
.sidebar .side-foot { padding: 14px 14px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .side-foot .who { font-size: 13px; color: #94a3b8; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 顶栏(移动端) */
.topbar { display: none; }

/* 主内容 */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-top {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 14px 24px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 20;
}
.admin-top h1 { font-size: 18px; margin: 0; }
.admin-top .crumb { color: var(--muted); font-size: 13px; }
.admin-content { padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* 列表条目行 */
.entry-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entry-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 4px; }
.entry-meta b { color: var(--text-2); font-weight: 600; }
.entry-content { white-space: pre-wrap; margin: 10px 0; font-size: 15px; }
.entry-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.entry-actions select, .entry-actions input { width: auto; }
.day-card h3 .day-label { margin-right: 8px; }
.day-badge { color: var(--muted); font-weight: 400; font-size: 13px; }

/* 日期分组外框 */
.day-card { padding: 14px 20px; }
.day-card > h3 { display: flex; align-items: center; }
.inner-rows { margin-top: 6px; }
.inner-row {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px;
  background: #fbfcfe;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.inner-row:hover {
  background: #fff; border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(29,78,216,.10); transform: translateY(-1px);
}

/* 用户档案面板 */
.user-panel { border-left: 3px solid var(--primary); }
.user-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px;
  background: var(--primary-soft); color: var(--primary); border-radius: 999px;
  font-size: 13px; font-weight: 500; }

/* 工具栏筛选 */
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.toolbar .f { display: flex; flex-direction: column; gap: 4px; }
.toolbar .f label { margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.toolbar input, .toolbar select { width: auto; }
.toolbar .f.keyword input { min-width: 180px; }

/* 统计分析 · 趋势日期筛选 */
.stats-head { margin-bottom: 6px; }
.stats-filter { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.stats-filter .f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stats-filter .f label { margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.stats-filter input { width: 180px; }
.stats-filter .btn { white-space: nowrap; }
.stats-filter > .f:last-child { margin-left: auto; }
.stats-filter .f:last-child .btn { width: auto; }

/* 表格(用户档案页) */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
table.data tr:hover td { background: #f8fafc; }
table.data tbody tr { transition: background .15s ease; }
table.data td.num { font-variant-numeric: tabular-nums; }

/* 分页条 */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 0 4px; flex-wrap: wrap; }
.pager .pager-info { font-size: 13px; color: var(--muted); }
.pager .btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (prefers-color-scheme: dark) {
  .inner-row:hover { background: rgba(59,130,246,.10); border-color: var(--primary-light); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
  table.data tr:hover td { background: rgba(148,163,184,.10); }
}

/* 空态 */
.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-state .ico { font-size: 40px; margin-bottom: 8px; opacity: .5; }

/* 汉堡按钮 & 遮罩：桌面端隐藏，移动端(抽屉模式)启用 */
.menu-btn {
  display: none;
  background: none; border: none; color: var(--text-2);
  cursor: pointer; padding: 4px; border-radius: 6px; line-height: 0;
}
.menu-btn:hover { background: var(--primary-soft); color: var(--primary); }
.scrim {
  display: none;
}

/* 顶栏右上角退出图标按钮 */
.logout-top {
  background: none; border: 1px solid transparent; color: var(--muted);
  cursor: pointer; padding: 5px; border-radius: 8px; line-height: 0;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.logout-top:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--line); }

/* 顶栏公司切换下拉 —— 与顶栏白底协调的小型 select */
.admin-top .company-switch {
  margin-left: auto;
  width: auto; min-width: 140px; max-width: 220px;
  padding: 6px 10px;
  font-size: 13px;
}

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  /* ---- 抽屉式侧边栏 ---- */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 250px; height: 100vh; z-index: 60;
    transform: translateX(-100%);
    transition: transform .24s ease;
    overflow-y: auto;
  }
  body.admin.nav-open .sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(15,23,42,.4); }
  body.admin.nav-open .scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(15,23,42,.4);
  }
  /* 抽屉内导航保持竖排；品牌/侧栏脚保留，供手机上退出登录用 */
  .sidebar .brand .sub { display: none; }

  /* ---- 顶栏(始终显示，含汉堡) ---- */
  .admin-top {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    position: sticky; top: 0; z-index: 20;
  }
  .admin-top h1 { font-size: 16px; flex: 0 0 auto; }
  .admin-top .crumb { display: none; }
  .menu-btn { display: inline-flex; }

  .admin-content { padding: 14px 12px 40px; max-width: 100%; }

  /* ---- 统计分析·趋势日期筛选(手机) ---- */
  .stats-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
  .stats-filter .f { min-width: 0; }
  .stats-filter input { width: 100%; }
  .stats-filter > .f:last-child { margin-left: 0; grid-column: 1 / -1; }
  .stats-filter .f:last-child .btn { width: 100%; }

  /* ---- 吐槽看板条目：操作控件改卡片内竖排可编辑 ---- */
  .inner-row { padding: 12px; }
  .entry-actions { flex-direction: column; align-items: stretch; }
  .entry-actions select,
  .entry-actions input { width: 100%; }
  .entry-actions .btn { width: 100%; }
  .day-card { padding: 10px 12px; }
  .day-card > h3 { align-items: center; gap: 6px; flex-wrap: wrap; }

  /* ---- 筛选工具栏：全宽 ---- */
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .f { flex: 1 1 auto; }
  .toolbar .f.keyword input,
  .toolbar input, .toolbar select { width: 100%; min-width: 0; }
  .toolbar .f.right { margin-left: 0; }
  .toolbar .btn { width: 100%; }

  /* ---- 用户档案表格 → 卡片 ---- */
  .table-wrap { overflow: visible; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data thead { display: none; }
  table.data tr {
    border: 1px solid var(--line); border-radius: var(--r-md);
    margin-bottom: 12px; padding: 4px 12px; background: #fbfcfe;
  }
  table.data tr:hover td { background: transparent; }
  table.data td {
    display: flex; justify-content: space-between; align-items: center;
    border: none; padding: 8px 0; border-bottom: 1px dashed var(--line);
  }
  table.data td:last-child { border-bottom: none; }
  table.data td::before {
    content: attr(data-label);
    color: var(--muted); font-size: 12px; flex: none; margin-right: 12px;
  }
  table.data td.num { text-align: right; }
  table.data td:last-child::before { display: none; }
  table.data td:last-child { justify-content: flex-end; }
  /* 加载中 / 空态行：不套卡片标签，居中 */
  table.data tr.state-row { border: none; background: transparent; padding: 0; margin: 0; }
  table.data tr.state-row td { justify-content: center; border: none; padding: 12px; }

  /* ---- 统计卡片 / 网格：单列 ---- */
  .grid2 { grid-template-columns: 1fr; }

  /* ---- 表格里被当作卡片的按钮区 ---- */
  table.data td .btn { white-space: nowrap; }

  /* 用户端 hero 收窄(适配 860 下的落地页) */
  .hero { padding: 24px 16px 40px; }
  .page { padding-bottom: 24px; }
}

/* ---- 来源标签（公司 / 入口）：反馈卡片与用户列表共用 ---- */
.src-tag {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: 999px;
  font-size: 12px; line-height: 1.6; white-space: nowrap;
}
.src-tag.company { background: rgba(59,130,246,.14); color: #1d4ed8; }
.src-tag.entry   { background: rgba(16,185,129,.16); color: #047857; }
@media (prefers-color-scheme: dark) {
  .src-tag.company { background: rgba(59,130,246,.22); color: #93c5fd; }
  .src-tag.entry   { background: rgba(16,185,129,.22); color: #6ee7b7; }
}

/* ---- 轻量模态框 ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--surface, #fff); color: inherit;
  border-radius: 16px; padding: 24px 24px 20px;
  width: 100%; max-width: 420px; max-height: 88vh; overflow: auto;
  box-shadow: 0 24px 64px rgba(15,23,42,.28);
}
.modal.wide {
  max-width: 640px;
}
.modal-body {
  margin-top: 6px;
}
.modal-body label {
  margin: 16px 0 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2, #475569);
}
.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body input:not([type]) {
  width: 100%; box-sizing: border-box;
}
.form-section {
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  padding: 14px 16px;
}
.form-section label {
  margin: 0 0 6px;
}
.form-section label:first-child {
  margin-top: 0;
}
.modal .perm-section {
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  padding: 14px 16px;
}
.modal-foot {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #e2e8f0);
}
.perm-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; line-height: 1.2;
  cursor: pointer; user-select: none;
  background: #f1f5f9; color: #334155;
  border: 1px solid #e2e8f0;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.perm-chip:hover {
  background: #e2e8f0; border-color: #cbd5e1;
}
.perm-chip.on {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(29, 78, 216, .22);
}
.perm-chip:active {
  transform: translateY(1px);
}
.modal h3 { margin: 0 0 12px; }
.modal-body label { display: block; margin: 10px 0 4px; font-size: 13px; font-weight: 600; }
.modal-body input[type="text"], .modal-body input[type="password"], .modal-body input:not([type]) {
  width: 100%; box-sizing: border-box;
}
.modal-body .chk {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px; border-bottom: 1px solid rgba(148,163,184,.18);
  font-weight: 500; cursor: pointer;
}
.modal-body .chk:last-child { border-bottom: none; }
.modal-body .chk input { width: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-body select { width: 100%; box-sizing: border-box; }
.modal-body input:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }

/* 轻量提示条：屏幕顶部居中浮现，2.2s 后自动消失 */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translate(-50%, -12px);
  z-index: 2000; max-width: 88vw;
  background: #1e293b; color: #fff;
  padding: 10px 18px; border-radius: 10px;
  font-size: 14px; line-height: 1.4; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-ok { background: #16a34a; }
.toast-err { background: #dc2626; }

@media print {
  .sidebar, .admin-top, .toolbar, .entry-actions, .btn { display: none !important; }
  body.admin { background: #fff; }
  .card, .inner-row { border: 1px solid #ccc; box-shadow: none; page-break-inside: avoid; }
}

/* ---- snsapi_userinfo：微信头像 + 昵称 ---- */
.wx-ava {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover; vertical-align: middle; margin-right: 6px;
  background: var(--line); flex: 0 0 auto;
}
.wx-user { display: inline-flex; align-items: center; }
.wx-welcome {
  display: flex; align-items: center;
  background: var(--primary-soft); color: var(--primary-dark);
  border: 1px solid rgba(59, 130, 246, .22);
  border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 16px;
  font-size: 14px; font-weight: 600;
}
.wx-welcome .wx-ava { width: 30px; height: 30px; }
.wx-user-card { display: flex; align-items: center; padding: 12px 16px; margin-bottom: 12px; }
.wx-user-card .wx-ava { width: 42px; height: 42px; }
.wx-user-card .wx-name { font-weight: 600; }
.wx-user-meta { margin-left: auto; font-size: 12px; }

@media (prefers-color-scheme: dark) {
  .wx-welcome { background: rgba(59, 130, 246, .16); color: #93c5fd; border-color: rgba(59, 130, 246, .3); }
}
