/* 卡卡工具箱 · 全局样式（shadcn/ui 风格设计语言） */

:root {
  color-scheme: light;
  --background: #fafafa;
  --foreground: #09090b;
  --card: #ffffff;
  --card-muted: #f7f7f8;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef2ff;
  --brand-soft-border: #c7d2fe;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --grid-line: rgba(9, 9, 11, 0.045);
  --header-bg: rgba(250, 250, 250, 0.78);
  --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.05);
  --shadow-md: 0 4px 16px -4px rgba(9, 9, 11, 0.08), 0 2px 6px -2px rgba(9, 9, 11, 0.04);
  --shadow-lg: 0 20px 45px -18px rgba(9, 9, 11, 0.22);
  --radius: 12px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html.dark {
  color-scheme: dark;
  --background: #09090b;
  --foreground: #fafafa;
  --card: #111113;
  --card-muted: #161618;
  --muted: #1c1c1f;
  --muted-foreground: #a1a1aa;
  --border: #26262a;
  --border-strong: #3f3f46;
  --primary: #fafafa;
  --primary-foreground: #09090b;
  --brand: #a5b4fc;
  --brand-strong: #c7d2fe;
  --brand-soft: rgba(99, 102, 241, 0.16);
  --brand-soft-border: rgba(129, 140, 248, 0.32);
  --success: #4ade80;
  --success-bg: rgba(34, 197, 94, 0.12);
  --success-border: rgba(74, 222, 128, 0.28);
  --danger: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(248, 113, 113, 0.28);
  --warning: #fbbf24;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(251, 191, 36, 0.28);
  --grid-line: rgba(255, 255, 255, 0.055);
  --header-bg: rgba(9, 9, 11, 0.72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -10px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 30px 60px -25px rgba(0, 0, 0, 0.8);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(99, 102, 241, 0.24);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted-foreground);
}

.align-right {
  text-align: right;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 200;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ------------------------------------------------------------ 背景 */
.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--background);
}

.backdrop-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 30%, transparent 100%);
}

.backdrop-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}

.orb-a {
  top: -220px;
  right: -120px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.5), transparent 68%);
}

.orb-b {
  top: 220px;
  left: -220px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.26), transparent 70%);
}

html.dark .orb-a {
  background: radial-gradient(circle, rgba(79, 70, 229, 0.28), transparent 68%);
}

html.dark .orb-b {
  background: radial-gradient(circle, rgba(147, 51, 234, 0.16), transparent 70%);
}

/* ------------------------------------------------------------ 顶栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  border-radius: 10px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--muted);
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  gap: 3px;
}

.brand-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted-foreground);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
  color: var(--foreground);
  background: var(--muted);
}

.nav-link.is-active {
  color: var(--foreground);
  background: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-foreground);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.theme-toggle .icon-sun {
  display: none;
}

html.dark .theme-toggle .icon-sun {
  display: block;
}

html.dark .theme-toggle .icon-moon {
  display: none;
}

.menu-toggle {
  display: none;
}

/* 用户菜单 */
.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.user-chip:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.user-chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 550;
}

.user-chip .chevron {
  color: var(--muted-foreground);
}

.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  width: 244px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  z-index: 70;
  animation: dropdown-in 0.14s ease-out;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-head {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
  gap: 2px;
}

.dropdown-name {
  font-size: 13.5px;
  font-weight: 600;
}

.dropdown-mail {
  font-size: 11.5px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-sep {
  height: 1px;
  margin: 4px 2px;
  background: var(--border);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--foreground);
  font-size: 13px;
  text-align: left;
  transition: background 0.12s ease;
}

.dropdown-item:hover {
  background: var(--muted);
}

