/* =========================================================
   工作量统计工具 · 设计系统 v2
   风格：清爽专业 · 浅色为主
   原则：保留全部既有 class 名与 CSS 变量名，
        业务 JS 一行未动，内联 var(--*) 自动跟随升级
   ========================================================= */

:root {
  /* --- 品牌主色（现代蓝） --- */
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-darker: #1E40AF;
  --primary-light: #EFF6FF;
  --primary-border: #BFDBFE;

  /* --- 语义色 --- */
  --success: #059669;
  --success-light: #ECFDF5;
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --purple: #7C3AED;
  --purple-light: #F5F3FF;
  --cyan: #0891B2;
  --cyan-light: #ECFEFF;

  /* --- 中性色阶（slate） --- */
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* --- 圆角 --- */
  --radius: 14px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --radius-xs: 6px;

  /* --- 阴影层级 --- */
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .07);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
  --shadow-xl: 0 24px 56px rgba(15, 23, 42, .18);

  /* --- 节奏 --- */
  --ring: 0 0 0 3px rgba(37, 99, 235, .14);
  --ease: cubic-bezier(.4, 0, .2, 1);

  /* --- 动态尺寸（演示模式会覆写） --- */
  --fs-body: 14px;
  --fs-stat: 30px;
  --fs-table: 13px;
  --ctl-h: 38px;
  --shell-max: 1240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  /* 页面底：微冷灰，衬托纯白卡片 */
  background: #F4F7FB;
  color: var(--gray-800);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 顶栏与内容之间的柔和光晕 */
  background-image: radial-gradient(1200px 380px at 50% -160px, #E4EDFB 0%, rgba(244, 247, 251, 0) 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  padding-bottom: env(safe-area-inset-bottom);
}

/* 数字统一等宽，看板对齐更整齐 */
.stat-value, .data-table td, .badge, .stat-unit {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

::selection { background: var(--primary-border); color: var(--primary-darker); }

/* 滚动条（电脑端更精致） */
@media (hover: hover) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: var(--gray-300); border-radius: 6px; border: 3px solid #F4F7FB;
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
}

