/* ==========================================================================
   丰朗盛泰 · 内部管理系统样式（light theme）
   ========================================================================== */

:root {
  /* 配色取自公司 Logo：#060d33 藏青 + #d01818 正红 */
  --primary: #1c2b6e;
  --primary-dark: #131d4d;
  --primary-100: #edf0fb;
  --accent: #d01818;
  --accent-100: #fbecec;

  --nav-bg: #060d33;
  --nav-bg-2: #0e1a4a;
  --nav-text: rgba(255, 255, 255, 0.7);
  --nav-active: #ffffff;

  --bg: #f2f5f9;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-strong: #cfd8e5;
  --text: #17202b;
  --text-soft: #43536a;
  --muted: #78879b;

  --ok: #2e9e63;
  --ok-bg: #e9f6ee;
  --warn: #c98a1a;
  --warn-bg: #fdf3e0;
  --danger: #cf4a44;
  --danger-bg: #fdeeee;
  --info: #2f7fc1;
  --info-bg: #e9f2fb;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 54, 0.05), 0 1px 3px rgba(16, 32, 54, 0.06);
  --shadow-md: 0 4px 14px rgba(16, 32, 54, 0.08);
  --shadow-lg: 0 20px 48px rgba(11, 37, 69, 0.2);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

[hidden] {
  display: none !important;
}

/* ---------------- 登录 / 初始化 ---------------- */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: #fff;
}

.auth-aside {
  background: radial-gradient(900px 460px at 82% 0%, rgba(208, 24, 24, 0.32) 0%, transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(37, 58, 134, 0.55) 0%, transparent 55%),
    linear-gradient(160deg, #05091f, #060d33 55%, #101a4d);
  color: #fff;
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 80%);
  pointer-events: none;
}

.auth-aside > * {
  position: relative;
  z-index: 2;
}

.auth-aside .a-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.auth-aside .a-brand .mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  padding: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.auth-aside .a-brand .mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auth-aside .a-brand strong {
  font-size: 17px;
  letter-spacing: 0.03em;
  display: block;
}

.auth-aside .a-brand small {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.1em;
}

.auth-aside h2 {
  font-size: 33px;
  line-height: 1.35;
  margin-bottom: 20px;
  letter-spacing: -0.015em;
}

.auth-aside p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
  line-height: 1.9;
  max-width: 460px;
}

.auth-features {
  display: grid;
  gap: 14px;
  margin-top: 34px;
}

.auth-features div {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.85);
}

.auth-features .fi {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent);
}

.auth-main {
  display: grid;
  place-items: center;
  padding: 48px 32px;
}

.auth-box {
  width: 100%;
  max-width: 400px;
}

.auth-box h1 {
  font-size: 25px;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.auth-box .lead {
  color: var(--muted);
  font-size: 14.2px;
  margin-bottom: 30px;
  line-height: 1.75;
}

.auth-footer {
  margin-top: 26px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-aside {
    display: none;
  }
}

/* ---------------- 表单控件 ---------------- */

.field {
  margin-bottom: 16px;
}

.field > label {
  display: block;
  font-size: 13.2px;
  color: var(--text-soft);
  margin-bottom: 6px;
  font-weight: 500;
}

.field > label .req {
  color: var(--danger);
  margin-left: 2px;
}

.field .hint {
  font-size: 12.4px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.6;
}

.field .err {
  font-size: 12.4px;
  color: var(--danger);
  margin-top: 5px;
}

/* 注意：一定要带上 input:not([type])。
   HTML 里 <input> 不写 type 时默认就是 text，但它【匹配不到】input[type="text"]，
   于是拿不到下面这套样式，会退回浏览器默认的迷你输入框——
   登录页用户名框（#lg_user）就是这么变得比密码框小一圈的。
   全后台有十几处 <input> 没写 type，所以这里统一兜住。 */
.input,
input:not([type]),
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: 0.16s;
  line-height: 1.5;
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 95, 168, 0.13);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f6f8fb;
  color: var(--muted);
  cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--primary);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.6px;
  color: var(--text-soft);
  user-select: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}

.form-grid .span2 {
  grid-column: span 2;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span2 {
    grid-column: span 1;
  }
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13.6px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.16s;
  white-space: nowrap;
  line-height: 1.5;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(29, 95, 168, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-default {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.btn-default:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: #fff;
  border-color: #eccac8;
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  padding: 6px 10px;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--primary-100);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 11px 20px;
  font-size: 14.6px;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12.8px;
}

/* ---------------- 布局 ---------------- */

.app {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--nav-bg), var(--nav-bg-2));
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sb-brand {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  flex-shrink: 0;
}

.sb-brand .mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  padding: 3px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.sb-brand .mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sb-brand strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #fff;
  font-size: 13.8px;
  letter-spacing: 0.01em;
  line-height: 1.35;
  word-break: break-all;
}

.sb-brand small {
  font-size: 10.8px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.08em;
}

.sb-nav {
  padding: 14px 12px 24px;
  flex: 1;
}

.sb-group {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.34);
  padding: 16px 12px 7px;
  text-transform: uppercase;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9.5px 12px;
  border-radius: 9px;
  color: var(--nav-text);
  font-size: 14px;
  cursor: pointer;
  transition: 0.15s;
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
}

.sb-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sb-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--nav-active);
  font-weight: 500;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sb-item svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.sb-item .badge {
  margin-left: auto;
  background: var(--accent);
  color: #241a04;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
}

.sb-foot {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 11.6px;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 30;
  /* 不能用 overflow:hidden —— 顶栏里的用户菜单与提醒面板是绝对定位浮层，会被裁掉；
     文本溢出由 .topbar h1 / .crumb 自身的省略号规则处理 */
  overflow: visible;
}

.topbar h1 {
  font-size: 17.4px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .crumb {
  font-size: 12.4px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: #fff;
  transition: 0.16s;
  position: relative;
}

.user-chip:hover {
  border-color: var(--primary);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-chip .u-name {
  font-size: 13.4px;
  font-weight: 500;
  line-height: 1.25;
}

.user-chip .u-role {
  font-size: 11.4px;
  color: var(--muted);
  line-height: 1.25;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  padding: 6px;
  z-index: 50;
}

.menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  background: none;
  border-radius: 7px;
  font-size: 13.6px;
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
}

.menu button:hover {
  background: var(--bg);
  color: var(--primary);
}

.menu .sep {
  height: 1px;
  background: var(--line);
  margin: 5px 4px;
}

.content {
  padding: 24px 26px 48px;
  flex: 1;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-head h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
}

.page-head p {
  color: var(--muted);
  font-size: 13.4px;
  margin-top: 4px;
  max-width: 720px;
  line-height: 1.7;
}

.page-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 20px 22px;
}

