:root {
  --primary: #1f6feb;
  --primary-dark: #175bc4;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e3e8ee;
  --text: #1f2a37;
  --muted: #6b7280;
  --danger: #e11d48;
  --success: #16a34a;
  --warning: #d97706;
  --info: #0ea5e9;
  --pending: #d97706;
  --processing: #0ea5e9;
  --closed: #16a34a;
  --rejected: #e11d48;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}

[v-cloak] { display: none; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

.container { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }

/* 顶部导航 */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 17px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.brand .logo { width: 26px; height: 26px; background: var(--primary); border-radius: 7px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 14px;
}
.nav a:hover { background: #eef2f7; }
.nav a.active { color: var(--primary); background: #e8f0fe; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
}
.page-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.section-title { font-size: 16px; font-weight: 600; margin: 0 0 12px; }

/* 表单 */
label.field { display: block; margin-bottom: 14px; }
label.field .lab { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; background: #fff; color: var(--text); font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
textarea { resize: vertical; min-height: 90px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: .15s; font-family: inherit;
}
.btn:hover { background: #f4f6f9; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { background: #fff; border-color: #fecdd3; color: var(--danger); }
.btn.danger:hover { background: #fff1f2; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 徽标/状态 */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.badge.pending       { background: #fef3c7; color: #92400e; }
.badge.processing    { background: #e0f2fe; color: #075985; }
.badge.closed        { background: #dcfce7; color: #166534; }
.badge.rejected      { background: #ffe4e6; color: #9f1239; }
.badge.info          { background: #e0f2fe; color: #075985; }
.badge.gray          { background: #f3f4f6; color: #4b5563; }
.badge.success       { background: #dcfce7; color: #166534; }
.badge.warning       { background: #fef3c7; color: #92400e; }
.badge.danger        { background: #ffe4e6; color: #9f1239; }
.badge.high          { background: #ffe4e6; color: #9f1239; } /* 紧急 */
.badge.med           { background: #fef3c7; color: #92400e; } /* 重要 */
.badge.low           { background: #f3f4f6; color: #4b5563; } /* 一般 */

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #fafbfc; font-weight: 600; color: var(--muted); white-space: nowrap; }
tr:hover td { background: #fafbfc; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* 状态统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 6px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { font-size: 13px; color: var(--muted); }

/* 图片 */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.img-grid img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; }
.preview-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.preview-imgs img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.preview-imgs .rm { position: relative; }
.preview-imgs .rm button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff; color: var(--danger); font-size: 12px; cursor: pointer; line-height: 1;
}

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.25); max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; padding: 22px; }
.modal h3 { margin: 0 0 14px; font-size: 18px; }

/* 消息 */
.msg { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.msg.success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.msg.error { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; }

/* 按钮组 */
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* 居中登录 */
.auth-wrap { max-width: 420px; margin: 60px auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.search-input { max-width: 200px; }

/* ===================== 手机友好 ===================== */
@media (max-width: 768px) {
  body { font-size: 15px; }
  .topbar-inner { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 15px; }
  .brand .logo { width: 22px; height: 22px; font-size: 12px; }
  .nav { gap: 4px; }
  .nav a { padding: 7px 9px; font-size: 13px; border-radius: 7px; }
  .topbar-right { margin-left: auto; }
  .container { padding: 12px 12px 50px; }
  .card { padding: 16px; margin-bottom: 14px; }
  .page-title { font-size: 18px; }
  .page-sub { font-size: 13px; }
  .section-title { font-size: 15px; }

  /* 触摸目标加大 */
  .btn { min-height: 44px; }
  .btn.sm { min-height: 38px; }
  input[type=text], input[type=password], input[type=number], input[type=date], textarea, select {
    font-size: 16px; /* 防 iOS 聚焦缩放 */
    padding: 11px 12px;
  }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .n { font-size: 22px; }
  .stat .l { font-size: 12px; }

  /* 手机表单字段铺满整行 */
  .row { gap: 0; }
  .row > * { flex: 1 1 100%; margin-bottom: 0; }
  .row > .field { margin-bottom: 4px; }

  /* 表格 → 卡片式堆叠 */
  .table-wrap { overflow-x: visible; }
  table { display: block; width: 100%; }
  thead { display: none; }
  table tbody { display: block; }
  tr { display: block; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; padding: 4px 12px; }
  td {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border); padding: 9px 2px; text-align: right;
  }
  td::before { content: attr(data-label); font-weight: 600; color: var(--muted); margin-right: 12px; white-space: nowrap; font-size: 13px; }
  td:last-child { border-bottom: none; }
  .actions { justify-content: flex-end; }

  /* 弹窗全屏 */
  .modal-mask { padding: 0; }
  .modal { max-width: 100%; padding: 16px; border-radius: 0; max-height: 100vh; }
}

/* 超大屏内容居中更舒服 */
@media (min-width: 1200px) {
  .container, .topbar-inner { max-width: 1200px; }
}
