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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0a0a12;
  color: #F0F0F5;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 背景吃瓜表情浮动装饰 */
body::before,
body::after {
  content: "🍉";
  position: fixed;
  font-size: 140px;
  opacity: 0.025;
  pointer-events: none;
  z-index: 0;
  filter: blur(2px);
}

body::before {
  top: 8%;
  left: 3%;
  animation: floatEmoji 7s ease-in-out infinite;
}

body::after {
  bottom: 12%;
  right: 5%;
  font-size: 110px;
  animation: floatEmoji 9s ease-in-out infinite reverse;
}

@keyframes floatEmoji {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-24px) rotate(5deg); }
}

/* 密码验证层 */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,18,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-box {
  background: rgba(255,255,255,0.03);
  padding: 40px;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  animation: fadeInUp 0.5s ease;
}

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

.auth-box h1 {
  font-size: 32px;
  margin-bottom: 8px;
  color: #FF2D78;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 0 20px rgba(255,45,120,0.3);
}

.auth-box p { color: #8B8B9E; margin-bottom: 20px; }

.auth-tip {
  font-size: 13px;
  color: #8B8B9E;
  margin-bottom: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.auth-box input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #F0F0F5;
  font-size: 16px;
  margin-bottom: 12px;
  outline: none;
  transition: all 0.2s;
}

.auth-box input:focus {
  border-color: #00D4FF;
  box-shadow: 0 0 0 3px rgba(0,212,255,0.15), 0 0 20px rgba(0,212,255,0.1);
}

.auth-box button {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #FF2D78, #FF6B35);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(255,45,120,0.3);
}

.auth-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255,45,120,0.4);
}

.error { color: #FF2D78; font-size: 14px; margin-top: 8px; }

.auth-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.auth-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #8B8B9E;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-action-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: #F0F0F5;
  transform: translateY(-1px);
}

.auth-action-icon {
  font-size: 16px;
}

/* 二维码弹窗 */
.qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,18,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}

.qr-modal-overlay.hidden { display: none !important; }

.qr-modal {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  position: relative;
  animation: qrFadeIn 0.25s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

@keyframes qrFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.qr-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: #5A5A6E;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.qr-modal-close:hover { color: #F0F0F5; }

.qr-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,45,120,0.1);
  color: #FF2D78;
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,45,120,0.2);
}

.qr-title {
  font-size: 20px;
  font-weight: 600;
  color: #F0F0F5;
  margin-bottom: 6px;
}

.qr-desc {
  font-size: 13px;
  color: #8B8B9E;
  margin-bottom: 20px;
  line-height: 1.5;
}

.qr-img-wrap {
  display: inline-block;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}

.qr-img-wrap img {
  width: 180px;
  height: 180px;
  display: block;
  border-radius: 12px;
}

.qr-tip {
  font-size: 12px;
  color: #5A5A6E;
}

.hidden { display: none !important; }

/* 主布局 */
.app { max-width: 960px; margin: 0 auto; padding: 24px; }

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

header h1 {
  font-size: 28px;
  color: #FF2D78;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(255,45,120,0.25);
  letter-spacing: -0.5px;
}

.search-box {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 260px;
  max-width: 420px;
}

.search-box input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: #F0F0F5;
  font-size: 16px;
  outline: none;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: #00D4FF;
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

.search-box button,
.btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #FF2D78, #FF6B35);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(255,45,120,0.25);
}

.search-box button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,45,120,0.35);
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: #F0F0F5;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  box-shadow: none;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* 标签云 */
.tags-section { margin-bottom: 20px; }

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: #8B8B9E;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.tag:hover {
  border-color: rgba(255,45,120,0.4);
  color: #FF2D78;
  background: rgba(255,45,120,0.05);
}

.tag.active {
  background: linear-gradient(135deg, #FF2D78, #FF6B35);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(255,45,120,0.3);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(255,45,120,0.3); }
  50% { box-shadow: 0 2px 16px rgba(255,45,120,0.5); }
}

/* 瓜卡片 */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease both;
}

.item-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,45,120,0.2);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 20px rgba(255,45,120,0.08);
}

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