.card-head {
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.card-head h3 {
  font-size: 15.4px;
  font-weight: 600;
}

.card-head .sub {
  font-size: 12.6px;
  color: var(--muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px 22px;
}

.card-body.flush {
  padding: 0;
}

/* ---------------- 统计卡 ---------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 19px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card .st-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card .st-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-100);
  color: var(--primary);
}

.stat-card .st-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.stat-card .st-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.stat-card.g .st-icon {
  background: var(--ok-bg);
  color: var(--ok);
}
.stat-card.w .st-icon {
  background: var(--warn-bg);
  color: var(--warn);
}
.stat-card.a .st-icon {
  background: var(--accent-100);

  color: var(--accent);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.grid-2b {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2,
  .grid-2b {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.24s;
  }
  .sidebar.open {
    transform: none;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 16px 14px 40px;
  }
  .topbar {
    padding: 0 14px;
  }
  .mobile-toggle {
    display: grid !important;
  }
}

.mobile-toggle {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  color: var(--text);
}

.sidebar-mask {
  display: none;
}

@media (max-width: 760px) {
  .sidebar-mask.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(8, 27, 51, 0.5);
    z-index: 80;
  }
}

/* ---------------- 条形图 ---------------- */

.bar-row {
  display: grid;
  grid-template-columns: 108px 1fr 46px;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
  font-size: 13.2px;
}

.bar-track {
  height: 9px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #4a92d6);
  transition: width 0.5s;
}

.bar-row .bar-label {
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row .bar-val {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 表格 ---------------- */

.table-wrap {
  overflow-x: auto;
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.6px;
}

table.tbl th {
  text-align: left;
  padding: 11px 16px;
  background: #f8fafc;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 12.8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

table.tbl td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  vertical-align: middle;
}

table.tbl tbody tr:hover {
  background: #f9fbfd;
}

table.tbl tbody tr:last-child td {
  border-bottom: none;
}

table.tbl .nowrap {
  white-space: nowrap;
}

/* 行号列（跟随当前排序、跨页连续），仅供展示 */
table.tbl th.idx,
table.tbl td.idx {
  width: 56px;
  min-width: 56px;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

table.tbl .strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------------- 宽表（员工档案）：冻结前三列 + 每列筛选 + 单元格直接编辑 ---------------- */

.emp-wide-wrap {
  overflow: auto;
  max-height: calc(100vh - 250px);
  min-height: 240px;
}

table.tbl.emp-wide {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

table.tbl.emp-wide th,
table.tbl.emp-wide td {
  padding: 4px 10px;
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* 表头只剩一行列名（逐列筛选已移到表格上方的筛选栏），继续吸顶 */
table.tbl.emp-wide thead th {
  height: 34px;
  padding: 8px 10px;
  vertical-align: middle;
}

table.tbl.emp-wide .th-label {
  display: block;
  line-height: 1.4;
}

/* 行高紧凑：徽标 / 行内按钮都比文字行盒高，不缩小就会把每一行撑到 36px。
   徽标压缩到 17px —— 高于这个值它的基线以下部分会把行盒再顶高 2px。 */
table.tbl.emp-wide td .badge {
  padding: 1px 8px;
  line-height: 15px;
}

table.tbl.emp-wide .row-actions .btn {
  height: 19px;
  padding: 0 5px;
  font-size: 13px;
  line-height: 1;
  border-radius: 5px;
}

table.tbl.emp-wide .th-label[data-sort]:hover {
  color: var(--primary);
  text-decoration: underline dotted;
}

/* ---------------- 员工档案：表格上方的筛选栏（替代原来的搜索框 + 几个下拉） ---------------- */

.emp-filters {
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.ef-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.ef-title {
  font-size: 12.8px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.ef-summary {
  font-size: 12.4px;
  color: var(--muted);
  white-space: nowrap;
}

.ef-summary.on {
  color: var(--primary);
  font-weight: 600;
}

.ef-spacer {
  flex: 1;
}

.ef-size {
  height: 28px;
  padding: 0 8px;
  font-size: 12.6px;
  color: var(--text-soft);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

/* 横向滚动的筛选条：每一格对应表格的一列 */
.ef-strip {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.ef-item {
  flex: 0 0 auto;
  padding: 6px 8px 7px;
  border-right: 1px solid var(--line);
}

.ef-item:last-child {
  border-right: none;
}

.ef-item.on {
  background: #eef4ff;
}

.ef-label {
  display: block;
  margin-bottom: 3px;
  font-size: 11.6px;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ef-item.on .ef-label {
  color: var(--primary);
}

.ef-item .cf {
  width: 100%;
  height: 26px;
  padding: 2px 6px;
  font: inherit;
  font-size: 12.4px;
  font-weight: 400;
  color: var(--text-soft);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.ef-item .cf:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-100);
  outline: none;
}

/* 文本筛选：输入框 + 一键清除 */
.ef-item .tf {
  position: relative;
  display: block;
}

.ef-item .tf .cf-text {
  padding-right: 20px;
}

.ef-item .tf-x {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.ef-item.on .tf-x {
  display: block;
}

.ef-item .tf-x:hover {
  color: var(--danger);
  background: #fdecec;
}

/* 多选下拉（枚举 / 部门 / 在职状态 / 合同提醒） */
.ef-item .msf {
  position: relative;
}

.ef-item .msf-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}

.ef-item .msf-txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ef-item .msf-caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--muted);
}

.ef-item.on .msf-btn {
  color: var(--primary);
  font-weight: 600;
  border-color: var(--primary);
}

.ef-item.on .msf-caret {
  border-top-color: var(--primary);
}

/* 面板用 fixed 定位：避免被筛选条的横向滚动裁掉 */
.msf-pop {
  position: fixed;
  /* 250 = 高于弹窗(200)、低于 toast(300)：筛选面板挂在 body 上，会出现在弹窗里 */
  z-index: 250;
  min-width: 168px;
  max-width: 300px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: 0 12px 30px -8px rgba(23, 32, 43, 0.3);
}

.msf-list {
  max-height: 250px;
  overflow: auto;
}

.msf-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  font-size: 12.8px;
  color: var(--text-soft);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.msf-opt:hover {
  background: #f4f7fb;
}

.msf-opt input {
  margin: 0;
  flex: 0 0 auto;
}

.msf-foot {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

/* 冻结列：序号 / 工号 / 姓名 */
table.tbl.emp-wide th.stick,
table.tbl.emp-wide td.stick {
  position: sticky;
  z-index: 3;
  background: var(--card);
}

table.tbl.emp-wide thead th.stick {
  background: #f8fafc;
  z-index: 7;
}

table.tbl.emp-wide th.s1,
table.tbl.emp-wide td.s1 {
  left: 0;
}

table.tbl.emp-wide th.s2,
table.tbl.emp-wide td.s2 {
  left: 56px;
}

table.tbl.emp-wide th.s3,
table.tbl.emp-wide td.s3 {
  left: 176px;
  box-shadow: 6px 0 8px -6px rgba(23, 32, 43, 0.22);
}

table.tbl.emp-wide tbody tr:hover td.stick {
  background: #f9fbfd;
}

/* 冻结在右侧的「操作」列：查看 / 编辑 / 删除 始终可见 */
table.tbl.emp-wide th.stick-r,
table.tbl.emp-wide td.stick-r {
  position: sticky;
  right: 0;
  z-index: 4;
  background: var(--card);
  box-shadow: -6px 0 8px -6px rgba(23, 32, 43, 0.22);
}

table.tbl.emp-wide thead th.stick-r {
  background: #f8fafc;
  z-index: 8;
}

table.tbl.emp-wide tbody tr:hover td.stick-r {
  background: #f9fbfd;
}

/* 可就地编辑的单元格 */
table.tbl.emp-wide td.ed {
  cursor: cell;
}

table.tbl.emp-wide td.ed:hover {
  background: #eff5ff;
  box-shadow: inset 0 0 0 1px #bcd3fb;
}

table.tbl.emp-wide td.editing {
  padding: 1px 4px;
  background: #fff;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

table.tbl.emp-wide td.editing input,
table.tbl.emp-wide td.editing select {
  width: 100%;
  height: 30px;
  padding: 3px 7px;
  font: inherit;
  font-size: 13.6px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--primary);
  border-radius: 5px;
}

table.tbl.emp-wide .cell-saving {
  color: var(--muted);
  font-size: 12.4px;
}

table.tbl.emp-wide td.masked {
  color: var(--muted);
}

table.tbl.emp-wide td.contract-cell {
  padding-top: 0;
  padding-bottom: 0;
  white-space: nowrap;
}

table.tbl.emp-wide .mini-btn {
  display: inline-block;
  height: 19px;
  margin: 0 0 0 6px;
  padding: 0 7px;
  font-size: 11.6px;
  line-height: 17px;
  vertical-align: middle;
  color: var(--text-soft);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
}

table.tbl.emp-wide .mini-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

table.tbl.emp-wide .mono-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.8px;
}

table.tbl.emp-wide th.ops,
table.tbl.emp-wide td.ops {
  padding-left: 8px;
  padding-right: 8px;
}

table.tbl.emp-wide .right {
  text-align: right;
}

.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}

.empty svg {
  opacity: 0.35;
  margin-bottom: 12px;
}

.empty p {
  font-size: 14px;
}

.empty .sub {
  font-size: 12.8px;
  margin-top: 5px;
  opacity: 0.8;
}

/* ---------------- 徽章 ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12.2px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.badge.plain::before {
  display: none;
}

.badge.ok {
  background: var(--ok-bg);
  color: #1e7a49;
}
.badge.warn {
  background: var(--warn-bg);
  color: #9c6a10;
}
.badge.info {
  background: var(--info-bg);
  color: #23648f;
}
.badge.danger {
  background: var(--danger-bg);
  color: #a83a35;
}
.badge.mute {
  background: #eef1f6;
  color: #6c7a8d;
}
.badge.accent {
  background: var(--accent-100);
  color: #8a6314;
}

/* ---------------- 筛选栏 ---------------- */

/* 快捷筛选标签 */
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-soft);
  font-size: 12.8px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.16s;
  font-family: inherit;
  line-height: 1.5;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip b {
  font-weight: 700;
  font-size: 12.6px;
  color: var(--primary);
}

.chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chip.on b {
  color: #fff;
}

/* 提醒类快捷标签（跳转到提醒中心） */
.chip.chip-alert {
  border-color: #f0cdcb;
  background: var(--danger-bg);
  color: #a83a35;
}

.chip.chip-alert:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.chip.chip-alert b {
  color: var(--danger);
}

/* 员工档案顶部板块页签（在职 / 离职） */
.board-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 12px 0 12px;
  background: var(--primary-100);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.board-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13.6px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.16s;
}

.board-tabs button:hover {
  color: var(--primary);
}

.board-tabs button b {
  font-weight: 700;
  font-size: 12.6px;
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(28, 43, 110, 0.1);
  color: var(--primary);
}

.board-tabs button.on {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.board-tabs button.on b {
  background: var(--primary);
  color: #fff;
}

.board-tabs button.tab-resigned.on {
  color: var(--danger);
}

.board-tabs button.tab-resigned.on b {
  background: var(--danger);
  color: #fff;
}

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filters .grow {
  flex: 1;
  min-width: 180px;
}

.filters input,
.filters select {
  width: auto;
  min-width: 130px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding-left: 34px;
}

/* ---------------- 分页 ---------------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.pager .pages {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pager button {
  min-width: 31px;
  height: 31px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 13px;
  padding: 0 7px;
}

.pager button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pager button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------------- 弹窗 ---------------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.modal-root.open {
  display: block;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(9, 26, 47, 0.48);
  backdrop-filter: blur(2px);
}

.modal {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(720px, 100vw);
  background: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideLeft 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.center {
  right: auto;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  border-radius: var(--radius);
  max-height: calc(100vh - 64px);
  animation: popIn 0.18s ease;
}

@keyframes slideLeft {
  from {
    transform: translateX(40px);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    transform: translate(-50%, -48%) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
}

.modal-head h3 {
  font-size: 16.4px;
  font-weight: 600;
}

.modal-head .sub {
  font-size: 12.6px;
  color: var(--muted);
  margin-top: 2px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--danger);
  border-color: #eccac8;
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-foot {
  padding: 15px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: #fbfcfe;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.02em;
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--line-strong);
  margin: 22px 0 16px;
}

.section-title:first-child {
  margin-top: 0;
}

/* ---------------- Toast ---------------- */

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  display: grid;
  gap: 10px;
  justify-items: end;
  pointer-events: none;
}

.toast {
  background: #12233b;
  color: #fff;
  border-radius: 10px;
  padding: 11px 17px;
  font-size: 13.6px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 9px;
  animation: toastIn 0.22s ease;
  max-width: 420px;
  pointer-events: auto;
}

.toast.ok {
  background: #167a45;
}
.toast.err {
  background: #b03a34;
}

@keyframes toastIn {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* ---------------- 新版本提示条（前端版本戳自愈） ----------------
   只在「服务器已换版本、但本机这一页还在跑旧 JS」时出现，见 assets/js/updater.js。
   放在底部居中：右上角是 toast 的地盘，弹窗在中间，这里最不容易挡到东西。 */

.build-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 350; /* 高于弹窗(200)与 toast(300)，保证这个提示一定看得见 */
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(720px, calc(100vw - 32px));
  padding: 10px 12px 10px 14px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13.2px;
  color: var(--text-soft);
  animation: toastIn 0.22s ease;
}

.build-bar-icon {
  flex: none;
  display: grid;
  place-items: center;
  color: var(--info);
}

.build-bar-text {
  flex: 1;
  min-width: 0;
  line-height: 1.6;
}

.build-bar .btn {
  flex: none;
}

@media (max-width: 640px) {
  .build-bar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
    max-width: none;
    flex-wrap: wrap;
  }
}

/* ---------------- 组织架构树 ---------------- */

.tree {
  padding: 6px 0;
}

.tree-node {
  border-left: 2px solid var(--line);
  margin-left: 14px;
  padding-left: 14px;
}

.tree-node:first-child {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: 0.15s;
}

.tree-item:hover {
  background: #f8fafc;
  border-color: var(--line);
}

.tree-item .ti-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.tree-item .ti-meta {
  font-size: 12.4px;
  color: var(--muted);
}

.tree-item .ti-spacer {
  flex: 1;
}

.tree-item .ti-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: 0.15s;
}

.tree-item:hover .ti-actions {
  opacity: 1;
}

/* ---------------- 权限矩阵 ---------------- */

.perm-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.perm-group-head {
  background: #f8fafc;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.perm-group-body {
  padding: 12px 15px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 20px;
}

@media (max-width: 700px) {
  .perm-group-body {
    grid-template-columns: 1fr;
  }
}

.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 13.4px;
  color: var(--text-soft);
  border-bottom: 1px solid #f2f5f9;
}

/* ---------------- 角色卡 ---------------- */

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.role-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 19px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: 0.18s;
  display: flex;
  flex-direction: column;
}

.role-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.role-card .rc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.role-card h4 {
  font-size: 15.4px;
  font-weight: 600;
}

.role-card .rc-desc {
  font-size: 12.9px;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 14px;
}

.role-card .rc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 12.7px;
  color: var(--muted);
}

/* ---------------- AI 作图工坊 ---------------- */

/* 页面：左创作面板 + 右作品画廊 */
.pw-layout {
  display: grid;
  grid-template-columns: minmax(330px, 400px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.pw-panel {
  position: relative;
}

.pw-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  margin-bottom: 18px;
}

.pw-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13.2px;
  font-weight: 500;
  color: var(--text-soft);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.16s;
}

.pw-tab:hover {
  color: var(--primary);
}

.pw-tab.on {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.pw-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 18px 0 7px;
}

.pw-label:first-child {
  margin-top: 0;
}

.pw-label .pw-sub {
  font-weight: 400;
  color: var(--muted);
  font-size: 12.2px;
  margin-left: 6px;
}

.pw-prompt {
  resize: vertical;
  min-height: 108px;
  line-height: 1.7;
  font-size: 13.6px;
}

.pw-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.2px;
  color: var(--muted);
  margin-top: 8px;
  min-height: 30px;
}

