/* ============================================================
   停车券自动审批发券 · 样式
   设计基调：深蓝渐变打底 + 白色居中卡片，桌面/移动自适应
   ============================================================ */

:root {
  --navy-0: #0b1e3d;
  --navy-1: #0f2547;
  --navy-2: #16345f;
  --blue: #1c62d6;
  --blue-lt: #3d8bfd;
  --blue-dk: #1a5fd0;
  --ink: #1f2a3d;
  --ink-2: #4a5a72;
  --ink-3: #7b8aa0;
  --line: #e4e9f2;
  --bg: #f5f7fb;
  --ok: #12a05c;
  --ok-bg: #e8f8f0;
  --warn: #d98900;
  --warn-bg: #fff6e5;
  --err: #d64545;
  --err-bg: #fdeeee;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 34, 64, .04), 0 8px 24px rgba(16, 34, 64, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 登录页 ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(61, 139, 253, .18), transparent 60%),
    radial-gradient(900px 500px at 85% 90%, rgba(26, 95, 208, .22), transparent 60%),
    linear-gradient(150deg, var(--navy-0) 0%, var(--navy-1) 45%, var(--navy-2) 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  padding: 40px 36px 32px;
  box-shadow: 0 24px 60px rgba(6, 20, 44, .35);
}

.auth-brand { text-align: center; margin-bottom: 28px; }

.auth-mark {
  width: 60px; height: 60px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue-lt), var(--blue-dk));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(28, 98, 214, .35);
}

.auth-brand h1 { margin: 0 0 6px; font-size: 21px; letter-spacing: .5px; }
.auth-brand p { margin: 0; color: var(--ink-3); font-size: 13px; }

/* ---------- 主框架 ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px;
  flex: 0 0 224px;
  background: linear-gradient(180deg, var(--navy-1) 0%, var(--navy-0) 100%);
  color: #cfdcee;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue-lt), var(--blue-dk));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px;
}

.brand-text b { display: block; color: #fff; font-size: 14px; letter-spacing: .3px; }
.brand-text span { display: block; color: #7f96b8; font-size: 11px; margin-top: 1px; }

.nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.nav-group {
  color: #6c86ab; font-size: 11px; letter-spacing: 1.2px;
  padding: 14px 10px 7px; text-transform: uppercase;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; margin-bottom: 2px;
  border-radius: 8px; color: #b9cbe4;
  font-size: 13.5px; text-decoration: none;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active {
  background: linear-gradient(90deg, rgba(61, 139, 253, .28), rgba(61, 139, 253, .06));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--blue-lt);
}
.nav .ico {
  width: 17px; text-align: center; font-style: normal;
  opacity: .85; font-size: 14px;
}
.nav .badge {
  margin-left: auto; background: #e04747; color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 9px; line-height: 17px;
}

.sidebar-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 11.5px; color: #6c86ab; line-height: 1.9;
}
.sidebar-foot a { color: #8fa7c8; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { margin: 0; font-size: 17px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  white-space: nowrap;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.wait { background: var(--warn-bg); color: var(--warn); }
.tag.err { background: var(--err-bg); color: var(--err); }
.tag.info { background: #eaf1fd; color: var(--blue); }

.userchip { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-lt), var(--blue-dk));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.userchip b { display: block; font-size: 13px; line-height: 1.3; }
.userchip span { display: block; font-size: 11px; color: var(--ink-3); }

.content { padding: 24px; flex: 1; max-width: 1440px; width: 100%; }

/* ---------- 通用卡片 ---------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .sub { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }

/* ---------- 统计 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.stat {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 18px 20px;
}
.stat .label { color: var(--ink-3); font-size: 12.5px; margin-bottom: 6px; }
.stat .value { font-size: 27px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; }
.stat .value.warn { color: var(--warn); }
.stat .value.ok { color: var(--ok); }
.stat .value.err { color: var(--err); }
.stat .value.blue { color: var(--blue); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; padding: 11px 14px;
  background: #f8fafd; color: var(--ink-2);
  font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: middle;
}
table.tbl tbody tr:hover { background: #fafcff; }
table.tbl tbody tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.plate {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 600; letter-spacing: .4px;
  background: #eef3fb; color: #17439a;
  padding: 2px 8px; border-radius: 5px; white-space: nowrap;
}

/* ---------- 状态 ---------- */
.st {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 3px 9px; border-radius: 6px; white-space: nowrap;
}
.st.pending { background: var(--warn-bg); color: var(--warn); }
.st.approved { background: var(--ok-bg); color: var(--ok); }
.st.rejected { background: #f0f2f6; color: var(--ink-3); }
.st.failed { background: var(--err-bg); color: var(--err); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: all .16s; text-decoration: none; white-space: nowrap;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-lt), var(--blue-dk));
  color: #fff; box-shadow: 0 3px 10px rgba(28, 98, 214, .28);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #cdd8e8; background: #fafcff; }
