/* 性能优化 */
* {
  box-sizing: border-box;
}

/* 启用硬件加速和优化 */
.cards,
.card,
.drawer {
  will-change: transform;
  transform: translateZ(0);
}

/* 减少重排重绘 */
.cards {
  contain: layout style paint;
}

:root {
  --bg: #0b1020;
  --bg-elev: rgba(255, 255, 255, 0.06);
  --text: #eef2ff;
  --muted: #a0a8c0;
  --brand: #5b8cff;
  --brand-2: #8a5bff;
  --success: #22c55e;
  --danger: #ef4444;
  --card: linear-gradient(135deg, rgba(91, 140, 255, 0.18), rgba(138, 91, 255, 0.18));
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: rgba(17, 24, 39, 0.04);
  --text: #0b1020;
  --muted: #5b647a;
  --brand: #2a6bff;
  --brand-2: #8a2aff;
  --card: linear-gradient(135deg, rgba(42, 107, 255, 0.1), rgba(138, 42, 255, 0.12));
}

/* 看板娘文本框样式优化 - 覆盖外部CSS */
#waifu-tips, .waifu-tips {
  position: absolute !important;
  top: -70px !important;  /* 向上移动更多避开内容 */
  left: 50% !important;
  transform: translateX(-50%) scale(0.9) !important;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98)) !important;
  border: 2px solid rgba(59, 130, 246, 0.3) !important;  /* 增加蓝色边框增强可见性 */
  border-radius: 12px !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
  color: #1f2937 !important;  /* 更深的文字颜色 */
  max-width: 180px !important;  /* 减小宽度避免遮挡 */
  text-align: center !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25) !important;  /* 增强阴影 */
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  pointer-events: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  word-wrap: break-word !important;
  line-height: 1.4 !important;
  font-weight: 600 !important;  /* 增加字重 */
  z-index: 999999 !important;
  opacity: 0 !important;
}

/* 文本框显示时的动画 */
#waifu-tips[style*="opacity: 1"], .waifu-tips[style*="opacity: 1"] {
  transform: translateX(-50%) scale(1) !important;
  opacity: 1 !important;
}

/* 深色主题下的看板娘文本框 */
[data-theme="dark"] #waifu-tips, 
[data-theme="dark"] .waifu-tips {
  background: linear-gradient(135deg, rgba(31,41,55,0.98), rgba(17,24,39,0.98)) !important;
  color: #f9fafb !important;  /* 更亮的文字颜色 */
  border-color: rgba(59, 130, 246, 0.4) !important;  /* 深色主题下的蓝色边框 */
  box-shadow: 0 8px 30px rgba(0,0,0,0.4) !important;  /* 深色主题下的阴影 */
}

/* 移动端优化 */
@media (max-width: 768px) {
  #waifu-tips, .waifu-tips {
    max-width: 140px !important;  /* 移动端进一步减小宽度 */
    font-size: 11px !important;
    padding: 6px 10px !important;
    top: -60px !important;  /* 移动端也向上移动更多 */
    border-width: 1px !important;  /* 移动端使用较细的边框 */
  }
}

/* 浅色主题下的导航栏文字增强 - 保持原有质感 */
[data-theme="light"] .nav .item {
  background: rgba(255,255,255,0.08);  /* 轻微增加背景透明度 */
}

[data-theme="light"] .item .name {
  color: #1a1a1a;  /* 仅在浅色主题下使用更深的文字颜色 */
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);  /* 添加轻微文字阴影增强可读性 */
}

[data-theme="light"] .item .count {
  color: #444444;  /* 深灰色数字 */
  background: rgba(0,0,0,0.08);  /* 轻微的背景色 */
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, Segoe UI, Roboto, PingFang SC, Microsoft YaHei, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 20px 20px 20px;
  border-right: 1px solid rgba(120, 120, 140, 0.15);
  background: linear-gradient(145deg, 
    rgba(255,255,255,0.08) 0%, 
    rgba(255,255,255,0.04) 50%, 
    rgba(255,255,255,0.02) 100%);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(26, 115, 232, 0.3) 20%, 
    rgba(26, 115, 232, 0.6) 50%, 
    rgba(26, 115, 232, 0.3) 80%, 
    transparent 100%);
  animation: glow 4s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { opacity: 0.3; transform: scaleX(0.8); }
  50% { opacity: 0.8; transform: scaleX(1.2); }
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.brand::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05), transparent);
  transform: rotate(45deg) translate(-100%, -100%);
  transition: transform 0.6s ease;
}

