/* 荔枝云 components (DESIGN.md §7.6). Tokens only (--ly-*). [data-force=…] pins a state for the component gallery. */

/* ---- icon & spinner ---- */
.ly-icon { display: inline-block; flex: none; vertical-align: middle; }
.ly-spinner {
  --ly-spinner-size: 16px;
  display: inline-block; flex: none; width: var(--ly-spinner-size); height: var(--ly-spinner-size);
  border-radius: var(--ly-radius-full); border: 2px solid currentColor; border-right-color: transparent;
  animation: ly-spin .8s linear infinite;
}
@keyframes ly-spin { to { transform: rotate(360deg); } }

/* ---- buttons ---- */
.ly-button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ly-space-2);
  height: 40px; min-width: 40px; padding: 0 var(--ly-space-4); border-radius: var(--ly-radius);
  border: 1px solid transparent; font: var(--ly-text-body); font-weight: 500; white-space: nowrap;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: background-color var(--ly-dur-fast) var(--ly-ease), border-color var(--ly-dur-fast) var(--ly-ease), transform var(--ly-dur-fast) var(--ly-ease);
}
.ly-button:active:not(:disabled), .ly-button[data-force="active"] { transform: scale(.98); }
.ly-button:disabled, .ly-button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.ly-button[aria-busy="true"] { cursor: progress; }
.ly-button--block { display: flex; width: 100%; }
.ly-button--primary { background: var(--ly-primary); color: var(--ly-on-primary); }
.ly-button--primary:hover:not(:disabled), .ly-button--primary[data-force="hover"], .ly-button--primary[data-force="active"] { background: var(--ly-primary-hover); }
.ly-button--secondary { background: var(--ly-surface); border-color: var(--ly-border-strong); color: var(--ly-text); }
.ly-button--secondary:hover:not(:disabled), .ly-button--secondary[data-force="hover"], .ly-button--secondary[data-force="active"] { background: var(--ly-surface-2); }
.ly-button--text { background: transparent; color: var(--ly-primary); padding: 0 var(--ly-space-3); }
.ly-button--icon { background: transparent; color: var(--ly-text-2); padding: 0; width: 40px; }
.ly-button--text:hover:not(:disabled), .ly-button--icon:hover:not(:disabled),
.ly-button--text[data-force="hover"], .ly-button--icon[data-force="hover"],
.ly-button--text[data-force="active"], .ly-button--icon[data-force="active"] { background: var(--ly-surface-2); }
.ly-button--icon:hover:not(:disabled) { color: var(--ly-text); }
.ly-button--danger { background: var(--ly-danger); color: var(--ly-on-primary); }
.ly-button--danger:hover:not(:disabled), .ly-button--danger[data-force="hover"], .ly-button--danger[data-force="active"] { background: color-mix(in srgb, var(--ly-danger) 92%, var(--ly-text)); }
.ly-button--danger:focus-visible, .ly-button--danger[data-force="focus"] { outline-color: var(--ly-danger); }
.ly-button { position: relative; }
.ly-button.is-loading.ly-button--icon > .ly-icon { display: none; }
.ly-button.is-loading--overlay > :not(.ly-spinner) { visibility: hidden; }
.ly-button.is-loading--overlay > .ly-spinner { position: absolute; left: 50%; top: 50%; margin: calc(var(--ly-spinner-size) / -2) 0 0 calc(var(--ly-spinner-size) / -2); }
[data-force="focus"] { outline: 2px solid var(--ly-primary); outline-offset: 2px; }

