:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e6e8eb;
  --text: #1f2329;
  --muted: #8a9099;
  --primary: #2b6de5;
  --primary-d: #1f58c2;
  --green: #1fab6b;
  --red: #e5484d;
  --orange: #f08c00;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin-top: 14px; line-height: 1.6; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#3a7afe,#2b6de5); }
.login-card { background: #fff; border-radius: 14px; padding: 34px 30px; width: 340px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; margin-top: 14px; }
.btn { border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; cursor: pointer; background: #eef0f3; color: var(--text); transition: .15s; }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-wecom { background: #07c160; color: #fff; }
.btn-wecom:hover { background: #06ad56; }
.divider { display: flex; align-items: center; color: var(--muted); font-size: 12px; margin: 16px 0 4px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.divider span { padding: 0 12px; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; }
.brand { font-size: 18px; font-weight: 700; color: var(--primary); padding: 6px 10px 14px; }
.nav-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--text); margin-bottom: 4px; }
.nav-item:hover { background: #f0f4ff; }
.nav-item.active { background: #e8f0ff; color: var(--primary); font-weight: 600; }
.badge { background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); }
.me-name { font-size: 13px; margin-bottom: 8px; }
.content { flex: 1; padding: 22px 26px; overflow: auto; }
.view h2 { margin: 0 0 16px; font-size: 18px; }

/* 卡片 / 统计 */
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.stat .num { font-size: 26px; font-weight: 700; }
.stat .lbl { color: var(--muted); margin-top: 4px; }

/* 列表 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; cursor: pointer; }
.card:hover { border-color: #c9d6f0; }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card .title { font-weight: 600; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.6; }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 20px; background: #eef0f3; color: var(--muted); }
.tag.pending { background: #fff3e0; color: var(--orange); }
.tag.approved { background: #e6f7ee; color: var(--green); }
.tag.rejected { background: #fdecec; color: var(--red); }

/* 表单 */
.form { max-width: 560px; }
.form label { display: block; margin: 12px 0 5px; font-weight: 600; font-size: 13px; }
.form .input, .form select, .form textarea { width: 100%; }
textarea.input { min-height: 70px; resize: vertical; }
.row-flex { display: flex; gap: 10px; }
.btn-row { margin-top: 18px; display: flex; gap: 10px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { background: #fafbfc; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* 审批流编辑 */
.level-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fafbfc; }
.level-box .lv-head { font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; }
.level-box select { width: 100%; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card { background: #fff; width: min(640px, 94vw); max-height: 88vh; overflow: auto; border-radius: 14px; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal-body { padding: 18px; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; }
.tl-item { position: relative; padding: 6px 0 14px; }
.tl-item::before { content: ''; position: absolute; left: -20px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.tl-item.ok::before { background: var(--green); }
.tl-item.no::before { background: var(--red); }
.tl-item.cur::before { background: var(--primary); box-shadow: 0 0 0 4px #d6e4ff; }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #1f2329; color: #fff; padding: 12px 18px; border-radius: 8px; z-index: 80; box-shadow: var(--shadow); max-width: 360px; white-space: pre-line; text-align: left; line-height: 1.6; font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.section-title { font-weight: 700; margin: 18px 0 10px; font-size: 15px; }
