/* style.css - 宇宙粒子风格样式 */
/* ========== CSS Variables ========== */
:root {
  --bg-void: #030508;
  --bg-deep: #0a0e17;
  --bg-card: rgba(10, 15, 28, 0.45);
  --fg: #e4e8f0;
  --fg-muted: #6b7394;
  --accent-cyan: #00e5ff;
  --accent-magenta: #ff0080;
  --accent-blue: #2563eb;
  --accent-teal: #06b6d4;
  --glow-cyan: rgba(0, 229, 255, 0.6);
  --glow-magenta: rgba(255, 0, 128, 0.5);
  --border: rgba(0, 229, 255, 0.15);
  --scanline: rgba(0, 229, 255, 0.03);
}

/* ========== Reset & Base ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Exo 2', 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--bg-void);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
.font-tech { font-family: 'Orbitron', 'Exo 2', monospace; letter-spacing: 0.05em; }

/* ========== Canvas Layers ========== */
#cosmos-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 50; pointer-events: none; }
.nebula-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.nebula-1 {
  background: radial-gradient(ellipse 120% 80% at 10% 20%, rgba(37, 99, 235, 0.15), transparent 50%),
              radial-gradient(ellipse 60% 60% at 90% 80%, rgba(0, 229, 255, 0.1), transparent 40%);
}
.nebula-2 {
  background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(6, 182, 212, 0.08), transparent 60%);
  animation: nebulaPulse 20s ease-in-out infinite;
}
@keyframes nebulaPulse { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.2); } }
.scanline-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, var(--scanline) 2px, var(--scanline) 4px);
  opacity: 0.3;
}

/* ========== Main Layout ========== */
.app-container { position: relative; z-index: 10; min-height: 100vh; display: flex; flex-direction: column; }

/* ========== Header ========== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, rgba(3, 5, 8, 0.85), rgba(3, 5, 8, 0.6));
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner { max-width: 1400px; margin: 0 auto; padding: 1rem; display: flex; align-items: center; gap: 1rem; }

/* Logo */
.logo-section { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.logo-orb {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 229, 255, 0.3), transparent 50%),
              linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(37, 99, 235, 0.2));
  border: 2px solid rgba(0, 229, 255, 0.3);
  display: flex; align-items: center; justify-content: center; position: relative;
  animation: orbPulse 3s ease-in-out infinite;
}
@keyframes orbPulse { 0%, 100% { box-shadow: 0 0 20px var(--glow-cyan), inset 0 0 15px rgba(0, 229, 255, 0.2); } 50% { box-shadow: 0 0 35px var(--glow-cyan), inset 0 0 25px rgba(0, 229, 255, 0.3); } }
.logo-orb svg { width: 22px; height: 22px; stroke: var(--accent-cyan); }
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-family: 'Orbitron', monospace; font-size: 1.1rem; font-weight: 700; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-sub { font-size: 0.65rem; color: var(--fg-muted); letter-spacing: 0.2em; text-transform: uppercase; }

/* Page Switcher */
.page-switcher { display: flex; background: rgba(0, 229, 255, 0.05); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.page-btn { padding: 0.5rem 1rem; background: transparent; border: none; border-radius: 8px; color: var(--fg-muted); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.3s; }
.page-btn:hover { color: var(--fg); }
.page-btn.active { background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue)); color: var(--bg-void); font-weight: 600; }

/* Page Dropdown (Mobile) */
.page-dropdown { display: none; position: relative; }
.dropdown-toggle {
  display: flex; align-items: center; gap: 0.25rem;
  padding: 0.4rem 0.6rem;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
}
.dropdown-toggle:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.dropdown-toggle svg { width: 14px; height: 14px; transition: transform 0.3s; }
.page-dropdown.open .dropdown-toggle svg { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  min-width: 80px;
  background: rgba(10, 15, 28, 0.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 50;
  backdrop-filter: blur(10px);
}
.page-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--fg-muted);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}
.dropdown-item:hover { background: rgba(0, 229, 255, 0.1); color: var(--fg); }
.dropdown-item.active { background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue)); color: var(--bg-void); }

