/* ============ 设计基础：企业微信淡蓝 + Apple 质感 ============ */
:root {
  --bg: #edf3fb;
  --bg-soft: #e5edf8;
  --card: rgba(255, 255, 255, 0.74);
  --card-solid: #ffffff;
  --ink: #1c2536;
  --ink-2: #4c586c;
  --ink-3: #8b97ab;
  --line: rgba(30, 64, 122, 0.10);
  --line-soft: rgba(30, 64, 122, 0.06);
  --primary: #2f6fed;
  --primary-deep: #1d55c8;
  --primary-soft: #e7f0ff;
  --green: #249a63;
  --green-soft: #e3f6ec;
  --red: #e5484d;
  --red-soft: #fdebec;
  --amber: #dd8b1f;
  --amber-soft: #fdf3e2;
  --purple: #7358d1;
  --purple-soft: #efebfc;
  --cyan: #1890c4;
  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(23, 43, 77, 0.04), 0 8px 24px rgba(23, 43, 77, 0.06);
  --shadow-float: 0 12px 40px rgba(23, 43, 77, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 100%/1.55 var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 85% -8%, rgba(83, 141, 255, 0.13), transparent 60%),
    radial-gradient(900px 460px at -10% 12%, rgba(70, 190, 214, 0.09), transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
button { font: inherit; }
svg { display: inline-block; vertical-align: middle; }

/* 入场动效：纯 CSS，不依赖 JS，任何情况下都不会停留在不可见状态 */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.animate-in { animation: rise-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* ---------- 顶栏：半透明悬浮层 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #4b8bff, #2f6fed 60%, #2457c8);
  box-shadow: 0 4px 12px rgba(47, 111, 237, 0.35);
}
.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.nav-desktop { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-link {
  position: relative;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}
.nav-link:hover { color: var(--ink); background: rgba(47, 111, 237, 0.07); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.nav-group { position: relative; }
.nav-group-btn { display: inline-flex; align-items: center; gap: 5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 160ms ease;
  color: var(--ink);
}
.user-chip:hover { background: rgba(47, 111, 237, 0.08); }
.user-name { font-size: 14px; font-weight: 500; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, #63a2ff, #3d7cf2);
  flex: none;
}
.avatar-lg { width: 42px; height: 42px; font-size: 17px; }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 2px;
  margin-left: 2px;
}

/* ---------- 下拉菜单 ---------- */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 172px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-float);
  border: 1px solid rgba(255, 255, 255, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 180ms;
  z-index: 60;
}
.dropdown.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.dropdown-right { left: auto; right: 0; }
.dropdown a, .dropdown-label {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink);
  font-size: 14px;
}
.dropdown a:hover { background: var(--primary-soft); color: var(--primary); }
.dropdown-label { color: var(--ink-3); font-size: 12px; letter-spacing: 0.02em; }

/* ---------- 汉堡与侧滑菜单 ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px; height: 38px;
  padding: 0 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.hamburger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 26, 48, 0.34);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms;
  z-index: 80;
}
.backdrop.show { opacity: 1; visibility: visible; }
.sheet {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(320px, 82vw);
  background: rgba(250, 252, 255, 0.94);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  box-shadow: -24px 0 60px rgba(23, 43, 77, 0.18);
  transform: translateX(102%);
  z-index: 90;
  padding: 22px 16px;
  overflow-y: auto;
  display: none;
}
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sheet-name { font-weight: 700; font-size: 16px; }
.sheet-role { color: var(--ink-3); font-size: 13px; }
.sheet-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 12px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
.sheet-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.sheet-section {
  padding: 18px 12px 6px;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* ---------- 页面容器 ---------- */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 40px;
}
.page-narrow { max-width: 760px; }
.page-head { margin-bottom: 20px; }
.page-title {
  margin: 0 0 4px;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.page-sub { color: var(--ink-2); font-size: 14px; margin: 0; }

/* ---------- 玻璃卡片 ---------- */
.card {
  background: var(--card);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
}
.card + .card { margin-top: 18px; }
.card-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-title small { font-weight: 500; color: var(--ink-3); font-size: 13px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 统计卡片 ---------- */
.stat {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--card);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow-card);
}
.stat-label { color: var(--ink-2); font-size: 13px; letter-spacing: 0.02em; }
.stat-value {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-value small { font-size: 14px; font-weight: 600; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.stat::after {
  content: "";
  position: absolute;
  right: -34px; top: -34px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 145, 255, 0.18), transparent 70%);
}
.stat.accent-blue .stat-value { color: var(--primary); }
.stat.accent-green .stat-value { color: var(--green); }
.stat.accent-amber .stat-value { color: var(--amber); }
.stat.accent-red .stat-value { color: var(--red); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 100ms ease-out, background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #4b8bff, var(--primary));
  box-shadow: 0 6px 16px rgba(47, 111, 237, 0.32);
}
.btn-primary:hover { background: linear-gradient(135deg, #4b8bff, var(--primary-deep)); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #dbe9ff; }
.btn-ghost { background: rgba(255,255,255,0.55); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #fff; }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(36, 154, 99, 0.28); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(229, 72, 77, 0.28); }
.btn-danger-soft { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.14);
}
.textarea { min-height: 96px; resize: vertical; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%235d6a80' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.hint { margin-top: 6px; color: var(--ink-3); font-size: 12.5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 分段选择（像 iOS segmented control） */
.segmented {
  display: flex;
  background: rgba(31, 64, 122, 0.07);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  width: fit-content;
}
.segmented label {
  position: relative;
  cursor: pointer;
}
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: inline-block;
  padding: 7px 15px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.segmented input:checked + span {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(23, 43, 77, 0.14);
}

/* ---------- 列表与状态 ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line-soft);
  box-shadow: 0 1px 3px rgba(23, 43, 77, 0.03);
  transition: transform 120ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
a.list-item { color: var(--ink); }
a.list-item:hover { border-color: rgba(47, 111, 237, 0.28); box-shadow: 0 6px 18px rgba(23, 43, 77, 0.07); transform: translateY(-1px); }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.list-side { text-align: right; flex: none; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { background: var(--amber-soft); color: var(--amber); }
.status-approved { background: var(--green-soft); color: var(--green); }
.status-finished { background: var(--cyan-soft, #e3f3fa); color: var(--cyan); }
.status-rejected { background: var(--red-soft); color: var(--red); }
.status-cancelled { background: rgba(90, 101, 119, 0.1); color: var(--ink-2); }
.status-finishing { background: var(--purple-soft); color: var(--purple); }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}
.empty-icon { font-size: 34px; margin-bottom: 8px; opacity: 0.7; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}
.tl-item { position: relative; padding: 8px 0 16px; }
.tl-dot {
  position: absolute;
  left: -24px; top: 12px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--ink-3);
  box-shadow: 0 0 0 1px var(--line);
}
.tl-item.done .tl-dot { background: var(--green); }
.tl-item.now .tl-dot { background: var(--primary); box-shadow: 0 0 0 4px rgba(47,111,237,0.18); }
.tl-item.rejected .tl-dot { background: var(--red); }
.tl-name { font-weight: 600; font-size: 14px; }
.tl-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: 13px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-float);
  border: 1px solid rgba(255,255,255,0.6);
  opacity: 0;
  transform: translateY(-8px);
}
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.toast-success .toast-dot { background: var(--green); }
.toast-danger .toast-dot { background: var(--red); }
.toast-warning .toast-dot { background: var(--amber); }
.toast-info .toast-dot { background: var(--primary); }

/* ---------- 表格（管理端） ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  min-width: 640px;
}
table.data th {
  text-align: left;
  padding: 9px 12px;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: rgba(47, 111, 237, 0.04); }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 26, 48, 0.42);
  display: none;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.show { display: grid; }
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: rgba(253, 254, 255, 0.96);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-radius: 20px;
  box-shadow: var(--shadow-float);
  padding: 24px;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
}
.modal-backdrop.show .modal { opacity: 1; transform: none; }
.modal-title { margin: 0 0 16px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- 页脚 ---------- */
.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px 30px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

@media (prefers-reduced-transparency: reduce) {
  .card, .stat, .topbar, .dropdown, .sheet, .modal { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .animate-in { animation: none; }
}

@media (prefers-contrast: more) {
  .card, .stat, .list-item { background: #fff; border-color: rgba(30,64,122,0.24); }
}

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .nav-desktop { display: none; }
  .hamburger { display: flex; }
  .sheet { display: block; }
  .user-name, .user-chip svg { display: none; }
  .user-chip { padding: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page { padding: 20px 14px 36px; }
}
@media (max-width: 520px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-value { font-size: 24px; }
  .card { padding: 18px; }
  .list-title { white-space: normal; }
}

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(400px, 100%);
  padding: 34px 30px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-float);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .brand-mark { margin: 0 auto 14px; }
.login-title { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.login-sub { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--ink-3);
  font-size: 12px;
}
.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.login-form .field:last-of-type { margin-bottom: 18px; }
.login-qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-qr {
  width: 176px;
  height: 176px;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(23, 43, 77, 0.08);
}
.login-qr svg { display: block; width: 100%; height: 100%; }
.login-qr-hint { margin: 0; color: var(--ink-2); font-size: 13px; text-align: center; line-height: 1.6; }
.login-guide { color: var(--ink-2); font-size: 13px; line-height: 1.7; text-align: center; margin: 0 0 16px; }
.login-foot { text-align: center; margin-top: 16px; font-size: 13.5px; }

/* ============ 请假申请：类型选择卡 ============ */
.type-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.type-card { position: relative; cursor: pointer; }
.type-card input { position: absolute; opacity: 0; }
.type-card-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid var(--line);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background-color 160ms ease;
}
.type-card input:checked + .type-card-inner {
  border-color: var(--tc, var(--primary));
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc, var(--primary)) 14%, transparent);
}
.type-card:hover .type-card-inner { transform: translateY(-1px); }
.type-icon {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--tc, var(--primary));
  background: color-mix(in srgb, var(--tc, var(--primary)) 13%, white);
}
.type-name { font-weight: 650; font-size: 15px; }
.type-meta { color: var(--ink-3); font-size: 12px; }