.dropdown-item .icon {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger .icon {
  color: var(--danger);
}

.dropdown form {
  margin: 0;
}

/* ------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  border-color: var(--border-strong);
  background: var(--muted);
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  background: var(--muted);
  color: var(--foreground);
}

.btn-ghost.is-danger {
  color: var(--danger);
}

.btn-ghost.is-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn-xs {
  height: 27px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-lg {
  height: 46px;
  padding: 0 22px;
  font-size: 14.5px;
  border-radius: 11px;
}

.btn-block {
  width: 100%;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.65;
}

.btn.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

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

.label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--foreground);
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.75;
}

.input:hover {
  border-color: var(--border-strong);
}

.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.input.tracking {
  letter-spacing: 0.28em;
  font-weight: 600;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.code-btn {
  height: 42px;
  min-width: 108px;
  border-radius: 10px;
  padding: 0 13px;
  font-size: 12.5px;
}

.password-field {
  position: relative;
}

.password-field .input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-foreground);
}

.password-toggle:hover {
  background: var(--muted);
  color: var(--foreground);
}

.password-toggle .icon-eye-off {
  display: none;
}

.password-toggle.is-visible .icon-eye {
  display: none;
}

.password-toggle.is-visible .icon-eye-off {
  display: block;
}

.hint {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ------------------------------------------------------------ 徽标 / 提示 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-success {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-border);
}

.badge-brand {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand-soft-border);
}

.badge-muted {
  color: var(--muted-foreground);
  background: var(--muted);
  border-color: var(--border);
}

.badge-danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.badge-warning {
  color: var(--warning);
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 auto 20px;
  padding: 11px 14px;
  max-width: 1180px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  font-size: 13px;
  line-height: 1.55;
}

.container > .alert {
  margin-top: 18px;
}

.alert-success {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success-border);
}

.alert-error {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: currentColor;
  color: var(--card);
  font-size: 11px;
  font-weight: 700;
}

.alert-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: currentColor;
  opacity: 0.6;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}

.alert-close:hover {
  opacity: 1;
}

/* ------------------------------------------------------------ 首页 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  align-items: center;
  gap: 54px;
  padding-top: 84px;
  padding-bottom: 76px;
}

.hero-single {
  grid-template-columns: 1fr;
  padding-top: 72px;
  padding-bottom: 56px;
}

.hero-single .hero-copy {
  max-width: 720px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 11.5px;
  font-weight: 550;
  box-shadow: var(--shadow-sm);
}

.eyebrow-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.eyebrow-sep {
  padding-left: 8px;
  border-left: 1px solid var(--border);
  color: var(--muted-foreground);
  font-weight: 500;
  opacity: 0.8;
}

.hero-title {
  margin: 22px 0 18px;
  font-size: clamp(38px, 4.4vw, 58px);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.gradient-text {
  background: linear-gradient(105deg, #4f46e5 0%, #7c3aed 48%, #c026d3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html.dark .gradient-text {
  background: linear-gradient(105deg, #a5b4fc 0%, #c4b5fd 48%, #f0abfc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  max-width: 520px;
  color: var(--muted-foreground);
  font-size: 15.5px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 28px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 560px;
}

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

.meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.meta-icon .icon {
  width: 15px;
  height: 15px;
}

.meta-item div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.meta-item strong {
  font-size: 12.5px;
  font-weight: 600;
}

.meta-item span {
  font-size: 11px;
  color: var(--muted-foreground);
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.visual-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 400px);
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 34px;
  background:
    radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.12), transparent 52%),
    radial-gradient(circle at 78% 82%, rgba(192, 132, 252, 0.13), transparent 55%),
    var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.visual-card::after {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px dashed var(--border);
  border-radius: 25px;
  pointer-events: none;
}

.visual-ring {
  position: absolute;
  width: 260px;
  height: 260px;
  border: 1px solid var(--brand-soft-border);
  border-radius: 50%;
  opacity: 0.8;
}

.visual-glow {
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 70%);
  filter: blur(24px);
}

.hero-logo {
  position: relative;
  z-index: 2;
  width: 58%;
  max-width: 218px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 26px 60px -22px rgba(49, 46, 129, 0.55);
}

.floating-chip {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--foreground);
  font-size: 11px;
  font-weight: 550;
  box-shadow: var(--shadow-md);
}

.floating-chip .icon {
  width: 13px;
  height: 13px;
  color: var(--brand);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.chip-1 {
  top: 17%;
  left: 6%;
}

.chip-2 {
  top: 27%;
  right: 4%;
}

.chip-3 {
  bottom: 15%;
  left: 11%;
}

.visual-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-foreground);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.13em;
}

.caption-line {
  width: 26px;
  height: 1px;
  background: var(--border-strong);
}

/* 区块 */
.section {
  padding-top: 72px;
  padding-bottom: 72px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.eyebrow-light {
  color: rgba(224, 231, 255, 0.75);
}

.section-heading h2,
.admin-page-head h1,
.auth-heading h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.section-heading p {
  margin-top: 7px;
  color: var(--muted-foreground);
  font-size: 13.5px;
}

.section-count {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tool-card.is-ready:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--brand-soft-border);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.tool-main {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.tool-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tool-title h3 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.tool-main p {
  color: var(--muted-foreground);
  font-size: 12.5px;
  line-height: 1.65;
}

.tool-foot {
  display: flex;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
}

.tool-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tool-link.is-disabled {
  color: var(--muted-foreground);
  font-weight: 500;
}

/* CTA */
.cta-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 38px 42px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% 15%, rgba(129, 140, 248, 0.28), transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(192, 132, 252, 0.22), transparent 45%),
    linear-gradient(120deg, #18181b, #27272a);
  color: #fafafa;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.cta-glow {
  position: absolute;
  top: -80px;
  right: 14%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.32), transparent 68%);
  filter: blur(20px);
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-content .eyebrow {
  color: rgba(199, 210, 254, 0.7);
}

.cta-content h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cta-content p {
  margin-top: 7px;
  max-width: 500px;
  color: rgba(244, 244, 245, 0.64);
  font-size: 13px;
}

.cta-actions {
  position: relative;
  z-index: 1;
  flex: none;
}

.cta-actions .btn-primary {
  background: #fafafa;
  color: #18181b;
}

/* ------------------------------------------------------------ 登录 / 注册 */
.auth-section {
  padding-top: 56px;
  padding-bottom: 82px;
}

.auth-shell {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  max-width: 1020px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  padding: 36px;
  background:
    radial-gradient(circle at 18% 12%, rgba(129, 140, 248, 0.5), transparent 46%),
    radial-gradient(circle at 88% 88%, rgba(192, 132, 252, 0.4), transparent 50%),
    linear-gradient(150deg, #1e1b4b 0%, #312e81 48%, #4c1d95 100%);
  color: #f8fafc;
}

.brand-inverse .brand-name {
  color: #ffffff;
}

.brand-inverse .brand-sub {
  color: rgba(224, 231, 255, 0.65);
}

.brand-inverse .brand-logo {
  border-color: rgba(255, 255, 255, 0.22);
}

.auth-aside-body h2 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.035em;
}

.aside-desc {
  margin-top: 12px;
  color: rgba(224, 231, 255, 0.68);
  font-size: 12.5px;
  line-height: 1.7;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(238, 242, 255, 0.9);
  font-size: 12.5px;
}

.feature-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #c7d2fe;
}