.pw-desc {
  font-size: 12.4px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.7;
}

.pw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- 产品标签（生成前的必选分类：大理石 / 木纹 / 毛毡 / 格栅 / 防撞软包） ---------- */

.pw-tag-custom {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 9px;
}

.pw-tag-custom .input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 7px 11px;
}

/* 「+ 自定义」用虚线区分：它是个入口，不是可选项 */
.chip.chip-add {
  border-style: dashed;
  color: var(--muted);
}

.chip.chip-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 自定义标签：带一个小叉，点了就移除 */
.chip.chip-custom {
  gap: 5px;
}

.pw-tag-tip {
  margin: 7px 0 0;
  font-size: 12.2px;
  color: var(--muted);
}

.pw-tag-tip-warn {
  color: var(--warn);
}

/* 「产品标签」标题行：左边是标题，右边是管理员才有的「管理标签」入口 */
/* 产品标签块是提交前最后一道必填，两侧都多留一点气口 */
.pw-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 28px 0 9px;
}

/* 行距由 .pw-label-row 统一管，这里的 label 不再自带上下边距 */
.pw-label-row .pw-label {
  margin: 0;
}

.pw-tag-manage {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: 0.16s;
}

.pw-tag-manage:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- 标签库管理弹窗 ---------- */

.pw-taglib-chips {
  gap: 8px;
}

