/* A1Tabs 新标签页样式 */

/* 基础重置和布局 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: transparent;
  overflow-x: hidden;
  position: relative;
}

/* 添加动态背景装饰 - 现在用于壁纸上方的装饰效果 */
html::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(168, 230, 207, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(127, 205, 205, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(129, 199, 132, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -3;
}

.newtab-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 新增主布局样式 */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  margin-left: 280px; /* 留出侧边栏的空间 */
}

.sidebar {
  width: 280px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
  padding: 0;
  z-index: 99;
  min-height: 0;
}

.sidebar-header {
  padding: 24px;
  
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  text-decoration: none;
  color: inherit;
}

.logo-container:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), 0 0 30px rgba(100, 181, 246, 0.2);
}

.logo-container:active {
  transform: translateY(-1px) scale(1.01);
}

.logo-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.app-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #64b5f6 0%, #81c784 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  text-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
  line-height: 1;
}

.version-info {
  font-size: 11px;
  font-weight: 500;
  color: rgba(100, 181, 246, 0.8);
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.1) 0%, rgba(129, 199, 132, 0.1) 100%);
  padding: 2px 8px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  align-self: flex-start;
}

.logo-container:hover .version-info {
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.2) 0%, rgba(129, 199, 132, 0.2) 100%);
  color: rgba(100, 181, 246, 1);
  box-shadow: 0 2px 8px rgba(100, 181, 246, 0.2);
}

/* 头部样式 */
.newtab-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), 0 0 80px rgba(255, 255, 255, 0.1) inset;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.logo-container:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), 0 0 30px rgba(100, 181, 246, 0.2);
}

.logo-container:active {
  transform: translateY(-1px) scale(1.01);
}

.logo-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.app-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #64b5f6 0%, #81c784 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  text-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
  line-height: 1;
}

.version-info {
  font-size: 11px;
  font-weight: 500;
  color: rgba(100, 181, 246, 0.8);
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.1) 0%, rgba(129, 199, 132, 0.1) 100%);
  padding: 2px 8px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  align-self: flex-start;
}

.logo-container:hover .version-info {
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.2) 0%, rgba(129, 199, 132, 0.2) 100%);
  color: rgba(100, 181, 246, 1);
  box-shadow: 0 2px 8px rgba(100, 181, 246, 0.2);
}

/* 深色主题下的logo容器样式 */
[data-theme="dark"] .logo-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

[data-theme="dark"] .logo-container:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

[data-theme="dark"] .version-info {
  color: rgba(168, 206, 246, 0.9);
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.15) 0%, rgba(129, 199, 132, 0.15) 100%);
}

[data-theme="dark"] .logo-container:hover .version-info {
  color: rgba(168, 206, 246, 1);
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.25) 0%, rgba(129, 199, 132, 0.25) 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .logo-container {
    padding: 6px 12px;
    gap: 10px;
  }
  
  .app-title {
    font-size: 24px;
  }
  
  .version-info {
    font-size: 10px;
    padding: 1px 6px;
  }
}

@media (max-width: 480px) {
  .logo-container {
    padding: 4px 8px;
    gap: 8px;
  }
  
  .app-title {
    font-size: 20px;
  }
  
  .version-info {
    font-size: 9px;
    padding: 1px 4px;
  }
}

.search-container {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.main-search {
  width: 100%;
  padding: 18px 28px;
  padding-right: 60px;
  border: none;
  border-radius: 60px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.25) 100%);
  backdrop-filter: blur(15px);
  font-size: 16px;
  outline: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.1), 0 0 60px rgba(255, 255, 255, 0.2) inset;
  color: #2d3748;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.main-search:focus {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.4) 100%);
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.15), 0 0 100px rgba(100, 181, 246, 0.2) inset;
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(100, 181, 246, 0.4);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 12px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.search-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.life-stats-container {
  display: flex;
  align-items: center;
  min-width: 450px; 
}

.life-stats {
  margin-top: 0;
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
}

.life-stats-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
}

.life-stats-row.single-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
}

