:root {
  --bg: #0a0a0f;
  --bg-gradient: linear-gradient(135deg, #0a0a0f 0%, #0d1117 50%, #0a0a0f 100%);
  --panel: rgba(24, 24, 27, 0.55);
  --panel-border: rgba(255, 255, 255, 0.06);
  --panel-blur: 20px;
  --raised: rgba(39, 39, 42, 0.45);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text: #fafafa;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --faint: #52525b;
  --accent: #fe2c55;
  --accent-hover: #e01e4a;
  --accent-glow: rgba(254, 44, 85, 0.3);
  --ok: #34d399;
  --ok-glow: rgba(52, 211, 153, 0.15);
  --warn: #fbbf24;
  --warn-glow: rgba(251, 191, 36, 0.15);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-shine: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 50%);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 15% 12%, rgba(254, 44, 85, 0.1) 0%, transparent 55%),
              radial-gradient(ellipse at 85% 18%, rgba(99, 102, 241, 0.1) 0%, transparent 55%),
              radial-gradient(ellipse at 75% 85%, rgba(52, 211, 153, 0.08) 0%, transparent 55%),
              radial-gradient(ellipse at 30% 88%, rgba(251, 191, 36, 0.05) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 45%, rgba(217, 70, 239, 0.05) 0%, transparent 60%),
              var(--bg-gradient);
  z-index: -1;
}

/* --- 背景装饰层 --- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  will-change: transform;
  animation: blobFloat 26s ease-in-out infinite alternate;
}
.bg-blob-1 {
  width: 420px;
  height: 420px;
  left: -120px;
  top: -80px;
  background: radial-gradient(circle, rgba(254, 44, 85, 0.28) 0%, transparent 70%);
}
.bg-blob-2 {
  width: 380px;
  height: 380px;
  right: -100px;
  top: 22%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.24) 0%, transparent 70%);
  animation-delay: -9s;
  animation-duration: 30s;
}
.bg-blob-3 {
  width: 460px;
  height: 460px;
  left: 30%;
  bottom: -140px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.2) 0%, transparent 70%);
  animation-delay: -17s;
  animation-duration: 34s;
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, transparent 75%);
}
.bg-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1.6px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 70% 20%, rgba(0, 0, 0, 0.8) 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 20%, rgba(0, 0, 0, 0.8) 0%, transparent 65%);
  opacity: 0.6;
}
@keyframes blobFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, -30px) scale(1.12);
  }
  100% {
    transform: translate(-30px, 35px) scale(0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-blob {
    animation: none;
  }
}
::selection {
  background: var(--accent);
  color: #fff;
}

/* --- Sidebar 布局 --- */
body {
  display: flex;
  min-height: 100vh;
}
body.no-sidebar .sidebar {
  display: none;
}
body.no-sidebar .main {
  max-width: 960px;
  margin: 0 auto;
  padding-top: 48px;
}
body.no-sidebar .menu-toggle {
  display: none;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 230px;
  flex-shrink: 0;
  z-index: 30;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 14px;
}
.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  display: none;
  background: var(--raised);
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-group {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--faint);
  padding: 14px 10px 6px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.sidebar-item.active {
  background: rgba(254, 44, 85, 0.12);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(254, 44, 85, 0.25);
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
}
.sidebar-item .s-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-user {
  color: var(--muted);
  font-size: 12.5px;
  padding: 0 10px;
  word-break: break-all;
}
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
}
.sidebar-actions .link {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 24px 80px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 45;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 29;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop.show {
    display: block;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .main {
    padding: 70px 14px 60px;
  }
}

/* --- 设置页子标签 --- */
.settings-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.settings-tab {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.settings-tab:hover {
  color: var(--text);
  border-color: var(--border-hover);
}
.settings-tab.active {
  background: rgba(254, 44, 85, 0.14);
  border-color: rgba(254, 44, 85, 0.35);
  color: var(--text);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* --- 欢迎横幅 --- */
.welcome-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: linear-gradient(120deg, rgba(254, 44, 85, 0.12), rgba(99, 102, 241, 0.08) 55%, rgba(52, 211, 153, 0.06)),
    var(--panel);
  backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: fadeSlideIn 0.4s ease both;
}
.welcome-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(135deg, rgba(254, 44, 85, 0.55), rgba(249, 115, 22, 0.45));
  box-shadow: 0 0 14px rgba(254, 44, 85, 0.18);
}
.welcome-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.welcome-title b {
  color: var(--muted);
  font-weight: 600;
}
.welcome-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* --- 闲鱼卡密购买卡片 --- */
.xianyu-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: linear-gradient(120deg, rgba(249, 115, 22, 0.12), rgba(251, 191, 36, 0.05)), var(--panel);
  backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  animation: fadeSlideIn 0.4s ease both;
  cursor: pointer;
}
.xianyu-card:hover {
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: var(--shadow-md), 0 0 20px rgba(249, 115, 22, 0.15);
  transform: translateY(-1px);
}
.xianyu-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #fb923c, #f59e0b);
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.3);
}
.xianyu-icon svg {
  width: 26px;
  height: 26px;
}
.xianyu-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.xianyu-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  transition: color var(--transition);
}
.xianyu-card:hover .xianyu-title {
  color: #fb923c;
}
.xianyu-sub {
  font-size: 12px;
  color: var(--muted);
}
.xianyu-arrow {
  width: 20px;
  height: 20px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--faint);
  transition: color var(--transition), transform var(--transition);
}
.xianyu-card:hover .xianyu-arrow {
  color: #fb923c;
  transform: translateX(3px);
}