/* Search */
.search-section { flex: 1; max-width: 400px; }
.search-wrapper { position: relative; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--fg-muted); pointer-events: none; }
.search-input { width: 100%; background: rgba(0, 229, 255, 0.05); border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 1rem 0.75rem 2.75rem; font-size: 0.9rem; color: var(--fg); transition: all 0.3s; backdrop-filter: blur(8px); }
.search-input::placeholder { color: var(--fg-muted); }
.search-input:focus { outline: none; border-color: var(--accent-cyan); background: rgba(0, 229, 255, 0.08); box-shadow: 0 0 30px rgba(0, 229, 255, 0.2), inset 0 0 20px rgba(0, 229, 255, 0.05); }

/* Header Right */
.header-right { display: flex; align-items: center; gap: 1.5rem; flex-shrink: 0; }
.date-display { font-family: 'Orbitron', monospace; font-size: 0.85rem; color: var(--accent-cyan); text-shadow: 0 0 10px var(--glow-cyan); white-space: nowrap; }
.view-toggle { width: 36px; height: 36px; background: rgba(0, 229, 255, 0.05); border: 1px solid var(--border); border-radius: 8px; color: var(--fg-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; }
.view-toggle:hover { background: rgba(0, 229, 255, 0.1); border-color: var(--accent-cyan); color: var(--accent-cyan); }
.view-toggle svg { width: 18px; height: 18px; display: none; }
.view-toggle .icon-large { display: block; }
.view-toggle.medium .icon-large { display: none; }
.view-toggle.medium .icon-medium { display: block; }
.view-toggle.small .icon-large { display: none; }
.view-toggle.small .icon-small { display: block; }
.header-stats { display: flex; gap: 1.5rem; }
.stat-item { text-align: center; }
.stat-value { font-family: 'Orbitron', monospace; font-size: 1.25rem; font-weight: 700; color: var(--accent-cyan); text-shadow: 0 0 20px var(--glow-cyan); }
.stat-label { font-size: 0.65rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* Menu Toggle */
.menu-toggle { display: none; padding: 0.5rem; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--fg); cursor: pointer; transition: all 0.3s; }
.menu-toggle:hover { background: rgba(0, 229, 255, 0.1); border-color: var(--accent-cyan); }
.menu-toggle svg { width: 24px; height: 24px; }

/* ========== Main Content ========== */
.app-main { flex: 1; display: flex; max-width: 1400px; margin: 0 auto; width: 100%; }

/* Sidebar */
.app-sidebar { width: 260px; flex-shrink: 0; padding: 1.5rem 1rem; border-right: 1px solid var(--border); background: linear-gradient(90deg, rgba(3, 5, 8, 0.6), transparent); backdrop-filter: blur(8px); }
.sidebar-title { font-size: 0.7rem; font-weight: 600; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.15em; padding: 0 0.75rem; margin-bottom: 0.75rem; }
.category-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.category-item { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-radius: 10px; cursor: pointer; transition: all 0.3s; border: 1px solid transparent; }
.category-item::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 0; background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue)); border-radius: 2px; transition: height 0.3s; }
.category-item:hover { background: rgba(0, 229, 255, 0.05); }
.category-item.active { background: rgba(0, 229, 255, 0.1); border-color: rgba(0, 229, 255, 0.2); }
.category-item.active::before { height: 50%; }
.category-item.active .category-name { color: var(--accent-cyan); }
.category-info { display: flex; align-items: center; gap: 0.75rem; }
.category-icon { width: 20px; height: 20px; color: var(--fg-muted); transition: color 0.3s; }
.category-item.active .category-icon { color: var(--accent-cyan); }
.category-name { font-size: 0.9rem; color: var(--fg); transition: color 0.3s; }
.category-count { font-family: 'Orbitron', monospace; font-size: 0.7rem; padding: 0.2rem 0.5rem; background: rgba(37, 99, 235, 0.15); color: var(--accent-blue); border-radius: 20px; }