.life-stat-item {
  flex: 0 0 calc(25% - 9px); /* 每行4个，减去间隙 */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
  backdrop-filter: blur(15px);
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.life-stat-item.edit-info {
  cursor: pointer;
}

.life-stat-item.edit-info:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.25) 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 0 40px rgba(100, 181, 246, 0.15);
  border-color: rgba(100, 181, 246, 0.4);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
  opacity: 0.9;
  margin-bottom: 6px;
}



.stat-value .edit-icon {
  width: 16px;
  height: 16px;
  fill: #4a5568;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.life-stat-item.edit-info:hover .stat-value .edit-icon {
  fill: #4285f4;
  opacity: 1;
}

.stat-unit {
  font-size: 12px;
  color: #718096;
  margin-left: 0; /* 去除左边距，让其与stat-value紧挨 */
  vertical-align: super;
  font-weight: normal;
}

.stat-comment {
  font-size: 10px;
  color: #718096;
  opacity: 0.8;
}

/* 响应式处理：在较小屏幕上调整生命统计数据 */
@media (max-width: 1024px) {
  .life-stats-container {
    min-width: auto;
    margin-left: 12px;
  }
  
  .life-stats {
    flex-direction: column;
  }
  
  .life-stats-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .life-stat-item {
    flex: 0 0 auto;
    padding: 10px;
  }
}

/* 当屏幕宽度小于1200px时，开始逐步隐藏生命统计数据项 */
@media (max-width: 1200px) {
  .life-stat-item.retirement-distance { /* 距离退休 */
    display: none;
  }
}

@media (max-width: 1024px) {
  .life-stat-item.retirement-distance, /* 距离退休 */
  .life-stat-item.expected-remaining { /* 预计剩余 */
    display: none;
  }
}

@media (max-width: 856px) {
  .life-stat-item.retirement-distance, /* 距离退休 */
  .life-stat-item.expected-remaining, /* 预计剩余 */
  .life-stat-item.successfully-lived { /* 成功存活 */
    display: none;
  }
}

/* 当屏幕宽度大于856px时，显示生命统计数据容器 */
@media (min-width: 857px) and (max-width: 1200px) {
  .life-stats-container {
    display: flex;
  }
}

/* 大于1200px时显示全部 */
@media (min-width: 1201px) {
  .life-stat-item.retirement-distance,
  .life-stat-item.expected-remaining,
  .life-stat-item.successfully-lived {
    display: flex;
    flex-direction: column;
  }
}

/* 在移动端（小于等于768px）时显示所有项目，因为侧边栏收起，空间较充足 */
@media (max-width: 768px) {
  .life-stat-item.retirement-distance,
  .life-stat-item.expected-remaining,
  .life-stat-item.successfully-lived {
    display: flex;
    flex-direction: column;
  }
}

/* 移动端侧边栏隐藏时显示lifeStatsContainer */
@media (max-width: 768px) {
  .life-stats-container {
    display: block;
    order: 1;
    width: 100%;
    margin-left: 0;
    margin-top: 12px;
  }
  
  .life-stats {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .life-stat-item {
    flex: 0 0 calc(50% - 6px);
  }
  
  .header-actions {
    order: 2;
    width: 100%;
    justify-content: flex-end;
    margin-top: 12px;
  }
}

@media (max-width: 768px) {
  .header-right {
    flex-wrap: wrap;
  }
  
  .life-stats-container {
    order: 1;
    width: 100%;
    margin-left: 0;
    margin-top: 12px;
  }
  
  .life-stats {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .life-stat-item {
    flex: 0 0 calc(50% - 6px);
  }
  
  .header-actions {
    order: 2;
    width: 100%;
    justify-content: flex-end;
    margin-top: 12px;
  }
}

@media (max-width: 480px) {
  .life-stat-item {
    flex: 0 0 100%;
  }
}

.time-display { 
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
  backdrop-filter: blur(15px);
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}

.year-month-date {
  font-size: 16px;
  color: #2d3748;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.time {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: #2d3748;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.weekday {
  font-size: 12px;
  margin-top: 4px;
  color: #4a5568;
  font-weight: 400;
}

.life-stats { 
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.life-stats-row {
  display: flex;
  gap: 12px;
}

.life-stat-item {
  flex: 1;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
  backdrop-filter: blur(15px);
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.life-stat-item.edit-info {
  cursor: pointer;
}

.life-stat-item.edit-info:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.25) 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 0 40px rgba(100, 181, 246, 0.15);
  border-color: rgba(100, 181, 246, 0.4);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: #2d3748;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  margin-bottom: 4px; 
}

.stat-value .edit-icon {
  width: 16px;
  height: 16px;
  fill: #4a5568;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.life-stat-item.edit-info:hover .stat-value .edit-icon {
  fill: #4285f4;
  opacity: 1;
}

.stat-unit {
  font-size: 12px;
  color: #4a5568;
  margin-left: 4px;
  vertical-align: super;
  font-weight: normal;
}

.stat-comment {
  font-size: 10px;
  color: #718096;
}

.header-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0px;
  align-items: center;
  width: 120px; /* 控制整体宽度 */
  height: 120px; /* 控制整体高度 */
}

.header-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.25) 100%);
  backdrop-filter: blur(15px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: #4a5568;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 定位各个按钮在网格中的位置 */
#addLinkBtn {
  grid-column: 1;
  grid-row: 1;
}