/* ============ 密码框 ============ */
.pwd-wrap { position: relative; display: flex; align-items: center; }
.pwd-wrap .form-control { padding-right: 46px; }
.pwd-toggle {
  position: absolute; right: 6px; background: none; border: none; cursor: pointer;
  font-size: 15px; padding: 6px 8px; line-height: 1; opacity: .55;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  border-radius: var(--radius-xs);
}
.pwd-toggle:hover { opacity: 1; background: var(--gray-100); }
.pwd-toggle:active { transform: scale(.9); }
.pwd-readonly {
  padding: 10px 12px; border: 1.5px dashed var(--gray-300); border-radius: var(--radius-sm);
  background: var(--gray-50); color: var(--gray-500); font-size: 14px; letter-spacing: 2px;
}

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(900px 500px at 15% 10%, #DBEAFE 0%, rgba(219, 234, 254, 0) 60%),
    radial-gradient(800px 500px at 85% 90%, #E0E7FF 0%, rgba(224, 231, 255, 0) 60%),
    linear-gradient(160deg, #F8FAFC 0%, #EEF2F9 100%);
}
.login-card {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 20px; padding: 40px 34px; width: 100%; max-width: 396px;
  box-shadow: var(--shadow-xl);
  animation: loginIn .5s var(--ease) both;
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
  to { opacity: 1; transform: none; }
}
.login-card .brand {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 15px;
  background: linear-gradient(135deg, var(--primary) 0%, #4F8DF7 55%, #7C3AED 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 25px; box-shadow: 0 8px 20px rgba(37, 99, 235, .32);
}
.login-card h1 { font-size: 21px; font-weight: 700; text-align: center; color: var(--gray-900); letter-spacing: -.2px; }
.login-card .sub {
  text-align: center; color: var(--gray-500); font-size: 13px; margin: 6px 0 30px;
}
.login-card .form-group { margin-bottom: 16px; }
.login-card input {
  width: 100%; padding: 12px 14px; height: 46px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  outline: none; background: #fff; color: var(--gray-900);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  font-size: 15px;
}
.login-card input:hover { border-color: var(--gray-300); }
.login-card input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.btn-login {
  width: 100%; padding: 13px; height: 48px; margin-top: 4px;
  background: linear-gradient(180deg, #3B76EF 0%, var(--primary) 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .3);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease);
}
.btn-login:hover { filter: brightness(1.06); box-shadow: 0 6px 20px rgba(37, 99, 235, .38); }
.btn-login:active { transform: scale(.985); }
.btn-login:disabled { opacity: .7; cursor: default; }

/* ============ 顶栏 ============ */
.app-header {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 22px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.app-header .logo {
  font-size: 16px; font-weight: 700; color: var(--gray-900);
  display: flex; align-items: center; gap: 10px; letter-spacing: -.2px;
}
.app-header .logo .mark {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary) 0%, #4F8DF7 60%, #7C3AED 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; box-shadow: 0 3px 10px rgba(37, 99, 235, .3);
}
/* 兼容旧结构里的 .dot */
.app-header .logo .dot { display: none; }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-badge {
  font-size: 13px; color: var(--gray-600);
  display: flex; align-items: center; gap: 8px; font-weight: 500;
}
.user-badge .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; border: 1px solid var(--primary-border);
}
.role-tag {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  font-weight: 600; letter-spacing: .2px; white-space: nowrap;
}
.role-tag.admin { background: var(--purple-light); color: var(--purple); }
.role-tag.engineer { background: var(--primary-light); color: var(--primary); }

/* ============ 主容器 ============ */
.app-body {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 20px 22px;
}

/* ============ 导航 ============ */
.nav-tabs {
  display: flex; gap: 4px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 5px; margin-bottom: 20px;
  box-shadow: var(--shadow);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  padding: 9px 18px; border: none; background: transparent; color: var(--gray-600);
  font-size: 14px; cursor: pointer; border-radius: var(--radius-sm);
  white-space: nowrap; font-weight: 500; line-height: 1.4;
  transition: color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-tab:hover { color: var(--gray-900); background: var(--gray-100); }
.nav-tab.active {
  background: linear-gradient(180deg, #3B76EF 0%, var(--primary) 100%);
  color: #fff; font-weight: 600;
  box-shadow: 0 3px 10px rgba(37, 99, 235, .28);
}
.nav-tab.active:hover { color: #fff; background: var(--primary-dark); }

/* ============ 卡片 ============ */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title {
  font-size: 16px; font-weight: 700; color: var(--gray-900);
  margin-bottom: 18px; letter-spacing: -.2px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 0 0 14px 14px; border-bottom: 1px solid var(--gray-100);
  position: relative;
}
/* 标题左侧竖条：必须绝对定位。
   若作为 flex item，单元素标题（如"提交工作量"）会被 justify-between 推到最右侧 */
.card-title::before {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-60%);
  width: 4px; height: 17px; border-radius: 3px;
  background: linear-gradient(180deg, var(--primary) 0%, #7C3AED 100%);
}

/* ============ 统计卡 ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  position: relative; overflow: hidden;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 17px 18px 16px;
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--primary);
}
.stat-card::after {
  content: ''; position: absolute; right: -26px; top: -30px;
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--primary); opacity: .07;
}
.stat-card.green::before { background: var(--success); }
.stat-card.green::after { background: var(--success); }
.stat-card.amber::before { background: var(--warning); }
.stat-card.amber::after { background: var(--warning); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.purple::after { background: var(--purple); }
.stat-card.red::before { background: var(--danger); }
.stat-card.red::after { background: var(--danger); }
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}
.stat-card .stat-label {
  font-size: 12.5px; color: var(--gray-500); margin-bottom: 6px; font-weight: 500;
  position: relative; z-index: 1;
}
.stat-card .stat-value {
  font-size: var(--fs-stat); font-weight: 700; color: var(--gray-900);
  line-height: 1.15; letter-spacing: -.6px; position: relative; z-index: 1;
}
.stat-card .stat-unit {
  font-size: 13px; color: var(--gray-400); margin-left: 4px; font-weight: 500;
}

/* ============ 表单 ============ */
.form-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px;
}
.form-group { display: flex; flex-direction: column; min-width: 0; }
.form-group label {
  font-size: 13px; color: var(--gray-600); margin-bottom: 6px; font-weight: 600;
}
.form-group label .req { color: var(--danger); }
.form-control {
  padding: 9px 12px; min-height: var(--ctl-h);
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  outline: none; background: #fff; color: var(--gray-900);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  width: 100%;
}
.form-control:hover { border-color: var(--gray-300); }
.form-control:focus { border-color: var(--primary); box-shadow: var(--ring); }
.form-control::placeholder { color: var(--gray-400); }
.form-control:disabled {
  background: var(--gray-50); color: var(--gray-500); cursor: default;
  border-style: dashed;
}
textarea.form-control { resize: vertical; min-height: 62px; line-height: 1.55; }
select.form-control {
  cursor: pointer; appearance: none; -webkit-appearance: none;
  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 fill='%2364748B' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}

/* 计件子类型动态数据块 */
.pw-block {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px 18px; margin-bottom: 14px;
  background: linear-gradient(180deg, #FAFCFF 0%, #F6F9FE 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.pw-block-title {
  font-weight: 700; color: var(--primary); margin-bottom: 12px; font-size: 14px;
  display: flex; align-items: center; gap: 7px;
}
.pw-block-title::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.pw-block .form-group { min-width: 190px; }

/* 复选 / 单选 */
.checkbox-group, .radio-group {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 4px 0;
}
.checkbox-item, .radio-item {
  display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer;
  user-select: none; padding: 7px 13px; border-radius: 999px;
  border: 1.5px solid var(--gray-200); background: #fff;
  transition: all .18s var(--ease); min-height: 36px;
}
.checkbox-item:hover, .radio-item:hover { border-color: var(--primary-border); background: var(--primary-light); }
.checkbox-item:has(input:checked), .radio-item:has(input:checked) {
  border-color: var(--primary); background: var(--primary-light); color: var(--primary-darker); font-weight: 600;
}
.checkbox-item input[type="checkbox"], .radio-item input[type="radio"] {
  width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); flex: 0 0 auto;
}
.field-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* ============ 自动完成 ============ */
.autocomplete-wrap { position: relative; flex-shrink: 0; width: 100%; }
/* 容器内输入框必须撑满：否则按默认宽度渲染会溢出并压住相邻按钮 */
.autocomplete-wrap > .form-control { width: 100%; box-sizing: border-box; }
.autocomplete-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); max-height: 250px; overflow-y: auto;
  z-index: 9999; display: none;
  box-shadow: var(--shadow-lg);
  padding: 4px;
}
.autocomplete-list.show { display: block; animation: acIn .16s var(--ease) both; }
@keyframes acIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.autocomplete-item {
  padding: 9px 11px; cursor: pointer; border-radius: var(--radius-xs);
  transition: background .12s var(--ease);
}
.autocomplete-item:hover, .autocomplete-item.active { background: var(--primary-light); }
.autocomplete-item .du-name { font-size: 13px; color: var(--gray-900); font-weight: 600; }
.autocomplete-item .du-meta { font-size: 11.5px; color: var(--gray-500); margin-top: 2px; }

/* 筛选栏控件禁止压缩/拉伸，避免搜索框遮挡相邻按钮 */
.flex.gap-8.flex-wrap.items-center > .autocomplete-wrap,
.flex.gap-8.flex-wrap.items-center > .range-wrap,
.flex.gap-8.flex-wrap.items-center > .range-quick,
.flex.gap-8.flex-wrap.items-center > select,
.flex.gap-8.flex-wrap.items-center > input,
.flex.gap-8.flex-wrap.items-center > .btn { flex: 0 0 auto; }

/* ============ 日期区间工具条 ============ */
.range-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.range-wrap .form-control { width: 150px; }
.range-sep { color: var(--gray-400); font-size: 13px; font-weight: 600; }
.range-quick { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* ============ 按钮 ============ */
.btn {
  padding: 9px 18px; min-height: var(--ctl-h);
  border: 1.5px solid var(--gray-200); background: #fff; color: var(--gray-700);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 500;
  transition: all .18s var(--ease);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; line-height: 1;
}
.btn:hover { border-color: var(--gray-300); background: var(--gray-50); color: var(--gray-900); }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, #3B76EF 0%, var(--primary) 100%);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .26);
}
.btn-primary:hover {
  background: var(--primary-dark); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .34);
}
.btn-success { background: var(--success); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(5,150,105,.24); }
.btn-success:hover { background: #047857; color: #fff; border-color: transparent; }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(220,38,38,.24); }
.btn-danger:hover { background: #B91C1C; color: #fff; border-color: transparent; }
.btn-sm { padding: 7px 13px; font-size: 13px; min-height: 34px; }
.btn-xs { padding: 3px 9px; font-size: 12px; border-radius: var(--radius-xs); min-height: auto; }
.btn-warn { background: var(--warning-light); color: var(--warning); border-color: #FDE68A; }
.btn-warn:hover { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); box-shadow: none; }
.btn-ghost:hover { background: var(--primary-light); border-color: transparent; color: var(--primary-dark); }
.btn-icon {
  padding: 7px 10px; font-size: 15px; border: none; background: transparent;
  cursor: pointer; color: var(--gray-500); border-radius: var(--radius-xs); min-height: auto;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
  line-height: 1;
}
.btn-icon:hover { color: var(--gray-900); background: var(--gray-100); }
.btn-icon:active { transform: scale(.9); }

/* ============ 表格 ============ */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  background: #fff;
}
table.data-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: var(--fs-table);
}
.data-table th {
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
  padding: 11px 13px; text-align: left; font-weight: 700;
  color: var(--gray-600); white-space: nowrap; font-size: 12.5px;
  position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid var(--gray-200);
}
.data-table th:first-child { border-top-left-radius: var(--radius-md); }
.data-table th:last-child { border-top-right-radius: var(--radius-md); }
.data-table td {
  padding: 10px 13px; border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800); white-space: nowrap;
}
.data-table tbody tr { transition: background .14s var(--ease); }
.data-table tbody tr:nth-child(even) { background: #FCFCFE; }
.data-table tbody tr:hover { background: var(--primary-light); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-md); }
.data-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius-md); }