.feature-check .icon {
  width: 11px;
  height: 11px;
}

.auth-aside-foot {
  color: rgba(224, 231, 255, 0.4);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.auth-main {
  padding: 46px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading h1 {
  font-size: 26px;
  margin-bottom: 7px;
}

.auth-heading p {
  color: var(--muted-foreground);
  font-size: 12.5px;
}

.auth-logo-mobile {
  display: none;
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 12.5px;
}

.auth-switch a {
  color: var(--brand);
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------ 个人中心 */
.page-section {
  padding-top: 40px;
  padding-bottom: 78px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px 28px;
  margin-bottom: 20px;
}

.profile-avatar-wrap {
  position: relative;
  flex: none;
}

.avatar {
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--muted);
}

.avatar-sm {
  width: 30px;
  height: 30px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
}

.avatar-xl {
  width: 88px;
  height: 88px;
  border-width: 2px;
  box-shadow: var(--shadow-md);
}

.profile-avatar-badge {
  position: absolute;
  right: -2px;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
}

.profile-avatar-badge .icon {
  width: 12px;
  height: 12px;
}

.profile-identity {
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.profile-name-row h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.profile-mail {
  margin-top: 2px;
  color: var(--muted-foreground);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 9px;
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.profile-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.profile-meta .icon {
  width: 13px;
  height: 13px;
}

.profile-home {
  margin-left: auto;
  flex: none;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 26px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.card-heading h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.card-heading p {
  margin-top: 5px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--muted);
  color: var(--muted-foreground);
}

.card-icon .icon {
  width: 16px;
  height: 16px;
}

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-editor-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.avatar-editor-actions .btn {
  cursor: pointer;
}

.avatar-editor-actions .hint {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-list {
  display: flex;
  flex-direction: column;
}

.detail-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted-foreground);
}

.detail-list dd {
  font-weight: 550;
  text-align: right;
  word-break: break-all;
}

.account-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.6;
}

.account-note .icon {
  color: var(--success);
  margin-top: 1px;
}

/* ------------------------------------------------------------ 错误页 */
.error-section {
  padding-top: 90px;
  padding-bottom: 110px;
}

.error-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 46px;
  text-align: center;
}

.error-code {
  display: block;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  background: linear-gradient(120deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-card h1 {
  margin-top: 18px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.error-card p {
  margin-top: 9px;
  color: var(--muted-foreground);
  font-size: 13px;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

/* ------------------------------------------------------------ 页脚 */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding: 26px 0;
  background: var(--card-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand,
.footer-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.footer-brand > span:first-of-type {
  color: var(--foreground);
  font-weight: 600;
  font-size: 12.5px;
}

.footer-logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.footer-dot {
  opacity: 0.5;
}

.footer-meta {
  gap: 16px;
}

.footer-meta a:hover {
  color: var(--foreground);
}

/* ------------------------------------------------------------ 提示条 */
.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--foreground);
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease-out;
  pointer-events: auto;
}

.toast.is-hiding {
  animation: toast-out 0.2s ease-in forwards;
}

.toast-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--brand);
}

.toast.is-success .toast-dot {
  background: #22c55e;
}

.toast.is-error .toast-dot {
  background: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px); }
}