#themeToggle {
  grid-column: 2;
  grid-row: 1;
}

#settingsBtn {
  grid-column: 1;
  grid-row: 2;
}

#personalInfoBtn {
  grid-column: 2;
  grid-row: 2;
}

.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* 分类导航 */
.categories-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  padding: 0 20px;
}

.categories-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
  scroll-behavior: smooth;
}

.categories-scroll::-webkit-scrollbar {
  height: 4px;
}

.categories-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.categories-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.3), rgba(129, 199, 132, 0.3));
  border-radius: 4px;
}

.category-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
  backdrop-filter: blur(15px);
  color: #4a5568;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  width: 100%;
}

.category-tab:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.3) 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 0 40px rgba(100, 181, 246, 0.15);
  border-color: rgba(100, 181, 246, 0.4);
}

.category-tab.active {
  background: linear-gradient(135deg, #64b5f6 0%, #81c784 100%);
  color: white;
  border-color: rgba(100, 181, 246, 0.6);
  box-shadow: 0 12px 35px rgba(100, 181, 246, 0.4), 0 0 60px rgba(100, 181, 246, 0.2);
  transform: translateY(-1px);
}

.category-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.category-icon {
  font-size: 16px;
  line-height: 1;
}

.category-name {
  font-size: 14px;
  font-weight: 500;
}

.category-count {
  background: rgba(66, 133, 244, 0.1);
  color: #4285f4;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

/* 分类删除按钮 */
.category-delete-btn {
  opacity: 0;
  visibility: hidden;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.category-delete-btn .icon {
  width: 14px;
  height: 14px;
  color: #ef4444;
}

.category-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  transform: scale(1.1);
}

.category-delete-btn:active {
  transform: scale(0.95);
}

/* 鼠标悬停时显示删除按钮 */
.category-tab:hover .category-delete-btn {
  opacity: 1;
  visibility: visible;
}

/* 侧边栏操作按钮 */
.sidebar-actions {
  display: flex;
  gap: 12px;
  padding: 0 12px;
  margin-top: auto;
}

.btn-add-category {
  width: 44px;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, #64b5f6 0%, #81c784 100%);
  cursor: pointer;
  color: white;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(100, 181, 246, 0.4);
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}

.btn-add-category::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;
}

.btn-add-category:hover {
  background: linear-gradient(135deg, #5a8dee 0%, #64b5f6 100%);
  box-shadow: 0 12px 35px rgba(100, 181, 246, 0.6);
  transform: translateY(-3px) scale(1.08);
  border-color: rgba(100, 181, 246, 0.8);
}

.btn-add-category:hover::before {
  left: 100%;
}

.btn-add-category:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.btn-add-category .icon {
  width: 20px;
  height: 20px;
  color: white;
}

/* 管理分类按钮 */
.btn-manage-category {
  width: 44px;
  height: 44px;
  border: 2px solid #6b7280;
  border-radius: 12px;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  cursor: pointer;
  color: white;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}

.btn-manage-category::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;
}

.btn-manage-category:hover {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
  transform: translateY(-2px) scale(1.05);
}

.btn-manage-category:hover::before {
  left: 100%;
}

.btn-manage-category:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.btn-manage-category .icon {
  width: 18px;
  height: 18px;
  color: white;
}

/* 待办事项按钮 */
.btn-todo {
  width: 44px;
  height: 44px;
  border: 2px solid #8b5cf6;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  cursor: pointer;
  color: white;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}

.btn-todo::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;
}

