/* ==========================================================================
   小胖联机 · components.css
   共享 UI 组件：按钮 / 卡片 / 面板 / 徽章 / 表单 / 弹窗 / 表格 / Toast …
   依赖 base.css 的语义变量。
   ========================================================================== */

/* ============================ 按钮 ============================ */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-line: var(--line);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-full);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650;
  font-size: 0.94rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
  border: 1px solid var(--btn-line);
  transition: transform var(--t-fast) var(--ease-out), background var(--t-base),
    border-color var(--t-base), color var(--t-base), box-shadow var(--t-base);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  isolation: isolate;
  will-change: transform;
}
.btn:hover {
  --btn-bg: var(--surface-3);
  --btn-line: var(--line-strong);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0) scale(0.985);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
  transform: none;
}
.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

/* 主按钮：皇家蓝实心 + 精致高光 */
.btn-primary {
  --btn-bg: var(--brand);
  --btn-fg: #ffffff;
  --btn-line: transparent;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  font-weight: 700;
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    100deg,
    transparent 25%,
    rgba(255, 255, 255, 0.28) 48%,
    transparent 62%
  );
  transform: translateX(-140%) skewX(-16deg);
  transition: none;
}
.btn-primary:hover {
  --btn-bg: var(--brand-soft);
  --btn-line: transparent;
  box-shadow: 0 14px 28px -10px rgba(37, 99, 235, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover::after {
  animation: shine-sweep 0.85s var(--ease-out);
}
html[data-theme="dark"] .btn-primary {
  --btn-fg: #ffffff;
}

/* 描边按钮 */
.btn-outline {
  --btn-bg: var(--bg-elev);
  --btn-line: color-mix(in srgb, var(--brand) 36%, var(--line-strong));
  color: var(--brand-text);
}
.btn-outline:hover {
  --btn-bg: color-mix(in srgb, var(--brand) 8%, var(--bg-elev));
  --btn-line: color-mix(in srgb, var(--brand) 65%, transparent);
}

/* 幽灵 */
.btn-ghost {
  --btn-bg: var(--bg-elev);
  --btn-line: var(--line);
}
.btn-ghost:hover {
  --btn-bg: var(--surface-2);
  --btn-line: var(--line-strong);
}

/* 极弱 */
.btn-quiet {
  --btn-bg: transparent;
  --btn-line: transparent;
  color: var(--text-dim);
  font-weight: 600;
}
.btn-quiet:hover {
  --btn-bg: var(--surface-2);
  color: var(--text);
}

/* 危险 */
.btn-danger {
  --btn-bg: color-mix(in srgb, var(--rose) 16%, transparent);
  --btn-line: color-mix(in srgb, var(--rose) 40%, transparent);
  color: color-mix(in srgb, var(--rose) 88%, var(--text));
}
.btn-danger:hover {
  --btn-bg: color-mix(in srgb, var(--rose) 26%, transparent);
  --btn-line: color-mix(in srgb, var(--rose) 60%, transparent);
}

/* 尺寸 */
.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 0.84rem;
  gap: 6px;
}
.btn-sm svg {
  width: 14px;
  height: 14px;
}
.btn-lg {
  height: 56px;
  padding: 0 30px;
  font-size: 1.03rem;
  gap: 11px;
}
.btn-lg svg {
  width: 19px;
  height: 19px;
}
.btn-xl {
  height: 62px;
  padding: 0 38px;
  font-size: 1.09rem;
  border-radius: var(--r-full);
}
.btn-block {
  width: 100%;
}
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}
.btn-sm.btn-icon {
  width: 34px;
  height: 34px;
}
.btn .btn-arrow {
  display: inline-block;
  transition: transform var(--t-base) var(--ease-out);
}
.btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* 加载态 */
.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
  flex: none;
}
.btn.is-loading {
  pointer-events: none;
}
.btn-block-spinner {
  display: inline-block;
  vertical-align: -2px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 按钮组 */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* 分段控制器 */
.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--line);
}
.segmented button,
.segmented a {
  position: relative;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-full);
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text-dim);
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
.segmented button:hover,
.segmented a:hover {
  color: var(--text);
}
.segmented .is-active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.55);
}
html[data-theme="dark"] .segmented .is-active {
  color: #ffffff;
}

