/* ══════════════════════════════════════════════════════════════
   半山礼内部管理系统 · 暖色治愈主题
   设计口径：米杏打底 + 陶土橘主色 + 圆润大圆角 + 柔和阴影
   ══════════════════════════════════════════════════════════════ */
:root {
  --ink: #7a4a2b;           /* 主色：陶土棕（替换原墨绿） */
  --ink-2: #935a35;         /* 主色浅一档 */
  --gold: #c98a4b;          /* 点缀：暖金 */
  --bg: #fdf6ee;            /* 页面底：米杏 */
  --card: #ffffff;          /* 卡片白 */
  --line: #f0e2d2;          /* 描边：浅杏 */
  --text: #4a3b31;          /* 正文：暖褐 */
  --muted: #a8968a;         /* 次要文字：暖灰 */
  --ok: #7ba05b;            /* 成功：柔和草绿 */
  --brand: var(--ink-2);
  --danger: #c9604f;        /* 危险：暖红 */
  --peach: #fbe8d8;         /* 浅桃（高亮底） */
  --sun: #fdf1dd;           /* 阳光米（提示底） */
  --radius: 18px;           /* 大圆角基准 */
  --radius-sm: 12px;
  --shadow: 0 4px 18px rgba(122, 74, 43, .07);
  --shadow-lg: 0 12px 34px rgba(122, 74, 43, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* 滚动条也暖一点 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #e8d5c2; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #dcc3ab; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 登录页 ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(150deg, #fdeee0 0%, #fbe3d1 45%, #f7d9c0 100%);
}
/* 登录卡背后加一层柔光圆斑，治愈感 */
.login-body::before,
.login-body::after {
  content: ""; position: fixed; border-radius: 50%; filter: blur(60px); opacity: .5; z-index: 0;
}
.login-body::before { width: 320px; height: 320px; background: #ffd9b3; top: -80px; left: -60px; }
.login-body::after { width: 260px; height: 260px; background: #ffe6cc; bottom: -70px; right: -40px; }
.login-card {
  position: relative; z-index: 1;
  width: 400px; padding: 38px 34px;
  background: rgba(255,255,255,.92);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.login-logo, .brand-logo {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(140deg, #b06a3d 0%, #8a4f2c 100%);
  color: #fff7ec;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; flex: none;
  box-shadow: 0 6px 16px rgba(138, 79, 44, .28);
}
.login-brand h1 { margin: 0; font-size: 19px; color: var(--ink); }
.login-brand p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.login-card label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.login-card input {
  width: 100%; margin-top: 7px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-size: 14px; background: #fffdfa; transition: all .18s;
}
.login-card input:focus {
  outline: none; border-color: var(--gold); background: #fff;
  box-shadow: 0 0 0 4px rgba(201, 138, 75, .12);
}
.login-error { color: var(--danger); min-height: 20px; font-size: 13px; }
.login-tip { margin: 18px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }

/* 侧栏：暖棕渐变 + 圆角悬浮 */
.sidebar {
  width: 232px; flex: none;
  background: linear-gradient(175deg, #8a5230 0%, #74452a 55%, #6b3f26 100%);
  color: #f3e2d3;
  margin: 14px 0 14px 14px;
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-logo { width: 44px; height: 44px; font-size: 21px; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { color: #fff; font-size: 16px; letter-spacing: .5px; }
.brand-text span { font-size: 11.5px; color: #d4b9a4; }
#nav { padding: 14px 10px; overflow-y: auto; }
.nav-group { padding: 14px 12px 7px; font-size: 11px; color: #c8a892; letter-spacing: .8px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; margin-bottom: 4px; border-radius: var(--radius-sm);
  color: #f0dccb; cursor: pointer; font-size: 13.5px;
  transition: background .16s, transform .16s;
}
.nav-item:hover { background: rgba(255,255,255,.1); transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(120deg, #f2d8bd 0%, #eccfae 100%);
  color: #6b3f26; font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,.14);
}
.nav-item.disabled { color: #b09079; cursor: not-allowed; }
.tag {
  font-size: 10px; background: rgba(255,255,255,.16); padding: 2px 7px; border-radius: 8px;
}
.nav-item.active .tag { background: rgba(122, 74, 43, .16); color: #6b3f26; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 68px; margin: 14px 14px 0; padding: 0 24px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between;
}
.topbar h2 { margin: 0; font-size: 19px; color: var(--ink); letter-spacing: .3px; }
.user-box { display: flex; align-items: center; gap: 10px; font-size: 13px; }

/* 顶部提示条：更圆、更柔 */
.banner {
  margin: 14px 14px 0; padding: 14px 20px;
  background: linear-gradient(100deg, #fdf1dd 0%, #fbe8d8 100%);
  border: 1px solid #f2dcbf;
  border-radius: var(--radius);
  color: #8a5a2c; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}

/* 共享素材页顶部的说明条：说清楚「只读」的规矩 */
.notice {
  margin: 0 0 16px; padding: 15px 20px; border-radius: var(--radius);
  background: linear-gradient(100deg, #fdf6ee 0%, #fbf0e2 100%);
  border: 1px solid #f0e0cc;
  color: #73553c; font-size: 13px; line-height: 1.8;
}
.notice b { color: #8a4f2c; }

.page { padding: 20px 14px 32px; }
.hidden { display: none !important; }

/* ---------- 卡片（大圆角 + 悬浮） ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 16px; margin-bottom: 20px; }
.card {
  background: var(--card); border: 1px solid #f6ebdd; border-radius: 20px; padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .num { font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: .5px; }
.card .label { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

.panel {
  background: var(--card); border: 1px solid #f6ebdd; border-radius: 20px; padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.panel h3 { margin: 6px 0 12px; font-size: 15px; color: var(--ink); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.checklist { margin: 0 0 18px; padding-left: 22px; line-height: 2; }
.checklist li { margin-bottom: 2px; }
.checklist.muted { color: var(--muted); }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=search] {
  flex: 1; min-width: 240px; padding: 11px 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); font-size: 13.5px; transition: all .18s;
}
.toolbar input[type=search]:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 138, 75, .1);
}
.toolbar select {
  padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); font-size: 13.5px; color: var(--text); cursor: pointer;
}
.toolbar select:focus { outline: none; border-color: var(--gold); }
.muted { color: var(--muted); font-size: 12.5px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { padding: 13px 10px; border-bottom: 1px solid #f7eee3; text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #fffaf4; }
.table tbody tr:last-child td { border-bottom: none; }
.table .q { font-weight: 600; cursor: pointer; color: var(--ink); }
.table .a { color: #5f5048; line-height: 1.75; white-space: pre-wrap; }
.table .sim { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pill {
  display: inline-block; padding: 3px 11px; border-radius: 12px;
  background: var(--sun); color: #a1702f; font-size: 12px; font-weight: 500;
}
/* V10.5：待接待 = 客户在等、还没人接，标红提醒 */
.pill.warn { background: #fdecea; color: #c0392b; font-weight: 600; }
.price { color: var(--danger); font-weight: 600; }
.pager { display: flex; align-items: center; gap: 10px; font-size: 13px; }

/* ---------- 按钮（全圆润） ---------- */
.btn-primary {
  padding: 11px 24px; background: linear-gradient(135deg, #a86238 0%, #8a4f2c 100%);
  color: #fff8f0; border: none; border-radius: 24px; cursor: pointer; font-size: 13.5px;
  font-weight: 600; letter-spacing: .3px;
  box-shadow: 0 4px 14px rgba(138, 79, 44, .22);
  transition: all .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(138, 79, 44, .3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  padding: 9px 18px; background: #fffdf9; color: #8a6a52;
  border: 1.5px solid var(--line); border-radius: 22px; cursor: pointer; font-size: 13px;
  transition: all .18s;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--gold); background: var(--sun); }
/* V10.5：顶栏通知铃铛 + 未读角标 */
#btn-bell { position: relative; }
.bell-badge {
  display: inline-block; min-width: 17px; padding: 0 5px; margin-left: 2px;
  background: #c0392b; color: #fff; border-radius: 10px; font-size: 11px;
  line-height: 17px; text-align: center; vertical-align: 2px;
}
.notif-item { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fffdf9; }
.notif-item.unread { border-left: 3px solid #c0392b; }
.notif-item .notif-title { font-weight: 600; color: var(--ink); font-size: 13px; }
.notif-item .notif-body { color: #8a6a52; font-size: 12px; margin-top: 3px; }
.notif-item .notif-time { color: #b7a496; font-size: 11px; margin-top: 3px; }
.notif-item .notif-go { color: var(--gold); font-size: 12px; cursor: pointer; margin-top: 4px; display: inline-block; }
.btn-mini {
  padding: 6px 14px; background: #fffdf9; border: 1.5px solid var(--line);
  border-radius: 16px; cursor: pointer; font-size: 12px; color: #8a6a52;
  transition: all .18s;
}
.btn-mini:hover { color: var(--ink); border-color: var(--gold); background: var(--sun); }
.btn-danger { color: var(--danger); border-color: #f2cdc4; }
.btn-danger:hover { color: #b3453a; border-color: var(--danger); background: #fdf1ee; }
.link { color: var(--ink); cursor: pointer; margin-right: 10px; text-decoration: underline; text-decoration-color: #e2c9ae; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(43, 32, 24, .58);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  backdrop-filter: blur(3px);
}
.modal-card {
  position: relative;
  width: 580px; max-width: 92vw; max-height: 86vh; overflow-y: auto;
  background: var(--card);
  border-radius: 24px; padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: pop .22s ease-out;
}
/* V10-P001：弹层右上角关闭按钮——此前「关闭」只藏在底部 modal-foot，
   小窗口下 foot 被截断，用户就被困在弹层里了 */
.modal-x {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--line); background: #fffdfa; color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer; transition: all .18s;
}
.modal-x:hover { color: var(--ink); border-color: var(--gold); background: var(--sun); transform: rotate(90deg); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card h3 { margin: 0 0 18px; color: var(--ink); font-size: 17px; }
.modal-card label { display: block; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); }
.modal-card input, .modal-card textarea, .modal-card select {
  width: 100%; margin-top: 6px; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit;
  background: #fffdfa; transition: all .18s;
}
.modal-card input:focus, .modal-card textarea:focus, .modal-card select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 138, 75, .1);
}
.modal-card textarea { min-height: 110px; resize: vertical; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }

/* ---------- P2 客服与 SOP ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1.5px solid var(--line); flex-wrap: wrap; }
.tab {
  padding: 11px 20px; background: transparent; border: none; cursor: pointer;
  font-size: 13.5px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px;
  border-radius: 12px 12px 0 0; transition: all .18s;
}
.tab:hover { color: var(--ink); background: var(--sun); }
.tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--gold); }

/* V10-P004：会话接管台改工作台式布局——顶栏统计与左右两栏固定高度，
   仅列表与详情各自内部滚动，滚到多深右侧「会话详情」都留在视口内 */
.kf-grid { display: grid; grid-template-columns: minmax(300px, 390px) 1fr; gap: 16px; align-items: start; }
#tab-console .cards { margin-bottom: 16px; }
#tab-console .kf-grid { height: calc(100vh - 300px); min-height: 420px; align-items: stretch; }
#tab-console .kf-grid > .panel {
  display: flex; flex-direction: column; overflow: hidden; max-height: 100%;
}
#tab-console .kf-grid > .panel > .panel-head { flex: none; }
#tab-console .kf-grid > .panel > .toolbar { flex: none; }
#kf-session-list { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 4px; }
#kf-detail-panel > h3 { flex: none; }
#kf-detail-panel .muted { flex: none; }
#kf-detail { flex: 1 1 auto; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }
#kf-detail.hidden { display: none; }
#kf-detail .kf-msgs { max-height: none; flex: 1 1 auto; min-height: 0; }
.kf-item {
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 13px 15px;
  margin-bottom: 10px; cursor: pointer; transition: all .18s; background: #fffdfa;
}
.kf-item:hover { border-color: var(--gold); transform: translateX(3px); }
.kf-item.on { border-color: var(--gold); background: var(--sun); box-shadow: var(--shadow); }
.kf-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kf-last { margin: 5px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kf-msgs {
  max-height: 340px; overflow-y: auto; border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 14px; background: #fffaf5;
}
.kf-msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.kf-msg.out { flex-direction: row-reverse; }
.kf-who { font-size: 11px; color: var(--muted); flex: none; margin-top: 8px; }
.kf-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 16px; background: #fff;
  border: 1px solid var(--line); font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
.kf-msg.in .kf-bubble { background: #fff; border-radius: 16px 16px 16px 4px; }
.kf-msg.out .kf-bubble { background: var(--peach); border-color: #f2d8c0; border-radius: 16px 16px 4px 16px; }

.sop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.sop-node, .sop-edge {
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 13px 15px;
  margin-bottom: 12px; background: #fffdfa;
}
.sop-node-head, .sop-edge-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sop-node input, .sop-node textarea, .sop-edge input, .sop-edge select {
  width: 100%; margin-bottom: 8px; padding: 9px 11px; font-size: 12.5px;
  border: 1.5px solid var(--line); border-radius: 10px; font-family: inherit; background: #fff;
}
.sop-node input:focus, .sop-edge input:focus, .sop-edge select:focus { outline: none; border-color: var(--gold); }
.sop-node textarea, .sop-edge textarea { resize: vertical; }
.sop-edge-head select { width: auto; }

/* ---------- P3 素材站 / 供应商 ---------- */
#page-assets .form-row label { font-size: 12.5px; color: var(--muted); }
#page-assets .form-row label input, #page-assets .form-row label select {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit;
  background: #fffdfa;
}
#page-assets .form-row label input:focus, #page-assets .form-row label select:focus {
  outline: none; border-color: var(--gold);
}
#sup-list { max-height: 640px; overflow-y: auto; }
#sup-timeline { max-height: 200px; overflow-y: auto; line-height: 2; }
#sup-items select, #sup-items input {
  width: 100%; padding: 7px 10px; font-size: 12.5px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
}
#sup-items select:focus, #sup-items input:focus { outline: none; border-color: var(--gold); }
#sup-items .table th, #sup-items .table td { padding: 8px 8px; }
#sup-items .panel { background: #fffaf4; border-radius: var(--radius); }

/* ---------- 进度条（供应商分级双口径） ---------- */
.bar { position: relative; height: 10px; border-radius: 6px; background: #f4e6d7; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--gold); }
.bar > i.pass { background: var(--ok); }

/* ---------- 批量删除（v10.2）：勾选栏 + 危险操作条 ---------- */
/* 设计口径：批量删除是「低频、高危、管理员专属」的操作，
   平时收在最小形态（只有一列复选框），选中后才浮出红色操作条——
   避免日常逛列表时被一个显眼的「删除」按钮反复诱惑、手滑点中。 */
.bulk-th { width: 36px; text-align: center; }
.bulk-th input, .bulk-td input { width: 15px; height: 15px; cursor: pointer; accent-color: #b3352f; }
.bulk-td { text-align: center; }

/* 选中行高亮，让「我勾了哪几条」一目了然（删东西不能靠记忆） */
tr.bulk-on { background: #fdf1ef; }
tr.bulk-on > td { background: inherit; }

/* 操作条：未选中时隐藏，选中后出现在列表上方 */
.bulk-bar {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 0; padding: 10px 13px; border-radius: var(--radius);
  background: #fdf3f1; border: 1.5px solid #f0cdc7;
}
.bulk-bar.on { display: flex; }
.bulk-bar .bulk-n { font-size: 13px; color: #8a2f29; font-weight: 600; }
.bulk-bar .bulk-warn { font-size: 12px; color: var(--muted); flex: 1 1 240px; }
.btn-bulk-del {
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; border-radius: 999px; background: #b3352f; color: #fff;
}
.btn-bulk-del:hover { background: #96261f; }
.btn-bulk-del:disabled { background: #d8b7b4; cursor: not-allowed; }

/* 二次确认弹层：确认词输入必须手动敲，粘贴都不给（挡「点快了」） */
.bulk-confirm-tip { font-size: 13px; line-height: 1.9; color: #7a2b26; }
.bulk-confirm-tip code {
  background: #fbe9e6; border: 1px solid #f0cdc7; border-radius: 6px;
  padding: 2px 7px; font-size: 13px; color: #b3352f; font-weight: 700;
}
.bulk-confirm-tip input {
  width: 100%; margin-top: 8px; padding: 11px 13px; font-size: 14px;
  border: 1.5px solid #e5b7b1; border-radius: var(--radius-sm); font-family: inherit;
}
.bulk-confirm-tip input:focus { outline: none; border-color: #b3352f; }

/* 批量删除 · 待销毁文件清单（v10.3）：删文件夹=清骨架，删夹里的文件=销毁原件，
   所以这份清单要让人一眼看清「要烧掉的是什么东西」，不能压缩成一行小字 */
.bulk-file-list { margin: 10px 0; max-height: 300px; overflow-y: auto; }
.bulk-file-group {
  border: 1px solid #f0cdc7; border-radius: var(--radius-sm);
  padding: 9px 12px; margin-bottom: 8px; background: #fffaf9;
}
.bulk-file-head { font-size: 13px; font-weight: 600; color: #8a2f29; }
.bulk-file-n {
  float: right; font-weight: 700; color: #b3352f;
  background: #fbe9e6; border-radius: 999px; padding: 1px 9px; font-size: 12px;
}
.bulk-file-names {
  margin-top: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.7;
  word-break: break-all;
}