.btn-todo:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px) scale(1.05);
}

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

.btn-todo:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* 待办事项抽屉 */
.todo-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 860px;
  height: 100vh;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: right 0.3s ease;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.todo-drawer.open {
  right: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .todo-drawer {
    max-width: 100vw;
  }
}

.todo-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.todo-drawer-title {
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.close-todo-drawer {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.close-todo-drawer:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.todo-input-container {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.todo-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 14px;
  resize: none;
  outline: none;
  font-family: inherit;
  line-height: 1.4;
  min-height: 46px;
  max-height: 120px;
}

.todo-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.todo-input:focus {
  border-color: rgba(100, 181, 246, 0.6);
  box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
}

.add-todo-btn {
  padding: 12px 16px;
  background: linear-gradient(135deg, #64b5f6 0%, #81c784 100%);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.add-todo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
}

.todo-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.todo-item {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 16px;
  transition: all 0.3s ease;
  position: relative;
}

.todo-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.todo-item.completed {
  opacity: 0.8;
  background: rgba(129, 199, 132, 0.1);
}

.todo-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  width: 100%;
}

.todo-item-content {
  display: block;
  padding-left: 32px;
  margin-top: 8px;
}

.todo-checkbox {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.todo-checkbox:hover {
  background: rgba(100, 181, 246, 0.2);
  border-color: rgba(100, 181, 246, 0.4);
}

.todo-checkbox.completed {
  background: linear-gradient(135deg, #64b5f6 0%, #81c784 100%);
  border-color: rgba(100, 181, 246, 0.6);
}

.todo-text {
  color: white;
  word-break: break-word;
  line-height: 1.5;
  white-space: pre-wrap;
  text-align: left;
}

.todo-text.completed {
  text-decoration: line-through;
  opacity: 0.7;
}

.completed-text {
  text-decoration: line-through;
  opacity: 0.7;
}

.todo-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 8px;
}

.todo-left-side {
  display: flex;
  align-items: center;
}

.todo-action-area {
  display: flex;
  align-items: center;
}

.todo-delete-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 20px;
  opacity: 0.6;
  transition: all 0.2s ease;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.todo-delete-btn:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

.todo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease;
  z-index: 999;
  pointer-events: none;
}

.todo-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* 保留旧的todo-backdrop类以向后兼容 */
.todo-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease;
  z-index: 999;
  pointer-events: none;
}

.todo-backdrop.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* 主内容区域 */
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px; 
  margin-left: auto;
  min-height: 100vh;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  padding: 32px;
}

.content-area .newtab-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), 0 0 80px rgba(255, 255, 255, 0.1) inset;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 24px;
}

/* 快速访问区域 - 现在位于右侧内容区 */
.quick-access {
  padding: 24px 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), 0 0 80px rgba(255, 255, 255, 0.1) inset;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 24px;
  font-weight: 800;
  color: white;
  margin-bottom: 28px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.section-title .icon {
  fill: white;
}

.quick-links-grid {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 20px;
  border-radius: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 181, 246, 0.4) transparent;
  scroll-behavior: smooth;
}

.quick-links-grid::-webkit-scrollbar {
  height: 8px;
}

.quick-links-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.quick-links-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.4), rgba(129, 199, 132, 0.4));
  border-radius: 6px;
  transition: background-color 0.3s;
}

.quick-links-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.6), rgba(129, 199, 132, 0.6));
}