/* ============================ 卡片 / 面板 ============================ */
.card {
  position: relative;
  padding: clamp(20px, 2.4vw, 28px);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm), var(--ring);
  transition: border-color var(--t-base), background var(--t-base),
    transform var(--t-base) var(--ease-out), box-shadow var(--t-base);
}
.card--hover:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: var(--shadow-md), var(--ring);
}
.card--flat {
  box-shadow: none;
  background: transparent;
}
.card-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.card-head h3 {
  font-size: var(--fs-h3);
  font-weight: 750;
}

.panel {
  position: relative;
  padding: clamp(22px, 3vw, 40px);
  border-radius: var(--r-xl);
  background:
    linear-gradient(160deg, var(--surface-2), transparent 58%),
    var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.panel--hero {
  border-radius: var(--r-2xl);
}

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}

/* 顶部描边高光（招牌质感） */
.sheen {
  position: relative;
}
.sheen::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--text) 34%, transparent),
    transparent
  );
  border-radius: inherit;
  pointer-events: none;
}

/* 卡片光晕边（hover 流光） */
.glow-edge {
  position: relative;
  isolation: isolate;
}
.glow-edge::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--angle, 0deg),
    transparent 65%,
    color-mix(in srgb, var(--brand) 85%, transparent) 78%,
    color-mix(in srgb, var(--aqua) 80%, transparent) 86%,
    transparent 96%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
  z-index: 1;
}
.glow-edge:hover::after {
  opacity: 1;
  animation: edge-rotate 3.4s linear infinite;
}
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes edge-rotate {
  to {
    --angle: 360deg;
  }
}

/* ============================ 徽章 / 标签 ============================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.chip--brand,
.chip-brand {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  border-color: color-mix(in srgb, var(--brand) 34%, transparent);
  color: var(--brand-text);
}
.chip-aqua {
  background: color-mix(in srgb, var(--aqua) 15%, transparent);
  border-color: color-mix(in srgb, var(--aqua) 32%, transparent);
  color: color-mix(in srgb, var(--aqua) 90%, var(--text));
}
.chip-violet {
  background: color-mix(in srgb, var(--violet) 16%, transparent);
  border-color: color-mix(in srgb, var(--violet) 32%, transparent);
  color: color-mix(in srgb, var(--violet) 90%, var(--text));
}
.chip-amber {
  background: color-mix(in srgb, var(--amber) 16%, transparent);
  border-color: color-mix(in srgb, var(--amber) 34%, transparent);
  color: color-mix(in srgb, var(--amber) 90%, var(--text));
}
.chip-rose {
  background: color-mix(in srgb, var(--rose) 16%, transparent);
  border-color: color-mix(in srgb, var(--rose) 34%, transparent);
  color: color-mix(in srgb, var(--rose) 90%, var(--text));
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 27px;
  padding: 0 11px 0 9px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
}
.badge.is-run {
  color: color-mix(in srgb, var(--brand) 88%, var(--text));
  border-color: color-mix(in srgb, var(--brand) 32%, transparent);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.badge.is-stop {
  color: var(--text-faint);
}
.badge.is-busy {
  color: color-mix(in srgb, var(--amber) 90%, var(--text));
  border-color: color-mix(in srgb, var(--amber) 32%, transparent);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
}
.badge.is-err {
  color: color-mix(in srgb, var(--rose) 90%, var(--text));
  border-color: color-mix(in srgb, var(--rose) 32%, transparent);
  background: color-mix(in srgb, var(--rose) 12%, transparent);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-faint);
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}
.dot-live {
  background: var(--brand);
  animation: pulse-dot 2.4s var(--ease-out) infinite;
}
.dot-ok {
  background: var(--brand);
}
.dot-warn {
  background: var(--amber);
}
.dot-err {
  background: var(--rose);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-text);
}
.kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* ============================ 区块标题 ============================ */
.sec-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto clamp(36px, 4.5vw, 60px);
}
.sec-head--left {
  align-items: flex-start;
  text-align: left;
  margin-inline: 0;
}
.sec-title {
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.1;
}
.sec-desc {
  font-size: clamp(0.95rem, 1.1vw, 1.04rem);
  color: var(--text-dim);
  line-height: 1.75;
  max-width: 60ch;
}
.sec-head-top {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ============================ 表单 ============================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}
.field-label .req {
  color: var(--rose);
}
.field-control {
  position: relative;
  display: flex;
  align-items: center;
}
.input,
.select,
.textarea {
  width: 100%;
  height: 46px;
  padding: 0 15px;
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast),
    background var(--t-fast);
  appearance: none;
}
html[data-theme="light"] .input,
html[data-theme="light"] .select,
html[data-theme="light"] .textarea {
  background: #fff;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-faint);
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--line-strong);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--brand) 62%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
  background: var(--bg-soft);
}
html[data-theme="light"] .input:focus,
html[data-theme="light"] .select:focus,
html[data-theme="light"] .textarea:focus {
  background: #fff;
}
.textarea {
  height: auto;
  min-height: 108px;
  padding: 13px 15px;
  resize: vertical;
  line-height: 1.6;
}
.select {
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238b9aae' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M1 1.5L6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}
.input--lg {
  height: 58px;
  font-size: 1.05rem;
  padding: 0 18px;
  border-radius: var(--r-md);
}
.field-hint {
  font-size: 0.76rem;
  color: var(--text-faint);
  line-height: 1.5;
}
.field-hint.is-error {
  color: color-mix(in srgb, var(--rose) 90%, var(--text));
}

.input-affix {
  position: absolute;
  right: 15px;
  font-size: 0.8rem;
  color: var(--text-faint);
  pointer-events: none;
}
.input-affix--btn {
  pointer-events: auto;
  right: 7px;
}

.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea {
  border-color: color-mix(in srgb, var(--rose) 60%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--rose) 12%, transparent);
}

