:root {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-nav: rgba(245, 245, 247, 0.88);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #aeaeb2;
  --border: rgba(0, 0, 0, 0.08);
  --border-card: rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 24px rgba(140, 44, 44, 0.09);
  --shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.13);
  --accent: #0071e3;
  --radius-sm: 10px;
  --radius-md: 16px;
  --font:
    -apple-system, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial,
    sans-serif;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t-fast: 0.18s;
  --t-med: 0.3s;
  --nav-h: 60px;
  --sidebar-w: 220px;
}
[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-secondary: #1c1c1e;
  --bg-card: rgba(28, 28, 30, 0.82);
  --bg-nav: rgba(0, 0, 0, 0.88);
  --text-primary: #f5f5f7;
  --text-secondary: #98989d;
  --text-tertiary: #636366;
  --border: rgba(255, 255, 255, 0.1);
  --border-card: rgba(255, 255, 255, 0.07);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-card: rgba(28, 28, 30, 0.82);
    --bg-nav: rgba(0, 0, 0, 0.88);
    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --text-tertiary: #636366;
    --border: rgba(255, 255, 255, 0.1);
    --border-card: rgba(255, 255, 255, 0.07);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.6);
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background var(--t-med) var(--ease),
    color var(--t-med) var(--ease);
}
a {
  text-decoration: none;
  color: inherit;
}
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  transition: background var(--t-med) var(--ease);
}
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  flex-shrink: 0;
}
.logo-icon {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  font-weight: 800;
}
.navbar-search {
  flex: 1;
  max-width: 460px;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-ico {
  position: absolute;
  left: 11px;
  color: var(--text-tertiary);
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
}
#searchInput {
  width: 100%;
  height: 34px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 0 32px 0 34px;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background var(--t-med) var(--ease);
}
#searchInput::placeholder {
  color: var(--text-tertiary);
}
#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}
.search-clear {
  position: absolute;
  right: 9px;
  background: var(--text-tertiary);
  border: none;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  cursor: pointer;
  color: var(--bg-secondary);
  font-size: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast);
}
.search-clear:hover {
  background: var(--text-secondary);
}
.search-clear.on {
  display: flex;
}
.navbar-right {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-secondary);
  transition:
    background var(--t-fast),
    transform var(--t-fast);
}
.icon-btn:hover {
  background: var(--border);
  color: var(--text-primary);
  transform: scale(1.08);
}
.icon-btn:active {
  transform: scale(0.93);
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  background: transparent;
  border: none;
  transition: background var(--t-fast);
}
.hamburger:hover {
  background: var(--border);
}
.hamburger span {
  display: block;
  width: 19px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--t-med) var(--ease);
}
.hamburger.on span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.on span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.on span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.layout {
  display: flex;
  padding-top: var(--nav-h);
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 16px 10px;
  border-right: 1px solid var(--border);
  background: var(--bg-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 900;
  scrollbar-width: none;
  transition:
    transform var(--t-med) var(--ease),
    background var(--t-med) var(--ease);
}
.sidebar::-webkit-scrollbar {
  display: none;
}
.sidebar-title {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 6px 12px 4px;
  margin-top: 6px;
}
.sidebar-nav {
  list-style: none;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition:
    background var(--t-fast),
    color var(--t-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.sidebar-item:hover {
  background: var(--border);
  color: var(--text-primary);
}
.sidebar-item.active {
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent);
}
.sidebar-item-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-item-count {
  margin-left: auto;
  background: var(--border);
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 20px;
}
.sidebar-item.active .sidebar-item-count {
  background: rgba(0, 113, 227, 0.15);
  color: var(--accent);
}
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 28px 28px 64px;
  transition: margin var(--t-med) var(--ease);
}
.hero {
  text-align: center;
  padding: 40px 20px 32px;
}
.hero-title {
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1.1;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.hero-title span {
  background: linear-gradient(135deg, var(--accent) 0%, #bf5af2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
}
.cat-section {
  margin-bottom: 44px;
  animation: fadeUp 0.4s var(--ease) both;
}
.cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.cat-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.cat-count {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 13px;
}
.link-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px 15px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    background var(--t-med) var(--ease);
  animation: cardIn 0.35s var(--ease) both;
}
.link-card:hover {
  transform: translateY(-3px) scale(1.015);
  box-shadow: var(--shadow-hover);
  border-color: var(--border);
}
.link-card:active {
  transform: translateY(-1px) scale(0.985);
  box-shadow: var(--shadow-md);
}
.card-emoji {
  font-size: 22px;
  margin-bottom: 9px;
  display: block;
  line-height: 1;
}
.card-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.card-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
}
.card-arrow {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 9px;
  font-weight: 500;
  transition:
    color var(--t-fast),
    letter-spacing var(--t-fast);
}
.link-card:hover .card-arrow {
  color: var(--accent);
  letter-spacing: 0.2px;
}
#searchResults {
  display: none;
}
#searchResults.on {
  display: block;
}
.result-count {
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 2px 0 18px;
  font-weight: 500;
}
.search-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-secondary);
}
.search-empty-icon {
  font-size: 44px;
  margin-bottom: 14px;
  opacity: 0.45;
}
.search-empty h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-primary);
}
mark {
  background: rgba(0, 113, 227, 0.15);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 1px;
}
.footer {
  text-align: center;
  padding: 20px;
  font-size: 11.5px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border);
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-info {
  flex: 1;
  min-width: auto;
}
.footer code {
  font-size: 11px;
  background: var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}