.quick-link-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.25) 100%);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1), 0 0 40px rgba(255, 255, 255, 0.1) inset;
  min-width: 140px;
  width: 140px;
  flex-shrink: 0;
  text-align: center;
}

.quick-link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(100, 181, 246, 0.2), transparent);
  transition: left 0.6s;
}

.quick-link-card:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.4) 100%);
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 80px rgba(100, 181, 246, 0.3);
  border-color: rgba(100, 181, 246, 0.6);
}

.quick-link-card:hover::before {
  left: 100%;
}

.quick-link-card:active {
  transform: translateY(0);
}

.quick-link-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 40px rgba(255, 255, 255, 0.1) inset;
  flex-shrink: 0;
  transition: transform 0.4s ease;
}

.quick-link-title {
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 链接区域 */
.links-section {
  border-radius: 20px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), 0 0 80px rgba(255, 255, 255, 0.1) inset;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-header .section-title {
  color: white;
  margin-bottom: 0;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sort-dropdown select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 4px;
}

.view-btn {
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
}

.view-btn.active {
  background: white;
  color: #4285f4;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.links-container {
  min-height: 400px;
}

/* 链接网格视图 */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* 链接列表视图 */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.links-list .link-card {
  display: flex;
  align-items: center;
  padding: 16px;
}

.links-list .link-card-header {
  margin-right: 16px;
  margin-bottom: 0;
}

.links-list .link-card-body {
  flex: 1;
  margin-bottom: 0;
}

/* 空状态样式 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #6b7280;
  text-align: center;
}

.empty-state .empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 24px;
  opacity: 0.7;
}

/* 加载和错误状态 */
.loading-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #6b7280;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #4285f4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

/* 背景装饰 */
.background-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* 壁纸背景 */
.wallpaper-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -4;
  transition: opacity 0.5s ease;
  opacity: 0;
}

.wallpaper-background.active {
  opacity: 1;
}

/* 壁纸设置相关样式 */
.wallpaper-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 8px;
  padding: 8px 0;
}

.wallpaper-option {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wallpaper-option input[type="radio"] {
  display: none;
}

.wallpaper-thumbnail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.wallpaper-thumbnail img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
}

.wallpaper-thumbnail .default-wallpaper {
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, #a8e6cf 0%, #7fcdcd 25%, #81c784 50%, #64b5f6 75%, #9fa8da 100%);
  border-radius: 6px;
  border: 2px solid transparent;
}

.wallpaper-thumbnail span {
  margin-top: 6px;
  font-size: 12px;
  text-align: center;
  color: #4a5568;
}

.wallpaper-option input[type="radio"]:checked + label .wallpaper-thumbnail img,
.wallpaper-option input[type="radio"]:checked + label .wallpaper-thumbnail .default-wallpaper {
  border-color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3);
  transform: scale(1.05);
}

.wallpaper-option label {
  cursor: pointer;
  width: 100%;
}

.decoration {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 6s ease-in-out infinite;
}

.decoration-1 {
  width: 100px;
  height: 100px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.decoration-2 {
  width: 150px;
  height: 150px;
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.decoration-3 {
  width: 80px;
  height: 80px;
  bottom: 30%;
  left: 70%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-15px) rotate(120deg); }
  66% { transform: translateY(-10px) rotate(240deg); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(100, 181, 246, 0.3); }
  50% { box-shadow: 0 0 40px rgba(129, 199, 132, 0.5), 0 0 60px rgba(100, 181, 246, 0.3); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* 模态框增强 */
.modal {
  backdrop-filter: blur(5px);
}

/* 删除确认模态框特殊层级设置 */
#deleteCategoryModal,
#deleteLinkModal {
  z-index: 1100 !important;
  background: rgba(0, 0, 0, 0.6);
}

/* 管理分类模态框层级 */
#manageCategoryModal {
  z-index: 1000 !important;
}

.modal-content {
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* 设置面板 */
.settings-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 24px;
}

.settings-tab {
  padding: 12px 24px;
  border: none;
  background: none;
  cursor: pointer;
  color: #6b7280;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.settings-tab.active {
  color: #4285f4;
  border-bottom-color: #4285f4;
}