.btn-danger { background: var(--err-bg); color: var(--err); border-color: #f5d6d6; }
.btn-danger:hover { background: #fbe3e3; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 7px; color: var(--ink-2);
}
.field .hint { color: var(--ink-3); font-size: 12px; margin-top: 6px; }
.field .req { color: var(--err); margin-left: 2px; }

input[type=text], input[type=password], input[type=tel],
input[type=number], select, textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid #d9e1ec; border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--ink);
  background: #fff; transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue-lt);
  box-shadow: 0 0 0 3px rgba(61, 139, 253, .14);
}
input::placeholder, textarea::placeholder { color: #a9b6c9; }
textarea { resize: vertical; min-height: 78px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- 提示 ---------- */
.flash {
  padding: 11px 16px; border-radius: 9px; margin-bottom: 14px; font-size: 13.5px;
}
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }

.alert {
  padding: 12px 16px; border-radius: 9px; font-size: 13px;
  display: flex; gap: 10px; align-items: flex-start; line-height: 1.65;
}
.alert.info { background: #eef5ff; color: #1b4a99; border: 1px solid #d8e7ff; }
.alert.warn { background: var(--warn-bg); color: #8a5c00; border: 1px solid #ffe4b8; }
.alert.err { background: var(--err-bg); color: #a72f2f; border: 1px solid #f8d8d8; }
.alert .ai { flex: 0 0 auto; font-weight: 700; }

/* ---------- 方案展示 ---------- */
.plan-box {
  background: linear-gradient(135deg, #f4f8ff, #eef4fe);
  border: 1px solid #d9e7fb;
  border-radius: 10px;
  padding: 16px 18px;
}
.plan-title { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }
.plan-formula {
  font-size: 16px; font-weight: 600; color: #16439e;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.plan-chip {
  display: inline-flex; align-items: center;
  background: #fff; border: 1px solid #c9dcf9;
  border-radius: 7px; padding: 4px 10px;
  font-size: 13.5px; font-weight: 600; color: #16439e;
  box-shadow: 0 1px 3px rgba(22, 67, 158, .07);
}
.plan-meta {
  margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-2);
}
.plan-meta b { color: var(--ink); }
.plan-meta .waste-good { color: var(--ok); }
.plan-meta .waste-bad { color: var(--warn); }

/* ---------- 二维码区 ---------- */
.qr-panel { text-align: center; padding: 8px 0; }
.qr-frame {
  display: inline-block; padding: 14px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 6px 20px rgba(16, 34, 64, .08);
}
.qr-frame img { display: block; width: 232px; height: 232px; }
.qr-cap { margin-top: 12px; color: var(--ink-3); font-size: 12.5px; }
.qr-code-text {
  margin-top: 14px; display: inline-block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 15px; letter-spacing: 1.5px;
  background: #f4f7fc; border: 1px dashed #cfdcef;
  padding: 10px 18px; border-radius: 9px; color: #16439e;
  user-select: all; cursor: copy;
}

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; padding: 56px 20px; color: var(--ink-3);
}
.empty .ei { font-size: 40px; opacity: .35; margin-bottom: 12px; }
.empty p { margin: 0 0 16px; font-size: 14px; }

/* ---------- 移动端 ---------- */
.mobile-top { display: none; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { display: none; }
  .mobile-top {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 16px;
    background: linear-gradient(90deg, var(--navy-1), var(--navy-0));
    color: #fff; position: sticky; top: 0; z-index: 30;
  }
  .mobile-top .mt-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; }
  .mobile-top .mt-mark {
    width: 30px; height: 30px; border-radius: 9px;
    background: linear-gradient(135deg, var(--blue-lt), var(--blue-dk));
    display: flex; align-items: center; justify-content: center; font-size: 14px;
  }
  .mobile-nav {
    display: flex; overflow-x: auto; background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0 8px; gap: 2px;
  }
  .mobile-nav a {
    padding: 12px 14px; font-size: 13px; color: var(--ink-2);
    white-space: nowrap; text-decoration: none;
    border-bottom: 2px solid transparent;
  }
  .mobile-nav a.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
  .topbar { display: none; }
  .content { padding: 14px; }
  .row2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat .value { font-size: 22px; }
  .card-body { padding: 16px; }
}

/* 纯移动端页面（申请页/查询页） */
.page-mobile { max-width: 560px; margin: 0 auto; padding: 20px; }
@media (max-width: 640px) { .page-mobile { padding: 14px; } }

/* ---------- 工具类 ---------- */
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.mb8 { margin-bottom: 8px; }
.mb16 { margin-bottom: 16px; }
.mt16 { margin-top: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.center { text-align: center; }
.right { text-align: right; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
.copyable { user-select: all; }