.footer a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
  border-bottom: 1px dotted var(--text-tertiary);
}
.footer a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.footer-link {
  cursor: pointer;
}
.load-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 4px 8px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--t-fast) var(--ease);
  opacity: 0;
  animation: fadeInScale 0.5s var(--ease) 0.2s both;
}
.load-time.super-fast {
  background: rgba(52, 211, 153, 0.1);
  color: #10b981;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.2);
}
.load-time.fast {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}
.load-time.normal {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.2);
}
.load-time.slow {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.2);
}
.load-time.very-slow {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.2);
}
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 850;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
}
.overlay.on {
  opacity: 1;
  pointer-events: auto;
}
#scrollTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--text-secondary);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  transition:
    opacity var(--t-med),
    transform var(--t-fast),
    background var(--t-fast),
    color var(--t-fast);
}
#scrollTop.on {
  opacity: 1;
  pointer-events: auto;
}
#scrollTop:hover {
  transform: translateY(-2px);
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
#scrollTop:active {
  transform: none;
}
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 13px;
  margin-bottom: 44px;
}
.skeleton-card {
  height: 115px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    90deg,
    var(--border) 0%,
    var(--bg-secondary) 50%,
    var(--border) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.cat-section:nth-child(1) {
  animation-delay: 0.04s;
}
.cat-section:nth-child(2) {
  animation-delay: 0.09s;
}
.cat-section:nth-child(3) {
  animation-delay: 0.14s;
}
.cat-section:nth-child(4) {
  animation-delay: 0.19s;
}
.cat-section:nth-child(5) {
  animation-delay: 0.24s;
}
.cat-section:nth-child(6) {
  animation-delay: 0.29s;
}
@media (max-width: 1024px) {
  :root {
    --sidebar-w: 190px;
  }
  .main {
    padding: 22px 22px 52px;
  }
  .links-grid {
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  }
}
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  .sidebar {
    transform: translateX(-100%);
    width: 250px;
    box-shadow: var(--shadow-hover);
  }
  .sidebar.on {
    transform: translateX(0);
  }
  .overlay {
    display: block;
    pointer-events: none;
  }
  .main {
    margin-left: 0;
    padding: 18px 15px 52px;
  }
  .navbar-search {
    max-width: none;
  }
  .logo-text {
    display: none;
  }
  .links-grid {
    grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
    gap: 10px;
  }
  #scrollTop {
    bottom: 18px;
    right: 14px;
  }
}
@media (max-width: 480px) {
  .links-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .navbar {
    padding: 0 14px;
    gap: 10px;
  }
}
@media (max-width: 360px) {
  .links-grid {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 1400px) {
  .links-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }
}
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1500;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
}
.modal-overlay.show {
  display: block;
  opacity: 1;
  pointer-events: auto;
}
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  z-index: 1600;
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.3s var(--ease);
}
.modal.show {
  display: block;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  transition: color var(--t-fast);
  z-index: 10;
}
.modal-close:hover {
  color: var(--text-primary);
}
.modal-content {
  padding: 28px 24px;
}
.modal-header {
  margin-bottom: 20px;
}
.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.modal-header p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.modal-body {
  margin-bottom: 20px;
  text-align: center;
}
.modal-qrcode {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--border);
  min-width: 120px;
  min-height: 120px;
  font-size: 11px;
  color: var(--text-secondary);
}
.modal-qrcode img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
}
.modal-info {
  padding: 12px 16px;
  background: rgba(0, 113, 227, 0.08);
  border-radius: 10px;
  border: 1px solid rgba(0, 113, 227, 0.15);
}
.modal-info p {
  font-size: 13px;
  color: var(--text-primary);
  margin: 6px 0;
  line-height: 1.5;
}
.modal-footer {
  display: flex;
  gap: 10px;
}
.btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--border-card);
}
.btn-secondary:active {
  transform: scale(0.98);
}
.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.password-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.password-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}
.password-input::placeholder {
  color: var(--text-tertiary);
}
.password-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.password-toggle:hover {
  background: var(--border);
}
.password-toggle:active {
  transform: scale(0.95);
}
.password-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
  padding: 8px 0;
  text-align: center;
}
.password-error {
  color: #ff3b30;
  font-size: 12px;
  margin: 0;
  padding: 8px 0;
  text-align: center;
}
.password-locked-card {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(0, 113, 227, 0.08),
    rgba(191, 90, 242, 0.08)
  ) !important;
  border: 2px dashed var(--border) !important;
  cursor: default !important;
  pointer-events: none;
  min-height: 180px;
  text-align: center;
}
.password-locked-card .btn {
  pointer-events: auto;
  margin-top: 8px;
}
.password-locked-card:hover {
  background: linear-gradient(
    135deg,
    rgba(0, 113, 227, 0.12),
    rgba(191, 90, 242, 0.12)
  ) !important;
  border-color: var(--accent) !important;
  transform: none !important;
  box-shadow: none !important;
}
.notif-bell {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: #ff3b30;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  pointer-events: none;
}
.notif-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  transition: background var(--t-fast);
}
.notif-item:last-child {
  margin-bottom: 0;
}
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.notif-icon.add {
  background: rgba(52, 199, 89, 0.12);
  color: #34c759;
}
.notif-icon.remove {
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
}
.notif-info {
  flex: 1;
  min-width: 0;
}
.notif-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.notif-info p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}
.notif-info .notif-date {
  font-size: 11px;
  color: var(--text-tertiary);
}
/* ══ 历史记录弹窗 ══ */
#historyModal {
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
}
#historyModal .modal-content {
  padding: 0;
}
#historyModal .modal-close {
  z-index: 20;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