.input-row {
  display: flex;
  gap: 10px;
}
.input-row .input {
  flex: 1;
  min-width: 0;
}

/* 复选框 / 单选框 */
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.check input {
  appearance: none;
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.check input:checked {
  background: var(--brand);
  border-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' fill='none' stroke='%230a1408' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 5l3.4 3.4L11 1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.check input[type="radio"] {
  border-radius: 50%;
}
.check input[type="radio"]:checked {
  background-image: none;
  box-shadow: inset 0 0 0 4px var(--bg-elev);
}
.check input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 70%, transparent);
  outline-offset: 2px;
}

/* 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text-dim);
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-track {
  position: relative;
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  transition: background var(--t-base);
  flex: none;
}
.switch-track i {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--text-faint);
  transform: translateY(-50%);
  transition: transform var(--t-base) var(--ease-spring), background var(--t-base);
}
.switch input:checked + .switch-track {
  background: color-mix(in srgb, var(--brand) 30%, transparent);
  border-color: color-mix(in srgb, var(--brand) 50%, transparent);
}
.switch input:checked + .switch-track i {
  transform: translate(17px, -50%);
  background: var(--brand);
}

/* 表单网格 */
.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid .span-2 {
  grid-column: span 2;
}
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid .span-2 {
    grid-column: span 1;
  }
}