/* ---- fields ---- */
.ly-field { display: grid; gap: 6px; min-width: 0; }
.ly-field__label { font: var(--ly-text-body); font-weight: 500; color: var(--ly-text); }
.ly-field__control { position: relative; display: flex; align-items: center; gap: var(--ly-space-2); }
.ly-input {
  width: 100%; min-width: 0; height: 40px; padding: 0 var(--ly-space-3); border-radius: var(--ly-radius);
  border: 1px solid var(--ly-border-strong); background: var(--ly-surface); color: var(--ly-text); font: var(--ly-text-body);
  transition: border-color var(--ly-dur-fast) var(--ly-ease);
}
.ly-textarea { height: auto; min-height: 96px; padding: var(--ly-space-2) var(--ly-space-3); resize: vertical; }
.ly-select { appearance: none; padding-right: 36px; cursor: pointer; }
.ly-field__chevron { position: absolute; right: var(--ly-space-3); color: var(--ly-text-2); pointer-events: none; }
.ly-input:hover:not(:disabled):not(:focus), .ly-input[data-force="hover"] { border-color: var(--ly-text-2); }
.ly-input:focus, .ly-input[data-force="focus"] { border-color: var(--ly-primary); }
.ly-input:focus-visible, .ly-input[data-force="focus"] { outline: 2px solid var(--ly-primary); outline-offset: 2px; }
.ly-input:disabled { background: var(--ly-surface-2); color: var(--ly-text-3); opacity: .5; cursor: not-allowed; }
.ly-input--readonly { background: var(--ly-surface-2); font-family: var(--ly-font-mono); text-overflow: ellipsis; }
.ly-field.is-invalid .ly-input, .ly-input[aria-invalid="true"], .ly-field.is-invalid .ly-input:hover, .ly-input[aria-invalid="true"]:hover { border-color: var(--ly-danger); }
.ly-field.is-loading .ly-input { padding-right: 36px; }
.ly-field__control > .ly-spinner { position: absolute; right: var(--ly-space-3); color: var(--ly-text-2); }
.ly-field__help { font: var(--ly-text-small); color: var(--ly-text-2); }
.ly-field__error { display: flex; align-items: flex-start; gap: var(--ly-space-1); font: var(--ly-text-small); color: var(--ly-danger); }
.ly-field__error .ly-icon { margin-top: 2px; }
.ly-field--copy .ly-field__control > .ly-button { flex: none; }
.ly-field.is-manual-copy .ly-input { border-color: var(--ly-primary); }
@media (max-width: 767px) {
  .ly-button, .ly-input { height: 44px; }
  .ly-button--icon { width: 44px; }
  .ly-textarea { height: auto; }
  .ly-input { font-size: var(--ly-control-font, 16px); }
}

/* ---- tabs (F191): underline tabs, the selected one in the primary colour ---- */
.ly-tabs { display: flex; max-width: 100%; overflow-x: auto; gap: var(--ly-space-1); border-bottom: 1px solid var(--ly-border); }
.ly-tabs__item {
  position: relative; height: 40px; padding: 0 var(--ly-space-4); border: 0; background: transparent; white-space: nowrap;
  color: var(--ly-text-2); font: var(--ly-text-body); font-weight: 500; border-radius: var(--ly-radius-sm) var(--ly-radius-sm) 0 0;
  transition: color var(--ly-dur-fast) var(--ly-ease), background-color var(--ly-dur-fast) var(--ly-ease);
}
.ly-tabs__item::after {
  content: ""; position: absolute; left: var(--ly-space-3); right: var(--ly-space-3); bottom: -1px; height: 2px;
  border-radius: 2px; background: var(--ly-primary); transform: scaleX(0); transition: transform var(--ly-dur-fast) var(--ly-ease);
}
.ly-tabs__item:hover { color: var(--ly-text); background: var(--ly-surface-2); }
.ly-tabs__item[aria-selected="true"] { color: var(--ly-primary); }
.ly-tabs__item[aria-selected="true"]::after { transform: scaleX(1); }