/* 库里每个标签右侧挂一个删除小叉：胶囊整体不是按钮，只有叉可点 */
.pw-taglib-chip {
  cursor: default;
  padding-right: 6px;
}

.pw-taglib-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 1px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: 0.16s;
}

.pw-taglib-del:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.pw-taglib-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.pw-taglib-add .input {
  flex: 1;
  min-width: 0;
}

.pw-taglib-tip {
  margin: 12px 0 0;
  font-size: 12.2px;
  color: var(--muted);
  line-height: 1.7;
}

.pw-taglib-empty {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12.6px;
  line-height: 1.7;
}

/* 没打标签就点「开始生成」→ 把标签区闪一下，让人一眼落回该操作的地方 */
.pw-tag-err {
  border-radius: var(--radius-sm);
  animation: pw-tag-flash 0.55s ease-in-out 3;
}

@keyframes pw-tag-flash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(207, 74, 68, 0);
  }
  50% {
    box-shadow: 0 0 0 5px var(--danger-bg);
  }
}

/* ---------- 作品卡片上的标签徽标（工坊画廊与集合页共用） ---------- */

.pw-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 7px;
}

/* 集合页卡片上的出图人姓名：描述上方单独一行，点一下按这个人筛 */
.pc-owner-row {
  margin: 0 0 7px;
}

.pc-owner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  border: 1px solid #dfe6d8;
  background: #f3f7ee;
  color: #4d6b3c;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.6;
  cursor: pointer;
  transition: 0.16s;
}

.pc-owner span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-owner svg {
  flex: none;
  opacity: 0.75;
}

.pc-owner:hover {
  border-color: #8fae74;
  background: #e6efdc;
  color: #3d5a2c;
}

.pw-item-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid #dde3f5;
  background: var(--primary-100);
  color: var(--primary);
  font-size: 11.6px;
  font-weight: 500;
  line-height: 1.7;
  font-family: inherit;
}

/* 集合页里的标签可点（点了就按它筛），工坊画廊里的只是展示 */
button.pw-item-tag {
  cursor: pointer;
  transition: 0.16s;
}

button.pw-item-tag:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.pw-hint {
  font-size: 12.2px;
  color: var(--muted);
  text-align: center;
  margin-top: 9px;
}

/* 汇总行里的提示：行内小字，不参与上面那套居中大间距 */
.pc-summary .pw-hint,
.pw-summary .pw-hint {
  font-size: 11.8px;
  margin: 0;
  text-align: left;
  opacity: 0.85;
}

/* 参考图 */
.pw-ref-wrap {
  margin-bottom: 2px;
}

.pw-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 8px;
  margin-bottom: 9px;
}

.pw-ref {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  cursor: grab;
  background: #f6f8fb;
}

.pw-ref img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pw-ref.dragging {
  opacity: 0.4;
}

.pw-ref.over {
  outline: 2px dashed var(--primary);
  outline-offset: -3px;
}

.pw-ref-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 19px;
  height: 19px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.66);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.pw-ref-x:hover {
  background: var(--danger);
}

.pw-ref-no {
  position: absolute;
  left: 3px;
  bottom: 3px;
  font-size: 10.6px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.66);
  color: #fff;
}

.pw-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12.6px;
  cursor: pointer;
  text-align: center;
  transition: 0.16s;
  background: #fbfcfe;
}

.pw-drop:hover,
.pw-drop.over {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-100);
}

/* 生成状态 */
.pw-status {
  margin-top: 12px;
  font-size: 12.8px;
  line-height: 1.6;
  min-height: 18px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pw-status.ok {
  color: var(--ok);
}

.pw-status.err {
  color: var(--danger);
}

/* 积分徽标 */
.pw-credits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--accent-100);
  border: 1px solid #eddcc0;
  color: #8a6420;
  font-size: 12.6px;
  font-weight: 600;
  white-space: nowrap;
}

.pw-credits.pw-bad {
  background: var(--danger-bg);
  border-color: #f0cdcb;
  color: #a83a35;
}

/* 火山方舟通道：绿色系，与积分通道的琥珀色区分开，视觉上就是「另一套账户」 */
.pw-credits-ark {
  background: #e8f4ec;
  border-color: #cbe6d4;
  color: #2c6e46;
}

.pw-credits-ark.pw-bad {
  background: #fbf0e2;
  border-color: #f0dcc4;
  color: #96662a;
}

/* 免费模型的成本提示：绿色，和「扣积分」的灰色提示一眼可分 */
.pw-hint-free {
  color: #2c6e46;
  background: #eef7f1;
  border: 1px solid #d6eadd;
  border-radius: 8px;
  padding: 7px 10px;
}

/* 作品卡片上的「免费」角标 */
.pw-free-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #e8f4ec;
  border: 1px solid #cbe6d4;
  color: #2c6e46;
  font-size: 11px;
  font-weight: 500;
  vertical-align: 1px;
}

/* 画廊工具条 */
.pw-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

select.pw-mini,
input.pw-mini {
  width: auto;
  min-width: 118px;
  padding: 7px 10px;
  font-size: 12.8px;
}

.pw-search {
  min-width: 160px;
  max-width: 220px;
}

.pw-search input {
  padding: 7px 10px 7px 32px;
  font-size: 12.8px;
}

/* 出图时间段筛选（AI 作图工坊 / AI 作图集合共用）：折叠按钮 + 下拉面板。
   旧版是「两个原生 date 输入常驻工具条」，三个日历图标挤一起、空态一串
   yyyy/mm/日、整条 311px 把工具条撑爆 —— 已改成按钮，点开才见日期面板。 */
.pw-dates-wrap {
  position: relative;
  display: inline-flex;
}

.pw-dates {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 35px;
  padding: 0 10px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  font-size: 12.8px;
  cursor: pointer;
  transition: 0.16s;
}

.pw-dates:hover {
  border-color: var(--primary);
  color: var(--text-soft);
}

/* chevron：面板展开时翻个面 */
.pw-dates svg {
  flex: none;
  transition: transform 0.16s;
}

.pw-dates.open svg:last-of-type {
  transform: rotate(180deg);
}

/* 任一端有值就点亮：一眼看出「时间段正筛着」，标签换成 10-10 ~ 10-16 */
.pw-dates.on {
  border-color: var(--primary);
  background: var(--primary-100);
  color: var(--primary);
  font-weight: 600;
}

.pw-dates-label {
  white-space: nowrap;
}

