/**
 * Sakura Console（Xiyin UI）· LaUi 组件层（与 app.css token 配套）
 * 旧类名保留为 alias，面板可逐步改用 la-* 前缀。
 */

/* 应援页内 la-seg 勿盖 sc-seg 风格 */
.sc-panel .la-seg {
  gap: 0;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 6%, transparent);
}
.sc-panel .la-seg__btn {
  border-radius: 0;
  padding: 6px 12px;
  box-shadow: none;
}
.sc-panel .la-seg__btn + .la-seg__btn {
  border-left: 1px solid var(--line);
}
.sc-panel .la-seg__btn.is-active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
  box-shadow: none;
}

/* ---- 统一表格 ---- */
.la-table table,
.la-table .la-table-inner {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.la-table th,
.la-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.la-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.la-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-bg) 35%, transparent);
}
.la-td-right, .la-th-right { text-align: right; }
.la-td-center, .la-th-center { text-align: center; }
.la-table-empty {
  text-align: center;
  color: var(--muted);
  padding: 24px 12px !important;
}
.la-error { margin: 8px 0; }

.ov-table,
.stats-table,
.mb-table,
.sc-table,
.music-search-table,
.queue-table,
.md-table {
  /* alias → 与 .la-table 共用 table-wrap 规则 */
}
.table-wrap.stats-table table,
.table-wrap.mb-table table,
.table-wrap.sc-table table,
.table-wrap.music-search-table table,
.la-table table {
  width: 100%;
  border-collapse: collapse;
}

/* ---- 统一分段按钮 ---- */
.la-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2, var(--surface));
}
.la-seg__btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  padding: 6px 12px;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-soft), color var(--motion-fast);
}
.la-seg__btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent-bg) 50%, transparent);
}
.la-seg__btn.is-active {
  background: var(--accent-bg);
  color: var(--accent-hover, var(--accent));
  font-weight: 550;
  box-shadow: none;
}

/* 旧分段控件对齐 LaUi */
.sc-seg-btn,
.bs-plat-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.sc-seg-btn.is-active,
.bs-plat-tab.active:not(.ghost) {
  color: var(--on-accent, #fff);
  background: var(--accent);
}

/* ---- 统一弹窗壳（与 confirm-modal 行为一致） ---- */
.la-modal,
.mb-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--motion-fast) var(--ease-soft),
    visibility var(--motion-fast);
}
.la-modal.is-open,
.mb-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.la-modal.hidden,
.mb-modal.hidden { display: none; }

.la-modal__dialog,
.mb-dialog {
  width: min(420px, 100%);
  padding: 22px 22px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}
.la-modal__dialog h3,
.mb-dialog h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

/* ---- 按钮微调 ---- */
.la-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

/* ---- 表单消息区 ---- */
.la-msg {
  min-height: 1.2em;
  font-size: 13px;
}
.la-msg.error { color: var(--danger); }