.brand:hover::before {
  transform: rotate(45deg) translate(100%, 100%);
}

.brand:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: rgba(26, 115, 232, 0.3);
}

.logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #64B5F6, #42A5F5, #2196F3);
  box-shadow: 0 4px 20px rgba(79, 195, 247, 0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 28px;
}

.logo svg {
  animation: toolboxFloat 2.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes toolboxFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-1px) rotate(1deg); }
}

.logo::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.brand:hover .logo::after {
  left: 100%;
}

.brand:hover .logo {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 30px rgba(135, 206, 235, 0.7);
  background: linear-gradient(135deg, #E3F2FD, #90CAF9, #64B5F6);
}

.brand:hover .logo svg {
  animation: toolboxActive 0.8s ease-in-out infinite alternate;
}

@keyframes toolboxActive {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  100% { transform: translateY(-2px) rotate(-2deg) scale(1.05); }
}

.brand-text {
  text-align: center;
}

.brand-text .title { 
  font-size: 18px; 
  font-weight: 700;
  background: linear-gradient(135deg, var(--text), #29B6F6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.brand-text .subtitle { 
  font-size: 12px; 
  color: var(--muted);
  opacity: 0.8;
  transition: all 0.3s ease;
}

.brand:hover .brand-text .subtitle {
  opacity: 1;
  color: var(--brand);
}

.nav {
  display: grid;
  gap: 8px;
  padding: 8px 0;
  overflow: auto;
  max-height: calc(100vh - 200px);
}

.nav .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.nav .item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255,255,255,0.1), 
    transparent);
  transition: left 0.5s ease;
}

.nav .item:hover::before {
  left: 100%;
}

.nav .item:hover {
  background: linear-gradient(135deg, 
    rgba(26, 115, 232, 0.08), 
    rgba(26, 115, 232, 0.04));
  border-color: rgba(26, 115, 232, 0.2);
  transform: translateX(4px) scale(1.02);
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.1);
}

.nav .item.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  border-color: var(--brand);
  box-shadow: 0 6px 20px rgba(26, 115, 232, 0.3);
  transform: translateX(6px) scale(1.03);
}

.nav .item.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 60%;
  background: rgba(255,255,255,0.8);
  border-radius: 0 4px 4px 0;
  transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.item .name { 
  font-weight: 600;
  transition: all 0.3s ease;
}

.item .count { 
  color: var(--muted); 
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  font-weight: 600;
}

.nav .item:hover .count {
  background: rgba(26, 115, 232, 0.2);
  color: var(--brand);
  transform: scale(1.1);
}

