/* ============================================================
   天穹会议 · 基础样式
   浅色、克制、信息密度优先，接近钉钉/飞书的工作台质感
   ============================================================ */

:root {
  --blue-50: #eef5ff;
  --blue-100: #dceaff;
  --blue-200: #b9d5ff;
  --blue-500: #3b8cff;
  --blue-600: #1677ff;
  --blue-700: #0b5fd7;
  --ink-900: #191c21;
  --ink-800: #23272e;
  --ink-700: #3d434d;
  --ink-600: #545b66;
  /* 500/400 比原值各深一档：原 #8d95a1 在白底只有 3.0:1，
     12px 的辅助说明（会议号、描述、提示）读起来发虚。
     现 400=#6f7783(4.5:1) 达标 AA，500=#5f6773(5.7:1) 保持层级。 */
  --ink-500: #5f6773;
  --ink-400: #6f7783;
  --ink-300: #b0b7c1;
  --ink-200: #d5dae1;
  --bg: #f4f5f7;
  --bg-soft: #f9fafb;
  --surface: #ffffff;
  --line: #e7e9ed;
  --line-soft: #eef0f3;
  --red: #e5484d;
  --red-strong: #d13438;
  --red-soft: #fff0ef;
  --green: #12a150;
  --green-soft: #edfbf3;
  --amber: #c77405;
  --amber-soft: #fff8e8;
  --violet: #6e56cf;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.05), 0 6px 16px -8px rgba(16, 24, 40, 0.1);
  --shadow-md: 0 2px 6px rgba(16, 24, 40, 0.05), 0 16px 40px -18px rgba(16, 24, 40, 0.16);
  --shadow-lg: 0 24px 64px -16px rgba(16, 24, 40, 0.22), 0 2px 8px rgba(16, 24, 40, 0.05);
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "HarmonyOS Sans SC",
    "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, p, ul, ol, figure, blockquote {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--blue-100);
}

:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.55);
  outline-offset: 2px;
}

/* 滚动条：细，悬停才明显 */
* {
  scrollbar-width: thin;
  scrollbar-color: #d9dde3 transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb {
  background: #d9dde3;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: #c3c9d2;
  background-clip: content-box;
}
*::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------------------- 排版工具 ---------------------------- */

.h1 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.h2 {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.h3 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.h4 {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
}
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.muted { color: var(--ink-500); }
.subtle { color: var(--ink-400); }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }

.row { display: flex; align-items: center; }
.row-top { display: flex; align-items: flex-start; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.hide { display: none !important; }

.ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.btn {
  --btn-h: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--btn-h);
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease),
    color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.12s var(--ease);
  user-select: none;
}
.btn:active:not(:disabled) {
  transform: translateY(0.5px) scale(0.992);
}
.btn .ico { width: 16px; height: 16px; }
.btn-primary {
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 119, 255, 0.24);
}
.btn-primary:hover:not(:disabled) { background: #0f6be6; }
.btn-primary:active:not(:disabled) { background: var(--blue-700); }
.btn-secondary {
  background: var(--surface);
  color: var(--ink-800);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) { border-color: #d5dae1; background: #fcfcfd; }
.btn-soft {
  background: var(--blue-50);
  color: var(--blue-700);
}
.btn-soft:hover:not(:disabled) { background: var(--blue-100); }
.btn-ghost {
  background: transparent;
  color: var(--ink-600);
}
.btn-ghost:hover:not(:disabled) { background: #f1f3f5; color: var(--ink-900); }
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: var(--red-strong); }
.btn-danger-ghost {
  color: var(--red);
  background: transparent;
}
.btn-danger-ghost:hover:not(:disabled) { background: var(--red-soft); }
.btn-outline-danger {
  border-color: #f0c8c8;
  color: var(--red);
  background: #fff;
}
.btn-outline-danger:hover:not(:disabled) { background: var(--red-soft); }
.btn:disabled {
  opacity: 0.55;
  box-shadow: none;
}
.btn-sm { --btn-h: 30px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-sm .ico { width: 14px; height: 14px; }
.btn-lg { --btn-h: 46px; padding: 0 22px; font-size: 15px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon {
  width: var(--btn-h);
  padding: 0;
}
.btn.loading {
  pointer-events: none;
  color: transparent !important;
  position: relative;
}
.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn-secondary.loading::after,
.btn-ghost.loading::after { color: var(--ink-600); }

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

.link {
  color: var(--blue-600);
  cursor: pointer;
  transition: color 0.15s var(--ease);
}
.link:hover { color: var(--blue-700); text-decoration: underline; text-underline-offset: 2px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  color: var(--ink-500);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { background: #f1f3f5; color: var(--ink-900); }
.icon-btn .ico { width: 18px; height: 18px; }

/* ---------------------------- 表单 ---------------------------- */

.field { display: flex; flex-direction: column; gap: 7px; }
.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  gap: 5px;
}
.label .opt { font-weight: 400; color: var(--ink-400); font-size: 12px; }
.input,
.select,
.textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-900);
  font-size: 14px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
  appearance: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--ink-300); }
.input:hover,
.select:hover,
.textarea:hover { border-color: #d5dae1; }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}
.input:disabled { background: #f8f9fa; color: var(--ink-400); }
.input.lg { height: 46px; font-size: 15px; border-radius: 9px; }
.input.mono { font-family: var(--mono); letter-spacing: 0.06em; }
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238d95a1' stroke-width='2.2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  overflow: hidden;
}
.input-group:focus-within {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}
.input-group .input {
  border: 0;
  box-shadow: none !important;
  background: transparent;
}
.input-group .suffix {
  padding: 0 10px;
  color: var(--ink-400);
  font-size: 13px;
  white-space: nowrap;
}
.hint { font-size: 12px; color: var(--ink-400); line-height: 1.5; }
.error-text { font-size: 13px; color: var(--red); line-height: 1.5; }
.form-error {
  display: none;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 7px;
  background: var(--red-soft);
  color: #b42318;
  font-size: 13px;
  line-height: 1.5;
}
.form-error.show { display: flex; }
.form-error .ico { width: 15px; height: 15px; margin-top: 1px; }

/* 开关 */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 36px;
  height: 21px;
  border-radius: 11px;
  background: #d9dde3;
  transition: background-color 0.18s var(--ease);
  flex: 0 0 auto;
  position: relative;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s var(--ease-out);
}
.switch input:checked + .track { background: var(--blue-600); }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.18); }
.switch .switch-label { font-size: 13px; color: var(--ink-700); }

