/* ============================================================================
   智行工作室综合管理平台 · 公共样式
   品牌色取自实验室旗帜：标志蓝 #2EC4E6 / 深蓝 #102A43 #143355
   强调橙 #E86C2B（机械）/ 强调青 #0E9488（电控）

   设计约定：
     --brand     用于填充、描边、发光（亮青，不放白字）
     --brand-ink 用于文字（压暗的青，白底可读）
     --navy      深色面（按钮、页头、登录页），承载白字
   ============================================================================ */

:root {
  /* 品牌 */
  --brand: #2EC4E6;
  --brand-ink: #0A7B92;
  --brand-deep: #143355;
  --navy: #102A43;
  --navy-2: #1B3A5C;
  --accent-orange: #E86C2B;
  --accent-teal: #0E9488;

  /* 品牌浅底 */
  --brand-light: #E7F8FC;
  --brand-mist: #F2FBFD;

  /* 语义 */
  --ok: #12805C;
  --ok-light: #E6F7EF;
  --warn: #B45309;
  --warn-light: #FEF4E6;
  --danger: #C0392B;
  --danger-light: #FDECEA;

  /* 中性 */
  --ink: #0F2338;
  --ink-2: #4A5D73;
  --ink-3: #8A9AAD;
  --line: #E2E9F1;
  --line-soft: #EFF3F8;
  --bg: #F5F8FB;
  --card: #FFFFFF;

  /* 形状与阴影 */
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(16, 42, 67, .04), 0 8px 24px -8px rgba(16, 42, 67, .10);
  --shadow-sm: 0 1px 2px rgba(16, 42, 67, .05);
  --shadow-lg: 0 18px 48px -12px rgba(16, 42, 67, .22);
  --ring: 0 0 0 3px rgba(46, 196, 230, .28);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

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

::selection { background: rgba(46, 196, 230, .28); }

/* 细滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #CBD8E4; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #AFC0D2; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ 品牌标识 ------------------------------ */
.brand-mark {
  width: 36px; height: 36px;
  flex: 0 0 auto;
  display: block;
}
.brand-mark.lg { width: 60px; height: 60px; }
.brand-mark.sm { width: 26px; height: 26px; }

.brand-lock { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-lock .txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-lock .t1 {
  font-size: 17px; font-weight: 800; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-lock .t2 {
  font-size: 12.5px; font-weight: 600; letter-spacing: 2.4px;
  text-transform: uppercase; opacity: .68;
}

/* ------------------------------- 按钮 ------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s, border-color .16s, box-shadow .16s, transform .06s;
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: .1px;
}
.btn:hover { border-color: #C6D5E4; background: #FAFCFE; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16,42,67,.18), 0 6px 16px -6px rgba(16,42,67,.42);
}
.btn-primary:hover {
  background: #0B1E31;
  border-color: #0B1E31;
  box-shadow: 0 2px 4px rgba(16,42,67,.2), 0 10px 22px -8px rgba(46,196,230,.55);
}
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #A5301F; border-color: #A5301F; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0D6A4C; border-color: #0D6A4C; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-soft); box-shadow: none; }
.btn-sm { padding: 5px 11px; font-size: 13.5px; border-radius: 9px; }
.btn-lg {
  padding: 15px 26px; font-size: 18px; border-radius: 13px; width: 100%;
  font-weight: 700; letter-spacing: .5px;
}
.btn-block { width: 100%; }

/* ------------------------------- 表单 ------------------------------- */
.field { margin-bottom: 15px; }
.field > label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 7px;
  letter-spacing: .3px;
}
.field .hint { font-size: 13px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }

input[type=text], input[type=password], input[type=number], input[type=tel],
input[type=search], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .16s, box-shadow .16s;
  outline: none;
}
input::placeholder, textarea::placeholder { color: #A9B7C6; }
input:hover, select:hover, textarea:hover { border-color: #CBD8E4; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--ring);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.7; }
input[type=range] { width: 100%; accent-color: var(--brand-ink); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%238A9AAD' d='M1 1.5 6 6.5l5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
.row-wide { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.grow { flex: 1 1 auto; }

/* ------------------------------- 卡片 ------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  color: var(--ink);
}
.card-title > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }

.toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

/* ------------------------------- 统计 ------------------------------- */
.stats {
  display: grid;
  gap: 13px;
  margin-bottom: 16px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.stat {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 17px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--line);
}
.stat .k { font-size: 13.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .3px; }
.stat .v {
  font-size: 28px; font-weight: 800; margin-top: 5px; letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
.stat .v small { font-size: 13.5px; font-weight: 600; margin-left: 4px; color: var(--ink-3); }
.stat.brand::before { background: var(--brand); }
.stat.brand .v { color: var(--brand-ink); }
.stat.ok::before { background: var(--ok); }
.stat.ok .v { color: var(--ok); }
.stat.warn::before { background: var(--warn); }
.stat.warn .v { color: var(--warn); }
.stat.danger::before { background: var(--danger); }
.stat.danger .v { color: var(--danger); }

/* ------------------------------- 标签 ------------------------------- */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.75;
  background: #F0F4F9;
  color: var(--ink-2);
  white-space: nowrap;
  letter-spacing: .2px;
}
.tag-ok { background: var(--ok-light); color: var(--ok); }
.tag-warn { background: var(--warn-light); color: var(--warn); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-brand { background: var(--brand-light); color: var(--brand-ink); }

/* ------------------------------ 提示条 ------------------------------ */
.toast-wrap {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 460px);
}
.toast {
  background: var(--navy);
  color: #fff;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s cubic-bezier(.2,.9,.3,1);
  max-width: 100%;
  text-align: center;
  word-break: break-word;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
.toast.warn { background: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }

/* ------------------------------ 提示块 ------------------------------ */
.notice {
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14.5px;
  line-height: 1.75;
  background: #F0F4F9;
  color: var(--ink-2);
  margin-bottom: 12px;
  border-left: 3px solid var(--line);
}
.notice.info, .notice-brand { background: var(--brand-light); color: var(--brand-deep); border-left-color: var(--brand); }
.notice.ok { background: var(--ok-light); color: #0B5C43; border-left-color: var(--ok); }
.notice.warn { background: var(--warn-light); color: #8A3F06; border-left-color: var(--warn); }
.notice.err, .notice-danger { background: var(--danger-light); color: #8E2417; border-left-color: var(--danger); }

.empty {
  text-align: center;
  color: var(--ink-3);
  padding: 38px 16px;
  font-size: 15px;
  line-height: 1.9;
}
.spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.32);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------- 弹窗 ------------------------------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(10, 24, 39, .48);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal {
  background: #fff;
  border-radius: 18px;
  width: min(680px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s cubic-bezier(.2,.9,.3,1);
  overflow: hidden;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #FBFDFF, #fff);
}
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: #FCFDFF;
}
.x-close {
  border: 0; background: none; font-size: 23px; line-height: 1;
  color: var(--ink-3); cursor: pointer; padding: 2px 6px; border-radius: 8px;
  transition: .15s;
}
.x-close:hover { color: var(--ink); background: var(--line-soft); }

/* ------------------------------- 表格 ------------------------------- */
.tbl-wrap {
  overflow: auto;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fff;
}
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; background: #fff; }
table.tbl th {
  background: #F7FAFD;
  text-align: left;
  padding: 11px 13px;
  font-weight: 700;
  color: var(--ink-2);
  font-size: 13.5px;
  letter-spacing: .3px;
  white-space: nowrap;
  position: sticky; top: 0;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
table.tbl td { padding: 10px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover td { background: #F7FCFF; }

/* 姓名不许折行（姓名都用 <b> 包着），否则列一窄就变成「刘睿 / 航」 */
table.tbl td b { white-space: nowrap; }

/* 按日期分组的分隔行 */
table.tbl tr.day-sep td {
  background: linear-gradient(180deg, #F4FAFD, #ECF6FA);
  padding: 9px 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.tbl tr.day-sep .day-t {
  font-weight: 800; color: var(--brand-deep); letter-spacing: .3px; font-size: 14px;
}
table.tbl tr.day-sep .day-w {
  font-weight: 700; color: var(--brand-ink); margin-left: 7px; font-size: 13px;
}
table.tbl tr.day-sep .day-n {
  float: right; font-size: 12.5px; font-weight: 800; color: #fff;
  background: var(--brand-ink); border-radius: 999px; padding: 1px 10px;
  line-height: 1.7;
}
table.tbl tr.day-sep + tr td { border-top: 0; }

.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; letter-spacing: -.2px; }
.nowrap { white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }
code { background: var(--line-soft); padding: 1px 6px; border-radius: 6px; font-size: 13.5px; }

/* ------------------------------ 选项卡 ------------------------------ */
.detail-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.detail-tabs button {
  border: 0; background: none; padding: 10px 16px; font-size: 15px; cursor: pointer;
  color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: inherit; font-weight: 600; border-radius: 8px 8px 0 0;
  transition: background .15s, color .15s;
}
.detail-tabs button:hover { background: var(--line-soft); }
.detail-tabs button.on { color: var(--brand-ink); border-bottom-color: var(--brand); }

/* --------------------------- 认领名字的选项 --------------------------- */
.claim-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1.5px solid var(--line); border-radius: 13px; padding: 14px 16px;
  margin-bottom: 9px; cursor: pointer; transition: .15s; background: #fff;
}
.claim-item:hover { border-color: #BFD8E6; background: #FAFDFF; }
.claim-item.on { border-color: var(--brand); background: var(--brand-light); box-shadow: var(--ring); }
.claim-item.dis { opacity: .5; cursor: not-allowed; background: #F7F8FB; }
.claim-item.dis:hover { border-color: var(--line); }

/* --------------------------- 通用小工具 --------------------------- */
.foot-tip { font-size: 13px; color: var(--ink-3); text-align: center; margin-top: 12px; line-height: 1.7; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }

/* --------------------------- 视图切换动画 --------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card, .stat { animation: fadeUp .26s ease both; }
.card:nth-child(2) { animation-delay: .03s; }
.card:nth-child(3) { animation-delay: .06s; }
.card:nth-child(4) { animation-delay: .09s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
