:root {
  --primary: #1565C0;
  --primary-dark: #0D47A1;
  --primary-light: #EEF4FB;
  --primary-lighter: #F6F9FE;
  --accent: #00897B;
  --warning: #EF6C00;
  --danger: #C62828;
  --success: #2E7D32;
  --text: #212121;
  --text-2: #424242;
  --muted: #6B7280;
  --border: #E3E8EF;
  --border-strong: #CBD5E1;
  --surface: #F7F9FC;
  --bg: #F1F4F9;
  --white: #fff;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 8px 24px rgba(16,24,40,.12);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 216px;
  --header-h: 56px;
  --ff: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--ff);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0D47A1 0%, #1565C0 45%, #0288D1 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--white);
  border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.24);
  overflow: hidden;
}
.login-head { background: var(--primary-dark); padding: 30px 28px 24px; color: #fff; }
.login-head .brand { font-size: 12px; letter-spacing: .18em; color: #90CAF9; margin-bottom: 8px; }
.login-head h1 { font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.login-head p { font-size: 12.5px; color: #BBDEFB; margin-top: 6px; }
.login-body { padding: 26px 28px 28px; }
.login-body .field { margin-bottom: 15px; }
.login-body label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.login-body input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); outline: none; transition: .15s;
}
.login-body input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,101,192,.1); }
.login-err {
  background: #FDECEA; color: var(--danger); padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; display: none;
}
.login-tip { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted); }
.login-tip b { color: var(--text-2); }
.login-tip code { background: var(--primary-light); color: var(--primary-dark); padding: 1px 5px; border-radius: 3px; font-size: 11.5px; }

