/* ===== 基础变量：配色提取自《后台界面UI设计参考》 ===== */
:root {
  --primary: #2E7CF6;
  --primary-dark: #1F63D8;
  --primary-light: #EAF2FF;
  --sidebar-bg: #1B2A4A;
  --sidebar-active: rgba(46, 124, 246, 0.95);
  --bg: #F5F7FB;
  --card: #FFFFFF;
  --text: #1A1F36;
  --text-2: #5A6178;
  --text-3: #9AA1B5;
  --border: #E8EBF2;
  --green: #22C55E;
  --green-light: #E8F9F0;
  --orange: #FF9500;
  --orange-light: #FFF5E4;
  --red: #F43F5E;
  --red-light: #FEEDF1;
  --purple: #8B5CF6;
  --purple-light: #F1EAFE;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(27, 42, 74, 0.06);
  --sidebar-w: 216px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; cursor: pointer; }

/* ===== 登录页 ===== */
.login-screen { display: flex; min-height: 100vh; background: #F0F4FB; }
.login-brand {
  flex: 1.1; display: flex; flex-direction: column; justify-content: center;
  align-items: center; background: linear-gradient(160deg, #EAF1FE 0%, #F6F9FF 100%);
  padding: 48px;
}
.login-brand-title { font-size: 34px; font-weight: 700; letter-spacing: 2px; }
.login-brand-sub { font-size: 14px; color: var(--text-3); letter-spacing: 6px; margin-top: 12px; }
.login-illustration { font-size: 140px; margin-top: 56px; }
.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px; }
.login-card { width: 380px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 44px 40px; }
.login-title { font-size: 24px; font-weight: 700; }
.login-sub { font-size: 13px; color: var(--text-3); margin: 8px 0 28px; }
.login-options { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); margin: 4px 0 24px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.login-tip { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 18px; }

/* ===== 表单控件 ===== */
.form-item { margin-bottom: 16px; }
.input, .select {
  width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 14px; font-size: 14px; outline: none; background: #FFF; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 124, 246, .12); }
.input::placeholder { color: #B6BCCB; }
textarea.input { height: auto; padding: 10px 14px; resize: vertical; }

.btn {
  height: 36px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; cursor: pointer; background: #FFF; transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: #FFF; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.btn-ghost { border-color: var(--primary); color: var(--primary); background: #FFF; }
.btn-ghost:hover { background: var(--primary-light); }
.btn-danger { background: var(--red); color: #FFF; }
.btn-text { border: none; color: var(--text-2); background: transparent; }
.btn-text:hover { color: var(--primary); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover, .btn[disabled]:hover { background: inherit; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 8px; border: none; background: transparent;
  font-size: 17px; cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--primary-light); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* ===== 主布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.sidebar-logo {
  height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 18px;
  color: #FFF; border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.logo-icon {
  width: 30px; height: 30px; border-radius: 8px; background: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.logo-text { font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.menu { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin: 2px 0;
  color: rgba(255, 255, 255, .72); border-radius: 8px; cursor: pointer;
  font-size: 14px; transition: all .15s; user-select: none;
}
.menu-item:hover { background: rgba(255, 255, 255, .08); color: #FFF; }
.menu-item.active { background: var(--sidebar-active); color: #FFF; font-weight: 500; }
.menu-icon { font-size: 15px; width: 20px; text-align: center; }
.menu-section { font-size: 12px; color: rgba(255,255,255,.35); padding: 14px 14px 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 20;
}
.menu-toggle { display: none; }
.topbar-search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: 8px; padding: 0 12px; height: 38px;
}
.search-icon { font-size: 13px; color: var(--text-3); }
.topbar-input { flex: 1; border: none; background: transparent; outline: none; font-size: 13px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.online-pill {
  font-size: 12px; color: var(--text-2); background: var(--green-light);
  padding: 5px 12px; border-radius: 20px; white-space: nowrap;
}
.admin-info { display: flex; align-items: center; gap: 8px; }
.admin-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary);
  color: #FFF; display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.admin-name { font-size: 13px; color: var(--text-2); }

.content { padding: 22px; }

/* ===== 卡片 / 标题 ===== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.page-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.page-sub { font-size: 12px; color: var(--text-3); margin-bottom: 18px; }

/* ===== 数据总览 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: 16px; }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px; font-size: 24px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-value { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.stat-delta { font-size: 12px; margin-top: 4px; }
.stat-delta.up { color: var(--green); }
.stat-delta.down { color: var(--red); }
.chart-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.chart-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-legend { flex: 1; }
.donut-item { display: flex; align-items: center; font-size: 13px; padding: 8px 0; color: var(--text-2); }
.donut-item b { margin-left: auto; color: var(--text); }

/* ===== 页签 / 筛选栏 ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 9px 16px; font-size: 14px; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none;
}
.tab.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.tab .badge {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px;
  background: var(--red); color: #FFF; font-size: 11px; border-radius: 9px; text-align: center; margin-left: 4px;
}
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; align-items: center; }
.filter-bar .select, .filter-bar .input { width: 170px; }
.filter-bar .grow { flex: 1; }
.filter-label { font-size: 13px; color: var(--text-2); }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th {
  text-align: left; font-size: 12px; color: var(--text-3); font-weight: 500;
  padding: 12px 14px; border-bottom: 1px solid var(--border); background: #FAFBFD; white-space: nowrap;
}
td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #F8FAFF; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.cell-sub { font-size: 12px; color: var(--text-3); }

/* 状态徽标 */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap;
}
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-orange { background: var(--orange-light); color: var(--orange); }
.tag-red { background: var(--red-light); color: var(--red); }
.tag-gray { background: #F0F2F7; color: var(--text-3); }
.tag-purple { background: var(--purple-light); color: var(--purple); }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.pagination .total { margin-right: auto; }
.page-btn {
  min-width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px;
  background: #FFF; cursor: pointer; font-size: 13px; color: var(--text-2); padding: 0 8px;
}
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #FFF; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===== 弹窗 / 抽屉 / Toast ===== */
.mask {
  position: fixed; inset: 0; background: rgba(20, 28, 48, .45);
  display: flex; align-items: center; justify-content: center; z-index: 150;
}
.modal {
  width: 460px; max-width: calc(100vw - 32px); max-height: 86vh; overflow-y: auto;
  background: #FFF; border-radius: 14px; padding: 26px 28px;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.drawer-mask { position: fixed; inset: 0; background: rgba(20, 28, 48, .45); z-index: 100; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 94vw;
  background: #FFF; z-index: 101; overflow-y: auto; padding: 26px 28px;
  box-shadow: -6px 0 24px rgba(20, 28, 48, .12);
}
.drawer-title { font-size: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.drawer-close { cursor: pointer; color: var(--text-3); font-size: 18px; border: none; background: none; }
.toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  background: rgba(26, 31, 54, .88); color: #FFF; font-size: 13px;
  padding: 10px 22px; border-radius: 8px; z-index: 200; animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 详情描述列表 */
.desc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-bottom: 18px; }
.desc-item { font-size: 13px; }
.desc-label { color: var(--text-3); margin-bottom: 4px; font-size: 12px; }
.section-title { font-size: 14px; font-weight: 600; margin: 20px 0 12px; }

/* ===== 权限矩阵 ===== */
.perm-table td, .perm-table th { white-space: normal; }
.perm-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; margin: 2px 8px 2px 0; color: var(--text-2); cursor: pointer; }

/* ===== 运营卡片 ===== */
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.op-card { overflow: hidden; padding: 0; }
.op-cover {
  height: 120px; display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: #FFF;
}
.op-body { padding: 14px 16px 16px; }
.op-title { font-size: 14px; font-weight: 600; }
.op-meta { font-size: 12px; color: var(--text-3); margin: 6px 0 12px; }
.op-actions { display: flex; gap: 8px; align-items: center; }

/* ===== 协同中心 ===== */
.collab-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.member-card { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.member-card:last-child { border-bottom: none; }
.member-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary-light);
  color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 13px; position: relative;
}
.member-status {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid #FFF; background: var(--green);
}
.member-status.offline { background: #C3C9D6; }
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
.feed-time { color: var(--text-3); font-size: 12px; margin-top: 3px; }

/* ===== 响应式 ===== */
.sidebar-mask { display: none; }
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .collab-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask.show {
    display: block; position: fixed; inset: 0; background: rgba(20, 28, 48, .4); z-index: 25;
  }
  .menu-toggle { display: block; }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { flex: 1; }
  .content { padding: 14px; }
  .topbar { padding: 0 14px; }
  .admin-name, .online-pill { display: none; }
  .desc-grid { grid-template-columns: 1fr; }
}

/* ===== 迁移补充：订单节点色标 / 表单提示 / 只读字段 ===== */
.tag-node-review { background: var(--orange-light); color: var(--orange); }
.tag-node-quote { background: var(--primary-light); color: var(--primary); }
.tag-node-pay { background: #FFF7E6; color: #B26B00; }
.tag-node-fulfill { background: var(--purple-light); color: var(--purple); }
.tag-node-done { background: var(--green-light); color: var(--green); }
.tag-node-cancel { background: #F0F2F7; color: var(--text-3); }
.field-hint { font-size: 12px; color: var(--text-3); line-height: 1.6; margin-top: 6px; }
.form-item label.desc-label { display: block; margin-bottom: 6px; }
.drawer .table-wrap table { min-width: 0; }
.drawer .table-wrap td, .drawer .table-wrap th { white-space: normal; }
.cell-sub a { color: var(--primary); }
/* .empty-block 统一在「运营模块」段落定义（含多行文案的行高） */

/* ===== 权限矩阵（角色编辑弹窗） ===== */
.perm-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px; max-height: 260px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px; padding: 12px;
}
.perm-grid .perm-check { margin: 0; }
.field-hint a { color: var(--primary); }

/* ===== 7 节点履约进度条（竖向排列）===== */
.node-chain {
  display: flex; flex-direction: column; gap: 0;
  margin: 16px 0;
}

/* 节点操作区：紧跟节点标题，与 feed-item 同风格 */
.node-section { padding: 10px 0; border-bottom: 1px solid var(--border); }
.node-section:last-child { border-bottom: none; }
.node-section-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; gap: 8px;
}
.node-section-title { font-size: 13px; font-weight: 600; color: var(--text); }
.node-section-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.node-section-body { font-size: 12px; color: var(--text-2); line-height: 1.7; }
.countdown-badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  background: var(--orange-light); color: var(--orange);
}
.countdown-badge.expired { background: var(--red-light); color: var(--red); }
.ticket-item {
  background: var(--bg); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 12px;
}
.ticket-item .t-hd { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.ticket-item .t-bd { color: var(--text-3); }

/* ===== 运营模块（ADMIN-1）：内容位 / 活动 / 案例 ===== */
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.item-editor {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px 4px;
  margin-bottom: 12px; background: #FBFCFE;
}
.item-editor-hd {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; margin-bottom: 10px; color: var(--text-2);
}
.item-editor .form-item { margin-bottom: 10px; }
.item-editor .input, .item-editor .select { height: 36px; }
.city-picker {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px;
  max-height: 220px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}
.city-picker .perm-check { margin: 0; }

/* ===== 图片上传（内容条目 / 案例封面与素材） ===== */
.image-upload { display: flex; gap: 8px; align-items: center; }
.image-upload .input { flex: 1; min-width: 0; }
.case-media-row {
  display: flex; gap: 8px; align-items: center;
  padding: 8px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.case-media-thumb {
  width: 48px; height: 48px; border-radius: 6px; object-fit: cover;
  flex-shrink: 0; background: #E8EBF2;
}
.case-media-row .input { flex: 1; min-width: 0; font-size: 12px; }
.admin-attachment-thumb {
  width: 60px; height: 60px; border-radius: 6px; object-fit: cover;
  flex-shrink: 0; background: #E8EBF2; margin-left: 8px;
  cursor: pointer; border: 1px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s;
}
.admin-attachment-thumb:hover {
  transform: scale(1.05); box-shadow: 0 2px 8px rgba(27, 42, 74, 0.12);
}
.cell-actions a { margin-right: 10px; display: inline-block; }
.cell-actions a:last-child { margin-right: 0; }
.link-disabled { color: var(--text-3) !important; cursor: not-allowed; }
.empty-block {
  padding: 36px 12px; text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.8;
}

/* ===== 审批流转提示条（ADMIN-3） ===== */
.flow-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--primary-light); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
}
.flow-step {
  font-size: 12px; color: var(--primary); background: #FFF; border: 1px solid rgba(46, 124, 246, .28);
  border-radius: 20px; padding: 4px 12px; white-space: nowrap;
}
.flow-step.flow-off { color: var(--text-3); border-color: var(--border); background: #FAFBFD; }
.flow-arrow { color: var(--primary); font-size: 12px; }

/* ===== 审计中文化（ADMIN-5） ===== */
.audit-raw {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; color: var(--text-3); background: #F3F5FA; border-radius: 4px;
  padding: 0 5px; margin-left: 6px;
}
.order-row { cursor: pointer; border-radius: 8px; }
.order-row:hover { background: var(--primary-light); }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .city-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