.nav .item.active .count {
  background: rgba(255,255,255,0.2);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar-footer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-secondary, .btn-link {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(120,120,140,0.3);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 12px;
  text-align: center;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.btn-link { text-align: center; text-decoration: none; }

.content {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  border-bottom: 1px solid rgba(120,120,140,0.2);
  z-index: 2;
}

.search { position: relative; }
.search input {
  width: 380px;
  max-width: 50vw;
  padding: 10px 34px 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(120,120,140,0.3);
  outline: none;
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.search .kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(120,120,140,0.35);
  color: var(--muted);
  font-size: 12px;
}

.toolbar-actions { display: flex; gap: 8px; }
.chip {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(120,120,140,0.3);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
}
.chip.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(91,140,255,0.25) inset; }

.stats {
  padding: 8px 18px;
  color: var(--muted);
  font-size: 13px;
}

.cards {
  padding: 16px;
  overflow: auto;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  grid-auto-rows: 1fr !important;
  gap: 16px !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
  align-items: stretch !important;
}

.card {
  position: relative;
  border-radius: 20px;
  padding: 24px;
  background: linear-gradient(145deg, 
    var(--card) 0%, 
    rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(120,120,140,0.15);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  height: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    var(--brand), 
    var(--brand-2), 
    var(--brand));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, 
    transparent 30%, 
    rgba(255,255,255,0.03) 50%, 
    transparent 70%);
  transform: rotate(45deg) translate(-100%, -100%);
  transition: transform 0.6s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover::after {
  transform: rotate(45deg) translate(100%, 100%);
}

.card:hover { 
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  border-color: rgba(26, 115, 232, 0.3);
}

/* 眼睛按钮统计数字显示 */
.btn.preview.showing-stats {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.9), rgba(255, 152, 0, 0.9));
  border-color: rgba(255, 193, 7, 0.6);
  color: white;
  transform: scale(1.1);
  animation: pulse 2s infinite;
}

.stats-number {
  font-size: 14px;
  font-weight: 700;
  display: block;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

@keyframes pulse {
  0%, 100% { 
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
  }
  50% { 
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
    transform: scale(1.15);
  }
}

.btn.preview.showing-stats:hover {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.9), rgba(255, 193, 7, 0.9));
  transform: scale(1.2);
  box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
}
/* 卡片头部布局 */
.card-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.card-logo {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
}

.card-logo::before {
  display: none;
}

.card-logo svg,
.card-logo img {
  width: 80px;
  height: 80px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.card:hover .card-logo {
  transform: translateY(-2px) scale(1.08);
}

.card:hover .card-logo svg,
.card:hover .card-logo img {
  transform: scale(1.05);
}

/* 深色模式适配 */
[data-theme="dark"] .card-logo {
  background: transparent;
}

.card-title { 
  margin: 0; 
  font-size: 18px; 
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
  color: var(--text);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.card:hover .card-title {
  color: var(--brand);
  transform: translateY(-2px);
}
.card-desc { 
  margin: 0 0 20px 0; 
  color: var(--muted); 
  font-size: 13px; 
  line-height: 1.6;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 150px;
  min-height: 42px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  padding-right: 8px;
}

/* 自定义滚动条样式 */
.card-desc::-webkit-scrollbar {
  width: 6px;
}

.card-desc::-webkit-scrollbar-track {
  background: rgba(120, 120, 140, 0.1);
  border-radius: 3px;
}

.card-desc::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 140, 0.3);
  border-radius: 3px;
  transition: background 0.3s ease;
}

.card-desc::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 120, 140, 0.5);
}

.card:hover .card-desc {
  color: var(--text);
  opacity: 0.9;
}

.card-badges { 
  position: absolute; 
  right: 16px; 
  top: 16px; 
  display: flex; 
  gap: 8px;
  z-index: 3;
}

.badge { 
  padding: 6px 12px; 
  border-radius: 20px; 
  background: rgba(255,255,255,0.15); 
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}

.badge.hot { 
  background: linear-gradient(135deg, rgba(239,68,68,0.8), rgba(220,38,38,0.8)); 
  color: white;
  box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}

.badge.new { 
  background: linear-gradient(135deg, rgba(34,197,94,0.8), rgba(22,163,74,0.8)); 
  color: white;
  box-shadow: 0 4px 15px rgba(34,197,94,0.3);
}

.card:hover .badge {
  transform: scale(1.1) translateY(-2px);
}

.card-actions { 
  display: flex; 
  gap: 8px; 
  margin-top: auto; 
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  padding-top: 12px;
  position: relative;
  z-index: 2;
}
.btn { 
  padding: 8px 14px; 
  border-radius: 10px; 
  border: 1px solid rgba(120,120,140,0.2); 
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05)); 
  color: var(--text); 
  cursor: pointer; 
  font-size: 12px; 
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  min-width: 65px;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(26, 115, 232, 0.1), rgba(26, 115, 232, 0.05));
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.2);
  color: var(--brand);
}
.btn-primary { 
  border-color: var(--brand); 
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); 
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 25px rgba(26, 115, 232, 0.4);
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
}