/* ============ 布局 ============ */
.app { display: none; min-height: 100vh; }
.app.show { display: block; }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: #0F2540; color: #C7D3E0; overflow-y: auto; z-index: 100;
  transition: transform .25s;
}
.sidebar-brand {
  height: var(--header-h); display: flex; align-items: center; gap: 9px;
  padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .3px;
}
.sidebar-brand .dot {
  width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg,#42A5F5,#00897B);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff;
}
.nav-group { padding: 12px 0 4px; }
.nav-group-title {
  padding: 6px 16px; font-size: 11px; color: #6B8299; letter-spacing: .1em;
  font-weight: 600; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 16px;
  font-size: 13.5px; color: #C7D3E0; cursor: pointer; border-left: 3px solid transparent;
  transition: .15s; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(21,101,192,.22); border-left-color: #42A5F5; color: #fff; font-weight: 600; }
.nav-item .ico { width: 17px; text-align: center; font-size: 14px; opacity: .9; }
.nav-item .badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10.5px;
  min-width: 17px; height: 17px; border-radius: 9px; display: flex;
  align-items: center; justify-content: center; padding: 0 5px; font-weight: 700;
}
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #6B8299; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.header {
  height: var(--header-h); background: var(--white); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 14px;
  position: sticky; top: 0; z-index: 50;
}
.header .page-title { font-size: 16px; font-weight: 700; color: var(--text); }
.header .spacer { flex: 1; }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-2); }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm); border: none;
  background: var(--surface); color: var(--text-2); display: flex;
  align-items: center; justify-content: center; position: relative; font-size: 15px;
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary); }
.icon-btn .dot-badge {
  position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.user-wrap { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 11px 5px 5px;
  border-radius: 20px; background: var(--surface); cursor: pointer;
  border: 1px solid transparent; transition: .15s;
}
.user-chip:hover { background: var(--primary-light); border-color: var(--primary-light); }
.user-chip .user-caret { font-size: 10px; color: var(--muted); margin-left: 2px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; flex-shrink: 0;
}
.user-chip .uname { font-size: 13px; font-weight: 600; }
.user-chip .urole { font-size: 11px; color: var(--muted); }

/* 用户下拉菜单 */
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 208px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 200; overflow: hidden;
  animation: umIn .14s ease-out;
}
@keyframes umIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.um-head { padding: 12px 14px 10px; background: var(--surface); }
.um-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.um-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.um-divider { height: 1px; background: var(--border); }
.um-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px;
  font-size: 13px; color: var(--text-2); cursor: pointer; transition: .12s;
}
.um-item:hover { background: var(--primary-lighter); color: var(--primary); }
.um-item.danger:hover { background: #FDECEA; color: var(--danger); }
.um-item .um-ico { font-size: 13px; width: 15px; text-align: center; opacity: .85; }

.content { padding: 18px 20px 40px; }

/* ============ 卡片 ============ */
.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border); margin-bottom: 16px;
}
.card-head {
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { font-size: 14.5px; font-weight: 700; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 0; }

/* ============ 指标卡 ============ */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.metric {
  background: var(--white); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 16px 18px; cursor: pointer;
  transition: .18s; position: relative; overflow: hidden;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.metric::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary);
}
.metric.warn::after { background: var(--warning); }
.metric.ok::after { background: var(--success); }
.metric .m-label { font-size: 12.5px; color: var(--muted); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.metric .m-value { font-size: 27px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.metric.warn .m-value { color: var(--warning); }
.metric.ok .m-value { color: var(--success); }
.metric .m-desc { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ============ 布局块 ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-side { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  background: var(--surface); color: var(--text-2); font-weight: 600; text-align: left;
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
  font-size: 12.5px;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:hover { background: var(--primary-lighter); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl .nowrap { white-space: nowrap; }
.tk { color: var(--primary); font-weight: 600; cursor: pointer; font-family: Consolas, monospace; font-size: 12.5px; }
.tk:hover { text-decoration: underline; }

/* ============ 标签 ============ */
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.tag-DRAFT { background: #ECEFF1; color: #546E7A; }
.tag-PENDING_ACCEPT { background: #FFF3E0; color: #E65100; }
.tag-PENDING_ASSIGN { background: #FFF8E1; color: #F9A825; }
.tag-PROCESSING { background: #E3F2FD; color: #1565C0; }
.tag-SUSPENDED { background: #F3E5F5; color: #7B1FA2; }
.tag-COMPLETED { background: #E8F5E9; color: #2E7D32; }
.tag-REJECTED { background: #FDECEA; color: #C62828; }
.tag-CANCELLED { background: #ECEFF1; color: #78909C; }
.tag-常规 { background: #ECEFF1; color: #546E7A; }
.tag-加急 { background: #FFF8E1; color: #F9A825; }
.tag-紧急 { background: #FDECEA; color: #C62828; }
.tag-overdue { background: #FDECEA; color: #C62828; }

/* ============ 按钮 ============ */
.btn {
  padding: 7px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--white); color: var(--text-2); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.success:hover { filter: brightness(1.08); color: #fff; }
.btn.warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn.warning:hover { filter: brightness(1.08); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.form-item label .req { color: var(--danger); margin-left: 2px; }
.form-item input, .form-item select, .form-item textarea {
  padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  outline: none; transition: .15s; width: 100%;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,101,192,.1);
}
.form-item textarea { resize: vertical; min-height: 88px; line-height: 1.65; }
.form-item .hint { font-size: 11.5px; color: var(--muted); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ============ 筛选栏 ============ */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.filters input, .filters select {
  padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  outline: none; background: var(--white);
}
.filters input:focus, .filters select:focus { border-color: var(--primary); }
.filters input.w-search { width: 220px; }

/* ============ 时间轴 ============ */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -23px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--primary); border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.tl-item.sys .tl-dot { background: #90A4AE; box-shadow: 0 0 0 2px #ECEFF1; }
.tl-item.hi .tl-dot { background: var(--success); box-shadow: 0 0 0 2px #E8F5E9; }
.tl-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.tl-action { font-size: 13px; font-weight: 700; color: var(--text); }
.tl-item.sys .tl-action { color: var(--muted); font-weight: 600; }
.tl-who { font-size: 12px; color: var(--primary); font-weight: 600; }
.tl-time { font-size: 11.5px; color: var(--muted); }
.tl-detail { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.6; }

/* ============ 详情 ============ */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { color: var(--text); word-break: break-word; }
.section-title {
  font-size: 13px; font-weight: 700; color: var(--primary-dark);
  padding: 9px 0; margin-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 7px;
}
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 13px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,25,45,.55); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--white); border-radius: 12px; width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: mIn .18s ease-out;
}
.modal.wide { max-width: 820px; }
@keyframes mIn { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { font-size: 15.5px; font-weight: 700; flex: 1; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--muted); line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--border); display: flex; gap: 9px; justify-content: flex-end; }

/* ============ 提示 ============ */
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--white); border-radius: var(--radius-sm); padding: 11px 15px;
  box-shadow: var(--shadow-lg); border-left: 3px solid var(--primary);
  font-size: 13px; min-width: 230px; max-width: 380px; animation: tIn .2s;
  display: flex; align-items: center; gap: 9px;
}
@keyframes tIn { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* ============ 消息 ============ */
.msg-list { display: flex; flex-direction: column; }
.msg-item { padding: 13px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: .12s; }
.msg-item:hover { background: var(--primary-lighter); }
.msg-item.unread { background: #F8FBFF; }
.msg-item.unread:hover { background: var(--primary-lighter); }
.msg-top { display: flex; align-items: center; gap: 9px; margin-bottom: 3px; }
.msg-title { font-size: 13.5px; font-weight: 600; flex: 1; }
.msg-item.unread .msg-title { color: var(--primary-dark); }
.msg-content { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.msg-time { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }

/* ============ 其他 ============ */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .e-ico { font-size: 40px; opacity: .3; margin-bottom: 10px; }
.empty .e-txt { font-size: 13.5px; }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.pager .spacer { flex: 1; }
.pager .info { font-size: 12.5px; color: var(--muted); }
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tab {
  padding: 10px 15px; font-size: 13.5px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.tab .cnt { font-size: 11px; background: var(--surface); padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.tab.active .cnt { background: var(--primary-light); color: var(--primary); }
.bar-chart { display: flex; align-items: flex-end; gap: 7px; height: 130px; padding: 10px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bar-col .bar { width: 100%; max-width: 34px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 3px; transition: .3s; }
.bar-col:hover .bar { background: var(--primary-dark); }
.bar-col .bar-val { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.bar-col .bar-lbl { font-size: 11px; color: var(--muted); }
.type-list { display: flex; flex-direction: column; gap: 9px; }
.type-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.type-row .tname { width: 96px; flex-shrink: 0; color: var(--text-2); }
.type-row .tbar { flex: 1; height: 7px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.type-row .tbar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.type-row .tval { width: 32px; text-align: right; color: var(--muted); font-weight: 600; }
.hint-box { background: var(--primary-lighter); border: 1px solid var(--primary-light); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 12.5px; color: var(--text-2); }
.hint-box b { color: var(--primary-dark); }
.perm-tree { font-size: 13px; }
.perm-node { padding: 5px 0; }
.perm-children { padding-left: 22px; border-left: 1px dashed var(--border-strong); margin-left: 8px; }
.perm-label { display: flex; align-items: center; gap: 7px; padding: 3px 0; }
.perm-label input { margin: 0; }
.perm-label .cat { font-size: 10.5px; color: var(--muted); background: var(--surface); padding: 0 5px; border-radius: 3px; }
.sel-list { display: flex; flex-wrap: wrap; gap: 7px; }
.sel-item {
  padding: 5px 11px; border: 1px solid var(--border-strong); border-radius: 16px;
  font-size: 12.5px; cursor: pointer; transition: .13s; user-select: none;
}
.sel-item:hover { border-color: var(--primary); color: var(--primary); }
.sel-item.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.sel-item small { color: var(--muted); margin-left: 4px; }
.sel-item.on small { color: #BBDEFB; }

/* ============ 开关（Switch） ============ */
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 9px 0; min-height: 38px;
}
.switch-row .sw-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.switch-row .sw-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.switch {
  position: relative; width: 44px; height: 25px; flex: 0 0 44px;
  background: var(--border); border-radius: 999px; cursor: pointer;
  transition: background .18s ease; border: none; padding: 0;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform .18s ease;
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(19px); }
.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 带单位后缀的输入框 */
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit input { padding-right: 52px; }
.input-unit .unit {
  position: absolute; right: 11px; font-size: 12px; color: var(--muted);
  pointer-events: none; font-weight: 500;
}

/* 敏感参数提示条 */
.secret-note {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 11.5px; color: var(--muted); margin-top: 2px;
}
.secret-note .sn-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
  flex: 0 0 6px; margin-top: 5px;
}

/* ============ 响应式 ============ */
@media (max-width: 1100px) {
  .grid-side, .detail-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 14px 12px 30px; }
  .header { padding: 0 12px; }
  .user-chip .uname, .user-chip .urole { display: none; }
  .user-chip { padding: 5px; }
  .user-chip .user-caret { display: none; }
  .user-menu { width: 190px; }
  .filters { padding: 10px 12px; }
  .filters input.w-search { width: 100%; }
}
@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr; }
  .modal { max-width: 100%; }
  /* 参数页在窄屏更紧凑，避免大量滚动 */
  .form-grid { gap: 10px; }
  .form-item { gap: 4px; }
  .form-item input, .form-item select, .form-item textarea { height: 40px; padding: 0 12px; }
  .switch-row { padding: 7px 0; }
  .section-title { margin: 16px 0 8px; }
  .card-head { padding: 11px 13px; }
  .card-body { padding: 13px; }
  .form-actions { position: sticky; bottom: 0; background: var(--white);
    padding: 10px 0; margin-top: 8px; border-top: 1px solid var(--border); }
  .form-actions .btn { width: 100%; justify-content: center; height: 44px; }
}

/* ============ 看板下钻来源标识 ============ */
.filter-source {
  display: flex; align-items: center; gap: 8px; padding: 9px 18px;
  background: var(--primary-light); border-bottom: 1px solid var(--primary-light);
  font-size: 12.5px; color: var(--primary-dark); font-weight: 600;
}
.filter-source .fs-icon { font-size: 13px; }
.filter-source .btn { margin-left: auto; color: var(--primary); }
.filter-source .btn:hover { background: var(--white); }

/* ============ 附件上传 ============ */
.upload-zone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; cursor: pointer; transition: .15s;
  background: var(--surface); color: var(--muted); font-size: 12.5px;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-lighter); color: var(--primary); }
.upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone .uz-icon { font-size: 20px; display: block; margin-bottom: 4px; }
.upload-zone .uz-btn {
  display: inline-block; margin-top: 7px; padding: 5px 14px; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 500;
}
.upload-zone .uz-btn:hover { background: var(--primary-dark); }

.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.file-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.file-item .fi-thumb {
  width: 30px; height: 30px; border-radius: 4px; object-fit: cover;
  background: var(--border); flex-shrink: 0; cursor: pointer;
}
.file-item .fi-icon {
  width: 30px; height: 30px; border-radius: 4px; background: var(--primary-light);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.file-item .fi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fi-size { color: var(--muted); font-size: 11.5px; flex-shrink: 0; }
.file-item .fi-del {
  border: none; background: none; color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 2px 4px;
}
.file-item .fi-del:hover { color: var(--danger); }
.file-item .fi-progress { width: 100%; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.file-item .fi-progress i { display: block; height: 100%; background: var(--primary); transition: width .2s; }

/* 详情页附件展示 */
.attach-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.attach-thumb {
  width: 96px; height: 96px; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); position: relative; cursor: pointer; background: var(--surface);
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-thumb .at-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 5px;
  background: rgba(0,0,0,.62); color: #fff; font-size: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attach-thumb .at-badge {
  position: absolute; top: 3px; right: 3px; background: var(--success); color: #fff;
  font-size: 9.5px; padding: 1px 5px; border-radius: 3px; font-weight: 600;
}

/* 图片预览浮层 */
.img-viewer {
  position: fixed; inset: 0; background: rgba(10,15,25,.9); z-index: 3000;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 30px; cursor: zoom-out;
}
.img-viewer img { max-width: 90vw; max-height: 80vh; object-fit: contain; border-radius: 6px; }
.img-viewer .iv-name { color: #fff; margin-top: 14px; font-size: 13.5px; }
.img-viewer .iv-close {
  position: absolute; top: 20px; right: 24px; color: #fff; font-size: 30px;
  background: none; border: none; cursor: pointer; line-height: 1;
}
