/* ===== 永亿数字化平台 · 设计系统 V0.1 ===== */
:root {
  --brand: #0B5FA5;
  --brand-2: #1E7FB8;
  --brand-light: #4FB3E8;
  --ink: #1c2733;
  --muted: #7a8794;
  --bg: #eef3f8;
  --card: #ffffff;
  --line: #e3eaf2;
  --ok: #12805c;
  --ok-bg: #e6f6ef;
  --warn: #b45309;
  --warn-bg: #fef4e4;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(11, 95, 165, .07), 0 1px 3px rgba(16, 42, 67, .06);
  --shadow-lg: 0 10px 30px rgba(11, 95, 165, .16);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }

/* ===== 顶栏 ===== */
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 8px 14px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .logo { height: 34px; display: block; }
.topbar .spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink);
  white-space: nowrap; min-width: 0; flex: 0 1 auto;
}
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex: 0 0 auto;
}
.user-chip .who { min-width: 0; overflow: hidden; }
.user-chip .who .name, .user-chip .who .role {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-chip .role { color: var(--muted); font-size: 12px; }
.btn-exit {
  font-size: 12px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; background: #fff;
  white-space: nowrap; flex: 0 0 auto;
}
.btn-exit:hover { color: var(--danger); border-color: var(--danger); }
@media (max-width: 640px) {
  .topbar { padding: 6px 10px; gap: 8px; }
  .topbar .logo { max-width: 38vw; height: auto; flex: 0 1 auto; }
  .user-chip { font-size: 13px; gap: 6px; }
  .user-chip .avatar { width: 26px; height: 26px; font-size: 12px; }
  .user-chip .who { max-width: 26vw; }
  .user-chip .who .role { font-size: 11px; }
  .btn-exit { padding: 4px 10px; }
}

/* ===== 导航 ===== */
.nav {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 60%, var(--brand-light) 100%);
  display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 0 8px; box-shadow: var(--shadow);
}
.nav a {
  color: rgba(255,255,255,.85); padding: 11px 16px; font-size: 14px;
  white-space: nowrap; border-bottom: 3px solid transparent;
}
.nav a:hover, .nav a.active { color: #fff; border-bottom-color: #fff; font-weight: 600; }

/* ===== 主体 ===== */
main { width: 100%; max-width: 920px; margin: 0 auto; padding: 18px 14px 30px; flex: 1; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.card h2 { font-size: 16px; color: var(--ink); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
}
.muted { color: var(--muted); font-size: 13px; }

/* ===== 页脚 ===== */
footer {
  text-align: center; color: var(--muted); font-size: 12px; padding: 18px 10px 26px;
}

/* ===== 表单 ===== */
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; color: #33414f; }
input[type=text], input[type=password], input[type=date], input[type=tel], select, textarea {
  width: 100%; padding: 13px 14px; border: 1.5px solid #d4dfe9; border-radius: 10px;
  font-size: 16px; background: #fbfdff; transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(30,127,184,.15); background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 150px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; border: none; padding: 13px 26px; border-radius: 10px;
  font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 12px rgba(11,95,165,.28); transition: transform .1s, box-shadow .15s;
}
.btn:hover { box-shadow: 0 6px 16px rgba(11,95,165,.36); }
.btn:active { transform: scale(.98); }
.btn-block { display: flex; width: 100%; margin-top: 16px; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; box-shadow: none; }
.btn-ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand-2); box-shadow: none; }
.btn-gray { background: #8a97a5; box-shadow: none; }
.btn-danger-ghost { background: #fff; color: var(--danger); border: 1.5px solid #e5b3ad; box-shadow: none; }

/* ===== 提示条 ===== */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #b9e6d2; }
.flash.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f2c5bf; }

/* ===== 登录页 ===== */
.login-body {
  background: linear-gradient(160deg, #083d6e 0%, var(--brand) 45%, var(--brand-2) 80%, var(--brand-light) 100%);
  display: flex; flex-direction: column; min-height: 100vh;
}
.login-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 30px 18px;
}
.login-brand {
  background: #fff; border-radius: 14px; padding: 14px 22px;
  box-shadow: var(--shadow-lg); margin-bottom: 26px; max-width: 420px; width: 100%;
}
.login-brand img { width: 100%; display: block; }
.login-card {
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 28px 24px; max-width: 420px; width: 100%;
}
.login-card h2 { text-align: center; font-size: 19px; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.login-foot { color: rgba(255,255,255,.85); font-size: 12px; text-align: center; padding-bottom: 22px; }

/* ===== 工作台 ===== */
.hero {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 70%, var(--brand-light) 100%);
  border-radius: var(--radius); color: #fff; padding: 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.hero .hello { font-size: 19px; font-weight: 700; }
.hero .meta { font-size: 13px; opacity: .88; margin-top: 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 14px; text-align: center;
}
.stat .num { font-size: 32px; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat .num.warn { color: var(--warn); }
.stat .num.ok { color: var(--ok); }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--warn-bg); color: var(--warn); border: 1px solid #f3ddba;
  border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 500;
}
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: #b9e6d2; }
.exc-item {
  border-left: 4px solid var(--danger); background: #fff; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.exc-item .t { font-weight: 600; font-size: 14px; }
.exc-item .c { font-size: 13px; color: #555; margin-top: 4px; }
.exc-item .m { font-size: 12px; color: var(--muted); margin-top: 6px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.quick {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 14px; text-align: center; color: var(--ink); font-weight: 600; font-size: 15px;
  border: 1px solid var(--line); transition: transform .1s, box-shadow .15s;
  display: block;
}
.quick:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.quick .ico { font-size: 26px; display: block; margin-bottom: 8px; }
.status-banner {
  border-radius: var(--radius); padding: 22px 18px; text-align: center; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.status-banner.done { background: var(--ok-bg); border: 1px solid #b9e6d2; }
.status-banner.todo { background: var(--warn-bg); border: 1px solid #f3ddba; }
.status-banner .big { font-size: 20px; font-weight: 700; }
.status-banner.done .big { color: var(--ok); }
.status-banner.todo .big { color: var(--warn); }

/* ===== 表格（桌面斑马纹 / 手机卡片化） ===== */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
thead th {
  background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff;
  padding: 11px 12px; text-align: left; font-size: 13px; white-space: nowrap; font-weight: 600;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:nth-child(even) { background: #f6fafd; }
tbody tr:hover { background: #eaf4fb; }
tbody tr:last-child td { border-bottom: none; }

@media (max-width: 640px) {
  table.responsive, table.responsive thead, table.responsive tbody,
  table.responsive tr, table.responsive td { display: block; }
  table.responsive thead { display: none; }
  table.responsive tbody tr {
    margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow); overflow: hidden; background: #fff;
  }
  table.responsive tbody td {
    display: flex; gap: 10px; border-bottom: 1px solid #f0f4f8; padding: 10px 14px;
  }
  table.responsive tbody td::before {
    content: attr(data-label); flex: 0 0 76px; color: var(--muted);
    font-size: 13px; font-weight: 600;
  }
  table.responsive tbody td > div { flex: 1; min-width: 0; }
  .table-wrap { border: none; overflow-x: visible; }
}

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag.admin { background: #f3e8ff; color: #6b21a8; }
.tag.supervisor { background: #e0f2fe; color: #075985; }
.tag.specialist { background: var(--ok-bg); color: var(--ok); }
.tag.off { background: #eef1f4; color: #9aa5b1; }
.tag.exc { background: var(--danger-bg); color: var(--danger); }

/* ===== 账号管理操作区 ===== */
.ops { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ops input { width: 130px !important; padding: 7px 10px !important; font-size: 13px !important; }
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end;
}
.filter-bar > div { flex: 1; min-width: 140px; }
.filter-bar label { margin-top: 0; }

/* ===== 异常上报卡 ===== */
.exc-box {
  border: 1.5px dashed #e8b04b; border-radius: 12px; padding: 14px;
  margin-top: 10px; background: #fffaf0;
}
.checkboxes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.checkboxes label {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  background: #fff; border: 1.5px solid #d4dfe9; border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.checkboxes input { width: auto; }
.switch-line { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; margin-top: 14px; cursor: pointer; }
.switch-line input { width: 18px; height: 18px; }

/* ===== 第一期新增组件 ===== */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pills label {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  background: #fbfdff; border: 1.5px solid #d4dfe9; border-radius: 10px;
  padding: 10px 14px; font-size: 15px; font-weight: 500; cursor: pointer;
}
.pills label:has(input:checked) { border-color: var(--brand-2); background: #eaf4fb; color: var(--brand); font-weight: 600; }
.pills input { width: 18px; height: 18px; accent-color: var(--brand); }

.mini-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0 10px; }
.mini-table { font-size: 13px; }
.mini-table th { background: #eaf2f9; color: #33506b; padding: 8px; font-size: 12px; white-space: nowrap; }
.mini-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.mini-table input[type=text], .mini-table select { padding: 7px 8px; font-size: 14px; border-radius: 6px; min-width: 90px; }
.mini-table input[type=checkbox] { width: 20px; height: 20px; }
.row-del { background: none; border: none; color: var(--danger); font-size: 14px; cursor: pointer; padding: 4px; }

.kv { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f4f8; }
.kv:last-child { border-bottom: none; }
.kv .k { flex: 0 0 118px; color: var(--muted); font-size: 13px; font-weight: 600; }
.kv .val { flex: 1; min-width: 0; font-size: 14px; word-break: break-all; }

.static-hint {
  background: #f2f8fd; border: 1px solid #d8e8f5; border-radius: 10px;
  padding: 12px 14px; font-size: 13px; color: #33506b; margin-top: 6px;
}

.timeline { padding-left: 6px; }
.tl-item { display: flex; gap: 12px; padding: 8px 0; }
.tl-dot {
  flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px;
  background: var(--brand-2); box-shadow: 0 0 0 3px #dceefb;
}
.tl-body { flex: 1; font-size: 14px; border-bottom: 1px dashed #e8eef4; padding-bottom: 8px; }
.tl-item:last-child .tl-body { border-bottom: none; }

.fives-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.fives-item {
  display: flex; align-items: center; gap: 10px; margin: 0;
  background: #fbfdff; border: 1.5px solid #d4dfe9; border-radius: 10px;
  padding: 12px 14px; font-size: 15px; font-weight: 500; cursor: pointer;
}
.fives-item.safety { border-color: #f0c9c4; background: #fff8f7; }
.fives-item:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }
.fives-item input { width: 20px; height: 20px; accent-color: var(--ok); flex: 0 0 auto; }
