:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #1f2733;
  --muted: #6b7785;
  --line: #e6eaf0;
  --primary: #4f46e5;
  --primary-d: #4338ca;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #2563eb;
  --shadow: 0 2px 10px rgba(20, 30, 60, .06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  background: var(--panel); padding: 36px 32px; border-radius: 16px;
  width: 360px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-card .sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.login-card label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.login-card input {
  width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; color: var(--ink);
}
.login-card input:focus { outline: none; border-color: var(--primary); }
.demo-accounts { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.demo-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 20px;
  padding: 6px 12px; margin: 0 6px 6px 0; cursor: pointer; font-size: 12px; color: var(--ink);
}
.chip:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: 8px; padding: 9px 16px; cursor: pointer;
  font-size: 14px; font-weight: 500; transition: .15s;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 应用布局 ---------- */
.app-wrap { min-height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel); padding: 0 24px; height: 56px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 16px; }
.user-box { display: flex; align-items: center; gap: 12px; }
.badge {
  background: var(--primary); color: #fff; border-radius: 12px; padding: 3px 10px; font-size: 12px;
}
.tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.tab {
  padding: 12px 16px; cursor: pointer; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.content { padding: 24px; max-width: 1080px; margin: 0 auto; }

/* ---------- 卡片/网格 ---------- */
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.card .meta { color: var(--muted); font-size: 13px; line-height: 1.7; }
.rate-pill { display: inline-block; background: #eef2ff; color: var(--primary); border-radius: 8px; padding: 2px 10px; font-weight: 600; }
a.link { color: var(--blue); text-decoration: none; font-weight: 500; }
a.link:hover { text-decoration: underline; }

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

/* ---------- 状态标签 ---------- */
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.tag.pending { background: #fef3c7; color: var(--amber); }
.tag.confirmed { background: #dbeafe; color: var(--blue); }
.tag.done { background: #dcfce7; color: var(--green); }
.tag.cancelled { background: #f1f5f9; color: var(--muted); }
.tag.refunded { background: #fee2e2; color: var(--red); }
.tag.approved { background: #dbeafe; color: var(--blue); }
.tag.paid { background: #dcfce7; color: var(--green); }
.tag.rejected { background: #fee2e2; color: var(--red); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* ---------- 统计卡 ---------- */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.stat .num { font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat .lbl { color: var(--muted); font-size: 13px; }

.section-title { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select, .toolbar input[type=date] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; color: var(--ink); }
.spacer { flex: 1; }
.empty { color: var(--muted); text-align: center; padding: 40px; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 440px; max-width: 92vw; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal-body { max-height: 60vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 消息 ---------- */
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.msg.unread { border-color: var(--primary); background: #f5f7ff; }
.msg .time { color: var(--muted); font-size: 12px; }
.msg .type { font-size: 11px; color: var(--primary); font-weight: 600; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #1f2733; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 14px; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