.settings-content {
  min-height: 300px;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.personal-settings {
  /* 个人信息设置面板样式 */
  display: block;
  padding: 20px 0;
}

.setting-item {
  margin-bottom: 24px;
}

.setting-item label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #374151;
}

.setting-item select,
.setting-item input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.setting-item small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-danger:hover {
  background: #dc2626;
}

/* 深色主题 */
[data-theme="dark"] {
  background: transparent;
}

[data-theme="dark"] .newtab-header {
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.3) 0%, rgba(31, 41, 55, 0.2) 100%);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 80px rgba(139, 92, 246, 0.1) inset;
}

[data-theme="dark"] .app-title,
[data-theme="dark"] .time-display {
  color: #f7fafc;
}

[data-theme="dark"] .time {
  color: #bfdbfe;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .year-month-date {
  color: #cbd5e0;
}

[data-theme="dark"] .weekday {
  color: #9ca3af;
}

[data-theme="dark"] .stat-label {
  color: #e2e8f0;
}

[data-theme="dark"] .stat-unit {
  color: #cbd5e0;
}

[data-theme="dark"] .stat-comment {
  color: #9ca3af;
}

[data-theme="dark"] .main-search {
  background: rgba(45, 55, 72, 0.3);
  color: #e2e8f0;
}

[data-theme="dark"] .main-search:focus {
  background: rgba(45, 55, 72, 0.5);
}

[data-theme="dark"] .header-btn {
  background: rgba(45, 55, 72, 0.3);
  color: #e2e8f0;
}

[data-theme="dark"] .btn-add-category {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .btn-add-category:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 6px 20px rgba(96, 165, 250, 0.4);
}

[data-theme="dark"] .category-tab {
  background: rgba(45, 55, 72, 0.3);
  color: #cbd5e0;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar {
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.4) 0%, rgba(31, 41, 55, 0.3) 100%);
  border-right-color: rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .category-tab.active {
  background: linear-gradient(135deg, #74b9ff 0%, #64b5f6 100%);
  color: white;
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.4), 0 0 60px rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .category-count {
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
}

[data-theme="dark"] .category-delete-btn {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.4);
}

[data-theme="dark"] .category-delete-btn .icon {
  color: #f87171;
}

[data-theme="dark"] .category-delete-btn:hover {
  background: rgba(248, 113, 113, 0.3);
  border-color: rgba(248, 113, 113, 0.6);
}

[data-theme="dark"] .section-header .section-title,
[data-theme="dark"] .section-title {
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .section-title .icon,
[data-theme="dark"] .promotion-section .icon {
  fill: white;
}

[data-theme="dark"] .view-toggle {
  background: #374151;
}

[data-theme="dark"] .view-btn.active {
  background: #4b5563;
  color: #60a5fa;
}

[data-theme="dark"] .quick-links-grid {
  scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
}

[data-theme="dark"] .quick-links-grid::-webkit-scrollbar-track {
  background: rgba(31, 41, 55, 0.2);
}

[data-theme="dark"] .quick-links-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(116, 185, 255, 0.4), rgba(100, 181, 246, 0.4));
}

[data-theme="dark"] .quick-links-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(116, 185, 255, 0.6), rgba(100, 181, 246, 0.6));
}

[data-theme="dark"] .quick-link-card {
  background: linear-gradient(135deg, rgba(75, 85, 99, 0.4) 0%, rgba(45, 55, 72, 0.3) 100%);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 40px rgba(139, 92, 246, 0.05) inset;
}

[data-theme="dark"] .quick-link-card:hover {
  background: linear-gradient(135deg, rgba(75, 85, 99, 0.6) 0%, rgba(45, 55, 72, 0.5) 100%);
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 80px rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .quick-link-card::before {
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
}

[data-theme="dark"] .quick-link-title {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .quick-access {
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.3) 0%, rgba(31, 41, 55, 0.2) 100%);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 80px rgba(139, 92, 246, 0.1) inset;
}

