/* IT服务申请 / 月报系统 —— 浅色主题，移动优先 */
:root {
  --brand: #0b8f5a;
  --brand-2: #07c160;
  --brand-soft: #e8f7ef;
  --accent: #1677ff;
  --ink: #1f2329;
  --muted: #646a73;
  --faint: #8f959e;
  --line: #e5e6eb;
  --bg: #f4f6f8;
  --card: #fff;
  --danger: #d92d20;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(31, 35, 41, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
code { background: #f1f3f5; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------- 顶栏 ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 20px; height: 56px;
  display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.topnav a:hover { background: #f2f3f5; text-decoration: none; }
.topnav a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.userbox { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.badge-admin { background: #fff4e5; color: var(--warn); padding: 2px 7px; border-radius: 5px; font-size: 11px; }

/* ---------- 布局 ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; }
.wrap.wide { max-width: 1400px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.card-body { padding: 20px; }
.hint { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 7px; }
.label .req { color: var(--danger); margin-left: 3px; }
.label .tip { font-weight: 400; color: var(--faint); font-size: 12px; margin-left: 6px; }
input[type=text], input[type=date], input[type=datetime-local], input[type=number],
input[type=month], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,143,90,.1); }
textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
select { cursor: pointer; }
.inline-note { background: var(--brand-soft); color: #0a6f47; padding: 10px 12px; border-radius: 8px; font-size: 12px; margin-bottom: 18px; }
.identity-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.identity-row { display: flex; align-items: baseline; gap: 7px; }
.identity-row span { color: var(--muted); font-size: 12px; }
.identity-row b { font-size: 14px; color: #075c3b; }
.identity-tip { flex-basis: 100%; font-size: 11.5px; opacity: .85; }
.identity-warn { flex-basis: 100%; color: var(--warn); font-weight: 600; font-size: 12px; }

.priority-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.priority-item { position: relative; }
.priority-item input { position: absolute; opacity: 0; pointer-events: none; }
.priority-item label {
  display: block; border: 1px solid var(--line); border-radius: 9px; padding: 11px 10px;
  cursor: pointer; text-align: center; transition: .15s; background: #fff;
}
.priority-item label b { display: block; font-size: 14px; }
.priority-item label span { display: block; font-size: 11px; color: var(--faint); margin-top: 3px; }
.priority-item input:checked + label { border-color: var(--brand); background: var(--brand-soft); color: #0a6f47; box-shadow: 0 0 0 2px rgba(11,143,90,.1); }
.priority-item input:checked + label span { color: #0a6f47; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; font-size: 13px;
  white-space: nowrap; transition: .15s;
}
.btn:hover { border-color: #c9cdd4; background: #fafbfc; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #0a7e50; border-color: #0a7e50; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f3c9c5; }
.btn.danger:hover { background: #fef3f2; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn + .btn { margin-left: 0; }

.success-card { text-align: center; padding: 36px 24px; }
.success-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 28px; margin: 0 auto 14px; }
.success-card h2 { margin: 0 0 8px; font-size: 18px; }

/* ---------- 列表 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 11px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .t { font-size: 12px; color: var(--faint); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; background: #f1f3f5; color: var(--muted); }
.pill.done { background: var(--brand-soft); color: var(--brand); }
.pill.pending { background: #fff4e5; color: var(--warn); }

/* ---------- 工具条 / 表格（后台） ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar input, .toolbar select { width: auto; min-width: 120px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 14px; cursor: pointer; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabpane { display: none; } .tabpane.active { display: block; }

.table-scroll { overflow: auto; max-height: 70vh; }
table.grid { border-collapse: collapse; width: 100%; font-size: 12px; white-space: nowrap; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
table.grid th { background: #92D050; color: #1f2329; font-weight: 700; position: sticky; top: 0; z-index: 2; }
table.grid tr:nth-child(even) td { background: #fbfcfd; }
table.grid td.problem { white-space: normal; min-width: 260px; max-width: 420px; }
table.grid td.note { white-space: normal; min-width: 180px; max-width: 300px; }
table.grid .ops { display: flex; gap: 5px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20,24,30,.45); z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: min(720px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.icon-btn { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--faint); line-height: 1; }

/* ---------- 字典 ---------- */
.dict-group { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.dict-group h3 { margin: 0 0 10px; font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: #f2f4f7; border-radius: 6px; padding: 4px 8px; font-size: 12px; }
.tag.off { opacity: .45; text-decoration: line-through; }
.tag button { border: 0; background: none; cursor: pointer; color: var(--faint); padding: 0; font-size: 14px; line-height: 1; }

/* ---------- 月报 ---------- */
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.report-sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 40px 44px; max-width: 980px; margin: 0 auto; }
.report-sheet h1 { font-size: 20px; text-align: center; margin: 0 0 24px; color: #1f4e79; }
.report-lead { font-size: 16px; font-weight: 600; line-height: 1.9; margin: 0 0 28px; }
.report-section { margin-top: 30px; }
.report-section h2 { font-size: 16px; color: #1f4e79; border-left: 4px solid var(--brand); padding-left: 10px; margin: 0 0 12px; }
.report-line { font-size: 14px; line-height: 1.9; margin: 0 0 12px; }
.chart { width: 100%; height: 400px; }
.chart.small { height: 360px; }
.sugg { margin: 0; padding-left: 22px; }
.sugg li { margin-bottom: 12px; line-height: 1.85; }
.report-foot { margin-top: 34px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--faint); }
.edit-input { width: 100%; border: 1px dashed var(--brand); border-radius: 6px; padding: 8px 10px; font-size: 14px; line-height: 1.8; background: #fbfefc; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat b { display: block; font-size: 22px; color: var(--brand); line-height: 1.3; }
.stat span { font-size: 12px; color: var(--muted); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.mini-table th, .mini-table td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.mini-table th { background: #f5f7fa; }

/* ---------- 提示 / 错误 ---------- */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px); background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #0b8f5a; } .toast.err { background: #d92d20; }
.error-page { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.error-card { background: #fff; padding: 32px; border-radius: 14px; box-shadow: var(--shadow); max-width: 520px; text-align: center; }
.error-card h1 { font-size: 20px; margin: 0 0 10px; }
.error-card .btn { margin: 8px 4px 0; }
.loading { text-align: center; padding: 40px; color: var(--faint); }

@media (max-width: 720px) {
  .topbar-inner { padding: 0 12px; gap: 10px; height: 52px; }
  .brand span.brand-text { display: none; }
  .topnav a { padding: 6px 8px; font-size: 12px; }
  .userbox .uname, .userbox .badge-admin { display: none; }
  .wrap { padding: 14px 12px 36px; }
  .card-body { padding: 16px; }
  .priority-group { grid-template-columns: 1fr; }
  .priority-item label { display: flex; align-items: baseline; gap: 10px; text-align: left; padding: 10px 12px; }
  .priority-item label span { margin: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .report-sheet { padding: 22px 16px 30px; }
  .chart { height: 330px; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  body { background: #fff; }
  .topbar, .report-actions, .no-print { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .report-sheet { border: 0; box-shadow: none; padding: 0; }
  .report-section { page-break-inside: avoid; }
  .chart { height: 340px; }
}

/* ---------- 本地管理员登录 ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 28px 26px 22px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; font-size: 17px; }
.login-brand h1 { margin: 0; font-size: 18px; font-weight: 700; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.login-hint { background: #fff7e6; color: #93500a; border: 1px solid #f5dcae; padding: 10px 12px; border-radius: 8px; font-size: 12px; margin-bottom: 16px; }
.login-error { background: #fef3f2; color: var(--danger); border: 1px solid #f3c9c5; padding: 10px 12px; border-radius: 8px; font-size: 12.5px; margin-top: 14px; }
.login-foot { margin: 18px 0 0; text-align: center; color: var(--faint); font-size: 12px; line-height: 1.8; }
.login-warn { color: var(--warn); }

/* ---------- 系统设置 ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.settings-status { background: var(--brand-soft); color: #0a6f47; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 16px; }
.settings-status.warn { background: #fff7e6; color: #93500a; }
.settings-status .src { color: var(--muted); font-size: 11.5px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.settings-actions .btn { margin-left: 0; }
.settings-result { margin-top: 12px; font-size: 12.5px; }
.settings-note { font-size: 12px; color: var(--muted); line-height: 1.9; margin: 12px 0 0; }
