/* ============================================================
   云笔记系统 · 组件库
   命名：.u-*（utility 原子） / .c-*（component 组件）
   所有交互元素均带 :focus-visible 与 :disabled 状态
   触控目标最小 44×44（移动端断点内强制）
   ============================================================ */

/* ============ 按钮 ============ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
.btn:disabled { opacity: 0.48; cursor: not-allowed; pointer-events: none; }
.btn .ic { flex: none; }

/* 主按钮 */
.btn--primary {
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  color: #fff;
  box-shadow: var(--sh-brand);
}
.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
  box-shadow: 0 6px 18px rgba(12, 129, 121, 0.3);
  color: #fff;
}
[data-theme="dark"] .btn--primary { color: #0C2B29; }
[data-theme="dark"] .btn--primary:hover:not(:disabled) { color: #0C2B29; }

/* 次按钮 */
.btn--secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: var(--sh-xs);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* 幽灵按钮 */
.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }

/* 弱强调 */
.btn--soft { background: var(--accent-soft-bg); color: var(--accent-soft-text); }
.btn--soft:hover:not(:disabled) { background: var(--brand-100); color: var(--brand-800); }
[data-theme="dark"] .btn--soft:hover:not(:disabled) { background: var(--brand-200); color: var(--brand-900); }

/* AI 按钮 */
.btn--ai {
  background: linear-gradient(135deg, var(--ai-500), var(--ai-600));
  color: #fff;
  box-shadow: 0 4px 14px rgba(114, 89, 228, 0.26);
}
.btn--ai:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }
[data-theme="dark"] .btn--ai { color: #1E1938; }
[data-theme="dark"] .btn--ai:hover:not(:disabled) { color: #1E1938; }

/* 危险 */
.btn--danger { background: var(--danger-500); color: #fff; box-shadow: 0 3px 10px rgba(200,72,60,0.24); }
.btn--danger:hover:not(:disabled) { background: var(--danger-600); color: #fff; }
.btn--danger-soft { background: var(--danger-50); color: var(--danger-700); }
.btn--danger-soft:hover:not(:disabled) { background: var(--danger-100); color: var(--danger-700); }

/* 尺寸 */
.btn--xs { height: 26px; padding: 0 var(--sp-2); font-size: var(--fs-xs); border-radius: var(--r-sm); gap: var(--sp-1); }
.btn--sm { height: 30px; padding: 0 var(--sp-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn--lg { height: 44px; padding: 0 var(--sp-6); font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn--xl { height: 50px; padding: 0 var(--sp-8); font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 30px; }
.btn--icon.btn--lg { width: 44px; }
.btn--round { border-radius: var(--r-full); }

/* 加载态 */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 15px; height: 15px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: #fff;
  animation: spin 0.62s linear infinite;
}
.btn--secondary.is-loading::after, .btn--ghost.is-loading::after,
.btn--soft.is-loading::after, .btn--danger-soft.is-loading::after { color: var(--text-primary); }

/* ============ 图标 ============ */
.ic {
  width: 18px; height: 18px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: none;
}
.ic--sm { width: 15px; height: 15px; stroke-width: 2; }
.ic--lg { width: 21px; height: 21px; }
.ic--xl { width: 26px; height: 26px; stroke-width: 1.6; }
.ic--filled { fill: currentColor; stroke: none; }

/* ============ 卡片 ============ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out),
              transform var(--t-base) var(--ease-out),
              background-color var(--t-base) var(--ease-out);
}
.card--pad { padding: var(--sp-5); }
.card--flat { box-shadow: none; }
.card--raised { box-shadow: var(--sh-lg); background: var(--bg-raised); }
.card--hover:hover { box-shadow: var(--sh-md); border-color: var(--border-strong); transform: translateY(-2px); }
.card--click { cursor: pointer; }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
}
.card__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); display: flex; align-items: center; gap: var(--sp-2); }
.card__body { padding: var(--sp-5); }
.card__foot {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-inset);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ============ 表单 ============ */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field__label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  display: flex; align-items: center; gap: var(--sp-1);
}
.field__label .req { color: var(--danger-500); }
.field__hint { font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-snug); }
.field__error {
  font-size: var(--fs-xs); color: var(--danger-600);
  display: flex; align-items: center; gap: var(--sp-1);
  animation: fadeUp var(--t-base) var(--ease-out);
}

.input, .textarea, .select {
  width: 100%;
  min-height: 38px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  color: var(--text-primary);
  transition: border-color var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-placeholder); }
.input:hover:not(:disabled), .textarea:hover:not(:disabled), .select:hover:not(:disabled) {
  border-color: var(--border-strong);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--sh-focus);
}
.input:disabled, .textarea:disabled, .select:disabled {
  background: var(--bg-inset); color: var(--text-muted); cursor: not-allowed;
}
.input.is-error, .textarea.is-error { border-color: var(--danger-500); }
.input.is-error:focus { box-shadow: 0 0 0 3px rgba(200, 72, 60, 0.16); }

.textarea { min-height: 96px; resize: vertical; line-height: var(--lh-normal); }

.select {
  padding-right: var(--sp-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7278' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  background-size: 15px;
  cursor: pointer;
}
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239BA3AA' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* 输入框 + 前缀/后缀 */
.input-group { position: relative; display: flex; align-items: center; width: 100%; }
.input-group .ic--lead {
  position: absolute; left: var(--sp-3);
  color: var(--text-muted); pointer-events: none;
}
.input-group .input { padding-left: calc(var(--sp-3) * 2 + 18px); }
.input-group__suffix {
  position: absolute; right: var(--sp-2);
  display: flex; align-items: center; gap: var(--sp-1);
}
.input-group--action .input { padding-right: 68px; }

/* 复选 / 单选 / 开关 */
.check { display: inline-flex; align-items: flex-start; gap: var(--sp-2); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  flex: none;
  width: 18px; height: 18px;
  margin-top: 1px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-xs);
  background: var(--bg-raised);
  display: grid; place-items: center;
  transition: all var(--t-fast) var(--ease-out);
}
.check__box svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3.2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.5);
  transition: all var(--t-fast) var(--ease-spring); }