#historyModalBody {
  max-height: 75vh;
  overflow-y: auto;
  padding: 0;
}
.history-container {
  padding: 28px 24px 20px;
}
.history-hero {
  text-align: center;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.history-hero h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}
.history-hero p {
  font-size: 13px;
  color: var(--text-secondary);
}
.history-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.history-stats .stat-item {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
}
.stat-num {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
  display: block;
}
/* Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}
.tl-item {
  position: relative;
  margin-bottom: 28px;
  animation: fadeUp 0.4s var(--ease) both;
}
.tl-item:last-child {
  margin-bottom: 4px;
}
.tl-dot {
  position: absolute;
  left: -24px;
  top: 16px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-secondary);
  box-shadow: 0 0 0 3px var(--border);
  z-index: 2;
}
.tl-dot-cat {
  background: #bf5af2;
  box-shadow: 0 0 0 3px rgba(191, 90, 242, 0.2);
}
.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 18px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.tl-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
.tl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tl-type-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--border);
  padding: 2px 8px;
  border-radius: 6px;
}
.tl-date {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.tl-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.tl-detail {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 12px;
}
.tl-changes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chg-group {
  font-size: 12.5px;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.chg-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.chg-tag.chg-add {
  background: rgba(52, 199, 89, 0.12);
  color: #34c759;
}
.chg-tag.chg-remove {
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
}
.chg-tag.chg-move {
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
}
.chg-tag.chg-tag {
  background: rgba(191, 90, 242, 0.1);
  color: #bf5af2;
}
.chg-cat {
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}
.chg-items {
  color: var(--text-secondary);
}
.history-footer {
  text-align: center;
  padding: 16px 0 4px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.history-footer p {
  font-size: 11px;
  color: var(--text-tertiary);
}
.history-footer code {
  font-size: 10.5px;
  background: var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}
.history-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.history-loading .spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 480px) {
  #historyModal {
    width: 95%;
    max-width: none;
  }
  .history-container {
    padding: 20px 16px 16px;
  }
  .history-hero h2 {
    font-size: 19px;
  }
  .tl-card {
    padding: 14px;
  }
  .tl-title {
    font-size: 15px;
  }
}
@media (max-width: 480px) {
  .modal {
    width: 95%;
    max-width: 360px;
  }
  .modal-content {
    padding: 20px 16px;
  }
  .modal-header h2 {
    font-size: 18px;
  }
}
