/* ==========================================================================
   Mizzle — 通用组件
   ========================================================================== */

/* ── 玻璃面板 ──────────────────────────────────────────────────────── */
.glass {
  background: rgba(var(--panel-rgb), var(--glass-opacity));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  border-radius: var(--r-lg);
}

.card {
  background: rgba(var(--panel-rgb), calc(var(--glass-opacity) * 0.78));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.6px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

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

/* ── 按钮 ──────────────────────────────────────────────────────────── */
.btn {
  --btn-bg: rgba(var(--panel-rgb), 0.5);
  --btn-fg: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-line);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: 0.4px;
  transition: transform 0.16s var(--ease), background var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong));
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  --btn-bg: linear-gradient(135deg, var(--accent), var(--accent-2));
  --btn-fg: var(--accent-ink);
  --btn-line: transparent;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 32%, transparent);
  font-weight: 620;
}

.btn-primary:hover {
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 40%, transparent);
  border-color: transparent;
}

.btn-soft {
  --btn-bg: color-mix(in srgb, var(--accent) 14%, transparent);
  --btn-fg: color-mix(in srgb, var(--accent) 70%, var(--ink));
  --btn-line: color-mix(in srgb, var(--accent) 26%, transparent);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-line: transparent;
  color: var(--ink-2);
}

.btn-ghost:hover {
  --btn-bg: rgba(var(--panel-rgb), 0.5);
  color: var(--ink);
}

.btn-danger {
  --btn-bg: rgba(224, 96, 96, 0.1);
  --btn-fg: #d8574f;
  --btn-line: rgba(224, 96, 96, 0.26);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 13px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--r-sm);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 30px;
  font-size: 16px;
  letter-spacing: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
  position: relative;
  flex: none;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  background: rgba(var(--panel-rgb), 0.6);
  color: var(--ink);
  border-color: var(--line);
}

.icon-btn.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* ── 表单 ──────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.field-label {
  font-size: 12.5px;
  color: var(--ink-2);
  letter-spacing: 0.6px;
  font-weight: 550;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: rgba(var(--panel-rgb), 0.55);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-3);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  background: rgba(var(--panel-rgb), 0.78);
}

.textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.7;
}

.select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.5;
}

.field-hint.error,
.text-danger {
  color: #d8574f;
}

.text-muted {
  color: var(--ink-3);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 180px;
  flex: 1;
  max-width: 430px;
}

.search svg {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  pointer-events: none;
}

.search .input {
  padding-left: 40px;
  border-radius: var(--r-pill);
  background: rgba(var(--panel-rgb), 0.45);
}

/* ── 开关 ──────────────────────────────────────────────────────────── */
.switch {
  --w: 44px;
  position: relative;
  width: var(--w);
  height: 25px;
  border-radius: 99px;
  background: var(--line-strong);
  transition: background var(--dur) var(--ease);
  flex: none;
  cursor: pointer;
  border: none;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform var(--dur) var(--ease);
}

.switch.on {
  background: var(--accent);
}

.switch.on::after {
  transform: translateX(19px);
}

/* ── 滑块 ──────────────────────────────────────────────────────────── */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--line-strong);
  outline: none;
  cursor: pointer;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
  cursor: grab;
}

.range::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
}

/* ── 头像 ──────────────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 40%, #fff),
      color-mix(in srgb, var(--accent) 12%, #fff));
  color: #fff;
  font-weight: 650;
  letter-spacing: 1px;
  box-shadow: 0 4px 14px rgba(80, 100, 90, 0.16);
  position: relative;
  user-select: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.ring {
  border: 2px solid rgba(var(--panel-rgb), 0.9);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent),
    0 8px 20px rgba(80, 100, 90, 0.18);
}

/* ── 标签 / 徽章 ───────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  line-height: 1.6;
  border: 1px solid var(--line);
  background: rgba(var(--panel-rgb), 0.5);
  color: var(--ink-2);
  white-space: nowrap;
}

.chip.accent {
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: color-mix(in srgb, var(--accent) 72%, var(--ink));
}

.chip.solid {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
}

.chip-dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ── 下拉菜单 ──────────────────────────────────────────────────────── */
.dd-anchor {
  position: relative;
}

.dd {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border-radius: var(--r-md);
  background: rgba(var(--panel-rgb), 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(60, 90, 75, 0.18);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  z-index: 60;
  animation: dd-in 0.18s var(--ease-out);
}

.dd.right {
  left: auto;
  right: 0;
}

@keyframes dd-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

.dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.16s var(--ease);
}

