/* ==================== 主题配置 ==================== */

/* 深色科技主题（默认） */
:root {
  --bg-body: #0a0f1a;
  --bg-container: #0d1829;
  --bg-card: #152238;
  --bg-card-hover: #1a2d4a;
  --bg-input: #0d1829;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --text-primary: #e8edf5;
  --text-secondary: #7b8ba8;
  --text-muted: #4a5a78;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --accent-light: rgba(59, 130, 246, 0.15);
  --border: #1e3a5f;
  --border-hover: #3b82f6;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --gradient-text: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  --category-bg: rgba(59, 130, 246, 0.1);
  --category-active: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --success: #22c55e;
  --badge-text: #ffffff;
}

/* 温润米色主题 */
[data-theme="warm"] {
  --bg-body: #f5ebe0;
  --bg-container: #faf6f1;
  --bg-card: #ffffff;
  --bg-card-hover: #fefcfa;
  --bg-input: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --text-primary: #5c4033;
  --text-secondary: #8b7355;
  --text-muted: #a89078;
  --accent: #c9a66b;
  --accent-glow: rgba(201, 166, 107, 0.25);
  --accent-light: rgba(201, 166, 107, 0.15);
  --border: #e8dfd3;
  --border-hover: #c9a66b;
  --shadow: 0 4px 20px rgba(92, 64, 51, 0.08);
  --shadow-lg: 0 8px 40px rgba(92, 64, 51, 0.12);
  --radius: 12px;
  --gradient-text: linear-gradient(135deg, #c9a66b 0%, #a67c52 100%);
  --category-bg: rgba(201, 166, 107, 0.12);
  --category-active: linear-gradient(135deg, #c9a66b 0%, #b8935a 100%);
  --success: #c9a66b;
  --badge-text: #ffffff;
}

/* 咖色高雅主题 */
[data-theme="coffee"] {
  --bg-body: #1a0f0a;
  --bg-container: #2a1810;
  --bg-card: #3d2317;
  --bg-card-hover: #4a2c1c;
  --bg-input: #3d2317;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --text-primary: #e8d5c4;
  --text-secondary: #b8997a;
  --text-muted: #8b7355;
  --accent: #c9a66b;
  --accent-glow: rgba(201, 166, 107, 0.25);
  --accent-light: rgba(201, 166, 107, 0.15);
  --border: #5c3a24;
  --border-hover: #c9a66b;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --gradient-text: linear-gradient(135deg, #ddb87a 0%, #c9a66b 100%);
  --category-bg: rgba(201, 166, 107, 0.12);
  --category-active: linear-gradient(135deg, #c9a66b 0%, #b8935a 100%);
  --success: #c9a66b;
  --badge-text: #ffffff;
}

/* 墨绿高雅主题 */
[data-theme="forest"] {
  --bg-body: #0a1612;
  --bg-container: #0f201a;
  --bg-card: #152f24;
  --bg-card-hover: #1a3a2c;
  --bg-input: #152f24;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --text-primary: #e0f0e8;
  --text-secondary: #8fb8a0;
  --text-muted: #5a8a70;
  --accent: #4ade80;
  --accent-glow: rgba(74, 222, 128, 0.25);
  --accent-light: rgba(74, 222, 128, 0.15);
  --border: #1e4a38;
  --border-hover: #4ade80;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --gradient-text: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  --category-bg: rgba(74, 222, 128, 0.12);
  --category-active: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  --success: #22c55e;
  --badge-text: #ffffff;
}

/* 浅粉色主�?*/
[data-theme="pink"] {
  --bg-body: #fdf2f8;
  --bg-container: #fff5fa;
  --bg-card: #ffffff;
  --bg-card-hover: #fce7f3;
  --bg-input: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.03);
  --text-primary: #831843;
  --text-secondary: #9d174d;
  --text-muted: #be185d;
  --accent: #ec4899;
  --accent-glow: rgba(236, 72, 153, 0.25);
  --accent-light: rgba(236, 72, 153, 0.12);
  --border: #fce7f3;
  --border-hover: #ec4899;
  --shadow: 0 4px 20px rgba(131, 24, 67, 0.08);
  --shadow-lg: 0 8px 40px rgba(131, 24, 67, 0.12);
  --radius: 12px;
  --gradient-text: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
  --category-bg: rgba(236, 72, 153, 0.1);
  --category-active: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  --success: #ec4899;
  --badge-text: #ffffff;
}

/* 紫色高雅主题 */
[data-theme="purple"] {
  --bg-body: #0f0a1a;
  --bg-container: #1a1229;
  --bg-card: #251a3d;
  --bg-card-hover: #2f2250;
  --bg-input: #251a3d;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --text-primary: #e8e0f5;
  --text-secondary: #b8a8d0;
  --text-muted: #8b7aa8;
  --accent: #a78bfa;
  --accent-glow: rgba(167, 139, 250, 0.3);
  --accent-light: rgba(167, 139, 250, 0.15);
  --border: #3d2a5c;
  --border-hover: #a78bfa;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --gradient-text: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%);
  --category-bg: rgba(167, 139, 250, 0.15);
  --category-active: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  --success: #8b5cf6;
  --badge-text: #ffffff;
}

/* 黑白淡雅主题 */
[data-theme="minimal"] {
  --bg-body: #f8f9fa;
  --bg-container: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5f5;
  --bg-input: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --accent: #333333;
  --accent-glow: rgba(51, 51, 51, 0.1);
  --accent-light: rgba(51, 51, 51, 0.08);
  --border: #e5e5e5;
  --border-hover: #333333;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --gradient-text: linear-gradient(135deg, #333333 0%, #666666 100%);
  --category-bg: rgba(0, 0, 0, 0.04);
  --category-active: linear-gradient(135deg, #333333 0%, #1a1a1a 100%);
  --success: #333333;
  --badge-text: #ffffff;
}

/* ==================== 基础样式 ==================== */

/* 设置模态框样式 */
.settings-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--category-bg);
  border-radius: 8px;
}

.settings-section-title span {
  font-size: 1.1rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.3s ease;
  display: flex;
  gap: 12px;
}

.settings-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.settings-card-full {
  grid-column: 1 / -1;
}

.settings-card-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--category-bg);
  border-radius: 8px;
  flex-shrink: 0;
}