/* ---- segmented ---- */
.ly-segmented { display: inline-flex; max-width: 100%; overflow-x: auto; gap: 2px; padding: 3px; border-radius: var(--ly-radius); background: var(--ly-surface-2); border: 1px solid var(--ly-border); }
.ly-segmented__item {
  height: 32px; padding: 0 var(--ly-space-4); border: 0; border-radius: calc(var(--ly-radius) - 3px); background: transparent;
  color: var(--ly-text-2); font: var(--ly-text-body); font-weight: 500; white-space: nowrap;
  transition: background-color var(--ly-dur-fast) var(--ly-ease), color var(--ly-dur-fast) var(--ly-ease);
}
.ly-segmented__item:hover:not(:disabled), .ly-segmented__item[data-force="hover"] { color: var(--ly-text); }
.ly-segmented__item[aria-checked="true"] { background: var(--ly-surface); color: var(--ly-text); box-shadow: var(--ly-shadow-1); outline-color: var(--ly-primary); }
:root[data-theme="dark"] .ly-segmented__item[aria-checked="true"] { box-shadow: inset 0 0 0 1px var(--ly-border-strong); }
.ly-segmented__item:disabled, .ly-segmented[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---- switch & checkbox ---- */
.ly-switch-row, .ly-checkbox { display: inline-flex; align-items: center; gap: var(--ly-space-3); cursor: pointer; }
.ly-switch {
  position: relative; flex: none; width: 36px; height: 20px; padding: 0; border-radius: var(--ly-radius-full);
  border: 1px solid var(--ly-border-strong); background: var(--ly-surface-2); transition: background-color var(--ly-dur-fast) var(--ly-ease);
}
.ly-switch__thumb {
  position: absolute; top: 1px; left: 1px; display: grid; place-items: center; width: 16px; height: 16px;
  border-radius: var(--ly-radius-full); background: var(--ly-surface); box-shadow: var(--ly-shadow-1); color: var(--ly-primary);
  border: 1px solid var(--ly-border-strong); transition: transform var(--ly-dur-fast) var(--ly-ease);
}
.ly-switch[aria-checked="true"] { background: var(--ly-primary); border-color: var(--ly-primary); }
.ly-switch[aria-checked="true"] .ly-switch__thumb { transform: translateX(16px); border-color: var(--ly-primary); }
.ly-switch:hover:not(:disabled), .ly-switch[data-force="hover"] { filter: brightness(.95); }
.ly-switch:disabled:not(.is-loading) { opacity: .5; cursor: not-allowed; }
.ly-switch .ly-spinner { border-width: 1.5px; }
.ly-checkbox__input { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; }
.ly-checkbox__box {
  display: grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 4px;
  border: 1px solid var(--ly-border-strong); background: var(--ly-surface); color: transparent;
}
.ly-checkbox__input:checked + .ly-checkbox__box { background: var(--ly-primary); border-color: var(--ly-primary); color: var(--ly-on-primary); }
.ly-checkbox:hover .ly-checkbox__input:not(:disabled) + .ly-checkbox__box { border-color: var(--ly-text-2); }
.ly-checkbox__input:focus-visible + .ly-checkbox__box { outline: 2px solid var(--ly-primary); outline-offset: 2px; }
.ly-checkbox__input:disabled + .ly-checkbox__box, .ly-checkbox:has(:disabled) { opacity: .5; cursor: not-allowed; }
.ly-checkbox__input[aria-invalid="true"] + .ly-checkbox__box { border-color: var(--ly-danger); }
.ly-checkbox-field { display: grid; gap: var(--ly-space-1); }

/* ---- card (panel) ---- */
.ly-panel { display: block; color: inherit; text-align: left; font: inherit; width: 100%; }
.ly-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--ly-space-3); margin-bottom: var(--ly-space-4); }
.ly-panel__title { font: var(--ly-text-h2); }
.ly-panel--clickable { cursor: pointer; text-decoration: none; transition: border-color var(--ly-dur-fast) var(--ly-ease), transform var(--ly-dur-fast) var(--ly-ease); }
.ly-panel--clickable:hover, .ly-panel--clickable[data-force="hover"] { border-color: var(--ly-border-strong); transform: translateY(-1px); }

/* ---- plan card ---- */
.ly-plan { position: relative; display: flex; flex-direction: column; gap: var(--ly-space-4); }
.ly-plan.is-selected { border: 2px solid var(--ly-primary); padding: calc(var(--ly-space-6) - 1px); }
.ly-plan__check { position: absolute; top: -1px; left: -1px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--ly-radius-lg) 0 var(--ly-radius) 0; background: var(--ly-primary); color: var(--ly-on-primary); }
.ly-plan__head { display: flex; align-items: center; justify-content: space-between; gap: var(--ly-space-2); }
.ly-plan__name { font: var(--ly-text-h2); }
.ly-plan.is-selected .ly-plan__name { padding-left: var(--ly-space-5); }
.ly-plan__price { display: flex; align-items: baseline; gap: 2px; }
.ly-plan__currency { font: var(--ly-text-h2); }
.ly-plan__amount { font: var(--ly-text-display); }
.ly-plan__unit { font: var(--ly-text-small); color: var(--ly-text-2); }
.ly-plan__features { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: var(--ly-space-2); color: var(--ly-text-2); }
.ly-plan__features li { display: flex; gap: var(--ly-space-2); align-items: flex-start; }
.ly-plan__tick { margin-top: 3px; color: var(--ly-leaf); }
.ly-plan.is-sold-out { background: var(--ly-surface-2); box-shadow: none; }
.ly-plan.is-sold-out, .ly-plan.is-sold-out .ly-plan__features, .ly-plan.is-sold-out .ly-plan__unit { color: var(--ly-text-3); }
.ly-plan.is-sold-out .ly-plan__amount { font-weight: 500; }
.ly-plan.is-sold-out .ly-plan__tick { color: var(--ly-text-3); }
@media (max-width: 767px) { .ly-plan.is-selected { padding: calc(var(--ly-space-4) - 1px); } }