/* ------------------------------------------------------------ 后台 */
.admin-body {
  background: var(--background);
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: 258px;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  background: var(--card);
}

.admin-brand {
  padding: 2px 8px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 18px;
  overflow-y: auto;
}

.admin-nav-label {
  margin: 14px 10px 6px;
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-nav-label:first-child {
  margin-top: 0;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.14s ease, color 0.14s ease;
}

.admin-nav-item .icon {
  width: 17px;
  height: 17px;
}

.admin-nav-item:hover {
  background: var(--muted);
  color: var(--foreground);
}

.admin-nav-item.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.admin-sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 6px 12px;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.admin-user-name {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-mail {
  font-size: 10.5px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12.5px;
  text-align: left;
}

.admin-logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.admin-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  margin-left: 258px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 64px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.admin-topbar-left,
.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 12.5px;
}

.admin-breadcrumb strong {
  color: var(--foreground);
  font-weight: 600;
}

.breadcrumb-sep {
  opacity: 0.5;
}

.admin-menu-toggle {
  display: none;
}

.admin-content {
  width: 100%;
  max-width: 1320px;
  padding: 28px 30px 54px;
}

.admin-content > .alert {
  max-width: none;
  margin: 0 0 18px;
}

.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.admin-page-head h1 {
  font-size: 25px;
}

.admin-page-head p {
  margin-top: 6px;
  color: var(--muted-foreground);
  font-size: 12.5px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.stat-card {
  padding: 18px 19px;
}

.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--muted);
  color: var(--muted-foreground);
}

.stat-icon .icon {
  width: 16px;
  height: 16px;
}

.stat-icon.tone-brand {
  border-color: var(--brand-soft-border);
  background: var(--brand-soft);
  color: var(--brand);
}