.duration-preview {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
  padding: 13px 16px;
  border-radius: 13px;
  background: linear-gradient(120deg, var(--primary-soft), rgba(255,255,255,0.6));
}
.duration-label { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.duration-value { font-weight: 700; font-size: 16px; color: var(--primary); }
.duration-balance { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }

.upload-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  border: 1.5px dashed rgba(47, 111, 237, 0.4);
  border-radius: 14px;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  background: rgba(47, 111, 237, 0.04);
  transition: background-color 160ms ease;
}
.upload-box:hover { background: rgba(47, 111, 237, 0.09); }
.file-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-chip {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12.5px;
}

/* ============ 首页余额条 ============ */
.balance-strip { display: flex; flex-direction: column; gap: 4px; }
.balance-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink);
  transition: background-color 160ms ease;
}
.balance-item:hover { background: rgba(47, 111, 237, 0.07); }
.balance-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.balance-name { font-weight: 550; font-size: 14px; }
.balance-name { white-space: nowrap; }
.balance-value { margin-left: auto; font-weight: 700; color: var(--primary); font-size: 15px; }
.balance-value small { color: var(--ink-3); font-weight: 500; font-size: 12px; }

/* ============ 余额详情页 ============ */
.balance-big { text-align: center; padding: 12px 0 16px; }
.balance-num { font-size: 44px; font-weight: 750; letter-spacing: -0.03em; color: var(--primary); line-height: 1; }
.balance-unit { color: var(--ink-2); font-size: 15px; margin-left: 4px; }
.balance-caption { display: block; margin-top: 7px; color: var(--ink-3); font-size: 12.5px; }
.balance-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(31, 64, 122, 0.045);
}
.balance-breakdown div { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.balance-breakdown b { color: var(--ink); }

/* ============ 筛选 ============ */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(31, 64, 122, 0.06);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
  transition: background-color 160ms ease, color 160ms ease;
}
.filter-chip:hover { color: var(--ink); }
.filter-chip.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(47,111,237,.3); }
.filter-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filter-row .field { flex: 1; min-width: 150px; }