/* Content Area */
.content-area { flex: 1; padding: 1.5rem; min-width: 0; }
.section-header { margin-bottom: 1.5rem; }
.section-title { font-family: 'Orbitron', monospace; font-size: 1.5rem; font-weight: 700; background: linear-gradient(90deg, var(--fg), var(--accent-cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 0.25rem; }
.section-desc { color: var(--fg-muted); font-size: 0.9rem; }
.bookmarks-grid { display: block; }
.bookmarks-grid.medium .category-bookmarks { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.bookmarks-grid.small .category-bookmarks { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.4rem; }

/* Category Section */
.category-section { margin-bottom: 2rem; }
.category-section:last-child { margin-bottom: 0; }
.category-section-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'Orbitron', monospace; font-size: 1rem; font-weight: 600;
  color: var(--accent-cyan); margin-bottom: 1rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
}
.category-section-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.8;
}
.category-section-icon svg { width: 100%; height: 100%; }
.category-bookmarks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.bookmarks-grid.medium .category-bookmarks { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.bookmarks-grid.small .category-bookmarks { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.4rem; }

/* Single category mode (grid layout for direct cards) */
.bookmarks-grid:not(:has(.category-section)) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.bookmarks-grid.medium:not(:has(.category-section)) {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}
.bookmarks-grid.small:not(:has(.category-section)) {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.4rem;
}

/* ========== Bookmark Card ========== */
.bookmark-card {
  position: relative; background: var(--bg-card); border: 1px solid rgba(0, 229, 255, 0.2); border-radius: 16px; padding: 1.25rem;
  cursor: pointer; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px); box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); z-index: 15;
}
.bookmark-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent); opacity: 0; transition: opacity 0.3s; }
.bookmark-card::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 229, 255, 0.15), transparent 50%); opacity: 0; transition: opacity 0.5s; pointer-events: none; }
.bookmark-card:hover { transform: translateY(-6px) scale(1.02); border-color: rgba(0, 229, 255, 0.5); background: rgba(10, 20, 35, 0.55); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 229, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.bookmark-card:hover::before { opacity: 1; }
.bookmark-card:hover::after { opacity: 1; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.card-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(0, 229, 255, 0.08); border: 1px solid rgba(0, 229, 255, 0.2); display: flex; align-items: center; justify-content: center; transition: all 0.4s; }
.bookmark-card:hover .card-icon { transform: scale(1.1) rotate(5deg); border-color: var(--accent-cyan); box-shadow: 0 0 20px var(--glow-cyan); background: rgba(0, 229, 255, 0.2); }
.card-icon svg { width: 24px; height: 24px; stroke: var(--accent-cyan); }
.card-tag { font-family: 'Orbitron', monospace; font-size: 0.65rem; padding: 0.25rem 0.6rem; background: rgba(37, 99, 235, 0.2); border: 1px solid rgba(37, 99, 235, 0.3); color: var(--accent-teal); border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; }
.card-tag-small { display: none; font-family: 'Orbitron', monospace; font-size: 0.5rem; padding: 0.05rem 0.25rem; background: rgba(37, 99, 235, 0.2); border: 1px solid rgba(37, 99, 235, 0.3); color: var(--accent-teal); border-radius: 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.card-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.5rem; transition: color 0.3s; flex: 1; }
.bookmark-card:hover .card-title { color: var(--accent-cyan); }
.card-desc { font-size: 0.85rem; color: var(--fg-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.card-url { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--fg-muted); opacity: 0.8; }
.card-url svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Medium Mode */
.bookmarks-grid.medium .bookmark-card { padding: 0.75rem; border-radius: 10px; }
.bookmarks-grid.medium .bookmark-card:hover { transform: translateY(-2px) scale(1.01); }
.bookmarks-grid.medium .card-header { margin-bottom: 0.5rem; }
.bookmarks-grid.medium .card-icon { width: 32px; height: 32px; border-radius: 8px; }
.bookmarks-grid.medium .card-icon svg { width: 16px; height: 16px; }
.bookmarks-grid.medium .card-tag { font-size: 0.55rem; padding: 0.15rem 0.4rem; }
.bookmarks-grid.medium .card-title { font-size: 0.85rem; margin-bottom: 0.25rem; }
.bookmarks-grid.medium .card-desc { font-size: 0.75rem; -webkit-line-clamp: 1; line-height: 1.4; }
.bookmarks-grid.medium .card-footer { margin-top: 0.5rem; padding-top: 0.5rem; }
.bookmarks-grid.medium .card-url { font-size: 0.65rem; }

/* Small Mode */
.bookmarks-grid.small .bookmark-card { padding: 0.4rem 0.5rem; border-radius: 4px; }
.bookmarks-grid.small .bookmark-card:hover { transform: translateY(-1px); }
.bookmarks-grid.small .card-header { display: none; }
.bookmarks-grid.small .card-title-row { margin-bottom: 0; }
.bookmarks-grid.small .card-title { font-size: 0.75rem; margin-bottom: 0; font-weight: 500; }
.bookmarks-grid.small .card-tag { display: none; }
.bookmarks-grid.small .card-tag-small { display: block; font-size: 0.5rem; padding: 0.05rem 0.2rem; border-radius: 2px; }
.bookmarks-grid.small .card-desc { display: none; }
.bookmarks-grid.small .card-footer { margin-top: 0.15rem; padding-top: 0; border-top: none; }
.bookmarks-grid.small .card-url { font-size: 0.6rem; opacity: 0.5; }

/* Empty State */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { width: 80px; height: 80px; margin: 0 auto 1.5rem; border-radius: 50%; background: rgba(0, 229, 255, 0.1); display: flex; align-items: center; justify-content: center; animation: emptyPulse 2s ease-in-out infinite; }
@keyframes emptyPulse { 0%, 100% { box-shadow: 0 0 30px rgba(0, 229, 255, 0.2); } 50% { box-shadow: 0 0 50px rgba(0, 229, 255, 0.4); } }
.empty-icon svg { width: 40px; height: 40px; stroke: var(--accent-cyan); }
.empty-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.empty-desc { color: var(--fg-muted); font-size: 0.9rem; }

/* ========== FAB Add Button ========== */
.fab-add {
  position: fixed; bottom: 5rem; right: 2rem; width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s; box-shadow: 0 8px 32px rgba(0, 229, 255, 0.4); z-index: 90;
}
.fab-add:hover { transform: scale(1.1) rotate(90deg); box-shadow: 0 12px 40px rgba(0, 229, 255, 0.6), 0 0 0 8px rgba(0, 229, 255, 0.1); }
.fab-add svg { width: 28px; height: 28px; stroke: var(--bg-void); stroke-width: 2.5; }

/* ========== Footer ========== */
.app-footer { position: relative; z-index: 10; padding: 1rem; background: linear-gradient(0deg, rgba(3, 5, 8, 0.9), transparent); border-top: 1px solid var(--border); margin-top: auto; }
.footer-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.75rem; color: var(--fg-muted); }
.footer-inner a { color: var(--fg-muted); text-decoration: none; transition: color 0.3s; }
.footer-inner a:hover { color: var(--accent-cyan); }
.footer-inner .separator { color: rgba(107, 115, 148, 0.5); margin: 0 0.25rem; }
.police-record { display: inline-flex; align-items: center; gap: 0.35rem; }
.police-record svg { width: 14px; height: 14px; opacity: 0.7; }
.copyright a { color: var(--accent-cyan); }

/* ========== Modal ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(3, 5, 8, 0.9); backdrop-filter: blur(10px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; visibility: hidden; transition: all 0.3s; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { width: 100%; max-width: 480px; background: rgba(10, 15, 28, 0.85); border: 1px solid var(--border); border-radius: 20px; padding: 1.5rem; transform: translateY(20px) scale(0.95); transition: transform 0.3s; backdrop-filter: blur(20px); box-shadow: 0 0 50px rgba(0, 229, 255, 0.1); }
.modal-overlay.active .modal-content { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-family: 'Orbitron', monospace; font-size: 1.25rem; font-weight: 700; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.modal-close { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: var(--fg-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; }
.modal-close:hover { background: rgba(255, 0, 128, 0.1); border-color: var(--accent-magenta); color: var(--accent-magenta); }
.modal-close svg { width: 18px; height: 18px; }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8rem; color: var(--fg-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.form-input { width: 100%; background: rgba(0, 229, 255, 0.05); border: 1px solid var(--border); border-radius: 10px; padding: 0.85rem 1rem; font-size: 0.9rem; color: var(--fg); transition: all 0.3s; }
.form-input:focus { outline: none; border-color: var(--accent-cyan); background: rgba(0, 229, 255, 0.08); box-shadow: 0 0 20px rgba(0, 229, 255, 0.15); }
.form-input::placeholder { color: var(--fg-muted); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6380' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.btn { flex: 1; padding: 0.85rem 1.5rem; border-radius: 10px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.3s; border: none; }
.btn-secondary { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: var(--fg-muted); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); color: var(--fg); }
.btn-primary { background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue)); color: var(--bg-void); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 229, 255, 0.4); }

/* ========== Toast Notification ========== */
.toast {
  position: fixed; bottom: 6rem; right: 2rem; padding: 1rem 1.5rem;
  background: rgba(10, 15, 28, 0.9); border: 1px solid var(--accent-cyan); border-radius: 12px;
  color: var(--fg); font-size: 0.9rem; display: flex; align-items: center; gap: 0.75rem;
  z-index: 300; transform: translateX(120%); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 229, 255, 0.2); backdrop-filter: blur(10px);
}
.toast.show { transform: translateX(0); }
.toast-icon { width: 20px; height: 20px; stroke: var(--accent-cyan); }

