* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; background: #f0f4f8; color: #2c3e50; }
a { color: #2563eb; text-decoration: none; }

.topbar { background: #1e3a5f; color: #fff; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.topbar .brand { font-weight: 700; font-size: 17px; }
.topbar .nav-right { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.topbar a { color: #cfe3ff; }
.topbar a:hover { color: #fff; }
.topbar .who { color: #9db8d9; font-size: 13px; }

.container { max-width: 1080px; margin: 24px auto; padding: 0 16px; }
.card { background: #fff; border-radius: 10px; padding: 24px 28px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.card.narrow { max-width: 420px; margin: 60px auto; }

h2 { margin: 0 0 16px; font-size: 20px; }
h3 { margin: 12px 0 8px; font-size: 15px; color: #1e3a5f; }

label { display: block; font-size: 13px; color: #555; margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; margin-bottom: 6px; }
input:focus, select:focus { outline: 2px solid #93c5fd; border-color: #3b82f6; }

.btn { display: inline-block; background: #e2e8f0; color: #1e3a5f; border: none; border-radius: 6px; padding: 8px 16px; font-size: 14px; cursor: pointer; margin-top: 8px; }
.btn:hover { background: #cbd5e1; }
.btn.primary { background: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.sm { padding: 4px 10px; font-size: 13px; margin: 0; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.flash.ok { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #e5e7eb; }
thead th { background: #f8fafc; font-weight: 600; }
table.kv th { width: 110px; background: #f8fafc; font-weight: 600; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid2 .full { grid-column: span 2; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } .grid2 .full { grid-column: span 1; } }

.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.s-draft { background: #fef3c7; color: #92400e; }
.s-pending { background: #dbeafe; color: #1e40af; }
.s-dispatched { background: #e0e7ff; color: #4338ca; }
.s-invoiced { background: #fce7f3; color: #9d174d; }
.s-done { background: #dcfce7; color: #166534; }
.s-v-available { background: #dcfce7; color: #166534; }
.s-v-busy { background: #fef3c7; color: #92400e; }
.s-v-repair { background: #fee2e2; color: #991b1b; }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.card-head h2 { margin-bottom: 4px; }
.card-head p { margin: 0; }

/* 列表搜索栏 */
.search-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 14px 0 6px; }
.search-bar input { flex: 1 1 260px; min-width: 0; margin: 0; }
.search-bar .btn { margin-top: 0; white-space: nowrap; }

.step-box { border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px 18px; margin: 16px 0; background: #fafbfc; }
.upload-form { border-top: 1px dashed #e5e7eb; padding-top: 6px; margin-top: 10px; }
.muted { color: #6b7280; font-size: 14px; }
.small { font-size: 12px; }
.ok-dot { color: #16a34a; font-weight: 600; }

/* 用户管理行内操作 */
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.mini-input { width: 96px; padding: 4px 8px; font-size: 13px; margin: 0; }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.btn.danger:hover { background: #fecaca; }
ol li { margin: 6px 0; line-height: 1.6; }

/* ================= 移动端适配 ================= */
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; gap: 6px; }
  .topbar .brand { font-size: 15px; }
  .topbar .nav-right { gap: 10px; font-size: 14px; width: 100%; }
  .topbar .who { display: none; }
  .container { margin: 12px auto; padding: 0 10px; }
  .card { padding: 16px 14px; border-radius: 8px; }
  h2 { font-size: 17px; }
  .btn { padding: 9px 16px; }

  /* 列表表格 → 卡片 */
  table.list-table thead { display: none; }
  table.list-table, table.list-table tbody, table.list-table tr, table.list-table td {
    display: block; width: 100%;
  }
  table.list-table tr {
    border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 10px 14px; margin-bottom: 12px; background: #fff;
  }
  table.list-table tr:hover { background: #fff; }
  table.list-table td {
    border: none; padding: 5px 0; font-size: 14px;
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    text-align: right; word-break: break-all;
  }
  table.list-table td::before {
    content: attr(data-label);
    color: #6b7280; font-size: 12px; font-weight: 400;
    flex: 0 0 auto; text-align: left;
  }
  table.list-table td.cell-title { font-weight: 700; font-size: 15px; color: #1e3a5f; }
  table.list-table td .btn.sm { margin: 0; }
  table.list-table td[data-label="操作"] { padding-top: 8px; }
  table.list-table td[data-label="操作"] .btn.sm { min-width: 84px; text-align: center; }

  /* 详情页信息表：标签列收窄 */
  table.kv th { width: 84px; font-size: 13px; padding: 8px 6px; }
  table.kv td { font-size: 14px; }
  .step-box { padding: 12px 12px; }
  input[type="file"] { font-size: 13px; }
}