/* ---- badge ---- */
.ly-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--ly-space-2); border-radius: var(--ly-radius-sm); font: var(--ly-text-small); font-weight: 500; white-space: nowrap; }
.ly-badge--neutral { background: var(--ly-surface-2); color: var(--ly-text-2); }
.ly-badge--primary { background: var(--ly-primary-soft); color: var(--ly-primary-soft-text); }
.ly-badge--leaf { background: var(--ly-leaf-soft); color: var(--ly-leaf-soft-text); }
.ly-badge--warning { background: var(--ly-warning-soft); color: var(--ly-warning-soft-text); }
.ly-badge--danger { background: var(--ly-danger-soft); color: var(--ly-danger-soft-text); }
.ly-badge--info { background: var(--ly-info-soft); color: var(--ly-info-soft-text); }

/* ---- progress ---- */
.ly-progress { display: grid; gap: var(--ly-space-2); min-width: 0; }
.ly-progress__top { display: flex; justify-content: space-between; gap: var(--ly-space-3); font: var(--ly-text-small); }
.ly-progress__label { color: var(--ly-text-2); }
.ly-progress__value { font-weight: 600; font-variant-numeric: tabular-nums; }
.ly-progress__track { height: 8px; border-radius: var(--ly-radius-full); background: var(--ly-surface-2); overflow: hidden; }
.ly-progress__fill { display: block; height: 100%; border-radius: inherit; background: var(--ly-primary); transition: width var(--ly-dur) var(--ly-ease); }
.ly-progress--warning .ly-progress__fill { background: var(--ly-warning); }
.ly-progress--danger .ly-progress__fill { background: var(--ly-danger); }
.ly-progress__caption { font: var(--ly-text-small); color: var(--ly-text-2); }
.ly-progress--warning .ly-progress__caption, .ly-progress--warning .ly-progress__value { color: var(--ly-warning); }
.ly-progress--danger .ly-progress__caption, .ly-progress--danger .ly-progress__value { color: var(--ly-danger); }

/* ---- overlays: dialog & drawer (F113) ---- */
.ly-scroll-locked, .ly-scroll-locked body { overflow: hidden; }
.ly-overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: var(--ly-space-4); }
.ly-overlay__scrim { position: absolute; inset: 0; background: var(--ly-scrim); opacity: 0; transition: opacity var(--ly-dur) var(--ly-ease); }
.ly-overlay__panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 480px; max-height: calc(100vh - 2 * var(--ly-space-4));
  background: var(--ly-surface); color: var(--ly-text); border: 1px solid var(--ly-border); border-radius: var(--ly-radius-lg); box-shadow: var(--ly-shadow-3);
  opacity: 0; transform: translateY(8px) scale(.98); transition: opacity var(--ly-dur) var(--ly-ease), transform var(--ly-dur) var(--ly-ease);
}
.ly-overlay__panel--wide { max-width: 720px; }
.ly-overlay.is-open .ly-overlay__scrim { opacity: 1; }
.ly-overlay.is-open .ly-overlay__panel { opacity: 1; transform: none; }
.ly-overlay__panel:focus { outline: none; }
.ly-overlay__head { display: flex; align-items: center; justify-content: space-between; gap: var(--ly-space-3); padding: var(--ly-space-4) var(--ly-space-4) 0 var(--ly-space-6); }
.ly-overlay__title { font: var(--ly-text-h2); min-width: 0; }
.ly-overlay__body { padding: var(--ly-space-4) var(--ly-space-6); overflow-y: auto; display: grid; align-content: start; gap: var(--ly-space-4); }
.ly-overlay__text { color: var(--ly-text-2); }
.ly-overlay__error { margin: 0 var(--ly-space-6); padding: var(--ly-space-2) var(--ly-space-3); border-radius: var(--ly-radius-sm); background: var(--ly-danger-soft); color: var(--ly-danger-soft-text); font: var(--ly-text-small); }
.ly-overlay__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--ly-space-3); padding: var(--ly-space-4) var(--ly-space-6) var(--ly-space-6); }
.ly-overlay__handle { display: none; }
/* drawer: right side on desktop */
.ly-overlay--drawer { justify-content: flex-end; align-items: stretch; padding: 0; }
.ly-overlay__panel--drawer { max-width: 400px; max-height: none; height: 100%; border-radius: var(--ly-radius-lg) 0 0 var(--ly-radius-lg); transform: translateX(24px); }
.ly-overlay__panel--drawer .ly-overlay__body { flex: 1; }
@media (max-width: 767px) {
  .ly-overlay { align-items: flex-end; padding: 0; }
  .ly-overlay__panel, .ly-overlay__panel--wide, .ly-overlay__panel--drawer {
    max-width: none; width: 100%; height: auto; max-height: 85vh; border-radius: var(--ly-radius-lg) var(--ly-radius-lg) 0 0;
    transform: translateY(32px); padding-bottom: env(safe-area-inset-bottom);
  }
  .ly-overlay--drawer { align-items: flex-end; }
  .ly-overlay__handle { display: block; width: 36px; height: 4px; margin: var(--ly-space-2) auto 0; border-radius: var(--ly-radius-full); background: var(--ly-border-strong); }
  .ly-overlay__head { padding-left: var(--ly-space-4); }
  .ly-overlay__body { padding: var(--ly-space-4); }
  .ly-overlay__error { margin: 0 var(--ly-space-4); }
  .ly-overlay__actions { padding: var(--ly-space-4); }
  .ly-overlay__actions .ly-button { flex: 1; }
}