.settings-card-content {
  flex: 1;
}

.settings-card-content h5 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.settings-card .btn {
  font-size: 0.8rem;
  padding: 6px 12px;
}

/* 切换开�?*/
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch label {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .4s;
  border-radius: 24px;
}

.toggle-switch label:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.toggle-switch input:checked + label {
  background-color: var(--accent);
}

.toggle-switch input:checked + label:before {
  transform: translateX(24px);
}

/* 键盘快捷�?*/
.keyboard-shortcut {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.keyboard-shortcut .key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: var(--category-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 24px;
  text-align: center;
}

/* 关于信息 */
.settings-about {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 响应式调�?*/
@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .settings-card {
    flex-direction: row;
  }
  
  .settings-card-content h5 {
    font-size: 0.85rem;
  }
  
  .settings-card-desc {
    font-size: 0.75rem;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================== 主容�?==================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* ==================== 头部区域（简洁版�?==================== */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 100;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* ==================== 工具�?==================== */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-container);
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

/* 搜索�?*/
.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 360px;
  min-width: 180px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: text;
}

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

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 4px 12px rgba(59, 130, 246, 0.2);
  transform: scale(1.02);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.search-wrapper:hover .search-icon {
  transform: translateY(-50%) scale(1.1);
  color: var(--accent);
  opacity: 1;
}

.shortcut-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-body);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* 按钮�?*/
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.96);
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--category-active);
  color: white;
}

.btn-primary:hover {
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: 1px solid #ef4444;
}

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

.btn-icon {
  padding: 10px 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
  border-color: var(--accent);
}

/* 主题切换按钮动画 */
.btn-icon.theme-btn {
  transition: all 0.3s ease;
  position: relative;
}

.btn-icon.theme-btn:hover {
  transform: rotate(180deg);
}

.btn-icon.theme-btn.spinning {
  animation: themeSpin 0.5s ease;
}

@keyframes themeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 主题菜单 */
.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-container);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.2s ease;
}

.theme-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.theme-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.theme-menu-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.theme-menu-item.active {
  background: var(--category-bg);
  color: var(--accent);
  font-weight: 500;
}