/* 眼睛图标按钮样式 */
.btn svg {
  transition: all 0.3s ease;
  display: block;
  margin: 0 auto;
}

.btn:hover svg {
  transform: scale(1.2);
  filter: drop-shadow(0 2px 4px rgba(26, 115, 232, 0.3));
}

.btn.preview {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
  border-color: rgba(34, 197, 94, 0.2);
  color: rgba(34, 197, 94, 0.9);
  min-width: 48px;
  padding: 10px;
}

.btn.preview:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.08));
  border-color: rgba(34, 197, 94, 0.4);
  color: rgb(34, 197, 94);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

.empty { text-align: center; padding: 48px 0; color: var(--muted); }
.empty-emoji { font-size: 48px; }
.empty-title { font-size: 18px; margin-top: 8px; color: var(--text); }
.empty-desc { font-size: 13px; }

.drawer {
  position: fixed;
  right: 0;
  top: 0;
  width: min(960px, 65vw);
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid rgba(120,120,140,0.28);
  box-shadow: -20px 0 60px rgba(0,0,0,0.35);
  transform: translateX(100%);
  transition: transform 200ms ease;
  display: grid;
  grid-template-rows: auto 1fr;
  z-index: 20;
}
.drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid rgba(120,120,140,0.25); }
.drawer-title { font-weight: 700; }
.drawer iframe { width: 100%; height: 100%; border: 0; background: white; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(30, 41, 59, 0.9);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.toast.show { opacity: 1; transform: translate(-50%, -6px); }

@media (max-width: 1200px) {
  .cards {
    grid-template-columns: repeat(3, 1fr) !important;
    max-width: 1000px;
  }
}

@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 700px;
  }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .cards {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr !important;
    max-width: 100%;
  }
}

/* 用户登录区域样式 */
.user-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  position: relative;
}

.auth-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-auth {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-feedback {
  background: linear-gradient(135deg, #FF6B6B, #FF8E8E) !important;
  color: white !important;
  border: 1px solid #FF6B6B !important;
}

.btn-feedback:hover {
  background: linear-gradient(135deg, #FF5252, #FF6B6B) !important;
  border-color: #FF5252 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-login {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-login:hover {
  background: var(--bg-2);
  border-color: var(--brand);
  color: var(--brand);
}

.btn-register {
  background: var(--brand);
  color: white;
}

.btn-register:hover {
  background: var(--brand-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
}

.user-info:hover {
  background: var(--bg-2);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

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

.user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  min-width: 160px;
  z-index: 1000;
  display: none;
  padding: 0.5rem 0;
}

.user-info:hover .user-menu {
  display: block;
}

.user-menu-item {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s ease;
  font-size: 0.875rem;
}

.user-menu-item:hover {
  background: var(--bg-2);
}

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg);
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-2);
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-2);
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.checkbox-group label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.4;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0 0;
  flex-shrink: 0;
}

.btn-submit {
  width: 100%;
  padding: 0.75rem;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.btn-submit:hover {
  background: var(--brand-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.btn-submit:disabled {
  background: var(--text-2);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
}

.auth-footer p {
  margin: 0.5rem 0;
  color: var(--text-2);
  font-size: 0.875rem;
}

.auth-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* 看板娘样式 - 基础版 */
#waifu {
  position: fixed;
  bottom: 0;
  left: 300px; /* 强制设置初始位置，避免覆盖侧边栏 */
  z-index: 999;
  pointer-events: auto; /* 启用指针事件以支持悬停和拖拽 */
  transition: opacity 0.3s ease-in-out, left 0.3s ease-in-out;
  opacity: 0.3; /* 默认虚化状态 */
  width: 240px;
  height: 150px;
  cursor: grab;
}

/* 看板娘可交互状态 - 允许点击交互 */
#waifu.interactive {
  pointer-events: auto;
  cursor: pointer;
}

/* 看板娘工具栏需要保持可点击 */
.live2d-tool {
  pointer-events: auto;
}

/* 看板娘tips需要保持可见 */
.live2d-tips {
  pointer-events: none;
}

/* 画布在拖拽时可交互 */
#waifu.dragging {
  pointer-events: auto;
}