/* --- 服务过期横幅 --- */
.expired-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: var(--danger-glow);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 18px;
  animation: fadeSlideIn 0.4s ease both;
}
.expired-banner .btn {
  margin-left: auto;
}

/* --- 随机时间窗口行 --- */
.random-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.random-row .field {
  margin: 0;
  flex: 0 0 auto;
}
.random-row input[type='time'] {
  width: 120px;
}

/* --- 滚动数字时间选择器 --- */
.wheel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wheel-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.wheel-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wheel-box .wheel-input {
  width: 42px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  padding: 2px 0;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.wheel-box .wheel-input:focus {
  color: var(--accent);
  border: none;
  box-shadow: none;
}
.wheel-arrows {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}
.wheel-arrow {
  width: 22px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition);
}
.wheel-arrow:hover {
  background: rgba(254, 44, 85, 0.2);
  color: var(--accent);
}
.wheel-sep {
  color: var(--faint);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 20px;
}
.wheel-label {
  color: var(--faint);
  font-size: 11px;
  text-align: center;
  margin-top: 2px;
}
.wheel-box .wheel-input::-webkit-inner-spin-button,
.wheel-box .wheel-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.wheel-box .wheel-input[type=number] {
  -moz-appearance: textfield;
}


/* --- Glassmorphism Cards --- */
.card {
  background: var(--panel);
  backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.03);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeSlideIn 0.4s ease both;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-shine);
  border-radius: inherit;
  pointer-events: none;
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}
.card h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 16px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.card .desc {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 14px;
}

/* --- 登录态卡片 --- */
.bind-status-row {
  margin-bottom: 12px;
}
.login-state-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.login-state-status {
  display: flex;
  align-items: center;
}
.login-state-expiry {
  color: var(--muted);
  font-size: 13px;
}
.login-state-expiry b {
  color: var(--text);
  font-weight: 700;
}
.login-state-text {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.login-state-block .btn {
  align-self: flex-start;
  margin-top: 4px;
}
.bind-status-dim {
  color: var(--warn);
  font-weight: 400;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  background: var(--panel);
  backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  animation: fadeSlideIn 0.4s ease both;
}
.stat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-shine);
  border-radius: inherit;
  pointer-events: none;
}
.stat:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat .num {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text), var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat .label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Stagger animation --- */
.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.18s; }
.card:nth-child(5) { animation-delay: 0.24s; }
.card:nth-child(6) { animation-delay: 0.30s; }
.stat:nth-child(1) { animation-delay: 0s; }
.stat:nth-child(2) { animation-delay: 0.06s; }
.stat:nth-child(3) { animation-delay: 0.12s; }

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

label.field {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin: 14px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
input[type='text'],
input[type='password'],
input[type='email'],
input[type='number'],
input[type='time'],
textarea,
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:hover,
textarea:hover,
select:hover {
  border-color: var(--border-hover);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea {
  min-height: 80px;
  resize: vertical;
}
textarea.mono {
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12.5px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
}
.check input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

/* --- Switch toggle 开关 --- */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  display: none;
}
.switch .switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--panel-border);
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.switch .switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--transition), background var(--transition);
}
.switch input:checked + .switch-track {
  background: rgba(254, 44, 85, 0.35);
  border-color: rgba(254, 44, 85, 0.5);
  box-shadow: 0 0 12px var(--accent-glow);
}
.switch input:checked + .switch-track::after {
  transform: translateX(20px);
  background: #fff;
}
.switch input:disabled + .switch-track {
  opacity: 0.4;
  cursor: not-allowed;
}
.switch .switch-label {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
.switch .switch-desc {
  color: var(--muted);
  font-size: 12px;
}

/* --- 自动续火卡片 --- */
.auto-run-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.02);
}
.auto-run-info {
  flex: 1;
  min-width: 200px;
}
.auto-run-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.auto-run-status {
  display: inline-block;
  margin-top: 4px;
}