.theme-menu-item .theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.theme-menu-item.active .theme-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* 导航跟随开�?*/
.nav-sticky-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-sticky-toggle label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sticky-switch {
  position: relative;
  width: 36px;
  height: 20px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.sticky-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.sticky-switch:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.sticky-switch:checked::after {
  left: 18px;
  background: white;
}

/* ==================== 分类导航 ==================== */

.category-nav {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-container);
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.3s ease;
}

.category-nav-inner {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.category-nav.collapsed .category-nav-inner {
  flex-wrap: nowrap;
  overflow: hidden;
  max-height: 40px;
  mask-image: linear-gradient(to right, black calc(100% - 60px), transparent);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 60px), transparent);
}

.category-nav.expanded .category-nav-inner {
  flex-wrap: wrap;
  mask-image: none;
  -webkit-mask-image: none;
}

.category-expand-btn {
  display: none;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}

.category-expand-btn:hover {
  background: var(--category-bg);
  border-color: var(--accent);
}

.category-nav.needs-expand .category-expand-btn {
  display: inline-flex;
}

/* 导航跟随 sticky */
.header.sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--bg-container);
  padding: 12px 16px;
  margin: -4px -8px 16px;
  border-radius: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.category-tag {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

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

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

.category-tag:hover {
  background: var(--category-bg);
  color: var(--accent);
  transform: translateY(-2px);
}

.category-tag.active {
  background: var(--category-active);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.category-tag .icon {
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

iconify-icon {
  vertical-align: middle;
}

/* ==================== 链接网格 ==================== */

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* 链接卡片 */
.link-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}

.link-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(167, 139, 250, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.link-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.link-card:hover::after {
  opacity: 1;
}

/* 卡片图标动画 */
.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg-container);
  padding: 4px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.link-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
}

/* 卡片内容动画 */
.card-title, .card-description, .card-categories {
  transition: all 0.3s ease;
}

.link-card:hover .card-title {
  color: var(--accent);
  transform: translateX(4px);
}

.link-card:hover .card-description {
  color: var(--text-primary);
}

.subcategory-section {
  grid-column: 1 / -1;
  margin-top: 24px;
  margin-bottom: 4px;
}

.subcategory-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  padding: 6px 0 6px 14px;
  margin: 0 0 14px 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid var(--accent);
}

.subcategory-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
  margin-left: 8px;
}

/* 添加卡片样式 */
.add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.add-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.add-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(167, 139, 250, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.add-card:hover::after {
  opacity: 1;
}

.add-card-content {
  text-align: center;
  color: var(--text-secondary);
}

.add-icon {
  margin: 0 auto 12px;
  transition: all 0.2s ease;
}

.add-card:hover .add-icon svg path {
  stroke: var(--accent);
}

.add-card p {
  margin: 0;
  font-size: 0.9rem;
}

.emoji-quick-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}

.emoji-quick-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.15);
}

/* 自定义工具卡片样式已移除，与其他卡片保持一�?*/

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  position: relative;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-badge {
  font-size: 0.65rem;
  padding: 3px 8px;
  background: var(--category-active);
  color: var(--badge-text, #ffffff);
  border-radius: 10px;
  font-weight: 500;
  flex-shrink: 0;
}

.top-badge {
  background: var(--success, #22c55e);
  color: var(--badge-text, #ffffff);
  margin-right: 6px;
}

.link-card.top {
  border: 1px solid var(--success);
  /** box-shadow: 0 0 20px rgba(34, 197, 94, 0.2); **/
}

.link-card.top::after {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(52, 211, 153, 0.1));
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-category {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  display: inline-block;
  margin-right: 8px;
}

.card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* 卡片操作按钮 */
.card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  gap: 4px;
  z-index: 10;
}

.link-card:hover .card-actions {
  display: flex;
}

/* 拖动手柄样式 */

.drag-handle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: grab;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 1rem;
  z-index: 5;
}

.link-card:hover .drag-handle {
  opacity: 1;
}

.drag-handle:hover {
  background: var(--bg-container);
  color: var(--accent);
}

.drag-handle:active {
  cursor: grabbing;
}

.card-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: none;
  background: var(--bg-container);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.card-action-btn:hover {
  background: var(--accent);
  color: white;
}

.card-action-btn.delete:hover {
  background: #ef4444;
}

/* ==================== 模态框 ==================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  display: flex;
}

.modal {
  background: var(--bg-container);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--border);
}

.modal-body {
  padding: 20px;
}

/* 文章类型切换 */
.article-type-toggle {
  display: flex !important;
  gap: 8px;
  margin-top: 8px;
}

.toggle-option {
  flex: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.toggle-option input[type="radio"] {
  margin: 0;
  accent-color: var(--accent);
}

.toggle-option:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.toggle-option .toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
}

/* 搜索模态框 */
.search-modal {
  max-width: 700px;
}

.search-modal .modal-body {
  padding: 16px 20px;
}

.search-modal .search-input {
  margin-bottom: 12px;
}

/* 搜索分类导航 */
.search-category-nav {
  margin-bottom: 16px;
}

.category-scroll-container {
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-card);
}

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