/* 拖拽模式启用状态 */
#waifu.drag-enabled {
  pointer-events: auto;
  cursor: grab;
}

#waifu.drag-enabled:active {
  cursor: grabbing;
}

/* 选中/交互状态 - 实体化 */
#waifu.active {
  opacity: 1 !important; /* 完全不透明，实体状态 */
  transition: opacity 0.2s ease-in-out;
}

/* 悬停状态 - 稍微实体一点 */
#waifu:hover {
  opacity: 0.6;
}

/* 拖拽状态 */
#waifu.dragging {
  transition: none;
  cursor: grabbing;
  opacity: 0.9;
  z-index: 1000;
}

.live2d-canvas {
  position: relative;
  pointer-events: auto;
  width: 240px !important;
  height: 150px !important;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.live2d-tips {
  position: absolute;
  top: -70px;  /* 向上移动更多避开内容 */
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
  border: 2px solid rgba(59, 130, 246, 0.3);  /* 增加蓝色边框增强可见性 */
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  color: #1f2937;  /* 更深的文字颜色 */
  max-width: 180px;  /* 减小宽度避免遮挡 */
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);  /* 增强阴影 */
  backdrop-filter: blur(12px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  word-wrap: break-word;
  line-height: 1.4;
  font-weight: 600;  /* 增加字重 */
  opacity: 0;
  /* 确保不会被其他元素遮挡 */
  z-index: 999999;
}

/* 提示气泡显示时的动画 */
.live2d-tips[style*="opacity: 1"] {
  transform: translateX(-50%) scale(1);
  animation: tipsBounce 0.4s ease-out;
}

@keyframes tipsBounce {
  0% {
    transform: translateX(-50%) scale(0.8);
    opacity: 0;
  }
  60% {
    transform: translateX(-50%) scale(1.05);
    opacity: 0.9;
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

.live2d-tips::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(255,255,255,0.95);
}

[data-theme="dark"] .live2d-tips {
  background: linear-gradient(135deg, rgba(31,41,55,0.98), rgba(17,24,39,0.98));
  color: #f9fafb;  /* 更亮的文字颜色 */
  border-color: rgba(59, 130, 246, 0.4);  /* 深色主题下的蓝色边框 */
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);  /* 深色主题下的阴影 */
}

[data-theme="dark"] .live2d-tips::after {
  border-top-color: rgba(31,41,55,0.95);
}

.live2d-tool {
  position: absolute;
  top: 0;
  right: -40px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: auto;
}

#waifu:hover .live2d-tool {
  opacity: 1;
  right: -35px;
}

.live2d-tool span {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 11px !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.live2d-tool span:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(26, 115, 232, 0.4);
}

.live2d-tool span:nth-child(1) { background: linear-gradient(135deg, #10B981, #059669); }
.live2d-tool span:nth-child(2) { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.live2d-tool span:nth-child(3) { background: linear-gradient(135deg, #F59E0B, #D97706); }
.live2d-tool span:nth-child(4) { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.live2d-tool span:nth-child(5) { background: linear-gradient(135deg, #EF4444, #DC2626); }

/* 看板娘移动端适配 */
@media (max-width: 768px) {
  #waifu {
    bottom: -5px;
    left: -20px;
    transform: scale(0.75);
  }
  
  .live2d-canvas {
    width: 180px !important;
    height: 110px !important;
  }
  
  .live2d-tips {
    max-width: 140px;  /* 移动端进一步减小宽度 */
    font-size: 11px;
    padding: 6px 10px;
    top: -60px;  /* 移动端也向上移动更多 */
    border-width: 1px;  /* 移动端使用较细的边框 */
  }
  
  .live2d-tool {
    right: -30px;
    gap: 4px;
  }
  
  .live2d-tool span {
    width: 22px;
    height: 22px;
    font-size: 10px !important;
  }
}

@media (max-width: 480px) {
  #waifu {
    transform: scale(0.65);
    left: -35px;
  }
  
  .live2d-canvas {
    width: 160px !important;
    height: 100px !important;
  }
}

/* 拖拽指示器 */
#waifu::before {
  content: '⇄';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1001;
}

#waifu:hover::before {
  opacity: 0.8;
}

#waifu.dragging::before {
  opacity: 1;
  content: '拖拽中...';
}

/* 看板娘隐藏状态 */
#waifu.hidden {
  transform: translateX(-100%);
  opacity: 0;
}

/* 确保看板娘容器始终可见用于调试 - 已移除，使用默认opacity: 0.3 */
/* 
#waifu {
  display: block !important;
  visibility: visible !important;
}
*/

/* 看板娘加载动画 */
#waifu.loading {
  opacity: 0.7;
  position: relative;
}

#waifu.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid rgba(91, 140, 255, 0.2);
  border-top: 3px solid var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1002;
}