/* 复选 */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-700);
}
.check input {
  width: 16px;
  height: 16px;
  border: 1px solid var(--ink-300);
  border-radius: 4px;
  appearance: none;
  background: #fff;
  margin: 0;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
  position: relative;
  flex: 0 0 auto;
}
.check input:checked { background: var(--blue-600); border-color: var(--blue-600); }
.check input:checked::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}

/* ---------------------------- 卡片 / 徽标 ---------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 20px; }
.card-hover { transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease); }
.card-hover:hover {
  border-color: #dbe0e7;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-title h3 { font-size: 14px; font-weight: 600; }
.panel-body { padding: 18px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  background: #f1f3f5;
  color: var(--ink-600);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-blue { background: var(--blue-50); color: var(--blue-700); }
.badge-green { background: var(--green-soft); color: #0b7a3d; }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red-strong); }
.badge-gray { background: #f1f3f5; color: var(--ink-500); }
.badge-live { background: var(--red-soft); color: var(--red); }
.badge-live .dot { animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #f1f3f5;
  color: var(--ink-500);
}
.tag-blue { background: var(--blue-50); color: var(--blue-700); }
.tag-green { background: var(--green-soft); color: #0b7a3d; }
.tag-amber { background: var(--amber-soft); color: var(--amber); }

.avatar {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  background: var(--blue-600);
  user-select: none;
}
/* 有照片时照片盖住首字母；加载失败由 core.js 摘掉 img，回落到底色 + 首字母 */
.avatar-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-img .avatar-ch { position: relative; z-index: 0; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 44px; height: 44px; font-size: 17px; }
.avatar.xl { width: 64px; height: 64px; font-size: 24px; }
.avatar-square { border-radius: 8px; }

.divider { height: 1px; background: var(--line-soft); border: 0; margin: 0; }
.divider-v { width: 1px; height: 16px; background: var(--line); }

/* ---------------------------- 分段 / 标签页 ---------------------------- */

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: #f1f3f5;
  gap: 2px;
}
.segmented button {
  height: 30px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-500);
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.segmented button:hover { color: var(--ink-800); }
.segmented button.active {
  background: #fff;
  color: var(--ink-900);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(20, 26, 33, 0.08);
}