.check input:checked + .check__box { background: var(--brand-600); border-color: var(--brand-600); }
.check input:checked + .check__box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .check__box { box-shadow: var(--sh-focus); }
.check input:disabled + .check__box { opacity: 0.45; cursor: not-allowed; }
.check__text { font-size: var(--fs-base); line-height: var(--lh-snug); }
.check--radio .check__box { border-radius: 50%; }

.switch { display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch__track {
  flex: none; width: 40px; height: 23px;
  background: var(--border-strong);
  border-radius: var(--r-full);
  position: relative;
  transition: background-color var(--t-base) var(--ease-out);
}
.switch__track::after {
  content: "";
  position: absolute; top: 2.5px; left: 2.5px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--sh-sm);
  transition: transform var(--t-base) var(--ease-spring);
}
.switch input:checked + .switch__track { background: var(--brand-500); }
.switch input:checked + .switch__track::after { transform: translateX(17px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--sh-focus); }
.switch input:disabled + .switch__track { opacity: 0.45; cursor: not-allowed; }

/* 分段控制器 */
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-inset);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}
.segmented__item {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: var(--sp-1);
}
.segmented__item:hover { color: var(--text-primary); }
.segmented__item.is-active {
  background: var(--bg-raised);
  color: var(--accent);
  box-shadow: var(--sh-xs);
}
.segmented--fill { display: flex; width: 100%; }
.segmented--fill .segmented__item { flex: 1; justify-content: center; }

/* ============ 徽章 / 标签 ============ */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  height: 22px; padding: 0 var(--sp-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: 0.01em;
  background: var(--bg-inset);
  color: var(--text-secondary);
  white-space: nowrap;
}
.badge--brand { background: var(--brand-50); color: var(--brand-700); }
.badge--ai { background: var(--ai-50); color: var(--ai-700); }
.badge--gold { background: var(--gold-50); color: var(--gold-700); }
.badge--success { background: var(--success-50); color: var(--success-700); }
.badge--warning { background: var(--warning-50); color: var(--warning-700); }
.badge--danger { background: var(--danger-50); color: var(--danger-700); }
.badge--dot::before {
  content: ""; width: 5px; height: 5px;
  border-radius: 50%; background: currentColor; flex: none;
}
.badge--lg { height: 26px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }

.tag {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  height: 26px; padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  background: var(--bg-inset);
  border: 1px solid transparent;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  transition: all var(--t-fast) var(--ease-out);
  cursor: pointer;
}
.tag:hover { background: var(--bg-hover); color: var(--text-primary); }
.tag.is-active {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
}
.tag__x { display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; opacity: 0.55; }
.tag__x:hover { background: rgba(0,0,0,0.1); opacity: 1; }