/* 加载文字样式 */
.loading-text {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(91, 140, 255, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1003;
  white-space: nowrap;
}

/* 当不在加载状态时隐藏加载文字 */
#waifu:not(.loading) .loading-text {
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .toolbar {
    flex-wrap: wrap;
  }
  
  .user-area {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  .modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .modal-header {
    padding: 1rem;
  }
}



/* ==================== 项目状态指示器 ==================== */
.status-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  width: 12px;
  height: 12px;
  cursor: help;
}

.status-dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #FFA500; /* 默认黄色 - 未知状态 */
  box-shadow: 0 0 0 0 rgba(255, 165, 0, 0.7);
  animation: status-pulse 2s infinite;
  transition: background 0.3s ease;
}

/* 状态颜色 */
.status-indicator[data-status="online"] .status-dot {
  background: #10B981; /* 绿色 - 在线 */
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

.status-indicator[data-status="offline"] .status-dot {
  background: #EF4444; /* 红色 - 离线 */
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: none; /* 离线状态不闪烁 */
}

.status-indicator[data-status="unknown"] .status-dot {
  background: #FFA500; /* 黄色 - 未知 */
  box-shadow: 0 0 0 0 rgba(255, 165, 0, 0.7);
}

.status-indicator[data-status="checking"] .status-dot {
  background: #6B7280; /* 灰色 - 检测中 */
  box-shadow: 0 0 0 0 rgba(107, 116, 128, 0.7);
  animation: status-checking 1s infinite;
}

/* 状态脉冲动画 - 仅用于在线和未知状态 */
@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    box-shadow: 0 0 0 4px rgba(255, 165, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 165, 0, 0);
  }
}

/* 检测中动画 */
@keyframes status-checking {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* 悬停效果 */
.status-indicator:hover .status-dot {
  transform: scale(1.2);
  transition: transform 0.2s ease;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .status-indicator {
    width: 10px;
    height: 10px;
    top: 6px;
    left: 6px;
  }
}

/* 看板娘工具推荐卡片样式 */
.waifu-tool-recommend {
  text-align: left;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  max-width: 300px;
}

.recommend-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 8px;
}

.recommend-tool {
  background: rgba(255, 255, 255, 0.15);
  padding: 12px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.recommend-tool strong {
  font-size: 18px;
  display: block;
  margin-bottom: 6px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.recommend-category {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: 500;
}

.recommend-desc {
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 0 12px;
  color: rgba(255, 255, 255, 0.95);
}

.recommend-action {
  text-align: center;
  margin-top: 10px;
}

.recommend-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #667eea;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.recommend-btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.recommend-btn:active {
  transform: translateY(0);
}

/* 看板娘对话框增强样式 */
#waifu-tips {
  min-width: 200px;
  max-width: 350px;
  padding: 12px 16px;
  word-wrap: break-word;
}

/* ========== 状态指示器权限控制 ========== */
.status-indicator { display: none !important; }
body.admin-user .status-indicator { display: block !important; }
