/* 野生动物收容管理 - 移动优先响应式样式 */
:root {
  --green: #2e7d32; --green-d: #1b5e20; --green-l: #e8f5e9;
  --blue: #1565c0; --blue-l: #e3f2fd;
  --amber: #b26a00; --amber-l: #fff8e1;
  --red: #c62828; --red-l: #fdecea;
  --gray: #5f6368; --gray-l: #f1f3f4; --line: #e0e0e0;
  --text: #212121; --muted: #757575;
  --bg: #f7f8f7;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); }
#app { min-height: 100vh; }
a { color: var(--green); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--text); }
:focus { outline: 2px solid rgba(46,125,50,.4); outline-offset: 1px; }

/* 通用 */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.muted { color: var(--muted); font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 10px; font-size: 15px; font-weight: 500; transition: opacity .15s; }
.btn:active { opacity: .75; }
.btn-primary { background: var(--green); color: #fff; }
.btn-outline { border: 1px solid var(--line); background: #fff; color: var(--text); }
.btn-danger { background: var(--red-l); color: var(--red); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }

/* 地图选点 */
.map-pick-btn { width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--green-l); font-size: 20px; display: flex; align-items: center; justify-content: center; }
.map-modal { max-height: 92vh; }
.map-kw { flex: 1; min-width: 0; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font-size: 15px; }
.map-result { padding: 8px 10px; border-bottom: 1px solid var(--gray-l); font-size: 14px; cursor: pointer; }
.map-result:active { background: var(--green-l); }
.map-tip { font-size: 12px; padding: 6px 2px 0; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.b-green { background: var(--green-l); color: var(--green-d); }
.b-teal { background: #e0f2f1; color: #00695c; }
.b-amber { background: var(--amber-l); color: var(--amber); }
.b-blue { background: var(--blue-l); color: var(--blue); }
.b-gray { background: var(--gray-l); color: var(--gray); }
.b-red { background: var(--red-l); 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%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; }
.field textarea { min-height: 76px; resize: vertical; }
.field .req::after { content: ' *'; color: var(--red); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.actions { display: flex; gap: 10px; margin-top: 4px; }

/* 大号选项按钮（渠道/地点/处置），选中高对比、文字居中 */
.opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opt-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 640px) { .opt-grid { grid-template-columns: repeat(4, 1fr); } }
.opt-btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; min-height: 48px; padding: 10px 4px; border-radius: 10px;
  font-size: 16px; font-weight: 400; line-height: 1.3;
  background: #fff; color: var(--text); border: 1.5px solid var(--line);
}
.opt-btn:active { transform: scale(.97); }
.opt-btn.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

/* 模态 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { font-size: 17px; }
.modal-x { width: 34px; height: 34px; font-size: 20px; color: var(--muted); border-radius: 50%; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(33,33,33,.92); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 100; max-width: 86vw; }
@media (min-width: 640px) { .modal-mask { align-items: center; } .modal { border-radius: 16px; } }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; background: linear-gradient(160deg, #e8f5e9 0%, #f7f8f7 55%); }
.login-box { max-width: 380px; width: 100%; margin: 0 auto; }
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo .ico { font-size: 44px; }
.login-logo h1 { font-size: 22px; color: var(--green-d); margin-top: 6px; }
.login-logo p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.login-card { background: #fff; border-radius: 16px; padding: 22px 18px; border: 1px solid var(--line); }

/* 框架布局 */
.shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 40; background: var(--green-d); color: #fff; display: flex; align-items: center; gap: 6px; padding: 10px 12px; }
.topbar .menu-btn { width: 42px; height: 42px; border-radius: 10px; color: #fff; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.topbar .title { font-size: 17px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .who { font-size: 12px; opacity: .9; padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.14); white-space: nowrap; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: 250px; background: #fff; z-index: 55; transform: translateX(-105%); transition: transform .22s; box-shadow: 2px 0 12px rgba(0,0,0,.12); }
.drawer.open { transform: translateX(0); }
.drawer .d-head { background: var(--green-d); color: #fff; padding: 18px 16px; }
.drawer .d-head h2 { font-size: 16px; }
.drawer .d-head p { font-size: 12px; opacity: .85; margin-top: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; font-size: 15px; color: var(--text); border-bottom: 1px solid var(--gray-l); }
.nav-item .ic { width: 22px; text-align: center; font-size: 17px; }
.nav-item.active { background: var(--green-l); color: var(--green-d); font-weight: 500; border-left: 3px solid var(--green); }
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; }
.page { padding: 14px 12px 40px; max-width: 1080px; margin: 0 auto; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 12px; }
.stat .v { font-size: 26px; font-weight: 600; color: var(--green-d); }
.stat .t { font-size: 12px; color: var(--muted); margin-top: 2px; }
.funnel { display: flex; gap: 4px; margin: 12px 0 6px; height: 10px; border-radius: 6px; overflow: hidden; }
.funnel i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.chart { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 12px; }
.chart .c-h { font-size: 14px; font-weight: 500; padding: 4px 6px 0; }

/* 列表 */
.list-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.list-head .search { flex: 1; min-width: 150px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 12px; font-size: 15px; }
.ico-btn { width: 44px; height: 44px; border-radius: 10px; background: var(--green-l); color: var(--green-d); font-size: 20px; flex: none; }
.filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.filters select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 10px; font-size: 14px; }
.tool-row { display: flex; gap: 8px; margin-bottom: 12px; }
.tool-row .btn { flex: 1; }
.order-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s; }
.order-card:active { border-color: var(--green); }
.oc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.oc-no { font-weight: 600; font-size: 15px; }
.oc-main { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 15px; flex-wrap: wrap; }
.oc-sp { font-size: 16px; font-weight: 500; }
.oc-sub { font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.oc-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 0; font-size: 14px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* 桌面表格 */
.table-lg { display: none; }
@media (min-width: 1024px) {
  .table-lg { display: block; }
  .table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
  table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
  .tbl th, .tbl td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--gray-l); white-space: nowrap; }
  .tbl th { background: var(--gray-l); font-weight: 500; color: var(--gray); font-size: 13px; }
  .tbl tbody tr { cursor: pointer; }
  .tbl tbody tr:hover { background: #fafcfa; }
}

/* 详情 */
.detail-head { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.dh-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dh-no { font-size: 18px; font-weight: 600; }
.dh-sp { font-size: 16px; font-weight: 500; color: var(--green-d); margin-top: 6px; }
.dh-sub { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; gap: 10px 16px; flex-wrap: wrap; }
.sec { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.sec-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--gray-l); font-weight: 500; font-size: 15px; }
.sec-h .step { color: var(--green-d); margin-right: 6px; }
.sec-b { padding: 14px; }
.kv { display: flex; padding: 6px 0; font-size: 14px; }
.kv .k { width: 88px; color: var(--muted); flex: none; }
.kv .v { flex: 1; word-break: break-all; }
.timeline { padding: 14px; }
.tl-item { position: relative; padding: 0 0 16px 18px; border-left: 2px solid var(--green-l); margin-left: 4px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: -6px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.tl-a { font-weight: 500; font-size: 14px; }
.tl-d { color: var(--muted); font-size: 12px; margin-top: 3px; }

.flow-steps { display: flex; overflow-x: auto; gap: 4px; padding: 8px 0; }
.fstep { flex: none; display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); padding: 6px 8px; border-radius: 8px; }
.fstep.done { color: var(--green-d); background: var(--green-l); }
.fstep.cur { color: #fff; background: var(--green); font-weight: 500; }
.fstep .arr { opacity: .5; }

/* 桌面布局 */
@media (min-width: 1024px) {
  .topbar { display: none; }
  .shell { display: flex; }
  .side { width: 232px; flex: none; background: #fff; border-right: 1px solid var(--line); min-height: 100vh; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .side .brand { padding: 22px 18px; border-bottom: 1px solid var(--line); }
  .side .brand h1 { font-size: 18px; color: var(--green-d); }
  .side .brand p { font-size: 12px; color: var(--muted); margin-top: 4px; }
  .side .nav-item { border-bottom: none; border-radius: 8px; margin: 4px 8px; padding: 12px 12px; }
  .side .nav-item.active { border-left: none; }
  .main { flex: 1; min-width: 0; }
  .page { padding: 22px 24px 60px; }
  .drawer { display: none; }
}
.side-user { padding: 12px 16px; font-size: 13px; color: var(--gray); border-top: 1px solid var(--line); margin-top: auto; }
.side .inner { display: flex; flex-direction: column; height: 100%; }
