:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #0ea5e9;
  --accent: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --gray-900: #0f172a;
  --gray-800: #1e293b;
  --gray-700: #334155;
  --gray-600: #475569;
  --gray-400: #94a3b8;
  --gray-50: #f8fafc;
  --white: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(14, 165, 233, 0.15) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.floating-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  animation: float 20s ease-in-out infinite;
}
.shape:nth-child(1) { width: 300px; height: 300px; top: 10%; left: -5%; }
.shape:nth-child(2) { width: 200px; height: 200px; top: 60%; right: -3%; animation-delay: -5s; }
.shape:nth-child(3) { width: 150px; height: 150px; bottom: 10%; left: 20%; animation-delay: -10s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(180deg); }
}

.hidden { display: none !important; }

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 40vh;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 2;
}

.loading-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.header {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo { display: flex; align-items: center; gap: 14px; }

.logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.logo-text h1 {
  font-size: 22px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
}

.logo-text p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

.navbar {
  background: rgba(15, 12, 41, 0.35);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  z-index: 40;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  min-height: 52px;
}

.navbar-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
.navbar-toggle span { display: none; }
.navbar-dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
  flex-shrink: 0;
}

.navbar-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  padding: 10px 0;
}

.navbar-item a {
  display: block;
  padding: 8px 16px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.navbar-item a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.navbar-item.active a {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

.search-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 40px;
  transition: all 0.3s ease;
}

.search-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.search-title { text-align: center; margin-bottom: 24px; }

.search-title h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.7));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search-title p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
}

.search-box {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 18px 60px 18px 24px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.95);
  color: var(--gray-800);
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
}

.search-btn:hover {
  transform: translateY(-50%) scale(1.05);
}

.pan-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.pan-filters button {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.pan-filters button:hover,
.pan-filters button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

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

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title i { color: var(--primary-light); }

.resources-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.resources-grid.double-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.resource-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.18);
}

.resource-card.double-mode {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 18px 12px 14px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
}

.resource-card.double-mode:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(102, 126, 234, 0.18);
}

.resource-card.double-mode .resource-icon {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.resource-card.double-mode .resource-name {
  font-size: 13px;
  font-weight: 600;
  color: #2d3436;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  padding: 0 4px;
}

.resource-card.double-mode .double-pinned {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: 10px;
}

.resource-header {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.resource-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
  overflow: hidden;
}

.resource-icon.has-cover {
  padding: 0;
  background: #fff;
}

.resource-icon.has-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.resource-icon.pan-quark { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.resource-icon.pan-uc { background: linear-gradient(135deg, #ff6900, #ff9a3c); }
.resource-icon.pan-baidu { background: linear-gradient(135deg, #06a4ff, #0284c7); }
.resource-icon.pan-xunlei { background: linear-gradient(135deg, #0098ff, #0369a1); }
.resource-icon.pan-yidong { background: linear-gradient(135deg, #00a4ff, #0077cc); }

.resource-info { min-width: 0; }
.resource-desc {
  margin: 6px 0 8px;
  color: var(--gray-600);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.resource-card.double-mode .resource-desc.double-desc {
  margin: 4px 0 0;
  padding: 0 4px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--gray-600);
  -webkit-line-clamp: 2;
}
.resource-info h3 {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--gray-600);
  font-size: 13px;
}

.platform-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary);
}

.pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #ff6b00, #ffc832);
}

.resource-links {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-info {
  background: linear-gradient(135deg, var(--secondary), #0284c7);
  color: white;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--gray-800);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

.btn-info:hover,
.btn-success:hover,
.btn-secondary:hover { transform: translateY(-2px); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.7);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
}

.empty-state i {
  font-size: 42px;
  margin-bottom: 12px;
  color: var(--primary-light);
}

.pagination-container {
  display: flex;
  justify-content: center;
  margin: 28px 0 40px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.pagination button,
.pagination .page-jump {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.25s ease;
}

.pagination button:hover:not(:disabled),
.pagination button.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .jump-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 8px;
}

.pagination input {
  width: 56px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.95);
  text-align: center;
  font-family: inherit;
}

.contact-info {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  margin-bottom: 24px;
}

.contact-info h3 {
  color: white;
  font-size: 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.contact-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.contact-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.footer {
  text-align: center;
  padding: 28px 16px 40px;
  color: rgba(255, 255, 255, 0.45);
  position: relative;
  z-index: 1;
}

.announcement-modal,
.detail-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.announcement-modal.show,
.detail-modal.show { display: flex; }

.announcement-modal-content,
.detail-modal-content {
  background: var(--white);
  border-radius: 24px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  animation: modalSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

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

.announcement-modal-header,
.detail-modal-header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.announcement-modal-header h3,
.detail-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.announcement-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.announcement-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.announcement-modal-body,
.detail-modal-body {
  padding: 24px;
  line-height: 1.8;
  color: var(--gray-700);
  max-height: 50vh;
  overflow-y: auto;
  font-size: 15px;
}

.announcement-modal-footer,
.detail-modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.detail-desc {
  margin-bottom: 14px;
  white-space: pre-wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.7;
}

.detail-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  margin-bottom: 10px;
  align-items: start;
}

.detail-row span { color: var(--gray-600); font-weight: 600; }
.detail-row code {
  word-break: break-all;
  background: var(--gray-50);
  padding: 8px 10px;
  border-radius: 8px;
  display: block;
}

.tip {
  margin-top: 14px;
  color: var(--gray-400);
  font-size: 13px;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all 0.3s ease;
  z-index: 80;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

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

@media (max-width: 768px) {
  .header-container { padding: 14px 16px; }
  .logo-icon { width: 44px; height: 44px; font-size: 18px; border-radius: 12px; }
  .logo-text h1 { font-size: 18px; }
  .main-container { padding: 24px 16px; }
  .search-container { padding: 22px 16px; border-radius: 18px; }
  .search-title h2 { font-size: 22px; }
  .navbar-container { flex-wrap: wrap; padding: 0 12px; }
  .navbar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    margin: 10px 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    letter-spacing: 0.02em;
  }
  .navbar-toggle span { display: inline; }
  .navbar-dot { display: inline-block; }
  .navbar-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-bottom: 12px;
  }
  .navbar-menu.open { display: flex; }
  .resource-card:not(.double-mode) {
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
  }
  .resource-links { width: 100%; }
  .resource-links .btn { flex: 1; }
  .resources-grid.double-layout { gap: 10px; }
  .resource-card.double-mode { padding: 14px 8px 12px; border-radius: 14px; }
  .resource-card.double-mode .resource-icon { width: 42px; height: 42px; }
  .resource-card.double-mode .resource-name { font-size: 12px; }
}