.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.tab {
  position: relative;
  padding: 0 0 11px;
  font-size: 14px;
  color: var(--ink-500);
  transition: color 0.16s var(--ease);
  white-space: nowrap;
}
.tab:hover { color: var(--ink-800); }
.tab.active { color: var(--ink-900); font-weight: 500; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--blue-600);
  border-radius: 2px;
}
.tab .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 9px;
  background: #f1f3f5;
  color: var(--ink-500);
  font-size: 11px;
}
.tab.active .count { background: var(--blue-50); color: var(--blue-700); }

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

.table-wrap { width: 100%; overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.table th {
  height: 40px;
  padding: 0 14px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-500);
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  height: 52px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.table tbody tr { transition: background-color 0.12s var(--ease); }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .cell-user .name { font-weight: 500; color: var(--ink-900); }
.table .cell-user .sub { font-size: 12px; color: var(--ink-400); }
.table .actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.table th.right, .table td.right { text-align: right; }

/* ---------------------------- 弹层 ---------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 26, 33, 0.36);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: overlay-in 0.18s var(--ease) both;
}
.overlay.closing { animation: overlay-out 0.15s var(--ease) both; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlay-out { from { opacity: 1; } to { opacity: 0; } }

.modal {
  width: 420px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s var(--ease-out) both;
  overflow: hidden;
}
.overlay.closing .modal { animation: modal-out 0.15s var(--ease) both; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes modal-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(4px) scale(0.99); }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 0;
}
.modal-head h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.modal-head p { margin-top: 5px; font-size: 13px; color: var(--ink-500); line-height: 1.5; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  background: #fcfcfd;
}
.modal-foot .left { margin-right: auto; }
.modal.wide { width: 620px; }
.modal.narrow { width: 360px; }

@media (max-width: 560px) {
  .overlay { padding: 0; align-items: flex-end; }
  .modal {
    width: 100% !important;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    animation: sheet-in 0.26s var(--ease-out) both;
  }
  .overlay.closing .modal { animation: sheet-out 0.18s var(--ease) both; }
  @keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes sheet-out { from { transform: none; } to { transform: translateY(100%); } }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* ---------------------------- 菜单 ---------------------------- */

.menu {
  position: fixed;
  z-index: 120;
  min-width: 176px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  animation: menu-in 0.14s var(--ease-out) both;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-700);
  text-align: left;
  transition: background-color 0.12s var(--ease), color 0.12s var(--ease);
}
.menu-item:hover { background: #f5f6f8; color: var(--ink-900); }
.menu-item .ico { width: 15px; height: 15px; color: var(--ink-400); }
.menu-item:hover .ico { color: var(--ink-600); }
.menu-item.danger { color: var(--red); }
.menu-item.danger .ico { color: var(--red); }
.menu-item.danger:hover { background: var(--red-soft); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 5px 6px; }
.menu-label { padding: 6px 9px 4px; font-size: 11px; color: var(--ink-400); }

/* ---------------------------- 提示 ---------------------------- */

.toast-host {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(480px, calc(100vw - 32px));
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(25, 28, 33, 0.94);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s var(--ease-out) both;
}
.toast .ico { width: 16px; height: 16px; }
.toast.success .ico { color: #6ee7a8; }
.toast.error .ico { color: #ff9a9a; }
.toast.leaving { animation: toast-out 0.16s var(--ease) both; }
/* toast-in 统一由文件后段的版本定义（带 scale，更有弹性），此处不再重复声明 */
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-4px); } }

/* ---------------------------- 空状态 / 骨架 ---------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 24px 40px;
  color: var(--ink-500);
}
.empty .art {
  width: 84px;
  height: 70px;
  margin-bottom: 14px;
  color: var(--ink-300);
}
.empty h4 { font-size: 15px; font-weight: 600; color: var(--ink-800); margin-bottom: 5px; }
.empty p { font-size: 13px; color: var(--ink-400); max-width: 320px; line-height: 1.6; }
.empty .btn { margin-top: 16px; }

.skeleton {
  background: linear-gradient(90deg, #f0f2f4 25%, #f7f8fa 37%, #f0f2f4 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.sk-line { height: 12px; border-radius: 4px; }
.sk-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }

/* ---------------------------- 进度 ---------------------------- */

.progress {
  height: 6px;
  border-radius: 3px;
  background: #eef0f3;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--blue-600);
  transition: width 0.4s var(--ease-out);
}
.progress.warn > i { background: var(--amber); }
.progress.danger > i { background: var(--red); }

/* ---------------------------- 工具类 ---------------------------- */

