/* Project-032 手足工作台 —— 双主题（暗色奢华/明亮）+ 响应式 */
:root {
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .18);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #13100c;
  --bg-soft: #1a1510;
  --card: #211a14;
  --card-hover: #2a2119;
  --border: #322920;
  --border-strong: #473a2b;
  --text: #f2e9dd;
  --muted: #a2907a;
  --accent: #c9a063;
  --accent-text: #1a1409;
  --accent-soft: rgba(201, 160, 99, .13);
  --danger: #e0604f;
  --ok: #59b37c;
}

html[data-theme="light"] {
  --bg: #f5f6f7;
  --bg-soft: #fbfbfc;
  --card: #ffffff;
  --card-hover: #f2f3f5;
  --border: #e5e6eb;
  --border-strong: #d6d8dd;
  --text: #1f2329;
  --muted: #86909c;
  --accent: #1677ff;
  --accent-text: #ffffff;
  --accent-soft: #e8f3ff;
  --danger: #f53f3f;
  --ok: #00b42a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 20% 10%, var(--accent-soft), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 30px 28px;
  box-shadow: var(--shadow);
}
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-card .brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #8a6428);
  color: #fff; font-weight: 700; font-size: 17px;
}
.login-card h1 { font-size: 20px; margin: 0; font-weight: 600; letter-spacing: .5px; }
.login-card p.sub { color: var(--muted); font-size: 13px; margin: 6px 0 24px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.login-card input {
  width: 100%; padding: 11px 13px; margin-bottom: 16px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); outline: none; transition: border-color .15s;
}
.login-card input:focus { border-color: var(--accent); }
.btn-primary {
  width: 100%; padding: 11px; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-text); font-weight: 600; letter-spacing: .5px;
}
.btn-primary:hover { filter: brightness(1.06); }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: -4px 0 10px; }

/* ---------------- 布局 ---------------- */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 14px 10px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 700;
  background: var(--accent); color: #fff;
}
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); text-align: left; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--card-hover); color: var(--text); }
.nav-item.active { background: var(--card-hover); color: var(--text); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--accent); color: var(--accent-text);
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.nav-section { font-size: 11px; color: var(--muted); padding: 16px 12px 6px; letter-spacing: .8px; opacity: .8; }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border-strong);
}
.user-chip .u-name { font-size: 13px; font-weight: 600; }
.user-chip .u-role { font-size: 11px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px; border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  position: sticky; top: 0; z-index: 20;
}
.search {
  flex: 0 0 480px; position: relative;
}
.search input {
  width: 100%; padding: 9px 12px 9px 34px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; outline: none;
}
.search input:focus { border-color: var(--accent); }
.search .mag { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.topbar-spacer { flex: 1; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
}
.icon-btn:hover { color: var(--accent); border-color: var(--border-strong); }

.view { padding: 16px 22px 60px; background: var(--bg); }

/* 钉钉式大白卡容器 */
.panel {
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 16px 18px 20px;
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 12px; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.panel-head .count { font-size: 12px; color: var(--muted); }
.panel-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.group-label { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); margin: 16px 6px 2px; letter-spacing: .3px; }
.group-label:first-child { margin-top: 4px; }
.view-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.view-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .3px; }
.view-head .sub { color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.view-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------- 卡片/网格 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.section { margin-bottom: 26px; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); letter-spacing: .6px; margin: 0 0 10px 2px;
}
.section-title .count { font-size: 11px; opacity: .7; }