/* 面板 position:fixed + JS 定位（同 .msf-pop），防被任何 overflow 祖先裁掉 */
.pw-dates-pop {
  position: fixed;
  z-index: 60;
  width: 248px;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 12px 30px -8px rgba(23, 32, 43, 0.3);
}

/* display:flex 会盖掉 hidden 属性，得显式补一条 */
.pw-dates-pop[hidden] {
  display: none;
}

.pw-dates-quick {
  display: flex;
  gap: 6px;
}

.pw-dates-quick button {
  flex: 1;
  padding: 4px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
  transition: 0.14s;
}

.pw-dates-quick button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-100);
}

/* 当前起止正好等于某个快捷项时点亮它 */
.pw-dates-quick button.act {
  border-color: var(--primary);
  background: var(--primary-100);
  color: var(--primary);
  font-weight: 600;
}

.pw-dates-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.4px;
  color: var(--muted);
  white-space: nowrap;
}

/* 全局 input[type="date"] 是 width:100% + 大内边距，这里按面板尺寸重排 */
.pw-dates-field input.pw-date {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 31px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
  font-size: 12.6px;
  color: var(--text);
}

.pw-dates-field input.pw-date:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(28, 43, 110, 0.12);
}

.pw-dates-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.pw-dates-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: auto; /* 清除靠左、「完成」恒靠右；清除隐藏时完成也不至于孤零零在左 */
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.2px;
  cursor: pointer;
}

.pw-dates-clear:hover {
  color: var(--danger);
}

/* hidden 属性会被上面的 display:inline-flex 盖掉，得显式补一条 */
.pw-dates-clear[hidden] {
  display: none;
}

.pw-dates-done {
  padding: 5px 16px;
  border: 0;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-size: 12.4px;
  cursor: pointer;
}

.pw-dates-done:hover {
  background: var(--primary-dark);
}

.pw-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 12.6px;
  color: var(--muted);
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

.pw-summary b {
  color: var(--primary);
  font-weight: 700;
}

.pw-warn {
  color: var(--warn);
}

/* 作品网格 */
.pw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.pw-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: 0.16s;
}

.pw-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

/* 生成中的占位卡：虚线边框 + 呼吸动画，和已出图的实卡区分开 */
.pw-card-pending {
  border-style: dashed;
  border-color: var(--primary);
  background: linear-gradient(180deg, #fbfdff, #f4f8fd);
}

.pw-card-pending:hover {
  box-shadow: none;
  border-color: var(--primary);
}

.pw-card-pending .pw-card-prompt {
  color: var(--text-soft);
}

.pw-card-img {
  aspect-ratio: 1;
  background: #eef2f7;
  cursor: zoom-in;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.pw-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pw-card-img.pw-lost {
  cursor: default;
  background: repeating-linear-gradient(45deg, #f5f7fa, #f5f7fa 8px, #eef2f7 8px, #eef2f7 16px);
}

.pw-lost-in {
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.pw-shimmer {
  color: var(--primary);
  animation: pw-pulse 1.4s ease-in-out infinite;
}

@keyframes pw-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.pw-card-body {
  padding: 10px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.pw-card-prompt {
  font-size: 12.7px;
  line-height: 1.55;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pw-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11.6px;
  color: var(--muted);
  align-items: center;
}

.pw-owner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pw-owner.me {
  color: var(--primary);
  font-weight: 600;
}

.pw-live {
  color: var(--primary);
  font-weight: 600;
}

.pw-card-ops {
  display: flex;
  gap: 5px;
  margin-top: auto;
  padding-top: 3px;
  flex-wrap: wrap;
}

.pw-card-ops .btn {
  padding: 4px 8px;
  font-size: 12px;
}

.pw-card-ops .pw-danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* 查看/预览 */
.pw-light {
  display: grid;
  gap: 16px;
}

.pw-light img {
  width: 100%;
  border-radius: 10px;
  background: #eef2f7;
}

.pw-light-sec {
  display: grid;
  gap: 8px;
}

.pw-light-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.6px;
  font-weight: 600;
  color: var(--text-soft);
}

.pw-light-tip {
  font-size: 11.6px;
  font-weight: 400;
  color: var(--muted);
}

.pw-light-imgs {
  display: grid;
  gap: 12px;
}

.pw-light-none {
  margin: 0;
  font-size: 12.6px;
  color: var(--muted);
}

/* 预览里的参考图：单列一段放在结果图下面，直接能看见、能点开 */
.pw-light-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pw-light-refs .pw-ref-shot {
  display: block;
  line-height: 0;
}

.pw-light-refs img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #eef2f7;
}

.pw-light-kv {
  margin: 0;
}

/* ==================== AI 作图：作品人工判定（成功图 / 废图） ==================== */

/* 预览弹窗底部：判定区靠左，下载原图 / 关闭留在右侧。
   底部 .modal-foot 是 flex-end，这里用 margin-right:auto 把它顶到左边。 */
.pw-grade {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-right: auto;
}

.pw-grade-label {
  font-size: 12.4px;
  font-weight: 600;
  color: var(--text-soft);
}

.pw-grade-hint {
  font-size: 11.8px;
  color: var(--muted);
}

.pw-grade-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
}

/* 选中态用「绿=成功 / 红=废图」，和右侧成功率列的颜色保持同一套语义 */
.pw-grade-btn.good.on {
  border-color: #1f9d55;
  background: #eaf7ef;
  color: #17743f;
  font-weight: 600;
}

.pw-grade-btn.bad.on {
  border-color: var(--danger);
  background: #fdecec;
  color: #b02525;
  font-weight: 600;
}

/* 卡片右上角的判定角标。未判定不渲染（那是常态，全标出来反而吵） */
.pw-card-img {
  position: relative;
}

.pw-grade-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.4px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  box-shadow: 0 1px 5px rgba(9, 14, 40, 0.24);
  pointer-events: none;
}

.pw-grade-tag.good {
  background: #1f9d55;
}

.pw-grade-tag.bad {
  background: var(--danger);
}

/* 「待判定」：受约束还没判的账，必须显眼（这批是要被清零的） */
.pw-grade-tag.todo {
  background: #c8791a;
}

/* 判定是**强制**的，但只对「新作品」：存量老图不判定也能关掉预览。
   被拦下时判定区抖一下、提示文案变红，让人一眼看出「卡在哪」。 */
.pw-grade-hint.need {
  color: var(--danger);
  font-weight: 600;
}

.pw-grade.shake {
  animation: pw-grade-shake 0.5s ease;
}

@keyframes pw-grade-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pw-grade.shake {
    animation: none;
  }
}

/* 未判定时把「关闭」压暗：先给个「现在关不掉」的视觉预告，别等点了才知道 */
.modal-foot .btn.pw-close-need {
  opacity: 0.62;
  cursor: not-allowed;
}

/* ==================== AI 作图：欠判定拦截弹窗 ==================== */
/* 「有未判定作品 → 不能开新图」：点生成时弹出的判定清单，判完自动关 */

.pw-pend-tip {
  margin-bottom: 14px;
}

.pw-pend-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 46vh;
  overflow: auto;
}

.pw-pend-list[hidden] {
  display: none;
}

.pw-pend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.pw-pend-thumb {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: #eef1f6;
  color: var(--text-soft);
}

.pw-pend-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pw-pend-main {
  flex: 1;
  min-width: 0;
}

.pw-pend-prompt {
  overflow: hidden;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pw-pend-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-soft);
}

.pw-pend-ops {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.pw-pend-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 4px;
  font-weight: 600;
  color: #17743f;
}

.pw-pend-empty[hidden] {
  display: none;
}

/* ==================== AI 作图：卡片上的参考图缩略条 ==================== */

.pw-card-refs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
}