/* ---- toasts (F113) ---- */
.ly-toasts { position: fixed; top: var(--ly-space-4); right: var(--ly-space-4); z-index: 60; display: grid; gap: var(--ly-space-2); width: min(360px, calc(100vw - 2 * var(--ly-space-4))); }
.ly-toast {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 28px; align-items: start; gap: var(--ly-space-3);
  background: var(--ly-surface); color: var(--ly-text); border: 1px solid var(--ly-border); border-left: 4px solid var(--ly-info);
  border-radius: var(--ly-radius); box-shadow: var(--ly-shadow-2); padding: var(--ly-space-3) var(--ly-space-2) var(--ly-space-3) var(--ly-space-3);
  animation: ly-toast-in var(--ly-dur) var(--ly-ease);
  transition: opacity var(--ly-dur) var(--ly-ease), transform var(--ly-dur) var(--ly-ease);
}
.ly-toast.is-leaving { opacity: 0; transform: translateY(-4px); }
.ly-toast__icon { margin-top: 1px; color: var(--ly-info); }
.ly-toast__text { margin: 0; overflow-wrap: anywhere; }
.ly-toast__close { display: grid; place-items: center; width: 28px; height: 28px; margin-top: -3px; border: 0; border-radius: var(--ly-radius-sm); background: transparent; color: var(--ly-text-2); }
.ly-toast__close:hover { background: var(--ly-surface-2); color: var(--ly-text); }
.ly-toast--success { border-left-color: var(--ly-leaf); } .ly-toast--success .ly-toast__icon { color: var(--ly-leaf); }
.ly-toast--error { border-left-color: var(--ly-danger); } .ly-toast--error .ly-toast__icon { color: var(--ly-danger); }
.ly-toast--warning { border-left-color: var(--ly-warning); } .ly-toast--warning .ly-toast__icon { color: var(--ly-warning); }
@keyframes ly-toast-in { from { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 767px) { .ly-toasts { left: 50%; right: auto; transform: translateX(-50%); } }

/* ---- empty / skeleton / error (F113) ---- */
.ly-empty, .ly-error-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--ly-space-2); padding: var(--ly-space-8) var(--ly-space-4); }
.ly-empty__icon { color: var(--ly-text-3); margin-bottom: var(--ly-space-2); }
.ly-empty__title, .ly-error-state__title { font: var(--ly-text-body); font-weight: 600; }
.ly-empty__body, .ly-error-state__body { color: var(--ly-text-2); max-width: 36ch; }
.ly-empty > .ly-button, .ly-error-state > .ly-button { margin-top: var(--ly-space-3); }
.ly-error-state__icon { color: var(--ly-danger); margin-bottom: var(--ly-space-2); }
.ly-skeleton-box { display: grid; gap: var(--ly-space-3); opacity: 0; animation: ly-reveal 1ms linear 300ms forwards; }
@keyframes ly-reveal { to { opacity: 1; } }
.ly-skel { position: relative; display: block; height: 14px; border-radius: var(--ly-radius-sm); background: var(--ly-surface-2); overflow: hidden; }
.ly-skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--ly-surface), transparent); opacity: .7;
  animation: ly-shimmer 1.2s var(--ly-ease) infinite;
}
@keyframes ly-shimmer { to { transform: translateX(100%); } }
.ly-skel--title { height: 22px; width: 40%; }
.ly-skel--block { height: 72px; width: 100%; border-radius: var(--ly-radius); }
.ly-skel--avatar { width: 40px; height: 40px; border-radius: var(--ly-radius-full); flex: none; }
.ly-skel-row { display: grid; grid-template-columns: 2fr 1fr 1.5fr 1fr; gap: var(--ly-space-4); align-items: center; height: 52px; border-bottom: 1px solid var(--ly-border); }
.ly-skel-row .ly-skel { width: 100% !important; }
.ly-skel-item { display: flex; gap: var(--ly-space-3); align-items: center; }
.ly-skel-item__text { flex: 1; display: grid; gap: var(--ly-space-2); }
@media (prefers-reduced-motion: reduce) { .ly-skel::after { display: none; } }