.grid-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 6px 4px; }
.app-card {
  position: relative; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 8px 12px; border-radius: 12px;
  background: transparent; border: 1px solid transparent;
  text-align: center; transition: background .14s, border-color .14s;
  min-height: 96px;
}
.app-card:hover { background: var(--card-hover); border-color: transparent; }
.app-icon {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-size: 24px;
  background: var(--accent-soft); border: 1px solid rgba(0,0,0,.05);
}
.app-name { display: block; font-size: 12.5px; font-weight: 500; line-height: 1.35; margin: 0; }
.app-desc { display: none; }
.app-card > span:last-child { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.app-badge {
  position: absolute; top: 6px; right: 8px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.app-card.pinned { }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 22px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat .n { font-size: 22px; font-weight: 600; letter-spacing: .5px; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.warn .n { color: var(--danger); }

/* ---------------- 经营看板 ---------------- */
.board-wrap { margin-bottom: 16px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi {
  background: var(--card-hover); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.kpi .k-l { font-size: 12px; color: var(--muted); }
.kpi .k-v { font-size: 22px; font-weight: 600; margin: 4px 0 2px; letter-spacing: .3px; }
.kpi .k-s { font-size: 12px; color: var(--muted); }
.board-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 16px; align-items: start; }
.board-cell {
  min-width: 0; overflow: hidden;
  background: var(--card-hover); border-radius: 10px; padding: 12px 14px;
}
.board-cell .section-title { margin-bottom: 6px; }
.rank-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.rank-item:last-child { border-bottom: 0; }
.rank-no {
  width: 20px; height: 20px; border-radius: 6px; font-size: 12px; line-height: 20px;
  text-align: center; background: var(--card-hover); color: var(--muted); flex: 0 0 auto;
}
.rank-no.r1 { background: #ffe1b8; color: #8a5a00; font-weight: 700; }
.rank-no.r2 { background: #e8eaed; color: #555; font-weight: 700; }
.rank-no.r3 { background: #f6d7c3; color: #8a4b1d; font-weight: 700; }
.rank-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.rank-val { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13.5px; }
.rank-sub { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.low-item { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.low-item:last-child { border-bottom: 0; }
.warn-txt { color: #d97706; }
.badge-dot {
  display: inline-block; min-width: 16px; padding: 0 5px; height: 16px; line-height: 16px;
  border-radius: 8px; background: var(--danger); color: #fff; font-size: 11px; text-align: center;
}
.attend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.attend div { background: var(--card-hover); border-radius: 8px; padding: 8px 4px; }
.attend b { display: block; font-size: 20px; font-weight: 600; }
.attend span { font-size: 11.5px; color: var(--muted); }
.os-row { margin-top: 16px; }
.os-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.os-item { background: var(--card-hover); border-radius: 10px; padding: 10px 12px; text-align: center; }
.os-item.os-muted { opacity: .6; }
.os-n { font-size: 20px; font-weight: 600; }
.os-l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.os-a { font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------------- 智能收件 ---------------- */
.inbox-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.inbox-bar .btn { min-height: 40px; display: inline-flex; align-items: center; }
.inbox-previews { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.preview-item { position: relative; display: inline-block; }
.preview-item img {
  width: 66px; height: 66px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--border);
}
.preview-item button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0;
  border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 13px; line-height: 1;
}
.inbox-thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.inbox-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* ---------------- 待办 ---------------- */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--border);
  transition: border-color .15s;
}
.todo:hover { border-color: var(--border-strong); }
.todo.done { opacity: .55; }
.todo.done .t-title { text-decoration: line-through; }
.check {
  width: 20px; height: 20px; border-radius: 6px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--border-strong); background: transparent;
  display: grid; place-items: center; color: transparent; font-size: 12px;
}
.check:hover { border-color: var(--accent); }
.todo.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.t-main { flex: 1; min-width: 0; }
.t-title { font-size: 14px; font-weight: 500; word-break: break-word; }
.t-note { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.t-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.pill { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 11px; }
.pill.high { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.pill.overdue { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.t-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.todo:hover .t-actions { opacity: 1; }

.tabs { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 999px; font-size: 13px; }
.tab.active { background: var(--accent); color: var(--accent-text); font-weight: 600; }

/* ---------------- 公告 ---------------- */
.notice-item {
  padding: 14px 16px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--border); cursor: pointer; transition: border-color .15s;
}
.notice-item:hover { border-color: var(--border-strong); }
.notice-item.unread { border-left: 3px solid var(--accent); }
.notice-item h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.notice-item .n-body { font-size: 13px; color: var(--muted); line-height: 1.65; white-space: pre-wrap; }
.notice-item .n-meta { font-size: 11.5px; color: var(--muted); margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------------- 表格 ---------------- */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: .4px; background: var(--bg-soft); }
tr:last-child td { border-bottom: 0; }
td .row-actions { display: flex; gap: 6px; }

.btn {
  padding: 7px 14px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text); font-size: 13px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.accent { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.btn.accent:hover { filter: brightness(1.06); color: var(--accent-text); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--card); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.sm { padding: 4px 10px; font-size: 12px; }

/* ---------------- 弹窗 / 提示 ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55);
  display: grid; place-items: center; padding: 20px; z-index: 100;
  animation: fade .12s ease-out;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: min(520px, 100%); max-height: 88vh; overflow: auto;
  background: var(--card); border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 22px; box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 16px; font-size: 17px; font-weight: 600; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal .err { color: var(--danger); font-size: 12.5px; min-height: 16px; margin-bottom: 8px; }

#toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  background: var(--card); border: 1px solid var(--border-strong); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { border-color: var(--danger); color: var(--danger); }

.banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 18px;
  border-radius: var(--radius-sm); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 13px;
}
.banner button { margin-left: auto; }
.empty { padding: 34px; text-align: center; color: var(--muted); font-size: 13px; }

/* 搜索命中高亮 */
.hit { animation: pulse 1.6s ease-out; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent) } 100% { box-shadow: 0 0 0 10px transparent } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .side-col { position: static; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto;
    flex-direction: row; align-items: center; padding: 6px 8px; z-index: 50;
    border-right: 0; border-top: 1px solid var(--border);
  }
  .sidebar .brand, .sidebar-foot, .nav-section { display: none; }
  .nav { flex-direction: row; justify-content: space-around; gap: 0; }
  .nav-item { flex-direction: column; gap: 3px; padding: 8px 4px; font-size: 11px; flex: 1; min-height: 52px; }
  .nav-item .ico { font-size: 19px; }
  .nav-item .nav-badge { display: none; }
  /* 手机端底部只放 4 个高频入口，管理项挪进「我的账号」 */
  .nav-item[data-admin] { display: none; }
  .nav-item[data-mobile="hide"] { display: none; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi .k-v { font-size: 19px; }
  .board-3 { grid-template-columns: 1fr; gap: 16px; }
  .os-strip { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  .view { padding: 10px 10px 96px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .search { flex: 1 1 auto; }
  .search input { padding: 10px 12px 10px 34px; font-size: 16px; }  /* 16px 防 iOS 聚焦缩放 */
  .topbar .icon-btn { width: 40px; height: 40px; }

  .home-grid { gap: 12px; }
  .panel { padding: 12px 10px 16px; border-radius: 12px; }
  .panel-head { flex-wrap: wrap; gap: 6px; }
  .panel-head h2 { font-size: 17px; }
  .group-label { margin: 12px 4px 2px; }

  .grid-apps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
  .app-card { min-height: 88px; padding: 10px 2px 8px; gap: 7px; }
  .app-icon { width: 42px; height: 42px; font-size: 21px; border-radius: 12px; }
  .app-name { font-size: 11.5px; }
  .app-badge { top: 2px; right: 2px; }

  .stat-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 10px 10px; }
  .stat .n { font-size: 20px; }

  .todo { padding: 12px 12px; }
  .check { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
  .t-actions { opacity: 1; }
  .btn { padding: 9px 14px; }
  .btn.sm { padding: 7px 12px; font-size: 12.5px; }
  .field-row { grid-template-columns: 1fr; }
  .view-head h2 { font-size: 18px; }
  .view-head .actions { margin-left: 0; width: 100%; }

  /* 弹窗在手机上变成底部抽屉 */
  .overlay { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0;
    border-bottom: 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .modal-foot { position: sticky; bottom: 0; background: var(--card); padding-top: 10px; }
  .modal-foot .btn { flex: 1; }
  .field input, .field select, .field textarea { font-size: 16px; padding: 11px 12px; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 560px; }
}

/* ================= AI 工作助手 ================= */
.ai-wrap {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 14px;
  height: calc(100vh - 150px); min-height: 460px;
}
.ai-side {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; overflow: auto; box-shadow: var(--shadow);
}
.ai-convs { display: flex; flex-direction: column; gap: 4px; }
.ai-conv {
  position: relative; padding: 9px 26px 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid transparent; background: transparent;
}
.ai-conv:hover { background: var(--card-hover); }
.ai-conv.active { background: var(--accent-soft); border-color: var(--accent); }
.ai-conv-t { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-conv-m { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ai-conv-x {
  position: absolute; right: 4px; top: 6px; border: 0; background: transparent;
  color: var(--muted); font-size: 15px; line-height: 1; padding: 2px 5px; border-radius: 6px;
}
.ai-conv-x:hover { color: var(--danger); background: var(--card-hover); }

.ai-main {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; min-height: 0; box-shadow: var(--shadow); overflow: hidden;
}
.ai-thread { flex: 1; overflow: auto; padding: 18px 18px 6px; display: flex; flex-direction: column; gap: 14px; }
.ai-msg { display: flex; gap: 10px; max-width: 100%; }
.ai-msg.me { justify-content: flex-end; }
.ai-msg.me .ai-bubble {
  background: var(--accent); color: var(--accent-text); border-radius: 14px 14px 4px 14px;
  padding: 10px 13px; max-width: min(720px, 82%); line-height: 1.62; word-break: break-word;
}
.ai-avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); font-size: 15px;
}
.ai-bubble-wrap { min-width: 0; max-width: min(860px, 100%); }
.ai-msg.ai .ai-bubble {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px;
  padding: 12px 14px; line-height: 1.66; word-break: break-word;
}
.ai-bubble p { margin: 0 0 8px; }
.ai-bubble p:last-child { margin-bottom: 0; }
.ai-bubble ul, .ai-bubble ol { margin: 6px 0; padding-left: 20px; }
.ai-bubble li { margin: 3px 0; }
.ai-bubble b { font-weight: 600; }
.ai-h { margin: 12px 0 6px; font-size: 14px; }
.ai-bubble code { background: var(--card-hover); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.ai-code {
  background: var(--card-hover); border-radius: var(--radius-sm); padding: 10px;
  overflow: auto; font-size: 12.5px; margin: 8px 0;
}
.ai-table { font-size: 13px; }
.ai-table th, .ai-table td { padding: 7px 9px; }
.ai-steps { margin-top: 6px; font-size: 12px; color: var(--muted); }
.ai-steps summary { cursor: pointer; }
.ai-step { padding: 3px 0 3px 10px; border-left: 2px solid var(--border-strong); margin-top: 4px; }
.ai-step.bad { border-left-color: var(--danger); color: var(--danger); }
.ai-tools { display: flex; gap: 6px; margin-top: 7px; }
.ai-tools .btn { font-size: 12px; padding: 3px 9px; }

.ai-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 18px 0; }
.chip {
  border: 1px solid var(--border-strong); background: var(--bg-soft); color: var(--text);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.ai-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px 6px; }
.ai-input textarea {
  flex: 1; resize: none; border: 1px solid var(--border-strong); background: var(--bg-soft);
  border-radius: var(--radius-sm); padding: 10px 12px; line-height: 1.55; max-height: 160px; outline: none;
}
.ai-input textarea:focus { border-color: var(--accent); }
.ai-hint { padding: 0 16px 12px; font-size: 11.5px; color: var(--muted); }

.ai-welcome { margin: auto; text-align: center; max-width: 640px; padding: 12px; }
.ai-welcome-mark { font-size: 40px; }
.ai-welcome h3 { margin: 8px 0 6px; }
.ai-welcome p { color: var(--muted); margin: 4px 0; }
.ai-cap { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0; }
.ai-cap span {
  background: var(--accent-soft); color: var(--accent); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px;
}
.typing span {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  margin-right: 4px; animation: ai-blink 1.1s infinite;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
.typing em { font-style: normal; color: var(--muted); font-size: 12.5px; margin-left: 4px; }
@keyframes ai-blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* 知识库 / 报价 */
.kb-list { display: flex; flex-direction: column; gap: 10px; }
.kb-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; background: var(--bg-soft); }
.kb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kb-head .ai-conv-x { position: static; margin-left: auto; }
.kb-body { margin-top: 6px; color: var(--muted); line-height: 1.66; white-space: pre-wrap; }
.quote-foot { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; flex-wrap: wrap; }
.quote-line { grid-template-columns: minmax(0, 1fr) 120px auto; align-items: end; margin-bottom: 4px; }
.quote-line .q-del { height: 36px; }

@media (max-width: 820px) {
  .ai-wrap { grid-template-columns: 1fr; height: auto; }
  .ai-side { max-height: 132px; }
  .ai-main { min-height: 62vh; }
  .ai-thread { padding: 12px 12px 4px; }
  .ai-chips { padding: 6px 12px 0; overflow-x: auto; flex-wrap: nowrap; }
  .ai-msg.me .ai-bubble, .ai-bubble-wrap { max-width: 100%; }
  .ai-input { padding: 8px 10px 4px; }
  .ai-hint { padding: 0 12px 10px; }
}


/* ---------- 首页「今日提醒」条 ---------- */
.brief-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.brief-strip.calm { gap: 12px; }
.brief-title {
  font-size: 12px; letter-spacing: .08em; color: var(--muted);
  text-transform: uppercase; padding-right: 6px; border-right: 1px solid var(--border);
}
.brief-none { color: var(--muted); font-size: 13px; }
.brief-chip {
  display: inline-flex; align-items: baseline; gap: 6px; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--bg-soft); color: var(--text); transition: .15s;
}
.brief-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.brief-chip .n { font-weight: 700; font-size: 15px; color: var(--accent); }
.brief-chip .l { font-size: 13px; color: var(--muted); }
.brief-chip .x { font-size: 12px; color: var(--muted); opacity: .8; }
.brief-chip.warn { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.brief-chip.warn .n { color: var(--danger); }
.brief-chip.info .n { color: var(--ok); }
.brief-tips {
  display: flex; flex-wrap: wrap; gap: 14px; margin: -4px 2px 14px;
  font-size: 12.5px; color: var(--muted);
}
@media (max-width: 720px) {
  .brief-strip { padding: 10px; gap: 8px; }
  .brief-title { border-right: none; width: 100%; }
  .brief-chip { flex: 1 1 44%; justify-content: center; }
  .brief-tips { display: none; }
}

/* ================= 业务中心（礼品/会议/展厅/印刷/活动/会客室/H5） ================= */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; }
.biz-card {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s, transform .15s;
}
.biz-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.biz-ico {
  width: 40px; height: 40px; border-radius: 12px; flex: none; font-size: 20px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.biz-main { min-width: 0; }
.biz-name { font-size: 14px; font-weight: 600; }
.biz-name .muted { font-weight: 400; font-size: 12px; }
.biz-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.danger-t { color: var(--danger); }
.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin: 4px 0 12px; }
.kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv span { font-size: 11.5px; color: var(--muted); }
.kv b { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.status-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-click { cursor: pointer; }
.row-click:hover td { background: var(--card-hover); }
.mini-select {
  padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--bg-soft); color: var(--text); font-size: 13px; outline: none;
}
.mini-select:focus { border-color: var(--accent); }
.modal.sheet { width: min(880px, 100%); }
.sidebar .nav { overflow-y: auto; min-height: 0; scrollbar-width: thin; }
@media (max-width: 820px) {
  .biz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .biz-card { padding: 11px; gap: 9px; }
  .biz-meta { font-size: 11px; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .sidebar .nav { overflow: visible; }
  .mini-select { font-size: 16px; padding: 9px 10px; }
}

/* 业务中心表格：单号/金额不折行，窄屏靠横向滚动 */
.table td.mono { white-space: nowrap; }

/* 密码框：可切换明文，方便核对有没有输错 */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: rgba(127,127,127,.10); border: 1px solid rgba(127,127,127,.25);
  cursor: pointer; font-size: 12.5px; line-height: 1; white-space: nowrap;
  padding: 5px 8px; opacity: .9; border-radius: 6px; color: inherit;
}
.pw-eye:hover { opacity: 1; background: rgba(127,127,127,.12); }
.pw-eye.on { opacity: 1; }