.row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.row > * {
  flex: 1;
  min-width: 160px;
}
.row .grow0 {
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--raised);
  color: var(--text);
  transition: all var(--transition);
  letter-spacing: 0.1px;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-shine);
  border-radius: inherit;
  pointer-events: none;
}
.btn:hover {
  background: rgba(63, 63, 70, 0.55);
  box-shadow: var(--shadow-sm);
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
/* 需要绑定抖音才能用的按钮：视觉禁用但可点击触发提示 */
.btn.bound-locked {
  opacity: 0.45;
  filter: grayscale(40%);
  cursor: not-allowed;
  pointer-events: auto;
}
.btn.bound-locked:hover {
  opacity: 0.6;
  filter: grayscale(20%);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 28px var(--accent-glow);
}
.btn-ok {
  background: var(--ok);
  color: #fff;
}
.btn-ok:hover {
  background: #2cc08a;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--muted);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: var(--raised);
  color: var(--text);
  border-color: var(--border-hover);
}
.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}
.btn-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-glow);
  border-color: rgba(239, 68, 68, 0.5);
}
.btn-block {
  width: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.pill-ok {
  background: var(--ok-glow);
  color: var(--ok);
}
.pill-warn {
  background: var(--warn-glow);
  color: var(--warn);
}
.pill-danger {
  background: var(--danger-glow);
  color: var(--danger);
}
.pill-muted {
  background: rgba(113, 113, 122, 0.12);
  color: var(--muted);
}

.status-line {
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
}
.status-ok {
  color: var(--ok);
}
.status-warn {
  color: var(--warn);
}
.status-danger {
  color: var(--danger);
}
.status-idle {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  background: var(--raised);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
tr:last-child td {
  border-bottom: none;
}
tbody tr {
  transition: background var(--transition);
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.logs {
  background: #0c0c0e;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #9aa0aa;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12px;
  padding: 14px;
  height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

.code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.code-row input {
  flex: 1;
}
.code-row button {
  flex: 0 0 auto;
}

.qr-box {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.friend-row:last-child {
  border-bottom: none;
}
.friend-row:hover {
  background: rgba(255, 255, 255, 0.02);
}
.friend-row .check {
  flex: 1;
}
.friend-row .name {
  font-weight: 500;
}
.friend-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 6px;
}
.spark-tag {
  font-size: 12px;
  color: var(--warn);
  font-weight: 500;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -12px);
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  color: var(--text);
  border: 1px solid var(--panel-border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.err {
  border-color: rgba(239, 68, 68, 0.4);
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.mt {
  margin-top: 12px;
}
.mb {
  margin-bottom: 12px;
}
.empty {
  color: var(--faint);
  text-align: center;
  padding: 22px 0;
  font-size: 13px;
}
.spacer {
  height: 8px;
}
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
a.link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--transition);
}
a.link:hover {
  opacity: 0.8;
}
.hidden {
  display: none !important;
}

.loading {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0;
}

.loading-box {
  text-align: center;
  padding: 24px 0;
}

.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 10px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --- Feature Gate (未绑定抖音时锁定) --- */
.lock-card {
  border: 1px dashed var(--border-hover);
  background: rgba(24, 24, 27, 0.35);
  backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--panel-blur)) saturate(160%);
}
.lock-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 16px;
  gap: 12px;
}
.lock-hero h2 {
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
}
.lock-hero p {
  color: var(--muted);
  font-size: 13px;
  max-width: 380px;
}
.lock-icon-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(254, 44, 85, 0.12);
  border: 1px solid rgba(254, 44, 85, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(254, 44, 85, 0.2); }
  50% { box-shadow: 0 0 0 12px rgba(254, 44, 85, 0); }
}
.lock-features {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 4px 0 8px;
  text-align: left;
  max-width: 400px;
}
.lock-features li {
  color: var(--text-2);
  font-size: 13px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
}
@media (max-width: 480px) {
  .lock-features {
    grid-template-columns: 1fr;
  }
}

/* --- QR Waiting Spinner --- */
.qr-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 200px;
  height: 200px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.qr-waiting .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}
.qr-waiting .wait-text {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
}

/* --- Auth page glass --- */
.auth-wrap {
  max-width: 420px;
  margin: 60px auto 0;
  animation: fadeSlideIn 0.4s ease both;
}
.auth-tabs {
  display: flex;
  background: var(--panel);
  backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--panel-blur)) saturate(160%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 14px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  transition: all var(--transition);
  position: relative;
}
.auth-tab.active {
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* --- Table glass --- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
th {
  background: rgba(39, 39, 42, 0.4) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* --- Logs glass --- */
.logs {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: #9aa0aa;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12px;
  padding: 14px;
  height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

/* --- Modal glass --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: fadeSlideIn 0.25s ease;
}
.modal h3 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- QR img --- */
.qr-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: #fff;
  display: none;
  box-shadow: var(--shadow-md);
  transition: opacity 0.3s ease;
}

.logo-preview {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: var(--bg);
  display: none;
}

@media (max-width: 640px) {
  .main {
    padding: 70px 14px 60px;
  }
  .card {
    padding: 18px;
  }
  .stat .num {
    font-size: 24px;
  }
  .qr-box {
    flex-direction: column;
  }
  .qr-img, .qr-waiting {
    width: 180px;
    height: 180px;
  }
}