/* ---- table & card list (F113) ---- */
.ly-table-scroll { overflow-x: auto; border: 1px solid var(--ly-border); border-radius: var(--ly-radius); }
.ly-table { width: 100%; border-collapse: collapse; font: var(--ly-text-body); }
.ly-table thead th { background: var(--ly-surface-2); color: var(--ly-text-2); font: var(--ly-text-small); font-weight: 600; text-align: left; padding: 0 var(--ly-space-4); height: 40px; white-space: nowrap; }
.ly-table tbody th, .ly-table td { height: 52px; padding: 0 var(--ly-space-4); text-align: left; border-top: 1px solid var(--ly-border); font-weight: 400; }
.ly-table tbody th { font-weight: 500; }
.ly-table .is-end { text-align: right; font-variant-numeric: tabular-nums; }
.ly-table tbody tr:hover, .ly-table tbody tr[data-force="hover"] { background: var(--ly-surface-2); }
.ly-table tbody tr.is-clickable { cursor: pointer; }
.ly-table tbody tr:focus-visible { outline: 2px solid var(--ly-primary); outline-offset: -2px; }
.ly-card-list { display: none; list-style: none; margin: 0; padding: 0; gap: var(--ly-space-3); }
.ly-card-list__item { display: block; width: 100%; text-align: left; font: inherit; color: inherit; padding: var(--ly-space-4); background: var(--ly-surface); border: 1px solid var(--ly-border); border-radius: var(--ly-radius-lg); }
.ly-card-list__item.is-clickable { position: relative; }
.ly-card-list__item.is-clickable:hover { border-color: var(--ly-border-strong); }
.ly-card-list__link { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ly-card-list__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.ly-card-list__link:focus-visible { outline: none; }
.ly-card-list__item:has(.ly-card-list__link:focus-visible) { outline: 2px solid var(--ly-primary); outline-offset: 2px; }
.ly-card-list__title { font-weight: 600; margin-bottom: var(--ly-space-2); }
.ly-card-list__fields { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--ly-space-1) var(--ly-space-4); margin: 0; font: var(--ly-text-small); }
.ly-card-list__fields dt { color: var(--ly-text-2); }
.ly-card-list__fields dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .ly-table-wrap--cards .ly-table-scroll { display: none; }
  .ly-table-wrap--cards .ly-card-list { display: grid; }
}

/* ---- pagination (F113) ---- */
.ly-pager { display: flex; align-items: center; justify-content: flex-end; gap: var(--ly-space-1); margin-top: var(--ly-space-4); }
.ly-pager__pages { display: flex; gap: var(--ly-space-1); list-style: none; margin: 0; padding: 0; }
.ly-pager__pages .ly-button { min-width: 40px; padding: 0 var(--ly-space-2); }
.ly-pager__pages .ly-button--text { color: var(--ly-text-2); }
.ly-pager__pages .ly-button[aria-current="page"] { border-color: var(--ly-primary); color: var(--ly-primary); font-weight: 600; }
.ly-pager__gap { display: grid; place-items: center; width: 24px; height: 40px; color: var(--ly-text-3); }
.ly-pager__summary { display: none; color: var(--ly-text-2); font: var(--ly-text-small); padding: 0 var(--ly-space-3); }
@media (max-width: 767px) {
  .ly-pager { justify-content: space-between; }
  .ly-pager__pages { display: none; }
  .ly-pager__summary { display: block; }
}
.ly-table-wrap--scroll .ly-table th, .ly-table-wrap--scroll .ly-table td { white-space: nowrap; }