.dd-item:hover {
  background: color-mix(in srgb, var(--accent) 10%, rgba(var(--panel-rgb), 0.6));
}

.dd-item .check {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: all 0.16s var(--ease);
}

.dd-item.on .check {
  background: var(--accent);
  border-color: var(--accent);
}

.dd-item.on .check::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.dd-sep {
  height: 1px;
  background: var(--line);
  margin: 6px 4px;
}

.dd-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 6px 2px;
}

/* ── 弹窗 ──────────────────────────────────────────────────────────── */
#modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 50, 46, 0.26);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.22s var(--ease);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  background: rgba(var(--panel-rgb), 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px rgba(50, 80, 65, 0.28);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  animation: modal-in 0.32s var(--ease-out);
  overflow: hidden;
  position: relative;
}

.modal.wide {
  width: min(720px, 100%);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 24px 6px;
}

.modal-head .t {
  font-size: 18px;
  font-weight: 680;
  letter-spacing: 1px;
}

.modal-head .s {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 4px;
  line-height: 1.5;
}

.modal-head .x {
  margin-left: auto;
  margin-top: -4px;
  margin-right: -6px;
}

.modal-body {
  padding: 12px 24px 4px;
  overflow: auto;
  min-height: 0;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 22px;
}

.modal-foot .left {
  margin-right: auto;
}

/* ── Toast ─────────────────────────────────────────────────────────── */
#toast-root {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  border-radius: var(--r-pill);
  background: rgba(46, 60, 53, 0.9);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 12px 30px rgba(30, 45, 38, 0.28);
  animation: toast-in 0.26s var(--ease-out);
  backdrop-filter: blur(10px);
  max-width: 80vw;
  text-align: center;
}

.toast.ok {
  background: rgba(46, 122, 92, 0.92);
}

.toast.err {
  background: rgba(190, 68, 62, 0.92);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ── 空状态 ────────────────────────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 70px 20px;
  color: var(--ink-3);
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.6px;
}

.empty .ico {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(var(--panel-rgb), 0.55);
  border: 1px dashed var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.empty .ico svg {
  width: 26px;
  height: 26px;
  opacity: 0.7;
}

/* ── 书本封面（CSS 生成，无需图片资源） ───────────────────────────── */
.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  container-type: inline-size;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(155deg, var(--c1), var(--c2));
  box-shadow: 0 10px 22px rgba(60, 80, 70, 0.16), 0 2px 4px rgba(60, 80, 70, 0.1);
  isolation: isolate;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, 0.42), transparent 55%),
    radial-gradient(90% 60% at 90% 100%, rgba(255, 255, 255, 0.24), transparent 60%);
  mix-blend-mode: soft-light;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 62%, rgba(30, 40, 35, 0.16));
}

.cover-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 5.5cqw 6cqw;
  z-index: 2;
}

/* 封面内描边，像真书的压印框 */
.cover-inner::before {
  content: "";
  position: absolute;
  inset: 4.5cqw;
  border: 1px solid color-mix(in srgb, var(--ct, #fff) 26%, transparent);
  border-radius: 1.6cqw;
  pointer-events: none;
}

.cover-t {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--f-serif);
  font-size: clamp(9px, 15.5cqi, 20px);
  line-height: 1.2;
  font-weight: 700;
  color: var(--ct, #fff);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.18);
  letter-spacing: 0.18em;
  max-height: 100%;
  overflow: hidden;
  text-align: start;
}

.cover-t.long {
  font-size: clamp(8px, 12.5cqi, 16px);
  letter-spacing: 0.1em;
}

.cover-t.xlong {
  font-size: clamp(7px, 10cqi, 13px);
  letter-spacing: 0.04em;
}

.cover-a {
  position: absolute;
  right: 6.5cqw;
  bottom: 6cqw;
  font-size: clamp(7px, 7cqi, 11px);
  color: var(--ct, #fff);
  opacity: 0.72;
  letter-spacing: 0.1em;
  writing-mode: horizontal-tb;
}

.cover-mark {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  opacity: 0.55;
  z-index: 2;
}

/* 完结缎带 */
.ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 44cqw;
  height: 44cqw;
  max-width: 76px;
  max-height: 76px;
  overflow: hidden;
  z-index: 3;
  pointer-events: none;
}

.ribbon span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 142%;
  height: 19%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--ribbon);
  color: var(--ribbon-ink);
  font-size: clamp(6px, 7cqw, 10px);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.16);
}