.pw-card-refs.pw-clickable {
  cursor: zoom-in;
}

.pw-card-refs.pw-clickable:hover {
  background: #eef4fb;
}

.pw-card-refs-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.4px;
  color: var(--muted);
  white-space: nowrap;
}

.pw-card-refs img {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #eef2f7;
}

/* 参考图占位：格子只有 26px，原图却可能几 MB，
   所以卡片里只画序号，点开才加载原图 */
.pw-ref-ph {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, #eef2f7, #eef2f7 4px, #e4ebf3 4px, #e4ebf3 8px);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  user-select: none;
}

.pw-card-refs-more {
  font-size: 11.4px;
  color: var(--muted);
}

/* ==================== AI 作图：参考图点击放大 ==================== */

.pw-ref-shot {
  display: inline-flex;
  line-height: 0;
  border-radius: 7px;
  cursor: zoom-in;
  transition: box-shadow 0.18s, transform 0.18s;
}

.pw-ref-shot:hover {
  box-shadow: 0 0 0 2px var(--accent);
  transform: translateY(-1px);
}

.pw-ref-shot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.pw-ref-shot img {
  display: block;
}

.pw-card-refs .pw-ref-shot {
  border-radius: 5px;
}

.pw-shot {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  background: #0d1520;
  border-radius: 12px;
  overflow: hidden;
}

.pw-shot img {
  max-width: 100%;
  max-height: min(66vh, 620px);
  display: block;
  transition: transform 0.22s ease;
  cursor: zoom-in;
}

.pw-shot-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(13, 21, 32, 0.62);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s;
}

.pw-shot-nav:hover {
  background: rgba(13, 21, 32, 0.9);
}

.pw-shot-nav.prev {
  left: 12px;
}

.pw-shot-nav.prev svg {
  transform: scaleX(-1);
}

.pw-shot-nav.next {
  right: 12px;
}


/* ---- 日历（用量统计里的「自定义区间」：只挑起止两个日期） ---- */
.pw-cal {
  position: fixed;
  /* 250 = 高于弹窗(200)、低于 toast(300)：这层面板是挂在 body 上的，
     而它的入口在「用量统计」弹窗里 —— 用 60 会被弹窗整块盖住（真实用户看不见）。
     ↑ 2026-10-19 实测踩过：DOM 存在、断言全绿，但截图上完全没有。 */
  z-index: 250;
  width: 344px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 35, 60, 0.16);
}

.pw-cal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* 最简版日历（只选起止区间）：快捷项在最上面，下面一条起止输入 */
.pw-cal-simple .pw-cal-quick {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.pw-cal-simple .pw-cal-cust {
  margin-bottom: 2px;
}

.pw-cal-hint {
  flex: 1;
  font-size: 11.8px;
  color: var(--muted);
}

.pw-cal-cust {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  /* Edge 的 date 输入很宽，放不下就让「应用」换行，别把它挤出面板 */
  flex-wrap: wrap;
}

/* 全局 input[type="date"] 给的是 width:100%，这里要压掉 */
.pw-cal-date {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 12.2px;
}

/* 用量统计 */
.pw-usage-tabs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* 「自定义」这一格兼作日期按钮：选中后里面显示「06-01 ~ 06-20」+ 小笔头，
   提示点它还能改区间。原来旁边那个独立的「选时间段」按钮作用重复，已删。 */
.pw-usage-tabs .chip.has-range {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.pw-usage-tabs .chip.has-range .pw-usage-custom-txt {
  letter-spacing: 0.2px;
}

/* 表格最上面钉的一行「合计」：横跨整行，扫一眼就知道所有人加起来多少 */
.pw-usage-sumhead td {
  padding: 9px 12px;
  background: color-mix(in srgb, var(--primary) 6%, #fff);
  border-bottom: 1px solid var(--line-strong);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.pw-usage-sumhead b {
  color: var(--primary);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.pw-usage-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 12.6px;
  color: var(--muted);
}

.pw-usage-range {
  white-space: nowrap;
}

.pw-usage-cards {
  margin-bottom: 16px;
}

.pw-th-bucket {
  text-align: center !important;
  min-width: 62px;
}

.pw-hot {
  color: var(--primary) !important;
  font-weight: 600;
}

.pw-zero {
  color: var(--muted) !important;
  opacity: 0.55;
}

tr.pw-total-row td {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text) !important;
}

/* 用量统计：筛选条 + 可排序表头 */
.pw-usage-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pw-usage-filters .pw-mini {
  height: 32px;
  font-size: 12.6px;
}

.pw-usage-q {
  min-width: 168px;
  flex: 0 1 200px;
}

.pw-usage-count {
  font-size: 12.4px;
  color: var(--muted);
  white-space: nowrap;
}

.pw-usage-gap {
  flex: 1;
}

th.pw-th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.pw-th-sort:hover {
  color: var(--primary);
}

th.pw-th-sort.on {
  color: var(--primary);
}

.pw-sort-mark {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.5;
}

th.pw-th-sort.on .pw-sort-mark {
  opacity: 1;
}

.pw-free-num {
  color: var(--accent, #d01818);
  font-weight: 600;
}

/* 生成中卡片右上角的「取消这个任务」 */
.pw-card-pending {
  position: relative;
}

.pw-card-cancel {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(15, 23, 42, 0.42);
  color: #fff;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: 0.15s;
}

.pw-card-cancel:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* 生成 / 取消 并排（与上面的产品标签块拉开距离） */
.pw-gen-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 26px;
}

.pw-gen-row #pwGenerate {
  flex: 1;
}

.pw-cancel-gen {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* 设置页里的图床块 */
.pw-cos {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.pw-cos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pw-cos-body .kv {
  margin: 0;
}

.pw-cos-ops {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pw-cos .pw-status {
  margin-top: 10px;
}

/* 火山方舟配置区（与 COS 区同为卡片内的分段，用虚线分隔） */
.pw-ark {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.pw-ark-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pw-ark-note {
  font-size: 12.4px;
  color: var(--muted);
  line-height: 1.7;
  background: #eef7f1;
  border: 1px solid #d6eadd;
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 14px;
}

.pw-ark .pw-status {
  margin-top: 10px;
}

/* 豆包 / 即梦 两块并列，窄屏自动堆叠 */
.pw-ark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.pw-ark-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 15px 15px;
}

.pw-ark-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.pw-ark-group .field {
  margin-bottom: 10px;
}

.pw-ark-group .btn {
  width: 100%;
}

@media (max-width: 1180px) {
  .pw-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .pw-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 11px;
  }

  .pw-search {
    max-width: none;
    min-width: 140px;
  }
}

.notice {
  display: flex;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.2px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.notice.info {
  background: var(--info-bg);
  color: #1f5c85;
  border: 1px solid #cfe3f4;
}

.notice.warn {
  background: var(--warn-bg);
  color: #8a5d0c;
  border: 1px solid #f0dcb3;
}

.notice.ok {
  background: var(--ok-bg);
  color: #1e7a49;
  border: 1px solid #c7e6d5;
}

/* ---------------- 网站内容编辑 ---------------- */

.site-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
}

.site-tab {
  border: 0;
  background: none;
  padding: 10px 16px;
  font-size: 13.8px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.site-tab:hover {
  color: var(--primary);
}

.site-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.repeater-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-bottom: 12px;
  background: #fcfdff;
  position: relative;
}

.repeater-item .ri-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12.6px;
  color: var(--muted);
  font-weight: 600;
}

.timeline {
  display: grid;
  gap: 0;
}

.tl-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}

.tl-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 30px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.tl-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 12px;
  z-index: 1;
}

.tl-body .tl-title {
  font-size: 13.6px;
  color: var(--text);
  font-weight: 500;
}

.tl-body .tl-meta {
  font-size: 12.2px;
  color: var(--muted);
  margin-top: 2px;
}

.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
  font-size: 13.6px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 9px 16px;
  font-size: 13.6px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  color: var(--text-soft);
}