/* ---- brand (F114) ---- */
.ly-brand { display: inline-flex; align-items: center; gap: var(--ly-space-2); min-width: 0; color: var(--ly-text); }
.ly-brand__mark {
  --ly-brand-size: 32px;
  display: inline-block; flex: none; width: var(--ly-brand-size); height: var(--ly-brand-size); background: var(--ly-primary);
  -webkit-mask: var(--ly-brand-src) center / contain no-repeat; mask: var(--ly-brand-src) center / contain no-repeat;
}
.ly-brand__name { font: var(--ly-text-h2); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ly-brand__img { display: block; width: auto; max-width: 200px; object-fit: contain; }

/* ---- payment-success confetti (ui/celebrate.js): above dialogs and toasts, never catches the pointer ---- */
.ly-confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; pointer-events: none; }

/* ---- lightbox (F181, DESIGN.md §7.6 灯箱; reference 38): full screen, dark (three scrim layers ≈ 88 % black in both
   schemes), image contained, arrows either side, 「n / total」 below; the overlay's focus trap / Esc are reused ---- */
.ly-overlay--lightbox { padding: 0; align-items: stretch; }
.ly-overlay__panel--lightbox {
  max-width: none; max-height: none; width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none;
  /* overlay scrim + two more layers of it ≈ 88 % black: the page behind no longer competes with the image */
  background: linear-gradient(var(--ly-scrim), var(--ly-scrim)), var(--ly-scrim); color: var(--ly-on-hero); transform: scale(.98);
}
.ly-overlay__panel--lightbox .ly-overlay__head { padding: var(--ly-space-3) var(--ly-space-3) 0 var(--ly-space-6); }
.ly-overlay__panel--lightbox .ly-overlay__title { font: var(--ly-text-body); font-weight: 600; }
.ly-overlay__panel--lightbox .ly-button--icon { color: var(--ly-on-hero); }
.ly-overlay__panel--lightbox .ly-button--icon:hover:not(:disabled) { color: var(--ly-on-hero); background: color-mix(in srgb, var(--ly-on-hero) 16%, transparent); }
.ly-overlay__panel--lightbox .ly-button--icon:focus-visible { outline: 2px solid var(--ly-on-hero); outline-offset: 2px; }
.ly-overlay__panel--lightbox .ly-overlay__body { flex: 1; min-height: 0; padding: var(--ly-space-2) var(--ly-space-4) var(--ly-space-4); grid-template-rows: 1fr auto; gap: var(--ly-space-2); overflow: hidden; }
.ly-lightbox { min-height: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--ly-space-2); }
.ly-lightbox__stage { min-width: 0; min-height: 0; height: 100%; display: grid; place-items: center; }
.ly-lightbox__img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: var(--ly-radius-sm); animation: ly-lightbox-in var(--ly-dur) var(--ly-ease); }
.ly-lightbox__nav { width: 48px; height: 48px; border-radius: var(--ly-radius-full); background: color-mix(in srgb, var(--ly-on-hero) 10%, transparent); }
.ly-lightbox__nav:disabled { opacity: .3; }
.ly-lightbox__count { margin: 0; text-align: center; font: var(--ly-text-small); font-variant-numeric: tabular-nums; }
.ly-lightbox__gone { display: grid; justify-items: center; gap: var(--ly-space-2); padding: var(--ly-space-8); border: 1px dashed color-mix(in srgb, var(--ly-on-hero) 40%, transparent); border-radius: var(--ly-radius-lg); }
@keyframes ly-lightbox-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) {
  .ly-overlay--lightbox { align-items: stretch; }
  .ly-overlay__panel--lightbox { max-height: none; height: 100%; border-radius: 0; transform: scale(.98); padding-bottom: env(safe-area-inset-bottom); }
  /* phones: the image takes the full width, the arrows sit underneath it (left / right) */
  .ly-lightbox { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
  .ly-lightbox__stage { grid-row: 1; grid-column: 1 / -1; }
  .ly-lightbox__nav--prev, .ly-lightbox__nav--next { grid-row: 2; }
  .ly-lightbox__nav--prev { justify-self: start; }
  .ly-lightbox__nav--next { justify-self: end; }
  .ly-lightbox__img { max-height: calc(100vh - 180px); }
}
.ly-shot.is-loading { background: linear-gradient(90deg, var(--ly-surface-2), var(--ly-border), var(--ly-surface-2)); background-size: 200% 100%; animation: ly-shot-shimmer 1.2s linear infinite; }
@keyframes ly-shot-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---- phase 5: page skeletons and error retry (DESIGN.md §16.4, §16.6). New classes only — nothing above changes. ----
   .ly-skeleton-view            container shaped like the page it stands in for; set aria-busy="true" on it and
                                aria-hidden="true" on the blocks. Appears after --ly-skeleton-delay, so data that is
                                already there never flashes a skeleton.
   .ly-skeleton-view--cards     dashboard, plans           .ly-skeleton-view--list     orders, tickets, traffic, invite
   .ly-skeleton-view--article   knowledge, notices         .ly-skeleton-view--form     profile, checkout
   .ly-skeleton-block           one grey block; the moving band is the reference site's skeleton: a gradient three
                                times as wide as the block, translateX(-37.5% → 37.5%), --ly-skeleton-dur, infinite.
   Reduced motion: static blocks, no delay animation. */
.ly-skeleton-view { display: grid; gap: var(--ly-space-4); opacity: 0; animation: ly-skeleton-reveal 1ms linear var(--ly-skeleton-delay) forwards; }
@keyframes ly-skeleton-reveal { to { opacity: 1; } }
.ly-skeleton-block { position: relative; display: block; min-height: 14px; border-radius: var(--ly-radius-sm); background: var(--ly-surface-2); overflow: hidden; }
.ly-skeleton-block::after {
  content: ""; position: absolute; top: 0; bottom: 0; inset-inline: -150%;
  background: linear-gradient(90deg, transparent 25%, var(--ly-surface) 37%, transparent 63%); opacity: .7;
  animation: ly-skeleton-loading var(--ly-skeleton-dur) var(--ly-skeleton-ease) infinite;
}
@keyframes ly-skeleton-loading { from { transform: translateX(-37.5%); } to { transform: translateX(37.5%); } }
.ly-skeleton-block--title { height: 24px; width: 40%; }
.ly-skeleton-block--line { height: 14px; width: 100%; }
.ly-skeleton-block--line-short { height: 14px; width: 60%; }
.ly-skeleton-block--card { height: 148px; border-radius: var(--ly-radius); }
.ly-skeleton-block--row { height: 52px; border-radius: var(--ly-radius-sm); }
.ly-skeleton-block--field { height: 44px; border-radius: var(--ly-radius-sm); }
.ly-skeleton-block--media { height: 180px; border-radius: var(--ly-radius); }
.ly-skeleton-view--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.ly-skeleton-view--cards > .ly-skeleton-block--title { grid-column: 1 / -1; }
.ly-skeleton-view--list { gap: var(--ly-space-2); }
.ly-skeleton-view--article { gap: var(--ly-space-3); max-width: 860px; }
.ly-skeleton-view--form { gap: var(--ly-space-4); max-width: 560px; }
/* SPEC F815: block skeletons inside a page (ui/feedback.js skeleton()) appear after the same 100 ms as page skeletons
   (the phase-2 rule above keeps its 300 ms for anything else that uses .ly-skeleton-box) */
.ly-skeleton-view-delay { animation-delay: var(--ly-skeleton-delay); }
/* content that replaces a skeleton fades in without moving */
.ly-skeleton-swap { animation: ly-skeleton-swap var(--ly-route-dur) var(--ly-route-ease); }
@keyframes ly-skeleton-swap { from { opacity: 0; } }
/* error retry (§16.4): a reason line under the title; on phones the retry button spans the width */
.ly-error-state__reason { color: var(--ly-text-2); max-width: 36ch; }
.ly-error-state--retry > .ly-button[aria-busy="true"] { pointer-events: none; opacity: .7; }
@media (max-width: 767px) { .ly-error-state--retry > .ly-button { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .ly-skeleton-view { opacity: 1; animation: none; }
  .ly-skeleton-block::after { display: none; }
  .ly-skeleton-swap { animation: none; }
}