/* ============ 详情页 ============ */
.back-link { display: inline-block; margin-bottom: 8px; color: var(--ink-2); font-size: 13.5px; }
.back-link:hover { color: var(--primary); }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-label { color: var(--ink-3); font-size: 12px; letter-spacing: 0.03em; }
.kv-value { font-size: 14.5px; font-weight: 550; overflow-wrap: anywhere; }
.reason-box {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 13px;
  background: rgba(31, 64, 122, 0.045);
}
.reason-text { margin-top: 4px; font-size: 14px; white-space: pre-wrap; }
.attach-row { margin-top: 12px; }
.attach-chip {
  display: inline-block;
  margin: 0 8px 6px 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
}

.decision-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.decision-form { display: flex; gap: 8px; align-items: center; }
.decision-form .input { flex: 1; }
.decision-form .btn { flex: none; }

/* ============ 管理端 ============ */
.quick-links { display: flex; flex-direction: column; }
.quick-links a {
  display: flex;
  flex-direction: column;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--ink);
  transition: background-color 160ms ease;
}
.quick-links a:hover { background: var(--primary-soft); }
.quick-links a span { font-weight: 600; font-size: 14px; }
.quick-links a small { color: var(--ink-3); font-size: 12px; margin-top: 1px; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 10px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  cursor: pointer;
}
.check-item input { accent-color: var(--primary); width: 15px; height: 15px; }

.type-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.type-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(31, 64, 122, 0.06);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 550;
}
.type-tab.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(47,111,237,.3); }
.type-tab.active .balance-dot { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }

.step-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.step-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 10px;
  background: rgba(31, 64, 122, 0.06);
  font-size: 13.5px;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.step-item:has(input:checked) { background: var(--primary-soft); color: var(--primary); }
.step-item input { accent-color: var(--primary); }

.dept-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.dept-row:last-child { border-bottom: 0; }
.type-flow-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.type-flow-row:last-child { border-bottom: 0; }
.type-flow-name { min-width: 92px; }
.type-flow-extra { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.pagination { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 14px; }

/* ============ 管理后台总览页 ============ */
.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.admin-tab {
  padding: 9px 18px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab:active { transform: scale(0.97); }
.admin-tab.active {
  background: linear-gradient(135deg, #4b8bff, var(--primary));
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 111, 237, 0.3);
}
.admin-panel { display: none; }
.admin-panel.active { display: block; }