code.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f3f6fa;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12.6px;
  color: #28486c;
}

/* ==========================================================================
   合同到期提醒
   ========================================================================== */

/* ---------------- 顶栏铃铛 ---------------- */

.bell-wrap {
  position: relative;
}

.bell-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.16s;
  padding: 0;
  font-family: inherit;
}

.bell-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.bell-btn.has-alert {
  color: var(--danger);
  border-color: #f0cdcb;
  background: var(--danger-bg);
}

.bell-btn .bell-dot {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid #fff;
  box-sizing: content-box;
}

.bell-btn.has-alert svg {
  animation: bell-shake 2.4s ease-in-out infinite;
}

@keyframes bell-shake {
  0%,
  72%,
  100% {
    transform: rotate(0);
  }
  76% {
    transform: rotate(-13deg);
  }
  80% {
    transform: rotate(11deg);
  }
  84% {
    transform: rotate(-8deg);
  }
  88% {
    transform: rotate(6deg);
  }
  92% {
    transform: rotate(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bell-btn.has-alert svg {
    animation: none;
  }
}

.bell-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  overflow: hidden;
}

.bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.bell-head strong {
  font-size: 14px;
  display: block;
}

.bell-head .sub {
  font-size: 11.8px;
  color: var(--muted);
  margin-top: 1px;
}

.bell-body {
  max-height: 336px;
  overflow: auto;
}

.bell-item {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  padding: 11px 15px;
  cursor: pointer;
  font-family: inherit;
  transition: 0.14s;
}

.bell-item:last-child {
  border-bottom: 0;
}

.bell-item:hover {
  background: var(--bg);
}

.bell-item .bi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bell-item .bi-name {
  font-size: 13.8px;
  font-weight: 600;
  color: var(--text);
}

.bell-item .bi-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.bell-empty {
  padding: 28px 15px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.bell-foot {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.bell-foot button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  font-size: 12.8px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: 0.14s;
}

.bell-foot button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------------- 可点击统计卡 ---------------- */

button.stat-card {
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: 0.16s;
}

button.stat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

button.stat-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.stat-card .st-tag {
  font-size: 11.4px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-bg);
  padding: 2px 8px;
  border-radius: 999px;
}

/* ---------------- 剩余天数 ---------------- */

.left-days {
  display: inline-block;
  font-size: 12.8px;
  font-weight: 600;
  white-space: nowrap;
}

.left-days.neg {
  color: var(--danger);
}

.left-days.hot {
  color: var(--danger);
}

.left-days.warm {
  color: var(--warn);
}

.left-days.cool {
  color: var(--text-soft);
}

.left-none {
  color: var(--muted);
  font-size: 12.6px;
}

/* ---------------- 提醒清单表格 ---------------- */

.cell-emp {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar.sm {
  width: 26px;
  height: 26px;
  font-size: 11.6px;
  font-weight: 600;
}

.cell-sub {
  display: block;
  font-size: 11.8px;
  color: var(--muted);
}

.dot-new {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  margin-left: 5px;
  vertical-align: middle;
}

tr.row-unread td {
  background: #fdfcf9;
}

tr.row-muted td {
  opacity: 0.62;
}

tr.row-flash td {
  animation: row-flash 2s ease-out;
}

@keyframes row-flash {
  0%,
  30% {
    background: #fff5d9;
  }
  100% {
    background: transparent;
  }
}

/* ---------------- 弹窗内快捷选项 ---------------- */

.quick-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.quick-row .chip {
  font-size: 12.4px;
  padding: 4px 12px;
}

/* ---------------- 设置页开关 ---------------- */

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.4px;
  color: var(--text-soft);
  font-weight: 400;
  line-height: 1.6;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.switch-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.switch-row:has(input:disabled) {
  opacity: 0.62;
  cursor: default;
}

/* ---------------- 工作台提醒卡 ---------------- */

.mini-stat-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

.mini-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fbfcfe;
}

.mini-stat span {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.mini-stat small {
  font-size: 12px;
  color: var(--muted);
}

.mini-stat.danger {
  border-color: #f3d6d4;
  background: var(--danger-bg);
}

.mini-stat.danger span {
  color: var(--danger);
}

.mini-stat.warn {
  border-color: #f2e0bb;
  background: var(--warn-bg);
}

.mini-stat.warn span {
  color: var(--warn);
}

.mini-stat.info {
  border-color: #d6e3f2;
  background: var(--info-bg);
}

.mini-stat.info span {
  color: var(--info);
}

.mini-stat.zero {
  background: #f7f9fc;
  border-color: var(--line);
}

.mini-stat.zero span {
  color: var(--muted);
}

.due-list {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.due-list::before {
  content: "最紧急的几条";
  display: block;
  font-size: 12.4px;
  color: var(--muted);
  margin-bottom: 8px;
}

.due-item {
  display: grid;
  grid-template-columns: 1fr 1fr 110px 110px;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.2px;
  color: var(--text-soft);
  transition: 0.14s;
}

.due-item:hover {
  background: var(--bg);
}

.due-item .due-name {
  font-weight: 600;
  color: var(--text);
}

.due-item .due-date {
  color: var(--muted);
  font-size: 12.6px;
}

.due-item .left-days {
  text-align: right;
}

@media (max-width: 900px) {
  .mini-stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .due-item {
    grid-template-columns: 1fr auto;
    row-gap: 3px;
  }
  .due-item .due-dept,
  .due-item .due-date {
    font-size: 12px;
  }
  .due-item .left-days {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .bell-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 68px;
    width: auto;
  }
  button.stat-card:hover {
    transform: none;
  }
}
/* ==========================================================================
   AI 视频工坊
   --------------------------------------------------------------------------
   左侧创作面板按「创作模式 / 画面描述 / 参考素材 / 生成参数 / 执行」分五段，
   每段用一条细分隔线切开并留出 18px 呼吸，避免整列控件糊成一片。
   ========================================================================== */

.vw-wrap {
  display: grid;
  grid-template-columns: minmax(0, 384px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* ---------------- 左侧：创作面板 ---------------- */

.vw-panel {
  position: relative;
  padding: 20px 20px 22px;
}

.vw-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.vw-panel-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15.5px;
}

.vw-credits {
  font-size: 12.4px;
  color: var(--muted);
  white-space: nowrap;
}

.vw-warn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--danger);
}

/* 分段容器 */
.vw-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* 紧跟标题的第一段不再重复画线（面板标题已经有一条） */
.vw-panel-head + .vw-group {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.vw-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
}

.vw-group-title {
  display: inline-flex;
  align-items: center;
  font-size: 12.6px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-soft);
}

/* ---------------- 创作模式 ---------------- */

.vw-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  background: #f1f5f9;
  border-radius: 10px;
}

.vw-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: none;
  padding: 9px 4px;
  border-radius: 8px;
  font-size: 12.8px;
  font-family: inherit;
  color: var(--text-soft);
  white-space: nowrap;
  cursor: pointer;
}

.vw-mode:hover {
  color: var(--text);
}

.vw-mode.on {
  background: var(--card);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.vw-mode-hint {
  margin: 0;
  font-size: 12.4px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------------- 画面描述 ---------------- */

.vw-ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 12.4px;
  cursor: pointer;
}

.vw-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.vw-prompt {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-family: inherit;
  font-size: 13.6px;
  line-height: 1.75;
  color: var(--text);
  background: var(--card);
}

.vw-prompt:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.vw-prompt-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: -4px;
}

.vw-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 参考素材 ---------------- */

