/* ============================================================
   工作日志与企业共享资料库 —— 原生样式表
   无框架、无 CDN，直接可用
   ============================================================ */

:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --bg: #f6f8fb;
  --card: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }

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

body {
  font: 14px/1.6 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
  width: 220px;
  flex: 0 0 220px;
  background: #111827;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand b { display: block; color: #fff; font-size: 15px; letter-spacing: .3px; }
.brand span { font-size: 11px; color: #94a3b8; letter-spacing: 1px; }

.nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 2px;
  color: #cbd5e1; border-radius: 8px; font-size: 14px;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.on { background: var(--brand); color: #fff; }
.nav a .ico { width: 16px; text-align: center; opacity: .9; font-size: 13px; }

.sidebar-foot {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  color: #94a3b8;
}
.sidebar-foot b { color: #e2e8f0; font-weight: 600; }

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

.topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar .sp { flex: 1; }
.topbar .who { font-size: 13px; color: var(--ink-2); }

.content { padding: 20px 22px 40px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-h {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.card-h h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-h .sp { flex: 1; }
.card-b { padding: 16px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; font-size: 13px; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; background: #f9fafb; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--danger); border-color: #fecaca; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-link { border: 0; background: none; color: var(--brand); padding: 0 4px; height: auto; }
.btn-link:hover { background: none; text-decoration: underline; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.field > label .help { font-weight: 400; }
.field > label i { color: var(--danger); font-style: normal; }

/* 注意：JS 生成的 input 常省略 type 属性，必须用 :not([type]) 一并覆盖，
   否则这些框会退回浏览器原生样式（黑边、直角） */
input[type=text], input[type=password], input[type=date], input[type=search],
input[type=number], input[type=email], input[type=tel], input[type=url],
input:not([type]), select, textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid #d9e1ec; border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.7; }

input::placeholder, textarea::placeholder { color: #b0b9c6; }

input:hover, select:hover, textarea:hover { border-color: #b9c6d8; }

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}

input:disabled, input[readonly], select:disabled, textarea:disabled {
  background: #f6f8fa; color: var(--ink-3); cursor: not-allowed; border-color: #e5eaf1;
  box-shadow: none;
}

/* 下拉框：去掉原生箭头，画一个统一的 */
select {
  -webkit-appearance: none; appearance: none;
  padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
select::-ms-expand { display: none; }

/* 复选 / 单选：跟随品牌色 */
input[type=checkbox], input[type=radio] {
  width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; flex: none;
}

/* 数字输入：弱化上下箭头 */
input[type=number]::-webkit-inner-spin-button { opacity: .4; }
input[type=number]:hover::-webkit-inner-spin-button { opacity: 1; }

input[type=file] { font-size: 13px; }
input[type=file]::file-selector-button {
  height: 30px; padding: 0 12px; margin-right: 10px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
  font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; transition: .15s;
}
input[type=file]::file-selector-button:hover { background: #f9fafb; border-color: #cbd5e1; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.row.tight { gap: 8px; }

/* ---------------- 工具条 / 标签 ---------------- */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.toolbar .sp { flex: 1; }
.toolbar input[type=search], .toolbar select { width: auto; min-width: 150px; height: 34px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button {
  border: 0; background: none; padding: 12px 14px; cursor: pointer;
  font: inherit; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 999px; font-size: 11px; line-height: 1;
  background: var(--brand-soft); color: var(--brand-dark);
  margin-right: 4px; white-space: nowrap;
}
.tag.blue { background: var(--brand-soft); color: var(--brand-dark); }
.tag.gray { background: #f3f4f6; color: var(--ink-2); }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.amber { background: #fffbeb; color: var(--warn); }

.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th, table.table td {
  text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.table th { color: var(--ink-2); font-weight: 600; background: #fafbfc; font-size: 12px; white-space: nowrap; }
table.table tbody tr:nth-child(even) { background: #fcfdff; }
table.table tbody tr { transition: background .12s; }
table.table tbody tr:hover { background: #f4f8ff; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table td.actions { white-space: nowrap; }
table.table td.name { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--ink-2); }

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; justify-content: flex-end; font-size: 13px; color: var(--ink-2); }

.empty { padding: 56px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }

/* ---------------- 资料库双栏 ---------------- */
.lib { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }

.tree { padding: 8px; }
.tree-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 13px;
}
.tree-item:hover { background: #f3f4f6; }
.tree-item.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.tree-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item .mini {
  opacity: 0; font-size: 14px; line-height: 1; color: var(--ink-3);
  padding: 2px 5px; border-radius: 5px; cursor: pointer;
}
.tree-item:hover .mini, .tree-item.ctx-on .mini { opacity: 1; }
.tree-item .mini:hover { background: #e5e7eb; color: var(--ink); }
/* 触摸屏没有 hover，一直显示「更多」 */
@media (hover: none) {
  .tree-item .mini { opacity: .55; }
}
.tree-item.ctx-on { background: #eceff4; }
.tree-children { padding-left: 14px; }

/* 当前文件夹操作条 */
.folder-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fafbfd;
}
.folder-bar .fb-ico { font-size: 14px; }
.folder-bar .fb-name { font-size: 13px; font-weight: 600; color: var(--ink); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-bar .fb-tip { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* 提醒时间快捷选择 */
.rm-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rm-presets button {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.rm-presets button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 提醒附件 */
.att-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 13px;
}
.att-item .sp { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-item .x { border: 0; background: none; color: var(--ink-3); font-size: 15px; cursor: pointer; line-height: 1; padding: 2px 4px; }
.att-item .x:hover { color: var(--danger); }
.att-empty { color: var(--ink-3); font-size: 12.5px; margin-bottom: 6px; }

/* ---------------- 右键菜单 ---------------- */
.ctx-menu {
  position: fixed; z-index: 120; min-width: 178px; padding: 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .35);
  display: none;
}
.ctx-menu.on { display: block; }
.ctx-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; text-align: left; padding: 8px 10px;
  font: inherit; font-size: 13px; color: var(--ink); border-radius: 6px; cursor: pointer;
}
.ctx-menu button:hover { background: #f3f4f6; }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover { background: var(--danger-soft); }
.ctx-menu .ico { width: 16px; text-align: center; font-size: 12px; opacity: .75; }
.ctx-menu .sep { height: 1px; margin: 4px 6px; background: var(--line); }
tr.ctx-on > td { background: #f5f7fb; }

/* ---------------- 弹窗 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 100; padding: 8vh 16px 16px; overflow-y: auto;
}
.mask.on { display: flex; }
.modal {
  background: #fff; border-radius: 12px; width: 520px; max-width: 100%;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,.35);
  animation: pop .16s ease-out;
}
.modal.wide { width: 760px; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-h { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 15px; }
.modal-h .x { margin-left: auto; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--ink-3); cursor: pointer; }
.modal-b { padding: 18px; max-height: 66vh; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }

/* ---------------- 抽屉 ---------------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(17,24,39,.35); display: none; z-index: 110; }
.drawer-mask.on { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 94vw;
  background: #fff; z-index: 111; box-shadow: -16px 0 40px -20px rgba(0,0,0,.4);
  transform: translateX(102%); transition: transform .2s ease; display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-h { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-h h3 { margin: 0; font-size: 15px; }
.drawer-h .x { margin-left: auto; border: 0; background: none; font-size: 20px; color: var(--ink-3); cursor: pointer; }
.drawer-b { padding: 18px; overflow-y: auto; flex: 1; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; word-break: break-all; }

/* ---------------- Toast ---------------- */
#toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  min-width: 160px; max-width: 78vw; padding: 10px 16px; border-radius: 8px;
  background: #111827; color: #fff; font-size: 13px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
  animation: fadein .18s ease-out;
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #065f46; }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------------- 登录页 ---------------- */
.guest {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef4ff 0%, #f8fafc 55%, #eefaf6 100%);
  padding: 24px;
}
.guest-card { width: 380px; max-width: 100%; background: #fff; border-radius: 14px; padding: 32px 30px 26px; box-shadow: 0 20px 60px -24px rgba(15, 23, 42, .35); }
.guest-card .logo { width: 42px; height: 42px; border-radius: 11px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; margin-bottom: 16px; }
.guest-card h2 { margin: 0 0 4px; font-size: 19px; }
.guest-card p.sub { margin: 0 0 22px; color: var(--ink-3); font-size: 12.5px; }
.guest-card .btn { width: 100%; height: 40px; margin-top: 6px; }
.err-box { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px; }

/* 密码框显示/隐藏 */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 42px; }
.pwd-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 30px; border: 0; border-radius: 7px; background: none;
  font-size: 14px; line-height: 1; color: var(--ink-3); cursor: pointer; transition: .15s;
}
.pwd-eye:hover { background: #f1f5f9; color: var(--ink-2); }

/* 记住公司编码 */
.remember {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-2); margin: -2px 0 14px; cursor: pointer; user-select: none;
}

/* 演示账号折叠 */
.demo-tip { margin-top: 16px; font-size: 12px; color: var(--ink-3); }
.demo-tip summary {
  list-style: none; cursor: pointer; text-align: center; padding: 6px 0;
  border-top: 1px dashed var(--line); color: var(--ink-3);
}
.demo-tip summary::-webkit-details-marker { display: none; }
.demo-tip summary:hover { color: var(--brand); }
.demo-tip p { margin: 8px 0 0; line-height: 1.9; text-align: center; }
.demo-tip code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: #f1f5f9; padding: 1px 6px; border-radius: 5px; color: #1e40af;
}

/* ---------------- 富文本编辑区 ---------------- */
.editor {
  min-height: 220px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 0 0 8px 8px; outline: none; font-size: 14px; line-height: 1.8;
  background: #fff; overflow-y: auto;
}
.editor:focus { border-color: var(--brand); }
.editor:empty:before { content: attr(data-ph); color: #b6bdc9; }
.editor-tools { display: flex; gap: 4px; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: #fafbfc; flex-wrap: wrap; }
.editor-tools button { height: 26px; min-width: 28px; padding: 0 8px; border: 1px solid transparent; background: transparent; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--ink-2); }
.editor-tools button:hover { background: #fff; border-color: var(--line); }

.rich { font-size: 14px; line-height: 1.85; word-break: break-word; }
.rich img { max-width: 100%; }

/* ---------------- 通讯录卡片 ---------------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.contact-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff; cursor: pointer; transition: .15s; }
.contact-card:hover { border-color: #bfd3f9; box-shadow: var(--shadow); }
.contact-card .nm { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.contact-card .sub { color: var(--ink-3); font-size: 12px; margin: 2px 0 8px; }
.contact-card .tel { font-size: 13px; color: var(--ink-2); }
.star { color: #f59e0b; }

/* ---------------- 其他 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.stat .k { font-size: 12px; color: var(--ink-3); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: .3px; }

.bar { height: 6px; background: #eef1f6; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.warn > i { background: var(--warn); }
.bar.danger > i { background: var(--danger); }

.notice { display: flex; gap: 8px; padding: 10px 14px; border-radius: 8px; background: #fffbeb; color: #92400e; font-size: 12.5px; border: 1px solid #fde68a; margin-bottom: 14px; }
.notice.blue { background: var(--brand-soft); color: #1e40af; border-color: #bfdbfe; }

.chk-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 160px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.chk-list label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 3px 8px; border-radius: 6px; background: #f7f8fa; cursor: pointer; }
.chk-list label:hover { background: #eef2f7; }

.help { font-size: 12px; color: var(--ink-3); }

/* ---------------- 细节优化 ---------------- */
/* 键盘可访问性：只在键盘导航时显示焦点框 */
:focus-visible { outline: 2px solid rgba(37, 99, 235, .55); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* 更细的滚动条，避免 Windows 默认粗条破坏观感 */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 统计卡片轻微反馈 */
.stat { transition: box-shadow .15s, border-color .15s; }
.stat:hover { border-color: #d5e2f7; box-shadow: var(--shadow); }

/* 空状态更柔和 */
.empty { color: var(--ink-3); }
.empty b { font-size: 14px; }

/* 表格里的操作按钮更紧凑 */
table.table .btn + .btn { margin-left: 4px; }

/* 数字对齐，长列表更好读 */
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .nav { display: flex; overflow-x: auto; padding: 8px; }
  .nav a { white-space: nowrap; margin-bottom: 0; }
  .sidebar-foot { display: none; }
  .lib { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .drawer { width: 100%; }
}

/* ---------------- 下拉菜单（详情 details 实现） ---------------- */
.dd { position: relative; display: inline-block; }
.dd > summary { list-style: none; cursor: pointer; }
.dd > summary::-webkit-details-marker { display: none; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
  min-width: 130px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.3);
  padding: 4px; display: flex; flex-direction: column;
}
.dd-menu button {
  border: 0; background: none; text-align: left; padding: 8px 10px;
  font: inherit; font-size: 13px; color: var(--ink); border-radius: 6px; cursor: pointer;
}
.dd-menu button:hover { background: #f3f4f6; }
.dd-menu button.danger { color: var(--danger); }
.dd-menu button.danger:hover { background: var(--danger-soft); }

/* ---------------- 日志 ---------------- */
.log-title { font-weight: 600; color: var(--ink); }
.log-body { font-size: 14px; line-height: 1.9; }
.log-body img { max-width: 100%; }
.attach-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 13px;
}
.attach-item .sp { flex: 1; }

/* ---------------- 管理后台 ---------------- */
.admin-tabs {
  display: inline-flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px;
  padding: 4px; background: #eef2f7; border-radius: 10px;
}
.admin-tabs button {
  border: 0; background: transparent; padding: 7px 16px;
  font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2);
  border-radius: 7px; transition: .15s;
}
.admin-tabs button:hover { background: rgba(255,255,255,.75); color: var(--ink); }
.admin-tabs button.on {
  background: #fff; color: var(--brand-dark); font-weight: 600;
  box-shadow: 0 1px 3px rgba(16,24,40,.10);
}
.admin-tabs button.on:hover { background: #fff; }
.panel { display: none; }
.panel.on { display: block; animation: panelIn .18s ease-out; }
@keyframes panelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- 多公司（SaaS）补充 ---------------- */
.guest-card.guest-wide { width: 560px; padding: 30px 32px 24px; }
.guest-card .form-sec {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.guest-card .form-sec:first-child { margin-top: 0; }
.guest-card .field-row { display: flex; gap: 12px; }
.guest-card .field-row .field { flex: 1; min-width: 0; }
.guest-card label i { color: var(--danger); font-style: normal; }
.guest-links {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; font-size: 12.5px;
}
.guest-links a { color: var(--brand); text-decoration: none; }
.guest-links a:hover { text-decoration: underline; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-row .stat span { display: block; font-size: 12px; color: var(--ink-3); }
.stat-row .stat b { display: block; font-size: 20px; margin-top: 4px; letter-spacing: .3px; }

.company-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 14px; border-radius: 9px;
  background: var(--brand-soft); border: 1px solid #bfdbfe; font-size: 12.5px; color: #1e3a8a;
}
.company-bar b { font-size: 13px; }
.company-bar .code { font-family: ui-monospace, Menlo, Consolas, monospace; background: #fff; border-radius: 5px; padding: 1px 6px; }

/* ---------------- 公司资料表单（两列网格） ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 20px; }
.form-grid .field { margin-bottom: 16px; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-grid label i { color: var(--danger); font-style: normal; }
.form-grid input:disabled { background: #f7f8fa; color: var(--ink-3); cursor: not-allowed; }
.form-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 2px; padding-top: 16px; border-top: 1px dashed var(--line);
}
.code-chip {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
  background: var(--brand-soft); color: #1e40af; padding: 2px 8px; border-radius: 6px;
}

/* ---------------- 套餐 ---------------- */
.plan-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.plan-name { font-size: 20px; font-weight: 700; }
.plan-tagline { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.plan-price { margin-left: auto; font-size: 22px; font-weight: 700; color: #b45309; white-space: nowrap; }
.plan-price small { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.free-tag { font-size: 13px; font-weight: 600; color: #15803d; background: #dcfce7; padding: 4px 12px; border-radius: 99px; }

.quota { margin-bottom: 14px; }
.quota-h { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.quota-h b { color: var(--ink); font-weight: 600; }
.quota-plain { padding-top: 12px; border-top: 1px dashed var(--line); }
.bar { height: 8px; background: #eef1f5; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width .3s; background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.bar.warn i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar.full i { background: linear-gradient(90deg, #ef4444, #f87171); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.plan-card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 16px 14px;
  background: #fff; transition: .15s;
}
.plan-card:hover { border-color: #c7d2fe; box-shadow: 0 6px 20px rgba(30, 64, 175, .08); }
.plan-card.current { border-color: var(--brand); background: #f8fbff; }
.plan-ribbon {
  position: absolute; top: 12px; right: 12px; font-size: 11px;
  background: var(--brand); color: #fff; padding: 2px 8px; border-radius: 99px;
}
.plan-card-name { font-size: 16px; font-weight: 700; }
.plan-card-price { margin: 8px 0 4px; }
.plan-card-price b { font-size: 24px; color: #b45309; }
.plan-card-price small { color: var(--ink-3); font-size: 12px; margin-left: 2px; }
.plan-card-tag { font-size: 12px; color: var(--ink-3); min-height: 34px; line-height: 1.5; }
.plan-feats { list-style: none; padding: 0; margin: 10px 0 14px; font-size: 12.5px; color: var(--ink-2); }
.plan-feats li { position: relative; padding-left: 18px; line-height: 1.95; }
.plan-feats li:before { content: "✓"; position: absolute; left: 0; color: #16a34a; font-weight: 700; }
.plan-card-foot { margin-top: auto; }
.plan-card-foot .btn { width: 100%; }

/* ---------------- 支付弹窗 ---------------- */
.pay-modal { width: 540px; max-width: 94vw; }
.pay-plan-brief {
  display: flex; flex-direction: column; gap: 3px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
}
.pay-plan-brief span { font-size: 12.5px; color: var(--ink-3); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 84px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 8px 6px; cursor: pointer; font-size: 13px; font-family: inherit; transition: .15s;
}
.seg button small { color: var(--ink-3); font-size: 11.5px; }
.seg button em { font-style: normal; font-size: 10.5px; color: #b45309; background: #fef3c7; border-radius: 99px; padding: 0 6px; }
.seg button.on { border-color: var(--brand); background: var(--brand-soft); color: #1e40af; }
.pay-total { margin: 16px 0; font-size: 13px; color: var(--ink-2); }
.pay-total b { font-size: 24px; color: #b45309; margin-left: 6px; }
.pay-channels { display: flex; flex-direction: column; gap: 8px; }
.pay-ch {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.pay-ch input { margin-top: 3px; }
.pay-ch span { display: flex; flex-direction: column; gap: 2px; }
.pay-ch small { color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.pay-ch:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pay-hint { font-size: 13px; color: var(--ink-2); line-height: 1.7; margin-bottom: 12px; }
.pay-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pay-qr-link { display: flex; gap: 8px; margin-bottom: 10px; }
.pay-order-no { font-size: 13px; margin-bottom: 12px; }
.pay-order-meta {
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3);
  border-top: 1px dashed var(--line); padding-top: 12px;
}
.pay-wait { color: #b45309; }
.pay-done { text-align: center; padding: 24px 0 18px; }
.pay-done-ico {
  width: 52px; height: 52px; border-radius: 50%; background: #dcfce7; color: #16a34a;
  font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.pay-done h4 { margin: 0 0 6px; font-size: 16px; }
.pay-done p { margin: 0; color: var(--ink-3); font-size: 13px; }
.tag-st { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #f1f5f9; color: var(--ink-2); }
.tag-st.ok { background: #dcfce7; color: #15803d; }
.tag-st.warn { background: #fef3c7; color: #b45309; }
.tag-st.muted { background: #f1f5f9; color: #94a3b8; }

/* ---------------- 通用表单分区（弹窗与配置页共用） ---------------- */
.form-sec {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.modal .form-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.modal .field { margin-bottom: 12px; }
.modal .field > label { font-size: 12.5px; }
.cfg-group { padding: 6px 0 10px; margin-bottom: 10px; border-bottom: 1px dashed var(--line); }
.cfg-group:last-child { border-bottom: 0; margin-bottom: 0; }
.cfg-group h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }

/* ============================================================
   产品宣传首页（?p=home）
   ============================================================ */
.hp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

body[data-page="home"] { background: #fff; }

/* ---- 顶部导航 ---- */
.hp-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15,23,42,.06);
}
.hp-nav-in { display: flex; align-items: center; gap: 26px; height: 62px; }
.hp-logo { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.hp-logo:hover { text-decoration: none; }
.hp-logo-ico {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2563eb, #4f8cff);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, .5);
}
.hp-logo b { font-size: 16px; }
.hp-nav-links { display: flex; gap: 22px; margin: 0 auto; }
.hp-nav-links a { color: var(--ink-2); font-size: 13.5px; }
.hp-nav-links a:hover { color: var(--brand); text-decoration: none; }
.hp-nav-cta { display: flex; gap: 10px; }

/* ---- 按钮 ---- */
.hp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 20px; border-radius: 9px; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: .15s; text-decoration: none;
}
.hp-btn:hover { text-decoration: none; transform: translateY(-1px); }
.hp-btn-lg { height: 46px; padding: 0 28px; font-size: 15px; border-radius: 11px; }
.hp-btn-main {
  background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .65);
}
.hp-btn-main:hover { background: linear-gradient(135deg, #1d4ed8, #2f6fe4); }
.hp-btn-ghost { border: 1px solid #d7dfeb; color: var(--ink); background: #fff; }
.hp-btn-ghost:hover { border-color: #b9c6d8; background: #f8fafc; }
.hp-btn-light { background: #fff; color: var(--brand-dark); }
.hp-btn-ghost-light { border: 1px solid rgba(255,255,255,.55); color: #fff; }
.hp-btn-ghost-light:hover { background: rgba(255,255,255,.12); }

/* ---- Hero ---- */
.hp-hero {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(59,130,246,.12), transparent 60%),
    radial-gradient(700px 380px at -10% 30%, rgba(16,185,129,.08), transparent 60%),
    linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
  border-bottom: 1px solid #eef2f7;
  overflow: hidden;
}
.hp-hero-in {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center;
  padding-top: 72px; padding-bottom: 76px;
}
.hp-pill {
  display: inline-block; font-size: 12.5px; color: #1e40af; background: var(--brand-soft);
  border: 1px solid #bfdbfe; border-radius: 99px; padding: 5px 14px; margin-bottom: 20px;
}
.hp-hero h1 { margin: 0 0 16px; font-size: 40px; line-height: 1.28; letter-spacing: -.5px; }
.hp-hero h1 em { font-style: normal; background: linear-gradient(90deg, #2563eb, #0ea5e9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hp-hero-sub { margin: 0 0 26px; font-size: 15.5px; line-height: 1.9; color: var(--ink-2); max-width: 460px; }
.hp-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hp-hero-free { margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.hp-hero-free b { color: #15803d; font-weight: 600; }

/* ---- 产品示意图（纯 CSS 画的） ---- */
.hp-shot {
  background: #fff; border: 1px solid #e5eaf2; border-radius: 14px;
  box-shadow: 0 30px 70px -30px rgba(15, 23, 42, .35);
  overflow: hidden; transform: rotate(.4deg);
}
.hp-shot-bar {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  background: #f4f6fa; border-bottom: 1px solid #e9edf4;
}
.hp-shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: #e2e8f0; }
.hp-shot-bar i:first-child { background: #fca5a5; }
.hp-shot-bar i:nth-child(2) { background: #fcd34d; }
.hp-shot-bar i:nth-child(3) { background: #86efac; }
.hp-shot-bar span { margin-left: 10px; font-size: 11.5px; color: var(--ink-3); }
.hp-shot-body { display: grid; grid-template-columns: 132px 1fr; min-height: 264px; }
.hp-shot-side { background: #111827; padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.hp-shot-side b {
  font-size: 12px; font-weight: 400; color: #cbd5e1; padding: 7px 9px; border-radius: 7px;
}
.hp-shot-side b.on { background: var(--brand); color: #fff; }
.hp-shot-main { padding: 14px 16px; }
.hp-shot-head { font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; margin-bottom: 10px; }
.hp-shot-head span { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.hp-shot-row {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px;
  padding: 9px 10px; border: 1px solid #eef1f6; border-radius: 8px; margin-bottom: 7px;
}
.hp-shot-row .ico { width: 22px; height: 22px; border-radius: 6px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.hp-shot-row .nm { flex: 1; }
.hp-shot-row .st { font-size: 11px; color: var(--ink-3); }
.hp-shot-row .st.green { color: #16a34a; }

/* ---- 通用 Section ---- */
.hp-sec { padding: 72px 0; }
.hp-sec-alt { background: #f7f9fc; border-top: 1px solid #eef2f7; border-bottom: 1px solid #eef2f7; }
.hp-h2 { margin: 0 0 10px; font-size: 28px; text-align: center; letter-spacing: -.3px; }
.hp-sub { margin: 0 0 40px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ---- 功能卡片 ---- */
.hp-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.hp-feat {
  background: #fff; border: 1px solid #e9edf4; border-radius: 14px; padding: 24px 22px;
  transition: .18s;
}
.hp-feat:hover { border-color: #c7d6f5; box-shadow: 0 14px 34px -18px rgba(30, 64, 175, .25); transform: translateY(-2px); }
.hp-feat .ico {
  width: 44px; height: 44px; border-radius: 11px; background: var(--brand-soft);
  display: flex; align-items: center; justify-content: center; font-size: 21px; margin-bottom: 14px;
}
.hp-feat h3 { margin: 0 0 8px; font-size: 16px; }
.hp-feat p { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }

/* ---- 多公司隔离 ---- */
.hp-saas { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hp-saas .hp-h2 { text-align: left; }
.hp-saas-txt > p { margin: 0 0 22px; font-size: 14.5px; line-height: 1.95; color: var(--ink-2); }
.hp-saas-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hp-saas-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: var(--ink-2); line-height: 1.8; }
.hp-saas-list b {
  flex: none; width: 24px; height: 24px; border-radius: 50%; margin-top: 2px;
  background: var(--brand); color: #fff; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center;
}
.hp-saas-demo { text-align: center; }
.hp-iso {
  background: #fff; border: 1px dashed #c7d2fe; border-radius: 14px; padding: 22px;
  display: flex; flex-direction: column; gap: 12px; position: relative;
}
.hp-iso-co {
  border: 1px solid #e5eaf2; border-radius: 11px; padding: 14px 16px; text-align: left;
  display: flex; flex-direction: column; gap: 3px; background: #f8faff;
}
.hp-iso-co b { font-size: 14.5px; }
.hp-iso-co span { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #1e40af; }
.hp-iso-co i { font-style: normal; font-size: 12px; color: var(--ink-3); }
.hp-iso-lock {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: #fff; border: 1px solid #fde68a; color: #92400e; font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 99px; box-shadow: 0 8px 20px -8px rgba(0,0,0,.18);
}
.hp-iso-note { margin: 14px 4px 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.8; }

/* ---- 价格 ---- */
.hp-pricing { max-width: 900px; margin: 0 auto; }
.plan-card { padding: 24px 20px 18px; }
.plan-card.hp-rec { border-color: var(--brand); box-shadow: 0 16px 40px -20px rgba(37, 99, 235, .35); }
.hp-year {
  font-style: normal; margin-left: 8px; font-size: 11.5px; color: #15803d;
  background: #dcfce7; border-radius: 99px; padding: 2px 8px;
}
.hp-price-note { margin: 26px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-3); }

/* ---- FAQ ---- */
.hp-faq { max-width: 760px; }
.hp-faq-item {
  background: #fff; border: 1px solid #e9edf4; border-radius: 11px;
  padding: 0 18px; margin-bottom: 10px;
}
.hp-faq-item summary {
  list-style: none; cursor: pointer; padding: 15px 0; font-size: 14.5px; font-weight: 500;
  position: relative; padding-right: 30px;
}
.hp-faq-item summary::-webkit-details-marker { display: none; }
.hp-faq-item summary:after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: var(--ink-3); transition: .15s;
}
.hp-faq-item[open] summary:after { content: "–"; }
.hp-faq-item p { margin: 0; padding: 0 0 15px; font-size: 13.5px; line-height: 1.9; color: var(--ink-2); }

/* ---- 底部 CTA ---- */
.hp-cta {
  background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #3b82f6);
  padding: 64px 0; text-align: center; color: #fff;
}
.hp-cta h2 { margin: 0 0 8px; font-size: 26px; }
.hp-cta p { margin: 0 0 26px; color: rgba(255,255,255,.85); font-size: 14px; }
.hp-cta .hp-hero-cta { justify-content: center; }

/* ---- Footer ---- */
.hp-footer { background: #0f172a; color: #94a3b8; padding: 44px 0 36px; font-size: 13px; }
.hp-footer-in { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.hp-footer-brand b { display: block; color: #fff; font-size: 15px; margin-bottom: 4px; }
.hp-footer-brand span { font-size: 12.5px; }
.hp-footer-links { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.hp-footer-links a { color: #94a3b8; }
.hp-footer-links a:hover { color: #fff; text-decoration: none; }
.hp-footer-copy { flex-basis: 100%; border-top: 1px solid rgba(148,163,184,.18); padding-top: 18px; font-size: 12px; color: #64748b; }

/* ---- 响应式 ---- */
@media (max-width: 960px) {
  .hp-hero-in, .hp-saas { grid-template-columns: 1fr; gap: 34px; }
  .hp-hero h1 { font-size: 30px; }
  .hp-hero-in { padding-top: 48px; padding-bottom: 52px; }
  .hp-sec { padding: 52px 0; }
  .hp-nav-links { display: none; }
  .hp-nav-cta { margin-left: auto; }
  .hp-shot { transform: none; }
}

/* ============================================================
   体验优化：顶部加载条 / 骨架屏 / 移动端细节
   ============================================================ */

/* 顶部加载进度条（接口请求进行中显示） */
#topLoading {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 9999;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
  opacity: 0; transition: width .25s ease, opacity .2s;
  box-shadow: 0 0 8px rgba(59,130,246,.6);
  pointer-events: none;
}
#topLoading.on { width: 82%; opacity: 1; animation: topLoadingPulse 1.6s ease-in-out infinite; }
@keyframes topLoadingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* 骨架屏 */
.sk {
  display: inline-block; height: 10px; border-radius: 6px;
  background: linear-gradient(90deg, #eef1f6 25%, #f7f9fc 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: skShine 1.3s ease infinite;
}
@keyframes skShine {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.sk-row td { padding: 15px 14px !important; }
.sk-row:hover { background: transparent !important; }

/* 空态里的操作按钮 */
.empty .btn { margin-top: 14px; }
.empty .help { display: block; margin-top: 6px; }

/* 弹窗内容过长时内部滚动，按钮区始终可见 */
.modal { display: flex; flex-direction: column; max-height: 88vh; }
.modal-b { overflow-y: auto; }
.modal-f { flex: 0 0 auto; }

/* 表格：小屏时首列更宽松，其余列自适应 */
@media (max-width: 720px) {
  table.table { font-size: 12.5px; }
  table.table th, table.table td { padding: 9px 10px; }
  table.table td.name { max-width: 52vw; }
  .toolbar { padding: 10px 12px; gap: 6px; }
  .toolbar input[type=search], .toolbar select { min-width: 0; flex: 1 1 120px; }
  .toolbar .sp { display: none; }
  .toolbar .btn { flex: 0 0 auto; }
  .tabs { overflow-x: auto; }
  .tabs button { padding: 10px 10px; white-space: nowrap; }
  .pager { justify-content: space-between; }
  .modal { width: 94vw; }
  .mask .modal.wide { width: 96vw; }
}

/* 通讯录卡片：窄屏单列 */
@media (max-width: 640px) {
  .contact-grid { grid-template-columns: 1fr !important; }
}
