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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  color: #1a1a2e;
  position: relative;
  overflow-x: hidden;
}

/* 随机壁纸背景层 */
.bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
  transition: opacity 1s ease;
}

/* 遮罩层 - 保证内容可读 */
.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: -1;
}

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

/* 头部 */
.header {
  text-align: center;
  padding: 50px 20px 35px;
}

.logo {
  font-size: 2.8rem;
  color: #fff;
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: 0 0 30px rgba(64, 169, 255, 0.6), 0 2px 10px rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, #fff 0%, #a8d8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: rgba(200, 225, 255, 0.9);
  font-size: 1rem;
  margin-bottom: 30px;
  letter-spacing: 2px;
}

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

.search-box input {
  width: 100%;
  padding: 15px 55px 15px 22px;
  border: 1px solid rgba(100, 180, 255, 0.3);
  border-radius: 50px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 50, 120, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  outline: none;
  transition: all 0.3s;
}

.search-box input::placeholder {
  color: rgba(200, 225, 255, 0.6);
}

.search-box input:focus {
  border-color: rgba(100, 180, 255, 0.7);
  box-shadow: 0 4px 30px rgba(64, 169, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.18);
}

.clear-btn {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 50%;
  line-height: 1;
  transition: all 0.3s;
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* 分类标签 */
.tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 15px 5px 25px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex-shrink: 0;
  padding: 9px 22px;
  border: 1px solid rgba(100, 180, 255, 0.25);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(220, 235, 255, 0.85);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.tab:hover {
  background: rgba(100, 180, 255, 0.2);
  border-color: rgba(100, 180, 255, 0.5);
  color: #fff;
}

.tab.active {
  background: linear-gradient(135deg, #1890ff, #096dd9);
  border-color: #40a9ff;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(24, 144, 255, 0.4);
}

/* 内容区 */
.content {
  min-height: 300px;
}

.category-section {
  margin-bottom: 35px;
}

/* 分类标题 - 明确分类 */
.category-title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 18px;
  padding: 10px 18px;
  background: linear-gradient(90deg, rgba(24, 144, 255, 0.35) 0%, rgba(24, 144, 255, 0.05) 100%);
  border-left: 4px solid #40a9ff;
  border-radius: 0 8px 8px 0;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  letter-spacing: 1px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

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

/* 网站卡片 - 毛玻璃科技感 */
.site-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 30, 80, 0.2);
}

.site-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(64, 169, 255, 0.6);
  box-shadow: 0 8px 30px rgba(24, 144, 255, 0.35), 0 0 0 1px rgba(64, 169, 255, 0.3);
}

.site-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1890ff, #0050b3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(24, 144, 255, 0.4);
}

.site-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-info {
  flex: 1;
  min-width: 0;
}

.site-name {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.site-desc {
  font-size: 0.82rem;
  color: rgba(220, 235, 255, 0.75);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.loading, .empty {
  text-align: center;
  padding: 70px 20px;
  color: rgba(220, 235, 255, 0.8);
  font-size: 1rem;
  letter-spacing: 1px;
}

/* 底部 */
.footer {
  text-align: center;
  padding: 35px 20px 25px;
  color: rgba(200, 225, 255, 0.6);
  font-size: 0.85rem;
  border-top: 1px solid rgba(100, 180, 255, 0.15);
  margin-top: 20px;
}

.admin-link {
  color: rgba(200, 225, 255, 0.4);
  text-decoration: none;
  margin-left: 12px;
  transition: color 0.3s;
}

.admin-link:hover {
  color: #40a9ff;
}

/* 网站弹窗 */
.site-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.site-modal-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  width: 420px;
  max-width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: modalIn 0.3s ease;
}

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

.site-modal-header {
  padding: 18px 24px;
  background: linear-gradient(135deg, #1890ff, #096dd9);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-modal-header h3 {
  font-size: 1.1rem;
  margin: 0;
}

.site-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.site-modal-close:hover {
  color: #fff;
}

.site-modal-body {
  padding: 24px;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.7;
  max-height: 300px;
  overflow-y: auto;
}

.site-modal-body .password-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.site-modal-body .password-input:focus {
  border-color: #1890ff;
}

.site-modal-body .password-error {
  color: #ff4d4f;
  font-size: 0.85rem;
  margin-top: 8px;
  min-height: 20px;
}

.site-modal-body .notice-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.site-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.site-modal-footer .btn {
  padding: 9px 22px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.site-modal-footer .btn-cancel {
  background: #f0f0f0;
  color: #666;
}

.site-modal-footer .btn-cancel:hover {
  background: #e0e0e0;
}

.site-modal-footer .btn-primary {
  background: linear-gradient(135deg, #1890ff, #096dd9);
  color: #fff;
}

.site-modal-footer .btn-primary:hover {
  opacity: 0.9;
}

/* 有密码/通知的网站卡片标记 */
.site-card .site-badges {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.site-card .badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(24, 144, 255, 0.15);
  color: #1890ff;
}

.site-card .badge.lock {
  background: rgba(255, 77, 79, 0.15);
  color: #ff4d4f;
}

/* 响应式 */
@media (max-width: 600px) {
  .logo {
    font-size: 2rem;
    letter-spacing: 2px;
  }
  .site-grid {
    grid-template-columns: 1fr;
  }
  .header {
    padding: 30px 10px 20px;
  }
  .category-title {
    font-size: 1.05rem;
    padding: 8px 14px;
  }
}