/* ========== Mobile Overlay ========== */
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 90; opacity: 0; visibility: hidden; transition: all 0.3s; }
.mobile-overlay.active { opacity: 1; visibility: visible; }

/* ========== Animations ========== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeInUp 0.5s ease forwards; }

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, 0.4); }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .bookmarks-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .category-bookmarks { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .header-stats { display: none; }
}
@media (max-width: 768px) {
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .header-inner { flex-wrap: nowrap; position: relative; }
  .page-switcher { display: none; }
  .page-dropdown { display: block; order: 6; margin-left: 0.5rem; }
  .search-section { order: 4; flex: 0 0 auto; margin-left: auto; }
  .search-wrapper {
    position: relative;
    width: 36px; height: 36px;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: visible;
    cursor: pointer;
    display: flex;
    align-items: center;
    z-index: 10;
  }
  .search-wrapper.expanded {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 44px;
    border-radius: 22px;
    background: rgba(10, 15, 28, 0.95);
    border-color: var(--accent-cyan);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 229, 255, 0.2);
    cursor: default;
  }
  .search-wrapper .search-icon {
    position: relative;
    left: auto; top: auto;
    transform: none;
    width: 36px; height: 36px;
    min-width: 36px;
    display: flex; align-items: center; justify-content: center;
    margin: 0;
    pointer-events: none;
  }
  .search-wrapper .search-input {
    display: none;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: transparent;
    border: none;
    color: var(--fg);
  }
  .search-wrapper.expanded .search-input {
    display: block;
    padding-left: 0.5rem;
  }
  .search-wrapper.expanded .search-icon {
    min-width: 44px;
    height: 44px;
  }
  .view-toggle {
    display: flex;
    order: 5;
    margin-left: 0.5rem;
  }
  .app-sidebar { position: fixed; left: -280px; top: 80px; height: calc(100vh - 80px); width: 280px; z-index: 100; background: rgba(3, 5, 8, 0.98); transition: left 0.3s; overflow-y: auto; padding-top: 1rem; padding-bottom: 2rem; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .app-sidebar.open { left: 0; }
  .app-sidebar .category-item { cursor: pointer; -webkit-tap-highlight-color: rgba(0, 229, 255, 0.2); }
  .app-sidebar .category-item:active { background: rgba(0, 229, 255, 0.15); }
  .mobile-overlay { display: block; }
  .content-area { padding: 1rem; }
  .section-title { font-size: 1.25rem; }
  .bookmarks-grid { grid-template-columns: 1fr; }
  .category-bookmarks { grid-template-columns: 1fr; }
  .category-section-title { font-size: 1rem; }
  .fab-add { bottom: 5.5rem; right: 1.5rem; width: 50px; height: 50px; }
  .toast { left: 1rem; right: 1rem; bottom: 5rem; }
  .date-display { display: none; }
  .footer-inner { flex-direction: column; gap: 0.5rem; font-size: 0.7rem; }
  .footer-inner .separator { display: none; }
}
@media (max-width: 480px) {
  .header-inner { padding: 0.75rem; }
  .logo-title { font-size: 1rem; }
  .logo-sub { display: none; }
  .search-input { padding: 0.65rem 0.85rem 0.65rem 2.5rem; font-size: 0.85rem; }
  .modal-content { padding: 1.25rem; }
  .form-input { padding: 0.75rem; }
  .btn { padding: 0.75rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