.category-scroll-container::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: 2px;
}

.category-scroll-container::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}

.category-scroll-content {
  display: inline-flex;
  gap: 8px;
  padding-bottom: 8px;
}

.search-category-nav .category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--category-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.search-category-nav .category-tag:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.search-category-nav .category-tag.active {
  background: var(--category-active);
  color: white;
  border-color: var(--accent);
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  animation: fadeInUp 0.3s ease forwards;
}

.search-result-item:hover {
  background: var(--bg-card-hover);
  transform: translateX(8px);
}

.search-result-item .card-icon {
  width: 32px;
  height: 32px;
}

/* 搜索结果中的分类分组 */
.search-category-section {
  margin-bottom: 20px;
}

.search-category-section:last-child {
  margin-bottom: 0;
}

.search-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.search-category-title .icon {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}

.search-category-title .count {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

.search-category-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==================== 表单 ==================== */

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  position: relative;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
  transform: translateY(-2px);
}

.form-textarea {
  min-height: 90px;
  resize: vertical;
}

.form-select {
  cursor: pointer;
}

/* ==================== 页脚 ==================== */

.footer {
  padding: 40px 20px 30px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--bg-container);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* 友情链接部分 */
.footer-links {
  margin-bottom: 30px;
  text-align: center;
}

.footer-links h4 {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
  letter-spacing: 0.5px;
}

.footer-links h4::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--gradient-text);
  border-radius: 2px;
}

.footer-links h4::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-text);
  border-radius: 2px;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.footer-links-grid a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
}