/* 合计行 */
.data-table tr.total-row td {
  background: linear-gradient(180deg, #F1F5F9 0%, #E8EEF7 100%) !important;
  border-top: 2px solid var(--gray-300);
  font-weight: 700; color: var(--gray-900);
}
.data-table tr.total-row:hover td { background: #E8EEF7 !important; }

/* 全部记录表 — 紧凑模式 */
#records-table .data-table { font-size: 12.5px; }
#records-table .data-table th { padding: 9px 11px; font-size: 12px; }
#records-table .data-table td { padding: 8px 11px; }
#records-table .data-table td[colspan] { padding: 14px; }

/* ============ 徽章 ============ */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.badge-blue { background: var(--primary-light); color: var(--primary-dark); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-amber { background: var(--warning-light); color: var(--warning); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-red { background: var(--danger-light); color: var(--danger); }

.row-warn { background: #FFFBEB !important; }
.row-warn:hover { background: #FEF3C7 !important; }
.dup-badge {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: var(--radius-xs);
  font-size: 11px; font-weight: 700; background: var(--danger-light); color: var(--danger);
  cursor: pointer; vertical-align: middle; border: 1px solid #FECACA;
  transition: all .16s var(--ease);
}
.dup-badge:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ============ 重复提醒面板 ============ */
.dup-alert-panel {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFFBF5 100%);
  border: 1.5px solid #FDBA74; border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 16px;
  animation: dupFadeIn .32s var(--ease) both;
}
@keyframes dupFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.dup-alert-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 14px; font-weight: 700; color: #B45309;
}
.dup-alert-icon { font-size: 17px; }
.dup-alert-list { display: flex; flex-direction: column; gap: 6px; }
.dup-alert-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: #fff; border: 1px solid #FED7AA; border-radius: var(--radius-sm);
  cursor: pointer; transition: all .18s var(--ease); font-size: 13px;
}
.dup-alert-item:hover {
  border-color: #FB923C; background: #FFF7ED; transform: translateX(3px);
  box-shadow: var(--shadow);
}
.dup-alert-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; padding: 3px 9px; background: #EA580C; color: #fff;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.dup-alert-info { flex: 1; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-alert-arrow { color: var(--gray-400); font-size: 16px; font-weight: 700; }

/* ============ Toast ============ */
.toast-wrap {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toastIn .28s var(--ease) both;
  max-width: 90vw; display: flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.18);
}
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--primary); color: #fff; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  to { opacity: 1; transform: none; }
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; animation: fadeIn .2s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; padding: 26px;
  box-shadow: var(--shadow-xl);
  animation: modalIn .26s var(--ease) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-title {
  font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--gray-900);
  letter-spacing: -.2px;
}
.modal-footer {
  margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 18px; border-top: 1px solid var(--gray-100);
}