/* ============ 头像 ============ */
.avatar {
  flex: none;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  overflow: hidden;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--xs { width: 22px; height: 22px; font-size: 10px; }
.avatar--sm { width: 28px; height: 28px; font-size: var(--fs-xs); }
.avatar--lg { width: 44px; height: 44px; font-size: var(--fs-md); }
.avatar--xl { width: 64px; height: 64px; font-size: var(--fs-xl); }
.avatar--ai { background: linear-gradient(135deg, var(--ai-400), var(--ai-600)); }
.avatar--ai::after { content: "✦"; font-size: 0.9em; }

/* ============ 进度 / 计量 ============ */
.progress {
  height: 6px;
  background: var(--bg-inset);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
  transition: width var(--t-slow) var(--ease-out);
}
.progress--thin { height: 4px; }
.progress--gold .progress__bar { background: linear-gradient(90deg, var(--gold-300), var(--gold-500)); }
.progress--ai .progress__bar { background: linear-gradient(90deg, var(--ai-400), var(--ai-600)); }
.progress--warn .progress__bar { background: linear-gradient(90deg, var(--warning-500), var(--danger-500)); }

.ring { transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--bg-inset); }
.ring__fill { fill: none; stroke: var(--brand-500); stroke-linecap: round;
  transition: stroke-dashoffset var(--t-slow) var(--ease-out); }