[data-theme="dark"] .links-section {
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.3) 0%, rgba(31, 41, 55, 0.2) 100%);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 80px rgba(139, 92, 246, 0.1) inset;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .main-content {
    padding: 24px 32px;
  }
  
  .links-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }
}

@media (max-width: 768px) {
  .newtab-header {
    padding: 16px 20px;
    flex-direction: column;
    gap: 16px;
  }
  
  .header-left {
    width: 100%;
    gap: 16px;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .main-layout {
    flex-direction: column;
    margin-left: 0; /* 小屏时右侧区域占满全部宽度 */
  }

  /* 防止右侧内容被裁剪，允许内容水平可见并保证居中 */
  .main-layout {
    overflow-x: visible;
  }
  
  .sidebar {
    /* 在窄屏时默认收起为抽屉样式，由 JS 控制打开 */
    width: 280px;
    height: 100vh;
    min-height: 0;
    transform: translateX(-110%);
    transition: transform 280ms ease;
    position: fixed;
    z-index: 200;
  }
  
  /* 保持纵向排列（column）以便触控滚动和可访问性 */
  .categories-scroll {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  .categories-nav {
    padding: 0 20px;
  }
  
  .main-content {
    padding: 16px 20px;
    margin: 0; /* 移除可能造成右侧空白的自动外边距 */
  }
  
  .links-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
  
  .quick-links-grid {
    margin: 0 -20px;
    padding: 16px 20px;
    gap: 16px;
    max-width: 1100px; /* 限制内容宽度并居中显示 */
    margin: 0 auto;
  }
  
  .section-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  
  .sidebar-actions {
    flex-direction: row;
    margin-top: 12px;
  }
  
  .btn-add-category,
  .btn-manage-category {
    flex: none;
    width: 40px;
    height: 40px;
  }

  /* 在移动端显示用于打开侧边栏的按钮（默认在 header 中） */
  .mobile-nav-btn {
    display: inline-flex;
  }

  /* 抽屉打开样式 */
  .sidebar.open {
    transform: translateX(0);
  }

  /* 背景遮罩 */
  .drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease;
    z-index: 150;
  }

  .drawer-backdrop.visible {
    opacity: 1;
    visibility: visible;
  }
}

/* 在更大屏幕隐藏移动导航按钮 */
.mobile-nav-btn { display: none; }

/* 悬浮侧边栏打开按钮（移动端） */
.sidebar-float-btn {
  position: fixed;
  bottom: 20px;
  left: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #64b5f6, #81c784);
  color: #fff;
  display: none; /* 仅在小屏显示，由 JS 控制可见性 */
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  z-index: 160;
  border: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  .sidebar-float-btn { display: inline-flex; }
  .sidebar.open + .drawer-backdrop + .sidebar-float-btn,
  .sidebar.open ~ .sidebar-float-btn {
    display: none; /* 打开抽屉时隐藏悬浮按钮（JS 也会处理） */
  }
}

/* 推广链接样式 */
.promotion-section {
  margin-top: 40px;
  border-radius: 24px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), 0 0 80px rgba(255, 255, 255, 0.1) inset;
}

.promotion-section .section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 24px;
  font-weight: 800;
  color: white;
  margin-bottom: 28px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.promotion-section .icon {
  width: 28px;
  height: 28px;
  fill: white;
}

.promotion-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.promotion-item {
  flex: 1;
  min-width: 240px;
  max-width: 320px;
}

.promotion-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.15) 0%, rgba(129, 199, 132, 0.1) 100%);
  backdrop-filter: blur(15px);
  border: 1.5px solid rgba(100, 181, 246, 0.3);
  border-radius: 20px;
  text-decoration: none;
  color: #2d3748;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 30px rgba(100, 181, 246, 0.15);
}

.promotion-link:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 50px rgba(100, 181, 246, 0.4);
  border-color: rgba(100, 181, 246, 0.6);
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.25) 0%, rgba(129, 199, 132, 0.2) 100%);
}

.promotion-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  min-height: 0; /* 允许内容按需要收缩，避免强制高度 */
  overflow: hidden; /* 防止长文本撑开布局 */
}

