/* 收费日报数据看板 · 浅色主题 + 响应式（≤768px 移动布局） */
:root {
  --blue: #0b5fa5; --blue-l: #e8f1f9;
  --orange: #f59e0b; --green: #16a34a; --red: #dc2626;
  --bg: #f4f6f9; --card: #ffffff; --line: #e5e7eb;
  --text: #1f2937; --text2: #6b7280; --amber: #b45309;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC","Microsoft YaHei",system-ui,sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg,#0b5fa5,#0d3b66); padding: 16px; }
.login-card { background: #fff; border-radius: 14px; padding: 32px 28px; width: 100%; max-width: 360px; box-shadow: 0 12px 40px rgba(0,0,0,.25); text-align: center; }
.login-logo { font-size: 40px; }
.login-card h1 { font-size: 20px; margin: 8px 0 4px; }
.login-sub { color: var(--text2); font-size: 12px; margin-bottom: 20px; }
.login-card input { width: 100%; padding: 11px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.login-msg { color: var(--red); font-size: 12px; min-height: 16px; margin-top: 8px; }
.login-hint { color: var(--text2); font-size: 11px; margin-top: 12px; line-height: 1.6; }

/* ---------- 布局 ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 16px; height: 52px; gap: 16px; position: sticky; top: 0; z-index: 50; }
.brand { font-weight: 700; color: var(--blue); white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--text2); text-decoration: none; white-space: nowrap; }
.nav a.on { background: var(--blue-l); color: var(--blue); font-weight: 600; }
.userbox { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.userbox span { color: var(--text2); font-size: 13px; }
.view { padding: 16px; max-width: 1200px; width: 100%; margin: 0 auto; flex: 1; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin-bottom: 12px; }
.card h3 { font-size: 14px; margin: 14px 0 8px; }
.field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.field label { color: var(--text2); font-size: 13px; }
input[type=date], select, input[type=number], input[type=text] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; }
.pill { background: var(--blue-l); color: var(--blue); padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.btn { padding: 8px 16px; border: none; border-radius: 8px; background: var(--blue); color: #fff; font-size: 14px; cursor: pointer; }
.btn:hover { opacity: .9; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.green { background: var(--green); }
.btn.amber { background: #d97706; }
.btn.red { background: var(--red); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text2); margin: 8px 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { background: #f8fafc; color: var(--text2); font-weight: 600; }
tr.sum td { background: var(--blue-l); font-weight: 700; }
tr.subtotal td { background: #fff7e0; font-weight: 600; color: #92400e; border-top: 1px dashed #e2c074; }
td.miss { color: var(--red); }
.table-scroll { overflow-x: auto; }

.note { background: #f0f7ff; border-left: 3px solid var(--blue); padding: 10px 12px; border-radius: 6px; font-size: 13px; line-height: 1.7; margin-bottom: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.kpi .k { color: var(--text2); font-size: 12px; }
.kpi .v { font-size: 20px; font-weight: 700; color: var(--blue); margin-top: 4px; }
.seg { display: inline-flex; background: #eef2f7; border-radius: 8px; padding: 2px; }
.seg button { border: none; background: transparent; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text2); }
.seg button.on { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* 图表容器 */
.chart-box { position: relative; width: 100%; min-height: 260px; }
.chart-box svg { width: 100%; height: auto; }
.chart-tip { position: absolute; pointer-events: none; background: #111827; color: #fff; padding: 8px 12px;
  border-radius: 8px; font-size: 12px; line-height: 1.8; opacity: 0; transition: opacity .12s; z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); min-width: 130px; }

/* 上报表单 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.form-grid .fg label { display: block; color: var(--text2); font-size: 12px; margin-bottom: 4px; }
.form-grid .fg input, .form-grid .fg select { width: 100%; }

/* 移动端：底部 Tab 导航 */
@media (max-width: 768px) {
  .topbar { height: 50px; padding: 0 12px; gap: 8px; }
  .brand { font-size: 15px; flex: 1; }
  .userbox span { display: none; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line);
    display: flex; justify-content: space-around; padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
    z-index: 60; box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
  .nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px;
    padding: 2px 4px; border-radius: 8px; color: var(--text2); }
  .nav a::before { content: attr(data-icon); font-size: 19px; line-height: 1; }
  .nav a.on { background: var(--blue-l); color: var(--blue); }
  .view { padding: 10px 10px 74px; }
  .card { padding: 12px; }
  table { font-size: 12px; }
  th, td { padding: 6px 4px; }
  .kpi .v { font-size: 16px; }
  .field { gap: 6px; }
  input[type=date], select { font-size: 13px; }
}

/* toast / modal */
.toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 200; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 480px; max-height: 86vh; overflow: auto; }
.modal h3 { margin-bottom: 12px; }
.inp { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; width: 100%; box-sizing: border-box; }
.inp:focus { outline: 2px solid var(--blue-l); }
.ok { color: #15803d; font-weight: 600; }
.bad { color: var(--red); font-weight: 600; }