/* ============ 模态 / 抽屉 ============ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(20, 23, 25, 0.42);
  backdrop-filter: blur(3px);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease-out), visibility var(--t-base);
}
.overlay.is-open { opacity: 1; visibility: visible; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  z-index: var(--z-modal);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: all var(--t-base) var(--ease-out);
}
.modal.is-open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal--sm { width: min(420px, calc(100vw - 32px)); }
.modal--lg { width: min(760px, calc(100vw - 32px)); }
.modal--xl { width: min(980px, calc(100vw - 32px)); }
.modal__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}
.modal__body { padding: var(--sp-5) var(--sp-6); overflow-y: auto; flex: 1; }
.modal__foot {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6) var(--sp-5);
  border-top: 1px solid var(--border-subtle);
}

.drawer {
  position: fixed; top: 0; right: 0;
  height: 100vh; width: min(440px, 100vw);
  background: var(--bg-raised);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--sh-xl);
  z-index: var(--z-drawer);
  transform: translateX(100%);
  transition: transform var(--t-slow) var(--ease-out);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }

/* ============ Toast ============ */
.toast-host {
  position: fixed;
  top: var(--sp-5); right: var(--sp-5);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--sp-2);
  pointer-events: none;
  max-width: min(400px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  pointer-events: auto;
  animation: fadeUp var(--t-base) var(--ease-out);
  font-size: var(--fs-base);
}
.toast.is-out { animation: fadeIn var(--t-base) var(--ease-out) reverse forwards; }
.toast--success { border-left-color: var(--success-500); }
.toast--success .toast__icon { color: var(--success-500); }
.toast--error { border-left-color: var(--danger-500); }
.toast--error .toast__icon { color: var(--danger-500); }
.toast--warning { border-left-color: var(--warning-500); }
.toast--warning .toast__icon { color: var(--warning-500); }
.toast--ai { border-left-color: var(--ai-500); }
.toast--ai .toast__icon { color: var(--ai-500); }
.toast__icon { color: var(--brand-500); flex: none; margin-top: 1px; }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-weight: var(--fw-medium); }
.toast__desc { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.toast__close { color: var(--text-muted); padding: 2px; border-radius: var(--r-xs); }
.toast__close:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ============ Tooltip ============ */
.tip { position: relative; }
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: var(--sp-1) var(--sp-2);
  background: var(--ink-900);
  color: var(--paper-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-normal);
  border-radius: var(--r-sm);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: all var(--t-fast) var(--ease-out);
  z-index: var(--z-tooltip);
}
[data-theme="dark"] .tip::after { background: #F2F1EE; color: #14171A; }
.tip:hover::after, .tip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.tip--right::after { bottom: auto; top: 50%; left: calc(100% + 7px); transform: translateY(-50%) translateX(-4px); }
.tip--right:hover::after { transform: translateY(-50%) translateX(0); }

/* ============ 菜单 ============ */
.menu {
  position: absolute;
  /* 默认隐藏：仅在 is-open 时显示，否则会在侧栏底部常驻露出 */
  display: none;
  min-width: 190px;
  padding: var(--sp-1);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  z-index: var(--z-toast);
  animation: pop var(--t-fast) var(--ease-out);
}
.menu.is-open { display: block; animation: pop var(--t-fast) var(--ease-out); }
.menu__item {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  color: var(--text-primary);
  text-align: left;
  transition: background-color var(--t-fast) var(--ease-out);
}
.menu__item:hover { background: var(--bg-hover); }
.menu__item .ic { color: var(--text-muted); }
.menu__item:hover .ic { color: var(--text-secondary); }
.menu__item--danger { color: var(--danger-600); }
.menu__item--danger:hover { background: var(--danger-50); }
.menu__item--danger .ic { color: var(--danger-500); }
.menu__sep { height: 1px; background: var(--border-subtle); margin: var(--sp-1) 0; }
.menu__label { padding: var(--sp-2) var(--sp-3) var(--sp-1); font-size: var(--fs-xs);
  color: var(--text-muted); font-weight: var(--fw-medium); letter-spacing: var(--ls-wide); }

/* ============ 空状态 ============ */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
  gap: var(--sp-3);
}
.empty__art {
  width: 88px; height: 88px;
  display: grid; place-items: center;
  border-radius: var(--r-3xl);
  background: radial-gradient(circle at 32% 28%, var(--brand-100), var(--bg-inset));
  color: var(--brand-600);
  margin-bottom: var(--sp-1);
}
.empty__art .ic { width: 38px; height: 38px; stroke-width: 1.4; }
.empty__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.empty__desc { font-size: var(--fs-base); color: var(--text-muted); max-width: 380px; line-height: var(--lh-normal); }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-base); }
.table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  letter-spacing: var(--ls-wide);
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.table tbody tr { transition: background-color var(--t-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table--compact td, .table--compact th { padding: var(--sp-2) var(--sp-3); }

/* ============ 代码 / 提示块 ============ */
.kbd {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  background: var(--bg-inset);
  border: 1px solid var(--border-default);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.callout {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border-left: 3px solid var(--brand-500);
  background: var(--brand-50);
  font-size: var(--fs-base);
  line-height: var(--lh-snug);
}
.callout__icon { color: var(--brand-600); flex: none; margin-top: 1px; }
.callout--ai { background: var(--ai-50); border-left-color: var(--ai-500); }
.callout--ai .callout__icon { color: var(--ai-600); }
.callout--warning { background: var(--warning-50); border-left-color: var(--warning-500); }
.callout--warning .callout__icon { color: var(--warning-700); }
.callout--danger { background: var(--danger-50); border-left-color: var(--danger-500); }
.callout--danger .callout__icon { color: var(--danger-700); }
.callout--gold { background: var(--gold-50); border-left-color: var(--gold-500); }
.callout--gold .callout__icon { color: var(--gold-700); }

/* ============ 分隔 ============ */
.hr { height: 1px; background: var(--border-subtle); border: none; margin: var(--sp-4) 0; }
.hr--dash { background: none; border-top: 1px dashed var(--border-default); }
.hr--v { width: 1px; height: auto; align-self: stretch; background: var(--border-subtle); margin: 0; }

/* ============ 积分展示 ============ */
.credit-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  height: 30px; padding: 0 var(--sp-3);
  background: linear-gradient(135deg, var(--gold-50), var(--gold-100));
  border: 1px solid var(--gold-200);
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--gold-700);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: all var(--t-fast) var(--ease-out);
}
.credit-chip:hover { border-color: var(--gold-300); box-shadow: 0 2px 8px rgba(196, 134, 43, 0.16); }
[data-theme="dark"] .credit-chip { background: linear-gradient(135deg, var(--gold-50), var(--gold-100)); }
.credit-chip .ic { width: 15px; height: 15px; }
.credit-chip__delta { font-size: var(--fs-xs); font-weight: var(--fw-medium); opacity: 0.75; }

/* ============ 骨架屏 ============ */
.sk-line { height: 11px; border-radius: var(--r-xs); }
.sk-line--title { height: 15px; width: 62%; }
.sk-line--sm { height: 9px; width: 40%; }

/* ============ 滚动条 ============ */
.scroll-y { overflow-y: auto; overscroll-behavior: contain; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); background-clip: content-box; }

/* ============ 移动端触控尺寸兜底 ============ */
@media (max-width: 767px) {
  .btn { min-height: var(--touch-min); height: var(--touch-min); }
  .btn--sm { height: 38px; min-height: 38px; }
  .btn--xs { height: 32px; min-height: 32px; }
  .btn--icon { width: var(--touch-min); }
  .input, .select, .textarea { min-height: var(--touch-min); font-size: 16px; }
  .check__box { width: 22px; height: 22px; }
  .switch__track { width: 46px; height: 26px; }
  .switch__track::after { width: 20px; height: 20px; }
  .switch input:checked + .switch__track::after { transform: translateX(20px); }
}
