:root {
  color-scheme: light;
}
.dark {
  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
  overflow-x: hidden;          /* 防止verify 100vw 出横向条 */
}

[x-cloak] { display: none !important; }

/* --------------------------------------------------------------------------
   card
   -------------------------------------------------------------------------- */
.card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 20px;
}
.dark .card {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   ana
   -------------------------------------------------------------------------- */
.stat {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 16px;
  padding: 10px 12px;
  min-width: 0;
}
.dark .stat {
  background: rgba(255, 255, 255, 0.05);
}
.stat-label {
  font-size: 11px;
  color: #86868b;
  margin-bottom: 3px;
}
.dark .stat-label { color: #98989d; }
.stat-value {
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
}
.dark .stat-value { color: #f5f5f7; }

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.05);
  color: #1d1d1f;
  border: none;
  outline: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.btn:hover { background: rgba(0, 0, 0, 0.08); }
.btn:active { transform: scale(0.97); }
.dark .btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
}
.dark .btn:hover { background: rgba(255, 255, 255, 0.16); }

.btn-primary {
  background: #0071e3;
  color: #fff;
}
.btn-primary:hover { background: #0077ed; }
.dark .btn-primary,
.dark .btn-primary:hover { background: #0a84ff; color: #fff; }

.btn-danger {
  background: #ff3b30;
  color: #fff;
}
.btn-danger:hover { background: #ff5147; }
.dark .btn-danger,
.dark .btn-danger:hover { background: #ff453a; color: #fff; }

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-xs {
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 7px;
}

.btn-warning {
  background: #ff9f0a;
  color: #fff;
}
.btn-warning:hover { background: #ffb340; }
.dark .btn-warning,
.dark .btn-warning:hover { background: #ff9f0a; color: #fff; }

.input-sm {
  width: auto;
  padding: 5px 10px;
  font-size: 13px;
  border-radius: 8px;
}

.switch-sm { transform: scale(0.8); transform-origin: left center; }

/* --------------------------------------------------------------------------
   输入框
   -------------------------------------------------------------------------- */
.input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: inherit;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
  outline: none;
  transition: all 0.2s ease;
}
.input::placeholder { color: #a1a1a6; }
.input:focus {
  border-color: #0071e3;
  background: rgba(0, 0, 0, 0.03);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}
.dark .input { background: rgba(255, 255, 255, 0.1); }
.dark .input:focus { background: rgba(255, 255, 255, 0.14); }
select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
}

/* 输入框错误态 */
.input-error {
  border-color: #ff453a !important;
  box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.15) !important;
}
.dark .input-error { border-color: #ff6b61 !important; }

/* 邮箱后缀提示（二级 tips） */
.email-tips {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
/* 淡入淡出动画（Alpine x-transition 使用固定 active 类名） */
.email-tips-enter,
.email-tips-leave-to { opacity: 0; transform: translateY(-4px); }
.email-tips-enter-start,
.email-tips-leave { opacity: 0; transform: translateY(-4px); }
.email-tips-enter-end,
.email-tips-leave-start { opacity: 1; transform: translateY(0); }
.x-transition-enter-active,
.x-transition-leave-active { transition: opacity 0.18s ease, transform 0.18s ease; }
.dark .email-tips {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.email-tips-title {
  font-size: 11px;
  font-weight: 600;
  color: #86868b;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.email-tips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.email-tips-item {
  font-size: 12px;
  color: #0071e3;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.18);
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}
.dark .email-tips-item {
  color: #7dd3fc;
  background: rgba(10, 132, 255, 0.14);
  border-color: rgba(10, 132, 255, 0.3);
}

/* 人机验证引导高亮 */
.turnstile-attention {
  animation: turnstile-attention 1.2s ease;
}
@keyframes turnstile-attention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0); }
  30% { box-shadow: 0 0 0 4px rgba(255, 69, 58, 0.35); }
  60% { box-shadow: 0 0 0 4px rgba(255, 69, 58, 0.2); }
}

/* --------------------------------------------------------------------------
   进度条
   -------------------------------------------------------------------------- */
.bar {
  height: 6px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.dark .bar { background: rgba(255, 255, 255, 0.12); }
.bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #0a84ff, #0071e3);
  transition: width 0.5s ease;
}

/* --------------------------------------------------------------------------
   开关（Apple 风格）
   -------------------------------------------------------------------------- */
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 24px;
  border-radius: 9999px;
  background: #e8e8ed;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
  outline: none;
  margin: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(16px); }
.dark .switch { background: #3a3a3c; }
.dark .switch:checked { background: #30d158; }

/* --------------------------------------------------------------------------
   徽章
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
}
.badge-info { background: rgba(0, 113, 227, 0.12); color: #0071e3; }
.badge-warn { background: rgba(255, 149, 0, 0.15); color: #ff9f0a; }
.badge-error { background: rgba(255, 59, 48, 0.12); color: #ff453a; }
.dark .badge-info { background: rgba(10, 132, 255, 0.18); color: #0a84ff; }
.dark .badge-warn { background: rgba(255, 159, 10, 0.18); color: #ff9f0a; }
.dark .badge-error { background: rgba(255, 69, 58, 0.18); color: #ff453a; }

/* --------------------------------------------------------------------------
   快捷选择块（定时分钟）
   -------------------------------------------------------------------------- */
.chip {
  flex: 1;
  padding: 6px 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.05);
  color: #6e6e73;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:hover { background: rgba(0, 0, 0, 0.08); }
.chip-active {
  background: #0071e3;
  color: #fff;
}
.dark .chip { background: rgba(255, 255, 255, 0.1); color: #98989d; }
.dark .chip:hover { background: rgba(255, 255, 255, 0.16); }
.dark .chip-active { background: #0a84ff; color: #fff; }

/* --------------------------------------------------------------------------
   Toast 提示
   -------------------------------------------------------------------------- */
.toast {
  background: rgba(28, 28, 30, 0.92);
  color: #fff;
  padding: 11px 22px;
  border-radius: 9999px;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.toast-error { background: rgba(255, 59, 48, 0.95); }

/* --------------------------------------------------------------------------
   渐入渐出（Toast / 确认弹窗）
   使用纯 CSS animation（vendor Alpine 为精简版，不含 x-transition 指令）
   -------------------------------------------------------------------------- */
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(12px) scale(0.95); }
}
.toast-in  { animation: toast-in 0.3s ease-out both; }
.toast-out { animation: toast-out 0.3s ease-in both; }

/* --------------------------------------------------------------------------
   发送通知 · 模拟显示效果预览
   -------------------------------------------------------------------------- */
.notify-stage {
  position: relative;
  min-height: 210px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background:
    radial-gradient(circle at 14% 22%, rgba(86, 124, 196, 0.55), transparent 42%),
    radial-gradient(circle at 82% 68%, rgba(88, 176, 132, 0.5), transparent 46%),
    radial-gradient(circle at 62% 12%, rgba(214, 148, 92, 0.45), transparent 40%),
    radial-gradient(circle at 30% 85%, rgba(150, 112, 196, 0.4), transparent 42%),
    linear-gradient(135deg, #e9edf4 0%, #d2dce9 55%, #bccadf 100%);
}
.dark .notify-stage {
  border-color: rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 14% 22%, rgba(56, 88, 150, 0.5), transparent 42%),
    radial-gradient(circle at 82% 68%, rgba(48, 120, 88, 0.45), transparent 46%),
    radial-gradient(circle at 62% 12%, rgba(140, 92, 52, 0.4), transparent 40%),
    radial-gradient(circle at 30% 85%, rgba(92, 64, 132, 0.4), transparent 42%),
    linear-gradient(135deg, #232732 0%, #1a1e28 55%, #131722 100%);
}
.notify-stage-desk {
  position: absolute;
  left: 14px;
  top: 12px;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: rgba(0, 0, 0, 0.45);
}
.dark .notify-stage-desk { color: rgba(255, 255, 255, 0.45); }

/* 毛玻璃卡片（Windows 11 Acrylic 材质） */
.notify-toast {
  position: absolute;
  top: 30px;
  right: 16px;
  width: min(360px, calc(100% - 32px));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  cursor: default;
}
.dark .notify-toast {
  background: rgba(44, 44, 46, 0.62);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* 标题栏 */
.notify-toast-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 6px 0 12px;
  background: rgba(0, 0, 0, 0.035);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.dark .notify-toast-bar {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.notify-toast-bar-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.notify-toast-bar-title {
  font-size: 12px;
  font-weight: 500;
  color: #1d1d1f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dark .notify-toast-bar-title { color: #f5f5f7; }
.notify-toast-bar-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: #616161;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.notify-toast-bar-btn:hover { background: rgba(0, 0, 0, 0.07); color: #1d1d1f; }
.dark .notify-toast-bar-btn { color: #c7c7cc; }
.dark .notify-toast-bar-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* 内容区 */
.notify-toast-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.notify-toast-body-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.notify-toast-body-title {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dark .notify-toast-body-title { color: #f5f5f7; }
.notify-toast-body-msg {
  font-size: 12px;
  color: #616161;
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dark .notify-toast-body-msg { color: #c7c7cc; }

@keyframes notify-toast-in {
  0%   { opacity: 0; transform: translateX(60px) scale(0.96); }
  55%  { opacity: 1; transform: translateX(-6px) scale(1); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
.notify-toast-in { animation: notify-toast-in 0.5s cubic-bezier(0.22, 0.8, 0.2, 1) both; }

@keyframes modal-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-fade-out { from { opacity: 1; } to { opacity: 0; } }
.modal-overlay-in  { animation: modal-fade-in 0.22s cubic-bezier(0.16, 1, 0.3, 1) both; }
.modal-overlay-out { animation: modal-fade-out 0.16s ease-in both; }

@keyframes modal-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modal-card-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.96); }
}
.modal-card-in  { animation: modal-card-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both; }
.modal-card-out { animation: modal-card-out 0.18s ease-in both; }

/* --------------------------------------------------------------------------
   页面切换平滑过渡
   -------------------------------------------------------------------------- */
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-transition-in { animation: page-in 0.3s ease-out both; }

@keyframes page-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}
.page-transition-out { animation: page-out 0.22s ease-in both; }

/* --------------------------------------------------------------------------
   确认弹窗
   -------------------------------------------------------------------------- */
.modal {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 26px 24px;
}
.dark .modal {
  background: #2c2c2e;
}

/* --------------------------------------------------------------------------
   主题切换按钮
   -------------------------------------------------------------------------- */
.theme-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6e6e73;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.theme-btn:hover { background: rgba(0, 0, 0, 0.06); color: #1d1d1f; }
.dark .theme-btn { color: #98989d; }
.dark .theme-btn:hover { background: rgba(255, 255, 255, 0.1); color: #f5f5f7; }

/* --------------------------------------------------------------------------
   加载动画
   -------------------------------------------------------------------------- */
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   排序箭头
   -------------------------------------------------------------------------- */
.sort-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 3px;
  vertical-align: middle;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
}
.sort-arrow.sort-asc { border-bottom: 5px solid #0071e3; }
.sort-arrow.sort-desc { border-top: 5px solid #0071e3; }

/* --------------------------------------------------------------------------
   登录页
   -------------------------------------------------------------------------- */
.login-card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 24px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1);
  padding: 40px 36px 32px;
}
.dark .login-card {
  background: rgba(28, 28, 30, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.error-box {
  display: flex;
  align-items: center;
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   滚动条
   -------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.3); }
.dark ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); }
.dark ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* ==========================================================================
   Apple 风格 · 交互动画与微交互
   ========================================================================== */

/* --------------------------------------------------------------------------
   按钮微交互（按压回弹）
   -------------------------------------------------------------------------- */
.btn {
  transition: background-color 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* --------------------------------------------------------------------------
   卡片悬浮（柔和抬升）
   -------------------------------------------------------------------------- */
.card {
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.card-interactive { cursor: pointer; }
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
}
.dark .card-interactive:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); }

/* --------------------------------------------------------------------------
   内容淡入（列表 / 区块逐条浮现）
   -------------------------------------------------------------------------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* 列表项交错淡入（通过 --i 控制延迟） */
@keyframes list-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.list-in {
  animation: list-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

/* 通用淡入 */
@keyframes soft-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.soft-in { animation: soft-in 0.35s ease-out both; }

/* --------------------------------------------------------------------------
   Tab 切换：内容滑入
   -------------------------------------------------------------------------- */
@keyframes tab-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-panel { animation: tab-fade 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Tab 下方高亮条 */
.tab-underline {
  position: relative;
}
.tab-underline::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: #0a84ff;
  transform: translateX(-50%);
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.tab-underline.tab-active::after { width: 60%; }

/* --------------------------------------------------------------------------
   开关（Apple 风格，复写原生 checkbox）
   -------------------------------------------------------------------------- */
.switch {
  width: 46px;
  height: 28px;
  border-radius: 9999px;
  background: #e4e4ea;
  position: relative;
  cursor: pointer;
  transition: background 0.25s ease;
  flex-shrink: 0;
  outline: none;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(18px); }
.switch:active::after { width: 28px; }
.dark .switch { background: #3a3a3c; }
.dark .switch:checked { background: #30d158; }

/* --------------------------------------------------------------------------
   输入框聚焦微光
   -------------------------------------------------------------------------- */
.input {
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus {
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   行内加载指示（spinner 配色适配浅色）
   -------------------------------------------------------------------------- */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-top-color: #0071e3;
}
.dark .spinner {
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #0a84ff;
}

/* 行内加载小圆点（按钮内） */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-primary.btn-loading::after { border-color: rgba(255, 255, 255, 0.45); border-top-color: #fff; }
.btn:not(.btn-primary).btn-loading::after {
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: #0071e3;
}
.dark .btn:not(.btn-primary).btn-loading::after {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #0a84ff;
}

/* --------------------------------------------------------------------------
   背景装饰（登录 / 注册页）
   -------------------------------------------------------------------------- */
.auth-split {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
@media (min-width: 900px) {
  .auth-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* 认证页（登录/注册）铺满整个视口，不受 main 的 max-w-6xl 约束 */
.auth-split,
.auth-bg {
  width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
}
.auth-right {
  display: none;
  position: relative;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(135deg, #0a84ff 0%, #0071e3 50%, #5e5ce6 100%);
}
.dark .auth-right {
  background: linear-gradient(135deg, #0a4ea8 0%, #002f6e 50%, #2c2a8f 100%);
}
@media (min-width: 900px) {
  .auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
  }
}
.auth-right-pattern {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.25), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.18), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
}
.auth-right-pattern::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
  opacity: 0.6;
}
.auth-right-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 1rem 1.5rem;
  gap: 1.25rem;
  width: 100%;
  max-width: 500px;
}
.auth-headline {
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 0.25rem;
}
.auth-feature-list {
  display: flex; flex-direction: column;
  gap: 0.5rem;
  font-size: 13.5px;
  opacity: 0.92;
}

/* --------------------------------------------------------------------------
   认证页右侧引导卡片（功能介绍 / 使用文档） - Apple 风格
   -------------------------------------------------------------------------- */
.auth-guide-wrap {
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.auth-guide-section-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.75rem;
}
.auth-guide-section-title svg {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}
.auth-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 1024px) {
  .auth-guide-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}
.auth-guide-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.auth-guide-card:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
  color: #fff;
}
.auth-guide-card:active {
  transform: translateY(0) scale(0.98);
  background: rgba(255, 255, 255, 0.18);
}
.auth-guide-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: background-color 0.2s ease;
}
.auth-guide-card:hover .auth-guide-card-icon {
  background: rgba(255, 255, 255, 0.28);
}
.auth-guide-card-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
}
.auth-guide-card-arrow {
  width: 14px;
  height: 14px;
  opacity: 0.65;
  transition: transform 0.2s ease, opacity 0.2s ease;
  margin-left: auto;
}
.auth-guide-card:hover .auth-guide-card-arrow {
  opacity: 1;
  transform: translateX(2px);
}
.auth-bg {
  position: relative;
  overflow: hidden;
  min-height: 100vh;          /* 铺满全屏 */
  background: linear-gradient(135deg, #dbeafe 0%, #eef2ff 40%, #f3e8ff 100%);  /* 浅色渐变铺底 */
}
.dark .auth-bg {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(0, 0, 0, 0) 40%, rgba(49, 46, 129, 0.4) 100%);
  background-color: #000;
}
.auth-bg::before,
.auth-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.auth-bg::before {
  width: 60vw; height: 60vw;
  top: -20%; left: -15%;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.45), transparent 70%);
}
.auth-bg::after {
  width: 60vw; height: 60vw;
  bottom: -25%; right: -15%;
  background: radial-gradient(circle, rgba(94, 92, 230, 0.4), transparent 70%);
}
.dark .auth-bg::before { background: radial-gradient(circle, rgba(10, 132, 255, 0.3), transparent 70%); }
.dark .auth-bg::after { background: radial-gradient(circle, rgba(94, 92, 230, 0.28), transparent 70%); }
.auth-bg > * { position: relative; z-index: 1; }

/* 品牌标识徽标 */
.brand-mark {
  width: 56px; height: 56px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0a84ff, #0071e3);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 26px;
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.35);
}
.dark .brand-mark { box-shadow: 0 8px 24px rgba(10, 132, 255, 0.45); }

/* 登出页 loading 转圈 */
.wcp-spinner {
  width: 26px; height: 26px;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-top-color: #0071e3;
  border-radius: 50%;
  animation: wcp-spin 0.8s linear infinite;
}
.dark .wcp-spinner { border-color: rgba(255, 255, 255, 0.18); border-top-color: #0a84ff; }
@keyframes wcp-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   拖拽组件（设备详情页布局）
   -------------------------------------------------------------------------- */
.comp-item {
  transition: box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backface-visibility: hidden;
}
/* 让设备页组件卡片在 grid 单元格内等高拉伸 */
#compGrid .comp-item { height: 100%; }
.comp-item.comp-chosen {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  z-index: 30;
  transform: scale(1.02);
}
.comp-item.comp-animating {
  will-change: transform, opacity;
  z-index: 25;
}
.comp-ghost {
  opacity: 0.25;
  border: 2px dashed rgba(10, 132, 255, 0.6);
  border-radius: 20px;
}
.comp-drag-handle { user-select: none; }
#trashDropZone.sortable-drag-over,
#trashDropZone:hover {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.15) !important;
  transform: scale(1.02);
}

/* --------------------------------------------------------------------------
   骨架屏（加载占位）
   -------------------------------------------------------------------------- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.03) 37%, rgba(0, 0, 0, 0.06) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
.dark .skeleton {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.08) 25%, rgba(255, 255, 255, 0.04) 37%, rgba(255, 255, 255, 0.08) 63%);
  background-size: 200% 100%;
}

/* --------------------------------------------------------------------------
   进程表行悬浮
   -------------------------------------------------------------------------- */
.row-hover { transition: background-color 0.15s ease; }
.row-hover:hover { background: rgba(0, 0, 0, 0.025); }
.dark .row-hover:hover { background: rgba(255, 255, 255, 0.04); }

/* 链接微交互 */
a.link-accent {
  color: #0071e3;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a.link-accent:hover { opacity: 0.7; text-decoration: underline; }
.dark a.link-accent { color: #0a84ff; }

/* 尊重用户的减少动态偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