/* 有缎带时标题略微下移，视觉更稳 */
.cover.with-ribbon .cover-t {
  margin-top: 4cqw;
}

/* ── 书籍网格 ──────────────────────────────────────────────────────── */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 28px 22px;
  align-items: start;
}

@media (max-width: 720px) {
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 20px 12px;
  }
  .book-card .title {
    font-size: 12.5px;
  }
}

.book-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  outline: none;
}

.book-card:hover .cover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(60, 80, 70, 0.22);
}

.book-card .title {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  text-align: center;
  word-break: break-word;
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: baseline;
}

.book-card .title .prog {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.book-card .sub {
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  margin-top: -4px;
}

/* ── 表格 ──────────────────────────────────────────────────────────── */
.table-wrap {
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  overflow: auto;
  background: rgba(var(--panel-rgb), 0.35);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.table th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--panel-rgb), 0.4);
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(8px);
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background 0.15s var(--ease);
}

.table tbody tr:hover {
  background: rgba(var(--panel-rgb), 0.5);
}

.table .cell-main {
  color: var(--ink);
  font-weight: 550;
}

.table .actions {
  display: flex;
  gap: 6px;
}

/* ── Tabs ──────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: rgba(var(--panel-rgb), 0.45);
  border: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
  font-weight: 500;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 620;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ── 统计卡 ────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat {
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: rgba(var(--panel-rgb), 0.5);
  border: 1px solid var(--line);
}

.stat .k {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.6px;
}

.stat .v {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.stat .u {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 4px;
}

/* ── 进度条 ────────────────────────────────────────────────────────── */
.bar {
  height: 6px;
  border-radius: 99px;
  background: var(--line-strong);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s var(--ease);
}

/* ── 分隔线文字 ────────────────────────────────────────────────────── */
.hr-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
  font-size: 12px;
  margin: 16px 0;
}

.hr-text::before,
.hr-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── 轻提示 ────────────────────────────────────────────────────────── */
.kbd {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: rgba(var(--panel-rgb), 0.6);
  color: var(--ink-2);
}

/* ── 骨架屏 ────────────────────────────────────────────────────────── */
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--line) 25%, rgba(var(--panel-rgb), 0.6) 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  min-height: 12px;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

/* ── 浮动面板（主题微调 / 快捷设置） ───────────────────────────────── */
.sheet {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 330px;
  max-height: calc(100vh - 60px);
  overflow: auto;
  border-radius: var(--r-xl);
  background: rgba(var(--panel-rgb), 0.9);
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(40, 70, 55, 0.26);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  z-index: 160;
  padding: 18px;
  animation: sheet-in 0.3s var(--ease-out);
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.sheet-head .t {
  font-size: 15px;
  font-weight: 680;
  letter-spacing: 1px;
}

.sheet-head .x {
  margin-left: auto;
}

.sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 13px;
  color: var(--ink-2);
}

.sheet-row .label {
  flex: none;
  min-width: 62px;
}

.sheet-row .val {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

/* ── 颜色选择器 ────────────────────────────────────────────────────── */
.cp {
  width: min(468px, 100%);
}

.cp-sv {
  position: relative;
  height: 210px;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: crosshair;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(var(--hue, 20), 100%, 50%));
}

.cp-sv .dot {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cp-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cp-preview {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  flex: none;
}

.cp-hue {
  flex: 1;
  height: 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  position: relative;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.cp-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.cp-rgb {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.cp-rgb label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
}

.cp-rgb input {
  text-align: center;
  padding: 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  background: rgba(var(--panel-rgb), 0.6);
  color: var(--ink);
  outline: none;
  font-variant-numeric: tabular-nums;
}

.cp-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.cp-presets button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  transition: transform 0.15s var(--ease);
}

.cp-presets button:hover {
  transform: scale(1.14);
}

/* ── 文本工具 ──────────────────────────────────────────────────────── */
.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row.between {
  justify-content: space-between;
}

.col {
  display: flex;
  flex-direction: column;
}

.spacer {
  flex: 1;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.scroll-y {
  overflow-y: auto;
  min-height: 0;
}

.hidden {
  display: none !important;
}

.spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

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

/* ── 无障碍：减少动态效果 ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .spin {
    animation-duration: 1s !important;
    animation-iteration-count: infinite !important;
  }
}