.item-title {
  font-size: 18px;
  font-weight: 600;
  color: #F0F0F5;
}

.platform-badge {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0,212,255,0.08);
  color: #00D4FF;
  font-size: 12px;
  border: 1px solid rgba(0,212,255,0.15);
  white-space: nowrap;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 8px;
  transition: all 0.2s;
}

.link-row:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}

.link-row:last-child { margin-bottom: 0; }

.link-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.link-code {
  font-size: 12px;
  color: #8B8B9E;
}

.link-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.link-actions .copy-btn,
.link-actions .open-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.4;
  font-weight: 500;
}

.link-actions .copy-btn {
  background: rgba(255,255,255,0.06);
  color: #F0F0F5;
  border: 1px solid rgba(255,255,255,0.1);
}

.link-actions .copy-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
}

.link-actions .open-btn {
  background: linear-gradient(135deg, #FF6B35, #FF8C42);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,53,0.25);
}

.link-actions .open-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,107,53,0.35);
}

.item-desc {
  color: #8B8B9E;
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #5A5A6E;
}

.item-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.item-tag {
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: #8B8B9E;
  font-size: 12px;
}

.item-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.item-actions a,
.item-actions button {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.item-actions a {
  background: rgba(255,255,255,0.04);
  color: #F0F0F5;
  border: 1px solid rgba(255,255,255,0.08);
}

.item-actions a:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding-bottom: 40px;
}

.pagination button {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: #F0F0F5;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}

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

.pagination button.active {
  background: linear-gradient(135deg, #FF2D78, #FF6B35);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,45,120,0.3);
}

/* 管理后台 */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-table th { color: #5A5A6E; font-weight: 500; }

.admin-table td { color: #ccc; }

.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,18,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 28px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

.modal h2 { margin-bottom: 16px; color: #F0F0F5; }

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #8B8B9E;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: #F0F0F5;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #00D4FF;
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #5A5A6E;
}

.empty-state h3 { color: #8B8B9E; margin-bottom: 8px; }

/* 图片网格 */
.item-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.item-images img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.3s;
}

.item-images img:hover {
  transform: scale(1.03);
  border-color: rgba(255,45,120,0.3);
  box-shadow: 0 4px 16px rgba(255,45,120,0.1);
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,18,0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  cursor: zoom-out;
}

.lightbox-overlay.hidden { display: none !important; }

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  display: block;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.15); }
.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }
.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
}

.lightbox-close:hover { color: #FF2D78; }

.lightbox-counter {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  color: #8B8B9E;
  font-size: 14px;
}

/* 后台图片管理 */
.admin-images-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-image-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.admin-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-image-thumb .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF2D78;
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
}

.admin-image-thumb .remove-btn:hover {
  background: #FF6B35;
  transform: scale(1.1);
}

.admin-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 14px;
  flex-wrap: wrap;
}

.admin-link-inputs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-link-inputs select,
.admin-link-inputs input {
  flex: 1;
  min-width: 120px;
}

.admin-link-inputs button {
  white-space: nowrap;
}

.settings-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.settings-section h3 {
  font-size: 15px;
  color: #FF2D78;
  margin-bottom: 12px;
  font-weight: 600;
}

/* 响应式 */
@media (max-width: 640px) {
  header { flex-direction: column; align-items: flex-start; }
  .search-box { max-width: 100%; width: 100%; }
  .item-header { flex-direction: column; align-items: flex-start; }
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 8px; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-nav { width: 44px; height: 44px; font-size: 18px; }

  .container { padding: 16px 12px; }
  .link-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .link-actions {
    width: 100%;
  }
  .link-actions .copy-btn,
  .link-actions .open-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 14px;
  }
  .pagination button {
    min-width: 44px;
    min-height: 44px;
    font-size: 15px;
  }
  .tags-cloud { gap: 6px; }
  .tag { padding: 6px 12px; font-size: 13px; }
  .auth-box { padding: 32px 20px; max-width: 90%; }
  .auth-box input { font-size: 16px; padding: 14px; }
  .auth-box button { padding: 14px; font-size: 16px; }
  .item-images {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .item-images img { height: 80px; }
}