/* ============================ 弹窗 ============================ */
html.is-modal {
  overflow: hidden;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden] {
  display: none;
}
.modal-veil {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade-in 0.24s var(--ease-out);
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.modal-box {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86dvh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.34s var(--ease-spring);
  overflow: hidden;
}
.modal-box--sm {
  width: min(420px, 100%);
}
.modal-box--lg {
  width: min(820px, 100%);
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 750;
}
.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-body > * + * {
  margin-top: 14px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}

/* ============================ Toast ============================ */
.toast-stack {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
  max-width: min(400px, calc(100vw - 36px));
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: max-content;
  max-width: 100%;
  padding: 13px 12px 13px 15px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: toast-in 0.36s var(--ease-spring);
}
.toast.is-out {
  animation: toast-out 0.26s var(--ease-out) forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}
.toast-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 1px;
}
.toast-ico svg {
  width: 13px;
  height: 13px;
}
.toast--ok .toast-ico {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--brand-text);
}
.toast--err .toast-ico {
  background: color-mix(in srgb, var(--rose) 22%, transparent);
  color: var(--rose);
}
.toast--warn .toast-ico {
  background: color-mix(in srgb, var(--amber) 22%, transparent);
  color: var(--amber);
}
.toast--info .toast-ico {
  background: color-mix(in srgb, var(--azure) 22%, transparent);
  color: var(--azure);
}
.toast-body {
  min-width: 0;
}
.toast-title {
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.45;
}
.toast-desc {
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.toast-x {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background var(--t-fast), color var(--t-fast);
}
.toast-x:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ============================ 表格 / 数据 ============================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  min-width: 560px;
  font-size: 0.86rem;
}
.table th {
  text-align: left;
  font-weight: 650;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
  font-family: var(--font-label);
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table tbody tr {
  transition: background var(--t-fast);
}
.table tbody tr:hover {
  background: var(--surface-2);
}
.table td strong {
  color: var(--text);
  font-weight: 650;
}

.kv {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin: 0;
}
.kv > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.kv dt {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
  font-family: var(--font-label);
  font-weight: 600;
}
.kv dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* 进度条 */
.meter {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  min-width: 60px;
}
.meter i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--grad-brand);
  transition: width 0.6s var(--ease-out);
}
.meter--flat i {
  background: var(--brand);
}
.meter--warn i {
  background: var(--amber);
}
.meter--crit i {
  background: var(--rose);
}

/* 空态 / 骨架 / 分隔 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: clamp(34px, 6vw, 64px) 20px;
  text-align: center;
  color: var(--text-faint);
}
.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 22px;
  color: var(--text-faint);
}
.empty h4 {
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 700;
}

.skeleton {
  position: relative;
  height: 14px;
  border-radius: 6px;
  background: var(--surface-2);
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--text) 8%, transparent),
    transparent
  );
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.sep {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}
.sep-v {
  width: 1px;
  align-self: stretch;
  background: var(--line);
}

.scroll-x {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.scroll-x > * {
  scroll-snap-align: start;
  flex: none;
}

/* 代码 */
.code-inline {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--brand-text);
  white-space: nowrap;
}
.code-block {
  position: relative;
  margin: 0;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: #05070c;
  border: 1px solid var(--line);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.75;
  color: #c3cfdd;
  tab-size: 2;
}
.code-block {
  background: #0f172a;
  color: #e2e8f0;
}
.code-block code {
  font-family: inherit;
  white-space: pre;
}
.code-block .c-key {
  color: #7dd3fc;
}
.code-block .c-str {
  color: #6ee7b7;
}
.code-block .c-num {
  color: #ffb84d;
}
.code-block .c-com {
  color: #64748b;
}

/* ============================ 提示条 ============================ */
.note {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text-dim);
}
.note--brand {
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  border-color: color-mix(in srgb, var(--brand) 26%, transparent);
  color: color-mix(in srgb, var(--brand) 40%, var(--text));
}
.note--warn {
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  border-color: color-mix(in srgb, var(--amber) 26%, transparent);
  color: color-mix(in srgb, var(--amber) 45%, var(--text));
}
.note--err {
  background: color-mix(in srgb, var(--rose) 10%, transparent);
  border-color: color-mix(in srgb, var(--rose) 26%, transparent);
  color: color-mix(in srgb, var(--rose) 45%, var(--text));
}
.note svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 2px;
}

/* ============================ 评价 / 星级 ============================ */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--amber);
}
.stars svg {
  width: 14px;
  height: 14px;
}

/* ============================ 头像 ============================ */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: 0.9rem;
  color: #ffffff;
  background: var(--grad-brand);
  flex: none;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
}

/* ============================ 链接 ============================ */
.link {
  color: var(--brand-text);
  font-weight: 650;
  position: relative;
  transition: opacity var(--t-fast);
}
.link:hover {
  opacity: 0.82;
}
.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--t-base) var(--ease-out);
}
.link-underline:hover {
  background-size: 100% 1px;
}

/* ============================ 可访问性辅助 ============================ */
.magnetic {
  transition: transform 0.34s var(--ease-out);
  will-change: transform;
}