/* ============================================================
   集团 AI 工作台 · 设计系统
   蓝白主色 · 左侧栏 - 内容区布局
   ============================================================ */
:root {
  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --brand-700: #1e40af;
  --brand-50: #eff4ff;
  --brand-100: #dbe6fe;

  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e8ecf2;
  --border-strong: #d6dfea;

  --text: #1a2233;
  --text-2: #4a5568;
  --muted: #8a95a6;

  --ok: #059669;      --ok-bg: #e8f7f0;
  --warn: #d97706;    --warn-bg: #fef4e6;
  --danger: #dc2626;  --danger-bg: #fdecea;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shadow-xs: 0 1px 2px rgba(16, 30, 54, .04);
  --shadow-sm: 0 1px 3px rgba(16, 30, 54, .05), 0 2px 8px rgba(16, 30, 54, .04);
  --shadow: 0 2px 6px rgba(16, 30, 54, .06), 0 12px 32px rgba(16, 30, 54, .06);
  --shadow-lg: 0 16px 48px rgba(16, 30, 54, .14);

  --sidebar-w: 236px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { color: var(--text); }
::selection { background: var(--brand-100); }

/* ---------- 通用原子 ---------- */
.muted { color: var(--muted); }
.small-text { font-size: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* ---------- 外壳 ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}
.sb-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sb-logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(140deg, #3b82f6, #1d4ed8);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: .5px;
  box-shadow: 0 3px 10px rgba(37, 99, 235, .3);
}
.sb-name { font-size: 14px; font-weight: 700; letter-spacing: .2px; line-height: 1.2; white-space: nowrap; }
.sb-sub { font-size: 10px; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
.sb-logo-img { height: 26px; width: auto; display: block; flex-shrink: 0; }
.hero-logo-img { height: 36px; width: auto; display: block; }
.hero-logo-pill {
  background: #fff; border-radius: 9px; padding: 6px 10px;
  display: flex; align-items: center; box-shadow: 0 6px 18px rgba(4, 16, 44, .22);
}
.hero-logo-pill img { height: 20px; width: auto; display: block; }

.sb-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.sb-group { padding: 12px 10px 6px; font-size: 11px; font-weight: 600; color: #a9b3c2; letter-spacing: .8px; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; cursor: pointer;
  border: 0; background: transparent; width: 100%; text-align: left;
  font-family: inherit; transition: background .14s, color .14s;
}
.sb-item:hover { background: var(--surface-2); color: var(--brand); }
.sb-item.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.sb-item.active .sb-ico { color: var(--brand); }
.sb-ico { width: 18px; height: 18px; display: grid; place-items: center; color: #9aa5b5; flex-shrink: 0; }
.sb-ico svg { width: 17px; height: 17px; }
.sb-badge {
  margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 9px;
  background: var(--brand-50); color: var(--brand); font-weight: 600;
}

.sb-promo {
  margin: 12px; padding: 14px; border-radius: var(--radius);
  background: linear-gradient(150deg, #eff5ff, #e3edff 60%, #dbe6fe);
  border: 1px solid #dbe6fe;
}
.sb-promo h5 { margin: 0 0 6px; font-size: 13px; }
.sb-promo p { margin: 0 0 10px; font-size: 11.5px; color: #5a6a85; line-height: 1.6; }
.sb-promo button {
  width: 100%; border: 0; border-radius: var(--radius-xs); padding: 7px;
  background: var(--brand); color: #fff; font-size: 12px; font-family: inherit; cursor: pointer;
}
.sb-foot { padding: 10px 18px 14px; font-size: 11px; color: #a9b3c2; }

/* ---------- 主区 ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 18px;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .menu-btn { display: none; }
.sidebar-mask { display: none; position: fixed; inset: 0; background: rgba(16, 30, 54, .42); z-index: 25; }
.sidebar-mask.show { display: block; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.crumb strong { color: var(--text); font-weight: 600; font-size: 14px; }
.crumb .sep { color: #cbd5e1; }
.crumb-link {
  border: 0; background: none; padding: 0; font: inherit; font-size: 13px;
  color: var(--muted); cursor: pointer; font-family: inherit;
}
.crumb-link:hover { color: var(--brand); text-decoration: underline; }

.col-more {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  padding: 9px 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); font: inherit; font-size: 12.5px;
  cursor: pointer; transition: border-color .14s, color .14s, background .14s;
}
.col-more:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.col-more svg { width: 13px; height: 13px; transition: transform .18s; }

.tb-search { position: relative; max-width: 340px; flex: 1; }
.tb-search input {
  width: 100%; height: 36px; border-radius: 18px;
  border: 1px solid var(--border); background: var(--surface-2);
  padding: 0 14px 0 36px; font: inherit; font-size: 13px; color: var(--text); outline: none;
  transition: .16s;
}
.tb-search input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.tb-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }

.tb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; color: #6b7789; cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--brand); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot-badge {
  position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--danger); border: 1.5px solid #fff;
}
.tb-user { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 20px; }
.tb-user:hover { background: var(--surface-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(140deg, #60a5fa, #2563eb); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.tb-user .u-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.tb-user .u-role { font-size: 11px; color: var(--muted); line-height: 1.2; }

.view { padding: 24px 26px 60px; width: 100%; max-width: 1680px; }

/* ---------- 页头 ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.page-head .head-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px 22px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  border-radius: var(--radius-sm); padding: 8px 15px; cursor: pointer;
  font-size: 13px; font-family: inherit; font-weight: 500; line-height: 1.4;
  transition: border-color .14s, color .14s, background .14s, box-shadow .14s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(37,99,235,.3);
}
.btn.primary:hover:not(:disabled) { background: var(--brand-600); border-color: var(--brand-600); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,.28); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.small { padding: 5px 11px; font-size: 12px; border-radius: var(--radius-xs); }
.btn.block { width: 100%; padding: 11px; font-size: 14.5px; font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-bg); }
.btn svg { width: 15px; height: 15px; }

/* ---------- 表单 ---------- */
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; font: inherit; font-size: 13.5px; color: var(--text);
  background: #fff; outline: none; transition: border-color .14s, box-shadow .14s;
}
.input::placeholder, .textarea::placeholder { color: #b3bccb; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.select {
  appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 8l3-3.5' fill='none' stroke='%238a95a6' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 3px; }
.field-label .req { color: var(--danger); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12px; color: var(--danger); }
.field-error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }

/* ---------- 标签 / 状态 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 500;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface-2); white-space: nowrap;
}
.tag.p0 { color: #b42318; border-color: #fbd5d1; background: #fef3f2; }
.tag.phase1 { color: var(--ok); border-color: #bfe6d4; background: var(--ok-bg); }
.tag.phase2, .tag.phase3 { color: var(--warn); border-color: #f5dfb8; background: var(--warn-bg); }
.tag.blue { color: var(--brand); border-color: var(--brand-100); background: var(--brand-50); }

.status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.成功 { background: var(--ok-bg); color: var(--ok); }
.status.失败 { background: var(--danger-bg); color: var(--danger); }
.status.执行中 { background: var(--brand-50); color: var(--brand); }
.status.待调度 { background: var(--warn-bg); color: var(--warn); }
.status.草稿, .status.已取消 { background: #eef1f5; color: var(--muted); }

/* ---------- 门户 ---------- */
.portal-wrap { position: relative; }
/* 分类横向排列，超宽时左右滑动，不再折到下面 */
.portal-grid {
  display: flex; gap: 18px; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px 2px 12px;
  scroll-padding-left: 2px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: #d8e0ec transparent;
}
.portal-grid::-webkit-scrollbar { height: 8px; }
.portal-grid::-webkit-scrollbar-track { background: transparent; }
.portal-grid::-webkit-scrollbar-thumb { background: #d8e0ec; border-radius: 4px; }
.portal-grid::-webkit-scrollbar-thumb:hover { background: #c2cfe0; }
/* 宽屏一屏正好 4 列，列数超出一屏时用两侧箭头左右滑动（不再折行到下面） */
.portal-col {
  display: flex; flex-direction: column; gap: 12px;
  flex: 0 0 max(232px, calc((100% - 54px) / 4));
  max-width: 360px; min-width: 0;
  scroll-snap-align: start;
}
.portal-nav {
  position: absolute; top: 46%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; z-index: 3;
  border: 1px solid var(--border); background: rgba(255,255,255,.97);
  box-shadow: 0 2px 10px rgba(16,32,64,.12);
  color: var(--text-2); font-size: 20px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  transition: opacity .15s, color .15s, border-color .15s;
}
.portal-nav:hover { color: var(--brand); border-color: #dbe6fe; }
.portal-nav.prev { left: -12px; }
.portal-nav.next { right: -12px; }
.portal-nav[disabled] { opacity: 0; pointer-events: none; }
.portal-tip { margin-left: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.portal-tip[hidden] { display: none; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 6px; }
.col-head .bar { width: 3px; height: 14px; border-radius: 2px; background: var(--brand); }
.col-head .name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.col-head .num { font-size: 11.5px; color: var(--muted); background: #eef2f7; border-radius: 9px; padding: 0 7px; }

.agent-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px 12px;
  display: flex; flex-direction: column; gap: 9px;
  transition: box-shadow .16s, transform .16s, border-color .16s;
}
.agent-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #dbe6fe; }
.agent-top { display: flex; align-items: flex-start; gap: 10px; }
.agent-no {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; letter-spacing: .3px;
}
.agent-name { font-size: 14px; font-weight: 650; line-height: 1.4; flex: 1; min-width: 0; padding-top: 2px; }
.agent-desc {
  font-size: 12.5px; color: var(--muted); line-height: 1.65; min-height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.agent-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.agent-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--border); padding-top: 9px; margin-top: 2px; }
.agent-go {
  border: 0; background: none; padding: 0; color: var(--brand); font-size: 12.5px;
  font-weight: 600; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.agent-go:hover { color: var(--brand-600); }
.agent-go svg { width: 13px; height: 13px; transition: transform .14s; }
.agent-go:hover svg { transform: translateX(2px); }
.agent-mini { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; cursor: pointer; font-family: inherit; }
.agent-mini:hover { color: var(--brand); }
.agent-card[data-off='1'] { opacity: .62; }

.portal-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.portal-toolbar .input, .portal-toolbar .select { width: auto; min-width: 190px; height: 36px; padding-top: 0; padding-bottom: 0; }

/* ---------- 拖拽上传 ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 26px 20px; text-align: center; cursor: pointer;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.dropzone:hover { border-color: var(--brand); background: var(--brand-50); }
.dropzone.drag { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 4px rgba(37,99,235,.08); }
.dz-icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.dz-icon svg { width: 22px; height: 22px; }
.dz-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.dz-title em { color: var(--brand); font-style: normal; }
.dz-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.file-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.file-ico {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #60a5fa, #2563eb); text-transform: uppercase;
}
.file-ico.xls { background: linear-gradient(140deg, #34d399, #059669); }
.file-ico.pdf { background: linear-gradient(140deg, #f87171, #dc2626); }
.file-ico.doc { background: linear-gradient(140deg, #60a5fa, #1d4ed8); }
.file-ico.audio, .file-ico.video { background: linear-gradient(140deg, #c084fc, #7c3aed); }
.file-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 11.5px; color: var(--muted); }
.file-del { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.file-del:hover { background: var(--danger-bg); color: var(--danger); }
.file-del svg { width: 14px; height: 14px; }

/* ---------- 运行结果 / 时间线 ---------- */
.timeline { display: flex; flex-direction: column; padding: 4px 0; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1.5px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-item.done::before { background: #bfe6d4; }
.tl-dot {
  width: 17px; height: 17px; border-radius: 50%; flex-shrink: 0; margin-top: 2px;
  border: 2px solid var(--border-strong); background: #fff; display: grid; place-items: center;
  color: #fff; z-index: 1;
}
.tl-dot svg { width: 9px; height: 9px; }
.tl-item.done .tl-dot { border-color: var(--ok); background: var(--ok); }
.tl-item.active .tl-dot { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.14); }
.tl-main { flex: 1; min-width: 0; }
.tl-title { font-size: 13px; font-weight: 600; color: var(--text); }
.tl-item:not(.done):not(.active) .tl-title { color: var(--muted); font-weight: 500; }
.tl-time { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.result-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .result-layout { grid-template-columns: 1fr; } }

.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .detail-cols { grid-template-columns: 1fr; } }

.output-block + .output-block { margin-top: 14px; }
.output-text {
  white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 15px 16px; font-size: 13px; line-height: 1.85; color: var(--text-2);
}
.output-title { font-size: 13px; font-weight: 650; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.output-title::before { content: ''; width: 3px; height: 12px; border-radius: 2px; background: var(--brand); }
.output-note { margin: 6px 2px 0; font-size: 12px; color: var(--muted); line-height: 1.8; }
.output-block + .output-block { margin-top: 4px; }

/* ---------- 进度环 ---------- */
.ring-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 2px; }
.ring { position: relative; width: 108px; height: 108px; }
.ring svg { transform: rotate(-90deg); }
.ring-track { stroke: #eef2f7; fill: none; }
.ring-bar { stroke: var(--ok); stroke-linecap: round; fill: none; transition: stroke-dashoffset .6s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-pct { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.ring-cap { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.ring-note { font-size: 12px; color: var(--muted); }
.check-list { display: flex; flex-direction: column; gap: 7px; width: 100%; margin-top: 4px; }
.check-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.check-item .ck { width: 15px; height: 15px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; flex-shrink: 0; }
.check-item .ck svg { width: 9px; height: 9px; }

/* ---------- 概览字段 ---------- */
.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.kv-item .k { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.kv-item .v { font-size: 13.5px; font-weight: 600; color: var(--text); word-break: break-all; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfcfe; }

/* ---------- 空态 / 提示 ---------- */
.empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 10px);
  background: #1a2233; color: #fff; padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 13px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 90; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 分栏 ---------- */
.split { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 18px; align-items: start; }
.side { padding: 12px; }
.side-item { padding: 9px 11px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); }
.side-item:hover { background: var(--surface-2); color: var(--brand); }
.side-item.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.side-group { margin: 12px 8px 6px; font-size: 11px; font-weight: 600; color: #a9b3c2; letter-spacing: .6px; }

/* ============================================================
   登录页
   ============================================================ */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.06fr 1fr; }

.login-hero {
  position: relative; overflow: hidden; color: #fff;
  background: #071b3d;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 46px 56px 34px;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; display: block; }
.hero-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(100deg, rgba(4, 15, 38, .95) 0%, rgba(4, 15, 38, .78) 40%, rgba(4, 15, 38, .34) 72%, rgba(4, 15, 38, .58) 100%),
    linear-gradient(180deg, rgba(4, 15, 38, .55) 0%, rgba(4, 15, 38, 0) 26%, rgba(4, 15, 38, .10) 62%, rgba(4, 15, 38, .86) 100%);
}
.hero-veil::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 18px 18px; opacity: .35;
}

.hero-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.hero-logo {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.25); display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}
.hero-brand { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.hero-brand small { display: block; font-size: 10.5px; font-weight: 400; opacity: .7; letter-spacing: 1px; text-transform: uppercase; }

.hero-mid { position: relative; z-index: 2; margin: auto 0; padding: 20px 0; }
.hero-slogan { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; letter-spacing: 1px; line-height: 1.15; margin: 0 0 18px; color: #fff; text-shadow: 0 2px 18px rgba(2, 10, 28, .45); }
.hero-slogan span { display: block; }
.hero-desc { font-size: 14.5px; line-height: 1.9; opacity: .92; max-width: 420px; margin: 0; text-shadow: 0 1px 10px rgba(2, 10, 28, .5); }
.hero-points { display: flex; gap: 22px; margin-top: 30px; flex-wrap: wrap; }
.hero-point { display: flex; align-items: center; gap: 8px; font-size: 12.5px; opacity: .92; }
.hero-point i { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.15); display: grid; place-items: center; font-style: normal; }
.hero-point svg { width: 12px; height: 12px; }

.hero-foot { position: relative; z-index: 2; display: flex; gap: 34px; align-items: flex-end; flex-wrap: wrap; text-shadow: 0 1px 8px rgba(2, 10, 28, .6); }
.hero-foot div { font-size: 11.5px; opacity: .8; line-height: 1.7; }
.hero-foot strong { display: block; font-size: 12.5px; opacity: 1; font-weight: 600; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 48px; background: #fff; }
.login-box { width: 100%; max-width: 372px; }
.login-box h1 { margin: 0 0 6px; font-size: 23px; font-weight: 700; letter-spacing: -.3px; }
.login-box .sub { margin: 0 0 22px; font-size: 13px; color: var(--muted); }

.login-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.login-tab { border: 0; background: none; padding: 0 0 11px; font: inherit; font-size: 13.5px; color: var(--muted); cursor: pointer; position: relative; font-weight: 500; }
.login-tab.active { color: var(--brand); font-weight: 650; }
.login-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }

.login-field { margin-bottom: 15px; }
.login-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.login-input-wrap { position: relative; }
.login-input-wrap .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #a9b3c2; pointer-events: none; }
.login-input-wrap .input { height: 42px; padding-left: 38px; border-radius: var(--radius-sm); }
.captcha-row { display: flex; gap: 10px; }
.captcha-row .input { height: 42px; flex: 1; letter-spacing: 3px; text-transform: uppercase; }
.captcha-img { width: 116px; height: 42px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); overflow: hidden; cursor: pointer; flex-shrink: 0; background: var(--surface-2); display: grid; place-items: center; }
.captcha-img svg { width: 100%; height: 100%; display: block; }
.captcha-img:hover { border-color: var(--brand); }

.login-row-between { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; font-size: 12.5px; }
.checkbox { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); cursor: pointer; }
.checkbox input { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
.login-link { color: var(--brand); font-size: 12.5px; }

.login-err { color: var(--danger); font-size: 12.5px; min-height: 20px; margin: 0 0 10px; }
.login-note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); line-height: 1.8; text-align: center; }

/* 钉钉扫码占位 */
.dd-box { text-align: center; padding: 8px 0 4px; }
.dd-qr { width: 168px; height: 168px; margin: 0 auto 14px; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; padding: 10px; position: relative; box-shadow: var(--shadow-sm); }
.dd-qr svg { width: 100%; height: 100%; display: block; opacity: .9; }
.dd-qr .dd-mask { position: absolute; inset: 10px; background: rgba(245,247,250,.92); display: grid; place-items: center; text-align: center; border-radius: 8px; font-size: 12px; color: var(--text-2); line-height: 1.7; padding: 12px; }
.dd-qr .dd-mask strong { display: block; color: var(--brand); font-size: 13px; margin-bottom: 4px; }
.dd-tip { font-size: 12px; color: var(--muted); }

/* ---------- Tab 页签 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  border: 0; background: none; padding: 10px 16px; font: inherit; font-size: 13.5px;
  color: var(--muted); cursor: pointer; position: relative; font-weight: 500;
  border-radius: 8px 8px 0 0; font-family: inherit;
}
.tab:hover { color: var(--brand); background: var(--brand-50); }
.tab.active { color: var(--brand); font-weight: 650; }
.tab.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }

/* ---------- 角色卡片 ---------- */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.role-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 10px;
}
.role-name { font-size: 14.5px; font-weight: 650; }
.role-desc { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; min-height: 34px; }
.role-perms { display: flex; flex-direction: column; gap: 5px; border-top: 1px dashed var(--border); padding-top: 10px; }
.perm-line { display: flex; gap: 8px; font-size: 12px; line-height: 1.6; }
.perm-k { color: var(--muted); flex-shrink: 0; width: 38px; }
.perm-v { color: var(--text-2); flex: 1; min-width: 0; }
.role-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; }

/* ---------- 弹层表单 ---------- */
.modal-body { flex: 1; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 8px 14px; margin-top: 4px; }
.pick-group { margin-top: 12px; }
.pick-group-title { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.perm-block { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.perm-block-title { font-size: 13px; font-weight: 650; margin-bottom: 2px; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 8px 18px; margin-top: 8px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2); }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 80; padding: 24px;
  background: rgba(16, 30, 54, .42);
  display: grid; place-items: center;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 76vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-body { padding: 8px; overflow-y: auto; }
.pick-item { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.pick-item:hover { background: var(--brand-50); color: var(--brand); }
.pick-item .agent-no { width: auto; min-width: 34px; padding: 0 8px; }
.pick-item svg { width: 16px; height: 16px; }

/* ---------- 全局搜索 ---------- */
.tb-search input { padding-right: 32px; }
.gs-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0;
  background: #dfe4ec; color: #64707f; display: grid; place-items: center; cursor: pointer;
}
.gs-clear:hover { background: #cfd6e2; color: #33404f; }
.gs-clear svg { position: static; left: auto; top: auto; transform: none; width: 11px; height: 11px; }

.gs-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 60; padding: 6px;
  max-height: 72vh; overflow-y: auto;
}
.gs-gt { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .4px; padding: 7px 10px 4px; }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.gs-item:hover, .gs-item.active { background: var(--brand-50); }
.gs-ico {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700;
}
.gs-ico.plain { background: var(--surface-2); border: 1px solid var(--border); color: #5b6678; font-size: 9px; }
.gs-t { display: block; font-size: 13px; color: var(--text); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-m { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 4px; padding: 9px 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--brand); cursor: pointer;
}
.gs-foot:hover { background: var(--brand-50); }
.gs-kbd { color: var(--muted); font-size: 11.5px; }
.gs-empty { padding: 20px 12px; text-align: center; font-size: 13px; color: var(--muted); }
mark { background: #fde68a; color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------- 搜索结果页 ---------- */
.tab-num {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 8px;
  background: var(--surface-2); color: var(--muted); font-size: 11px;
}
.tab.active .tab-num { background: var(--brand-50); color: var(--brand); }
.sr-list { padding: 6px; }
.sr-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border: 0; background: transparent; border-radius: 10px;
  cursor: pointer; font-family: inherit; color: var(--text);
}
.sr-row:hover { background: var(--brand-50); }
.sr-ico {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700;
}
.sr-ico.plain { background: var(--surface-2); border: 1px solid var(--border); color: #5b6678; font-size: 9.5px; }
.sr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sr-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-go { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--brand); flex-shrink: 0; }
.sr-go svg { width: 14px; height: 14px; }
.sr-tip {
  margin: -4px 0 14px; padding: 9px 14px; border-radius: 8px;
  background: var(--warn-bg); color: #8a5a12; font-size: 12.5px;
}

/* ---------- 资料库（网盘式） ---------- */
.lib-crumb { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.lib-drop {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 18px 14px; padding: 13px; border: 1.5px dashed var(--border-strong);
  border-radius: 10px; color: var(--muted); font-size: 12.5px;
  background: var(--surface-2); transition: .15s;
}
.lib-drop svg { width: 16px; height: 16px; }
.lib-drop.drag { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.folder-row { background: #fcfdff; }
.fld-ico { display: inline-flex; vertical-align: -3px; margin-right: 6px; color: #eab308; }
.fld-ico svg { width: 17px; height: 17px; }
.fld-name { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; padding: 0; font-weight: 600; }
.fld-name:hover { color: var(--brand); text-decoration: underline; }
.file-badge {
  display: inline-block; min-width: 34px; margin-right: 8px; padding: 1px 5px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 9.5px; font-weight: 700; color: #6b7789; text-align: center; letter-spacing: .3px;
}
.file-badge.xls { background: #e8f7f0; border-color: #bfe8d5; color: #0b7a52; }
.file-badge.pdf { background: #fdecea; border-color: #f7c9c4; color: #b3261e; }
.file-badge.doc { background: #eaf1fd; border-color: #c6dbfb; color: #1a56c4; }
.lib-types { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 7px; }
.lt-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.lt-row b { color: var(--text-2); font-weight: 600; }
.lib-tip { padding: 10px 16px 14px; font-size: 11.5px; color: var(--muted); line-height: 1.9; border-top: 1px dashed var(--border); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) { .portal-col { flex-basis: max(228px, calc((100% - 36px) / 3)); } }
@media (max-width: 1080px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { padding: 32px 22px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .portal-col { flex-basis: max(240px, calc((100% - 36px) / 3)); max-width: none; }
  .form-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > * { min-width: 0; }
  .tb-search { display: block; flex: 1; max-width: none; margin: 0 6px; }
  .crumb { display: none; }
  .menu-btn { display: grid !important; }
  .view { padding: 18px 14px 50px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head .head-actions { justify-content: flex-start; }
  .topbar { padding: 0 14px; }
  .kv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* 手机上每次整屏一列，避免右侧露出被裁一半的文字 */
  .portal-col { flex-basis: 100%; max-width: 100%; }
  .portal-nav.prev { left: -8px; }
  .portal-nav.next { right: -8px; }
}