.vw-refs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.vw-ref {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f8fafc;
}

.vw-ref img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
}

.vw-ref-video {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  color: var(--muted);
  background: #eef2f8;
}

.vw-ref-meta {
  padding: 6px 8px 7px;
}

.vw-ref-name {
  display: block;
  font-size: 11.6px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vw-ref-size {
  font-size: 11px;
  color: var(--muted);
}

.vw-ref-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 13, 51, 0.62);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.vw-ref-del:hover {
  background: var(--danger);
}

.vw-ref-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 132px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.4px;
  cursor: pointer;
}

.vw-ref-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------------- 生成参数 ---------------- */

.vw-params {
  display: grid;
  /* 左栏本来就窄，两列会把时长滑条和清晰度挤成一团 → 一律纵向单列 */
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.vw-field {
  min-width: 0;
}

.vw-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 12.6px;
  font-weight: 600;
  color: var(--text-soft);
}

.vw-label-tip {
  font-size: 11.8px;
  font-weight: 400;
  color: var(--muted);
}

.vw-select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-family: inherit;
  font-size: 13.2px;
  color: var(--text);
  background: var(--card);
}

.vw-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.vw-select-sm {
  width: auto;
  min-width: 122px;
  height: 36px;
  padding: 0 9px;
  font-size: 12.8px;
}

/* 参数 chips（清晰度等档位选择，参考 KIE 控制台样式） */
.vw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vw-chip {
  min-width: 52px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-family: inherit;
  font-size: 12.8px;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.vw-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.vw-chip.on {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-100);
  font-weight: 600;
}

.vw-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-100);
}

/* 字段下方的一句说明 */
.vw-field-hint {
  margin: 6px 0 0;
  font-size: 11.8px;
  line-height: 1.5;
  color: var(--muted);
}

/* 时长滑动条行：滑块 + 值框 + 自动快捷键 */
.vw-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vw-slider {
  /* flex 基准给实际宽度，防止被同行的值框（全局 input[type=text] width:100%）挤成 0 */
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 120px;
  height: 22px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.vw-slider:disabled {
  cursor: default;
  opacity: 0.55;
}

.vw-slider-val {
  /* 全局 input[type=text] 是 width:100%（0,1,1），这里的类选择器（0,1,0）压不住，
     必须用 flex-basis 锁死自身宽度，否则会把滑动条挤成 0 宽（拖不动的根因） */
  flex: 0 0 64px;
  width: 64px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  text-align: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.vw-slider-reset {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-family: inherit;
  font-size: 12.4px;
  color: var(--text-soft);
  cursor: pointer;
}

.vw-slider-reset:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.vw-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f7f9fd;
  font-size: 12.2px;
  line-height: 1.55;
  color: var(--text-soft);
}

.vw-hint svg {
  flex: none;
  margin-top: 2px;
  color: var(--muted);
}

/* 生成失败的原因要留在页面上，不能只弹一个几秒就消失的 toast */
.vw-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #f2c9c9;
  border-radius: var(--radius-sm);
  background: #fff6f6;
  font-size: 12.4px;
  line-height: 1.55;
  color: #b42318;
}

.vw-error svg {
  flex: none;
  margin-top: 2px;
}

.vw-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 12.2px;
  line-height: 1.6;
  color: var(--muted);
}

.vw-note svg {
  flex: none;
  margin-top: 2px;
}

/* ---------------- 执行 ---------------- */

.vw-gen-row {
  display: flex;
  gap: 10px;
}

.vw-gen,
.vw-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  font-size: 14px;
}

.vw-gen {
  flex: 1;
}

/* ---------------- 右侧：生成中 + 作品 ---------------- */

.vw-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.vw-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 9px;
}

.vw-task-spin {
  display: inline-flex;
  color: var(--accent);
  animation: vw-spin 1.6s linear infinite;
}

@keyframes vw-spin {
  to {
    transform: rotate(360deg);
  }
}

.vw-task-body {
  flex: 1;
  min-width: 0;
}

.vw-task-prompt {
  font-size: 13.2px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vw-task-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.vw-gallery {
  padding: 18px;
}

.vw-gal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.vw-gal-title h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15.5px;
}

.vw-gal-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vw-stat {
  font-size: 12.2px;
  color: var(--muted);
  background: #f4f7fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}

.vw-stat strong {
  color: var(--text);
}

.vw-gal-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.vw-search {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  max-width: 320px;
  min-width: 200px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: var(--muted);
}

.vw-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
}

.vw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.vw-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.vw-card:hover {
  box-shadow: var(--shadow-md);
}

.vw-thumb {
  position: relative;
  background: #0b1020;
}

.vw-thumb video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1020;
}

.vw-lost {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 16 / 9;
  font-size: 12.4px;
  color: #f0a0a0;
}

.vw-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
}

.vw-card-prompt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.vw-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.vw-tag {
  font-size: 11.4px;
  color: var(--text-soft);
  background: #f4f7fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
}

/* 模型名标签：宽度有限，长名字（含「已下线」后缀）截断，完整名走 title */
.vw-tag-model {
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vw-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  font-size: 11.8px;
  color: var(--muted);
}

.vw-card-acts {
  display: inline-flex;
  gap: 2px;
}

.vw-act {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.vw-act:hover {
  background: #f1f5f9;
  color: var(--text);
}

.vw-act-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ---------------- 自适应 ---------------- */

@media (max-width: 1400px) {
  .vw-wrap {
    grid-template-columns: minmax(0, 350px) minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .vw-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .vw-refs {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 720px) {
  .vw-grid {
    grid-template-columns: 1fr;
  }
  .vw-params {
    grid-template-columns: 1fr;
  }
}

/* ---- 用量统计：分模型出图（豆包 / 即梦走方舟独立账户，需分别对账） ---- */
.pw-model-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.pw-model-label {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
}
.pw-model-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pw-model-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 12.5px;
  line-height: 1.6;
}
.pw-model-chip b {
  font-weight: 600;
  color: var(--text);
}
.pw-model-chip i {
  font-style: normal;
  color: var(--muted);
}
.pw-model-chip.ark {
  border-color: #edcdcd;
  background: var(--accent-100);
}
.pw-model-chip.ark b {
  color: var(--accent);
}

/* ==========================================================================
   AI 作图集合（成功图 + 描述的作品集）
   --------------------------------------------------------------------------
   卡片壳子直接复用作品画廊的 .pw-card / .pw-card-img / .pw-card-body，
   只有三处不同：图更宽（4:3）、描述更能读（4 行 + 展开）、左上角挂「成功图」标。
   ========================================================================== */

/* 描述是这个页面的主角，卡片比作品画廊宽一档 */
.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.pc-shot {
  aspect-ratio: 4 / 3;
}

.pc-shot-tag {
  position: absolute;
  left: 8px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1f9d55;
  color: #fff;
  font-size: 11.4px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 1px 5px rgba(9, 14, 40, 0.24);
  pointer-events: none;
}

.pc-prompt-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.pc-prompt {
  -webkit-line-clamp: 4;
  line-height: 1.62;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 展开态：去掉行数裁剪，长描述完整可读 */
.pc-prompt.open {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.pc-more {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 11.8px;
  cursor: pointer;
}

.pc-more:hover {
  text-decoration: underline;
}

/* 详情弹窗里的描述：整块可选中、可滚，方便手动复制长文 */
.pc-quote {
  max-height: 240px;
  overflow: auto;
  padding: 11px 13px;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--primary-100);
  color: var(--text);
  font-size: 13.4px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}

.pc-empty-act {
  display: flex;
  justify-content: center;
  padding-bottom: 30px;
  margin-top: -12px;
}

.pc-empty-act .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 720px) {
  .pc-grid {
    grid-template-columns: 1fr;
  }
}