.stat-icon.tone-green {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

.stat-icon.tone-blue {
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

html.dark .stat-icon.tone-blue {
  color: #93c5fd;
}

.stat-icon.tone-amber {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning);
}

.stat-hint {
  padding-top: 3px;
  color: var(--muted-foreground);
  font-size: 10.5px;
  text-align: right;
}

.stat-value {
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.stat-label {
  margin-top: 3px;
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.chart {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: 210px;
  padding-top: 6px;
}

.chart-col {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.chart-value {
  font-size: 10.5px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.chart-bar {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 34px;
  height: 150px;
  border-radius: 7px;
  background: var(--muted);
  overflow: hidden;
}

.chart-bar span {
  display: block;
  width: 100%;
  border-radius: 7px;
  background: linear-gradient(180deg, #818cf8, #4f46e5);
  transition: height 0.35s ease;
}

html.dark .chart-bar span {
  background: linear-gradient(180deg, #a5b4fc, #6366f1);
}

.chart-label {
  font-size: 10px;
  color: var(--muted-foreground);
}

.overview-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}

.overview-row strong {
  color: var(--foreground);
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.overview-bar {
  height: 6px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}

.overview-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #818cf8, #4f46e5);
}

.overview-bar.is-muted span {
  background: var(--border-strong);
}

.card-heading-pad {
  padding: 20px 22px 0;
  margin-bottom: 12px;
}

.admin-table-card {
  margin-top: 18px;
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(440px, 100%);
}

.search-icon {
  display: none;
}

.search-input {
  height: 36px;
  border-radius: 8px;
  font-size: 12.5px;
}

.table-count {
  color: var(--muted-foreground);
  font-size: 11.5px;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card-muted);
  color: var(--muted-foreground);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: var(--card-muted);
}

.data-table th.align-right,
.data-table td.align-right {
  text-align: right;
}

.table-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 136px;
}

.table-user > div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.table-user-name {
  font-size: 12.5px;
  font-weight: 600;
}

.table-user-sub {
  color: var(--muted-foreground);
  font-size: 10.5px;
}

.cell-muted {
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.cell-self {
  color: var(--muted-foreground);
  font-size: 11px;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.row-actions form {
  margin: 0;
}

.empty-state {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 12.5px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.page-btn:hover {
  border-color: var(--border-strong);
  color: var(--foreground);
}

.page-btn.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

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

.page-ellipsis {
  padding: 0 3px;
  color: var(--muted-foreground);
  font-size: 11px;
}

.admin-overlay {
  display: none;
}

/* 后台登录 */
.admin-auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 40px 20px;
  background: var(--background);
  overflow: hidden;
}

.admin-auth-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--background);
}

.admin-auth-home,
.admin-auth-theme {
  position: fixed;
  top: 22px;
  z-index: 10;
}

.admin-auth-home {
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 12px;
}

.admin-auth-home:hover {
  color: var(--foreground);
  border-color: var(--border-strong);
}

.admin-auth-theme {
  right: 24px;
  background: var(--card);
  border-color: var(--border);
}

.admin-auth-card {
  width: min(420px, 100%);
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.admin-auth-logo {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border: 1px solid var(--border);
  border-radius: 17px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.admin-auth-card h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.admin-auth-desc {
  margin: 6px 0 22px;
  color: var(--muted-foreground);
  font-size: 12.5px;
}

.admin-auth-card .form {
  text-align: left;
  margin-top: 20px;
}

.admin-auth-foot {
  margin-top: 20px;
  color: var(--muted-foreground);
  font-size: 11px;
}

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1100px) {
  .hero {
    gap: 36px;
    padding-top: 68px;
    padding-bottom: 60px;
  }

  .hero-title {
    font-size: 46px;
  }

  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 56px;
    padding-bottom: 48px;
  }

  .hero-copy {
    order: 1;
  }

  .hero-visual {
    order: 0;
    margin-bottom: 8px;
  }

  .visual-card {
    width: min(100%, 330px);
  }

  .hero-title {
    font-size: clamp(36px, 7vw, 46px);
  }

  .hero-meta {
    gap: 18px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .auth-aside {
    display: none;
  }

  .auth-main {
    padding: 34px 28px;
  }

  .auth-logo-mobile {
    display: inline-block;
    margin-bottom: 20px;
  }

  .auth-logo-mobile img {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    border: 1px solid var(--border);
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    flex-wrap: wrap;
  }

  .profile-home {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .admin-sidebar {
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }

  .admin-shell.is-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-menu-toggle {
    display: inline-flex;
  }

  .admin-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(9, 9, 11, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .admin-shell.is-open ~ .admin-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 820px) {
  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    padding: 12px 20px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-md);
  }

  .site-header.nav-open .site-nav {
    display: flex;
  }

  .nav-link {
    padding: 10px 12px;
    font-size: 14px;
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 18px;
  }

  .header-inner {
    height: 62px;
    gap: 12px;
  }

  .brand-sub {
    display: none;
  }

  .brand-name {
    font-size: 14px;
  }

  .nav-login {
    display: none;
  }

  .user-chip-name {
    max-width: 74px;
  }

  .section {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .cta-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
  }

  .hero-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .meta-item {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .auth-section {
    padding-top: 30px;
    padding-bottom: 54px;
  }

  .auth-shell {
    border-radius: 18px;
  }

  .auth-main {
    padding: 28px 20px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    padding: 22px;
  }

  .profile-identity {
    flex: 1;
  }

  .profile-name-row h1 {
    font-size: 21px;
  }

  .card-pad {
    padding: 20px;
  }

  .avatar-editor {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-meta {
    flex-wrap: wrap;
    gap: 12px;
  }

  .toast-root {
    right: 14px;
    bottom: 14px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    padding: 0 16px;
  }

  .admin-content {
    padding: 20px 16px 40px;
  }

  .admin-page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-breadcrumb span:first-child,
  .breadcrumb-sep {
    display: none;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form {
    width: 100%;
  }

  .admin-auth-card {
    padding: 28px 22px;
  }

  .admin-auth-home {
    left: 14px;
    top: 14px;
  }

  .admin-auth-theme {
    right: 14px;
    top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------ 积分 / 安慕希 / 兑换码 */
.tools-grid-home {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-layout .data-table {
  min-width: 100%;
}

.points-grid .input-row .btn {
  height: 42px;
}

.dropdown-points {
  align-self: flex-start;
  margin-top: 4px;
  padding: 1px 7px;
  border: 1px solid var(--brand-soft-border);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 600;
}

.profile-points-link,
.points-inline-link {
  color: var(--brand);
}

.profile-points-link:hover,
.points-inline-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-head p {
  margin-top: 7px;
  color: var(--muted-foreground);
  font-size: 13px;
}

.breadcrumb-lite {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.breadcrumb-lite a {
  color: var(--brand);
}

.breadcrumb-lite span {
  opacity: 0.5;
}

.tool-head-side {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.points-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--brand-soft-border);
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  white-space: nowrap;
}

.points-pill .icon {
  width: 15px;
  height: 15px;
}

.points-pill strong {
  font-size: 13.5px;
}

.points-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 18px;
  margin-bottom: 18px;
}

.points-balance {
  position: relative;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 15%, rgba(129, 140, 248, 0.18), transparent 50%),
    linear-gradient(145deg, var(--card), var(--brand-soft));
}

.points-balance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-foreground);
  font-size: 12px;
}

.points-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--brand-soft-border);
  border-radius: 10px;
  background: var(--card);
  color: var(--brand);
}

.points-value {
  margin-top: 10px;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.points-balance p {
  margin: 8px 0 18px;
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.checkin-done {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid var(--success-border);
  border-radius: 10px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 12.5px;
  font-weight: 550;
}

.checkin-hint {
  margin-top: 10px;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

.query-cost {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.query-cost .icon {
  color: var(--brand);
}

.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 210px;
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted-foreground);
  text-align: center;
}

.result-placeholder .icon {
  width: 34px;
  height: 34px;
  opacity: 0.55;
}

.result-placeholder p {
  font-size: 12.5px;
}

.result-hint {
  margin-top: 12px;
}

.task-message {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
}

.task-output {
  margin-top: 12px;
  padding: 12px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-detail {
  max-width: 420px;
  word-break: break-all;
  white-space: pre-wrap;
}

.raw-details {
  margin-top: 14px;
  font-size: 12px;
}

.raw-details summary {
  cursor: pointer;
  color: var(--muted-foreground);
}

.raw-details pre {
  margin-top: 8px;
  padding: 10px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--muted);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
}

.tool-note {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  margin-top: 18px;
}

.tool-note > .icon {
  width: 28px;
  height: 28px;
  color: var(--brand);
  flex: none;
}

.tool-note div {
  flex: 1;
  min-width: 0;
}

.tool-note strong {
  font-size: 13.5px;
}

.tool-note p {
  margin-top: 3px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.amount-plus {
  color: var(--success);
  font-weight: 650;
}

.amount-minus {
  color: var(--danger);
  font-weight: 650;
}

.cell-points {
  color: var(--foreground);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.input-xs {
  width: 66px;
  height: 27px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11.5px;
}

.row-points-form {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.code-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding: 4px;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--muted);
}

.code-row code,
.code-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.code-text {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--muted);
}

.generated-codes {
  margin-top: 18px;
}

.codes-hint {
  margin-top: 14px;
}

.admin-table-card .data-table {
  min-width: 960px;
}

.page-points .admin-table-card .data-table {
  min-width: 100%;
}

@media (max-width: 1100px) {
  .points-grid {
    grid-template-columns: 1fr 1fr;
  }

  .points-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .tool-head-side {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .points-grid {
    grid-template-columns: 1fr;
  }

  .points-grid > :first-child {
    grid-column: auto;
  }

  .tool-note {
    flex-wrap: wrap;
  }

  .tool-note .btn {
    width: 100%;
  }

  .tools-grid-home {
    grid-template-columns: 1fr;
  }
}