.scroll-y { overflow-y: auto; overscroll-behavior: contain; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: #fafbfc;
  color: var(--ink-400);
  font-size: 11px;
  font-family: var(--mono);
}


/* ============================================================
   v2 细节打磨：触感、层次、节奏
   ============================================================ */

/* 数字统一等宽，避免跳动 */
.num,
.tabular,
.metric-value,
.stat b,
.kpi b {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 按钮：按下有 0.5px 的“落位”，不再只是变深 */
.btn:active:not(:disabled) {
  transform: translateY(0.5px) scale(0.988);
}
.btn-primary {
  background: linear-gradient(180deg, #2b86ff 0%, #1677ff 62%, #0d6ef2 100%);
  box-shadow: 0 1px 2px rgba(16, 66, 145, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #3d91ff 0%, #1a7cff 62%, #0f6fe8 100%);
  box-shadow: 0 4px 12px -4px rgba(22, 119, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:active:not(:disabled) {
  background: #0d6ef2;
  box-shadow: inset 0 1px 3px rgba(6, 38, 84, 0.24);
}
.btn-secondary {
  background: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-soft {
  background: var(--blue-50);
  color: var(--blue-700);
}

/* 输入框聚焦：细描边 + 极淡外圈，替代浓重的蓝色光圈 */
.input:focus,
.input:focus-within,
textarea:focus,
select:focus {
  border-color: #a9c8ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
  outline: none;
}

/* 卡片：静态时只留一丝投影，hover 才浮起 */
.card {
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.035);
}

/* Toast：轻微缩放进入，更像系统提示 */
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* 自定义滚动条，避免 Windows 下粗黑条破坏浅色质感 */
* {
  scrollbar-width: thin;
  scrollbar-color: #d3d8e0 transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #d3d8e0;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #bcc3cd; background-clip: content-box; }

/* 页面内容进入：6px 上浮 + 淡入，节奏短促不拖沓 */
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.rise { animation: rise 0.28s var(--ease-out) both; }
.rise-1 { animation-delay: 0.03s; }
.rise-2 { animation-delay: 0.06s; }
.rise-3 { animation-delay: 0.09s; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 空状态说明文案：避免出现单字孤行 */
.empty p { max-width: 340px; text-wrap: pretty; }

/* ============================================================
   v4 全站交互打磨：焦点可达性 / 按压反馈 / 滚动条 / Tooltip
   ============================================================ */

/* 键盘导航时的统一焦点环（鼠标点击不显示） */
:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible, .icon-btn:focus-visible, .ctrl:focus-visible {
  outline-offset: 1px;
  border-radius: 8px;
}

/* 按压微反馈：所有按钮统一"按下沉一点" */
.btn:not(:disabled):active { transform: translateY(1px) scale(0.99); }
.icon-btn:not(:disabled):active { transform: scale(0.92); }
.btn, .icon-btn { will-change: auto; }

/* 文本选中色 */
::selection { background: rgba(22, 119, 255, 0.18); }

/* 细滚动条：悬停加粗，移动端保持系统默认 */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #d3d8df;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: #b8bfca; }
* { scrollbar-width: thin; scrollbar-color: #d3d8df transparent; }

/* 表单错误：出现时轻微抖动，把视线引过去 */
.form-error.show { animation: err-shake 0.28s var(--ease); }
@keyframes err-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  55% { transform: translateX(3px); }
  80% { transform: translateX(-2px); }
}

/* Tooltip：黑底白字小箭头，向上 / 向下两个方向（纯 CSS，无 JS） */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%) translateY(2px);
  background: rgba(25, 28, 33, 0.94);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s var(--ease), transform 0.12s var(--ease-out);
  z-index: 120;
}
[data-tip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%) translateY(2px);
  border: 4px solid transparent;
  border-top-color: rgba(25, 28, 33, 0.94);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s var(--ease), transform 0.12s var(--ease-out);
  z-index: 120;
}
[data-tip]:hover::after, [data-tip]:hover::before,
[data-tip]:focus-visible::after, [data-tip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* 向下弹出的变体（顶栏按钮） */
[data-tip-down]::after { bottom: auto; top: calc(100% + 7px); }
[data-tip-down]::before { bottom: auto; top: calc(100% + 3px); border-top-color: transparent; border-bottom-color: rgba(25, 28, 33, 0.94); }

/* 触屏不弹 tooltip（无 hover 能力时悬停不触发） */
@media (hover: none) {
  [data-tip]::after, [data-tip]::before,
  [data-tip-down]::after, [data-tip-down]::before { display: none; }
}