/* ============ 状态 ============ */
.loading { text-align: center; padding: 48px; color: var(--gray-500); }
.spinner {
  width: 34px; height: 34px; border: 3px solid var(--gray-200);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 52px 20px; color: var(--gray-500); }
.empty-state .icon { font-size: 42px; margin-bottom: 12px; opacity: .35; }

/* ============ 首页欢迎卡 ============ */
.hero-card {
  background: linear-gradient(120deg, #2563EB 0%, #4F8DF7 45%, #7C3AED 100%);
  border: none; color: #fff; position: relative; overflow: hidden;
  padding: 30px 28px; border-radius: var(--radius);
  margin-bottom: 16px; box-shadow: 0 10px 30px rgba(37, 99, 235, .22);
}
.hero-card::after {
  content: ''; position: absolute; right: -40px; bottom: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.hero-card::before {
  content: ''; position: absolute; right: 60px; top: -50px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.card.hero-card:hover { box-shadow: 0 14px 38px rgba(37, 99, 235, .3); }
.hero-card .hero-date { font-size: 13.5px; opacity: .85; margin-bottom: 6px; position: relative; z-index: 1; }
.hero-card .hero-title {
  font-size: 25px; font-weight: 700; margin-bottom: 6px; position: relative; z-index: 1;
  letter-spacing: -.4px;
}
.hero-card .hero-sub { font-size: 13.5px; opacity: .82; position: relative; z-index: 1; }

/* 首页功能入口网格（独立 class：内联 style 会盖掉媒体查询，手机上无法变两列） */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 14px;
}
.feature-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 24px 18px; text-align: center; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
  box-shadow: var(--shadow);
}
.feature-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-border);
}
.feature-card:active { transform: translateY(-1px); }
.feature-card .f-icon {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 15px;
  background: var(--primary-light); display: flex; align-items: center; justify-content: center;
  font-size: 25px; transition: transform .2s var(--ease);
}
.feature-card:hover .f-icon { transform: scale(1.08) rotate(-3deg); }
.feature-card .f-label { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.feature-card .f-desc { font-size: 12.5px; color: var(--gray-500); margin-top: 4px; }

/* ============ 工具类 ============ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--gray-500); }
.cursor-pointer { cursor: pointer; }

/* =========================================================
   投屏 / 会议汇报 —— 演示模式
   ========================================================= */
body.presentation {
  --fs-body: 17px;
  --fs-stat: 46px;
  --fs-table: 17px;
  --ctl-h: 46px;
  --shell-max: 1560px;
}
body.presentation .card { padding: 30px; margin-bottom: 22px; }
body.presentation .card-title { font-size: 21px; margin-bottom: 22px; }
body.presentation .stat-card { padding: 24px 22px; }
body.presentation .stat-card .stat-label { font-size: 15px; }
body.presentation .data-table th { padding: 15px 18px; font-size: 16px; }
body.presentation .data-table td { padding: 14px 18px; }
body.presentation .nav-tab { padding: 12px 24px; font-size: 16px; }
body.presentation .app-header { height: 72px; }
body.presentation .badge { font-size: 14px; padding: 4px 12px; }
body.presentation .btn { font-size: 16px; padding: 11px 22px; }
/* 演示模式下的开关按钮高亮 */
.btn-icon.on, .pres-toggle.on {
  background: var(--primary-light); color: var(--primary-dark);
}
.btn-icon.on:hover { background: var(--primary); color: #fff; }

/* 演示模式：让内联柱状图容器同步放大（不侵入业务代码） */
body.presentation [style*="height:160px"] { height: 250px !important; }
body.presentation [style*="width:28px"] { width: 42px !important; }
body.presentation [style*="width:48px"] { width: 68px !important; }
body.presentation [style*="min-width:64px"] { min-width: 86px !important; }
/* 趋势折线图（SVG 带 viewBox，撑满即等比放大） */
body.presentation .card svg { max-width: 100%; height: auto; }

/* =========================================================
   响应式 —— 手机端现场提交
   ========================================================= */
@media (max-width: 900px) {
  .app-body { padding: 16px 14px; }
}

@media (max-width: 640px) {
  /* 触控友好：所有可点区域 ≥44px */
  :root { --ctl-h: 46px; }
  .form-control, .btn { min-height: 46px; font-size: 15px; }
  .btn-sm { min-height: 40px; padding: 8px 14px; }
  .nav-tab { padding: 10px 15px; font-size: 14px; min-height: 42px; }
  .btn-icon { padding: 10px 12px; font-size: 17px; }

  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .app-body { padding: 14px 12px; }
  .card { padding: 17px 15px; border-radius: var(--radius-md); margin-bottom: 14px; }
  .card-title { font-size: 15.5px; margin-bottom: 15px; padding-bottom: 12px; }

  /* 统计卡两列，数字更醒目 */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .stat-card { padding: 14px 13px; }
  .stat-card .stat-value { font-size: 26px; }
  .stat-card .stat-label { font-size: 12px; }

  .data-table th { padding: 10px 11px; font-size: 12px; }
  .data-table td { padding: 10px 11px; font-size: 13px; }

  .nav-tabs { border-radius: var(--radius-sm); padding: 4px; margin-bottom: 14px; }
  .app-header { padding: 0 14px; height: 56px; }
  .user-badge span:not(.role-tag) { display: none; }

  .modal { padding: 20px 17px; border-radius: 16px; max-height: 92vh; }
  .modal-title { font-size: 17px; margin-bottom: 16px; }
  .modal-footer { flex-direction: row-reverse; }
  .modal-footer .btn { flex: 1; min-height: 46px; }

  .toast-wrap { bottom: 20px; width: 100%; padding: 0 14px; }
  .toast { max-width: 100%; }

  /* 首页 */
  .hero-card { padding: 24px 20px; }
  .hero-card .hero-title { font-size: 21px; }
  .feature-card { padding: 18px 12px; }
  .feature-card .f-icon { width: 46px; height: 46px; font-size: 22px; }

  /* 区间选择条在手机上换行排布 */
  .range-wrap { width: 100%; }
  .range-wrap .form-control { flex: 1; min-width: 120px; width: auto; }
}

@media (max-width: 380px) {
  .stats-grid, .feature-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   响应式 —— 电脑端大屏看板（更高信息密度）
   ========================================================= */
@media (min-width: 1500px) {
  :root { --shell-max: 1360px; }
}

/* 打印 */
@media print {
  .app-header, .nav-tabs, .btn, .toast-wrap { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