.promotion-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: white;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.promotion-url {
  font-size: 14px;
  opacity: 0.8;
  margin: 0;
  color: #4a5568;
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.promotion-icon {
  margin-left: 16px;
  opacity: 0.7;
  transition: opacity 0.3s, transform 0.3s;
  color: #64b5f6;
}

.promotion-link:hover .promotion-icon {
  opacity: 1;
  transform: translateX(4px) scale(1.1);
}

/* 深色主题下的推广链接 */
[data-theme="dark"] .promotion-section {
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.4) 0%, rgba(31, 41, 55, 0.3) 100%);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 80px rgba(139, 92, 246, 0.05) inset;
}

[data-theme="dark"] .promotion-section .section-title {
  color: white;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .promotion-link {
  background: linear-gradient(135deg, rgba(116, 185, 255, 0.2) 0%, rgba(100, 181, 246, 0.15) 100%);
  border-color: rgba(139, 92, 246, 0.4);
  color: #e2e8f0;
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .promotion-link:hover {
  background: linear-gradient(135deg, rgba(116, 185, 255, 0.3) 0%, rgba(100, 181, 246, 0.25) 100%);
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 16px 50px rgba(139, 92, 246, 0.4);
}

[data-theme="dark"] .promotion-title {
  color: white;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .promotion-url {
  color: #cbd5e1;
}

[data-theme="dark"] .promotion-icon {
  color: #8b5cf6;
}

/* 添加链接模态框左右布局样式 */
.add-link-layout {
  display: flex;
  gap: 30px; 
  height: 100%;
}

.quick-add-tips {
  flex: 1;
  min-width: 280px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 12px; 
  padding: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tip-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.tip-content h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
}

.tip-content p {
  margin: 0;
  font-size: 13px;
  color: #4a5568;
  line-height: 1.5;
}

.add-link-form {
  flex: 1.5;
  min-width: 320px;
}

.add-link-main {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.add-link-sidebar {
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-left: 20px;
  border-left: 1px solid #e5e7eb;
}

[data-theme="dark"] .add-link-sidebar {
  border-left-color: #374151;
}

.logo-settings {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.right-click-tip {  
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.quick-icon-tip {  
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .right-click-tip,
[data-theme="dark"] .quick-icon-tip {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .quick-add-tips {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tip-item {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .tip-content h4 {
  color: #e2e8f0;
}

[data-theme="dark"] .tip-content p {
  color: #a0aec0;
}

/* 响应式设计：小屏幕上左右布局变为上下布局 */
@media (max-width: 768px) {
  .edit-link-layout {
    flex-direction: column;
  }
  
  .edit-link-main,
  .edit-link-sidebar {
    min-width: unset;
    width: 100%;
  }
}

/* 编辑链接模态框左右布局样式 */
.edit-link-layout {
  display: flex;
  gap: 30px;
  padding: 20px;
  height: 100%;
}

.edit-link-main {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.edit-link-sidebar {
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-left: 20px;
  border-left: 1px solid #e5e7eb;
}

[data-theme="dark"] .edit-link-sidebar {
  border-left-color: #374151;
}

/* 响应式设计：小屏幕上左右布局变为上下布局 */
@media (max-width: 768px) {
  .add-link-layout {
    flex-direction: column;
  }
  
  .add-link-main,
  .add-link-sidebar {
    min-width: unset;
    width: 100%;
    padding-left: 0;
    border-left: none;
  }
}

/* 编辑链接模态框左右布局样式 */
.edit-link-layout {
  display: flex;
  gap: 24px;
  height: 100%;
}

.edit-link-tips {
  flex: 1;
  min-width: 280px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.edit-link-form {
  flex: 1.5;
  min-width: 320px;
}

[data-theme="dark"] .edit-link-tips {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 响应式设计：小屏幕上左右布局变为上下布局 */
@media (max-width: 768px) {
  .edit-link-layout {
    flex-direction: column;
  }
  
  .edit-link-tips,
  .edit-link-form {
    min-width: unset;
    width: 100%;
  }
}