.footer-links-grid a:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.footer-links-grid a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(167, 139, 250, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.footer-links-grid a:hover::after {
  opacity: 1;
}

/* 版权信息部分 */
.footer-copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.footer-filing {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-filing a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-filing a:hover {
  color: var(--accent);
}

/* ==================== 文章列表 ==================== */

.articles-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

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

.section-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0;
}

.article-categories-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.article-categories-list::-webkit-scrollbar {
  display: none;
}

.article-category-item {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  border: 1px solid var(--border);
}

.article-category-item:hover {
  background: var(--category-bg);
  color: var(--accent);
  transform: translateY(-2px);
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .article-categories-list {
    width: 100%;
    flex-wrap: nowrap;
  }
  
  .article-category-item {
    flex: none;
    text-align: left;
  }
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: cardIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 为不同卡片设置不同的动画延迟 */
.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }

.article-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(167, 139, 250, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.article-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  border-color: var(--accent);
}

.article-card:hover::after {
  opacity: 1;
}

.article-cover {
  height: 150px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card);
  transition: transform 0.5s ease;
  overflow: hidden;
  padding: 12px;
  border: 4px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.article-card:hover .article-cover {
  transform: scale(1.1);
}

.articles-grid.list .article-card:hover .article-cover {
  transform: none;
}

.article-content {
  padding: 24px 32px;
  position: relative;
  line-height: 1.8;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.article-content h1 { font-size: 1.8rem; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.article-content h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.article-content h3 { font-size: 1.25rem; }
.article-content h4 { font-size: 1.1rem; }
.article-content h5 { font-size: 1rem; }
.article-content h6 { font-size: 0.9rem; color: var(--text-secondary); }

.article-content p {
  margin-bottom: 16px;
  line-height: 1.9;
}

.article-content a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s;
}

.article-content a:hover {
  text-decoration: underline;
}

.article-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.article-content em {
  font-style: italic;
}

.article-content ul,
.article-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.article-content ul li {
  list-style-type: disc;
  margin-bottom: 6px;
}

.article-content ol li {
  list-style-type: decimal;
  margin-bottom: 6px;
}

.article-content li ul,
.article-content li ol {
  margin-top: 6px;
  margin-bottom: 0;
}

.article-content ul ul li { list-style-type: circle; }
.article-content ul ul ul li { list-style-type: square; }

.article-content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  margin: 0 2px;
  border-radius: 4px;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.article-content pre {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.6;
  position: relative;
}

.article-content pre code {
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  font-size: 0.9rem;
  line-height: 1.7;
  display: block;
}

.article-content blockquote {
  margin: 20px 0;
  padding: 12px 20px;
  border-left: 4px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

.article-content blockquote p {
  margin-bottom: 8px;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
  display: block;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-content th,
.article-content td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
}

.article-content th {
  background: var(--bg-card);
  font-weight: 600;
  color: var(--text-primary);
}

.article-content td {
  color: var(--text-secondary);
}

.article-content tr:nth-child(even) td {
  background: var(--bg-card);
}

.article-content mark {
  background: var(--accent);
  color: white;
  padding: 2px 4px;
  border-radius: 2px;
}

.article-content .task-list-item {
  list-style-type: none;
  margin-left: -20px;
}

.article-content input[type="checkbox"] {
  margin-right: 8px;
  vertical-align: middle;
}

.article-top-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 1;
}

.article-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.4;
  transition: all 0.3s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-title .external-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

.article-card:hover .article-title .external-badge {
  background: var(--accent);
  color: #fff;
}

.article-card.is-external {
  cursor: pointer;
}

.article-card.is-external::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.article-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.article-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all 0.3s ease;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.article-category {
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* 列表式文章布局 */
.articles-grid.list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.articles-grid.list .article-card {
  padding: 0;
  transform: none;
  display: flex;
  flex-direction: row;
  min-height: 140px;
}

.articles-grid.list .article-card:hover {
  transform: translateX(8px);
}

.articles-grid.list .article-cover {
  width: 200px;
  height: 150px;
  flex-shrink: 0;
  margin: 16px;
  border-radius: 12px;
  background-color: var(--bg-card);
  padding: 12px;
  border: 4px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  object-fit: cover;
}

.articles-grid.list .article-card.no-cover .article-cover {
  display: none;
}

.articles-grid.list .article-card.no-cover .article-content {
  padding: 20px;
}

.articles-grid.list .article-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 20px 12px 0;
}

.articles-grid.list .article-top-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

.articles-grid.list .article-title {
  font-size: 1.15rem;
}

.articles-grid.list .article-excerpt {
  -webkit-line-clamp: 2;
  font-size: 0.9rem;
}

.articles-grid.list .article-meta {
  margin-top: auto;
}

@media (max-width: 768px) {
  .articles-grid.list {
    grid-template-columns: 1fr;
  }

  .articles-grid.list .article-card {
    flex-direction: column;
  }

  .articles-grid.list .article-cover {
    width: 100%;
    height: 150px;
    min-height: 150px;
  }

  .articles-grid.list .article-card:hover {
    transform: translateY(-4px) scale(1.01);
  }
}

.article-card:hover .article-title {
  color: var(--accent);
  transform: translateX(4px);
}

.article-card:hover .article-title::after {
  width: 100%;
}

.article-card:hover .article-excerpt {
  color: var(--text-primary);
}

.article-card:hover .article-category {
  background: var(--category-active);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* 文章详情模态框 */
.article-modal {
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
}

/* 响应式调�?*/
@media (max-width: 768px) {
  .article-card {
    transition: all 0.2s ease;
  }
  
  .article-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }
  
  .article-cover {
    height: 150px;
  }
  
  .article-card:hover .article-cover {
    transform: scale(1.05);
  }
  
  .article-card:hover .article-title {
    transform: translateX(2px);
  }
  
  .article-title {
    font-size: 1rem;
  }
  
  .article-excerpt {
    font-size: 0.8rem;
  }
}

.article-modal .article-cover {
  height: 250px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.article-modal .article-full-content {
  padding: 24px;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-modal .article-full-content p {
  margin-bottom: 16px;
}

.article-modal .article-meta {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* ==================== 空状�?==================== */

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ==================== 图标选择�?==================== */

.icon-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-preview {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
}

.icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.icon-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.icon-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  background: var(--bg-card);
}

.icon-picker-item:hover {
  background: var(--category-bg);
  border-color: var(--border);
  transform: scale(1.1);
}

.icon-picker-item.selected {
  border-color: var(--accent);
  background: var(--accent-light, rgba(99, 102, 241, 0.1));
  box-shadow: 0 0 0 1px var(--accent);
}

/* 固定头部样式 */
.fixed-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-container);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fixed-header .mobile-menu-btn {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  display: none;
}

.fixed-header .logo {
  font-size: 1.2rem;
  margin: 0;
  flex: 1;
  text-align: center;
}

/* 移动端菜单按�?*/
.mobile-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  color: var(--text-primary);
  transition: all 0.2s ease;
  display: none;
}

.mobile-menu-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

/* 侧边分类菜单 */
.category-sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100vh;
  background: var(--bg-container);
  border-right: 1px solid var(--border);
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
}

.category-sidebar.active {
  left: 0;
}

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

.sidebar-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.sidebar-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.sidebar-close:hover {
  background: var(--border);
}

.sidebar-nav {
  padding: 20px;
}

.sidebar-section-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.sidebar-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav .category-tag {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  border-radius: 8px;
}

/* ==================== 响应式设�?==================== */

.mobile-search-bar {
  display: none;
}

.mobile-action-bar {
  display: none;
}

@media (max-width: 768px) {
  .container {
    padding: 80px 12px 32px;
  }

  .fixed-header {
    display: flex;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }

  .fixed-header .mobile-menu-btn {
    display: flex;
  }

  .mobile-menu-btn {
    display: none;
  }

  .header {
    display: none;
  }

  .mobile-search-bar {
    display: flex;
    width: 100%;
    margin-bottom: 16px;
  }

  .mobile-search-bar .search-wrapper {
    max-width: 100%;
    flex: 1;
  }

  .mobile-action-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-around;
    background: var(--bg-container);
    border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  }

  .mobile-bar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 16px;
    min-width: 64px;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bar-btn:active {
    color: var(--accent);
  }

  .mobile-bar-label {
    font-size: 0.65rem;
    line-height: 1;
    color: inherit;
  }

  .mobile-bar-add {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    margin-top: -18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bar-add:active {
    transform: scale(0.92);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .search-wrapper {
    max-width: 100%;
  }

  .btn-group {
    justify-content: center;
  }

  .links-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .link-card {
    padding: 16px;
  }

  .category-nav {
    display: none;
  }

  .card-action-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .link-card {
    -webkit-tap-highlight-color: transparent;
  }

  .category-tag,
  .btn {
    min-height: 44px;
    padding: 10px 16px;
  }

  .container {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
  }

  .back-to-top {
    display: flex;
    bottom: 90px;
  }
}

/* 桌面端隐藏固定头�?*/
@media (min-width: 769px) {
  .fixed-header {
    display: none;
  }
  
  #siteTitle {
    display: none;
  }
}

.back-to-top {
  display: none;
  position: fixed;
  bottom: 140px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ==================== 动画 ==================== */

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

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .link-card, .article-card {
    animation: none !important;
  }
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 12px 24px;
  z-index: 10001;
  font-size: 1rem;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* 加载动画 */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  padding: 20px;
}

.skeleton-card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
  animation: shimmer 1.5s infinite;
  background-image: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-container) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--border);
  margin-bottom: 12px;
}

.skeleton-title {
  height: 18px;
  width: 60%;
  border-radius: 4px;
  background: var(--border);
  margin-bottom: 10px;
}

.skeleton-text {
  height: 14px;
  width: 90%;
  border-radius: 4px;
  background: var(--border);
  margin-bottom: 6px;
}

.skeleton-text-short {
  height: 14px;
  width: 50%;
  border-radius: 4px;
  background: var(--border);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 元素初始化动�?*/
.container > * {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.header { animation-delay: 0.1s; }
.toolbar { animation-delay: 0.2s; }
.category-nav { animation-delay: 0.3s; }
.links-grid { animation-delay: 0.4s; }
.articles-section { animation-delay: 0.5s; }
.footer { animation-delay: 0.6s; }

.link-card {
  animation: fadeInUp 0.3s ease forwards;
}

.article-card {
  animation: fadeInUp 0.3s ease forwards;
}

/* 滚动条美�?*/
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
