/* ===== 小雫的个人小站 - 前端主题 ===== */
:root {
  --pink: #ec6f9e;
  --pink-light: #f9c6d8;
  --pink-bg: #fdf2f7;
  --pink-card: #ffffff;
  --blue: #7ec3e8;
  --blue-light: #d6ecfa;
  --text: #5a4a52;
  --text-light: #a08d96;
  --border: #f3dfe8;
  --shadow: 0 6px 20px rgba(236, 111, 158, 0.12);
  --shadow-lg: 0 16px 48px rgba(236, 111, 158, 0.22);
  --radius: 18px;
  --radius-sm: 12px;
}

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

/* 共用 SVG 图标尺寸 */
.ico { width: 1.05em; height: 1.05em; vertical-align: -0.18em; fill: currentColor; display: inline-block; }
.ico-lg { width: 1.3em; height: 1.3em; vertical-align: -0.22em; fill: currentColor; display: inline-block; }
.ico-sm { width: 0.9em; height: 0.9em; vertical-align: -0.12em; fill: currentColor; display: inline-block; }
.ico-xl { width: 48px; height: 48px; fill: currentColor; display: inline-block; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(249, 198, 216, 0.5) 0, transparent 30%),
    radial-gradient(circle at 85% 20%, rgba(214, 236, 250, 0.6) 0, transparent 32%),
    linear-gradient(160deg, #fdf2f7 0%, #fef8fb 45%, #f3f8fc 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(236, 111, 158, 0.08);
}
.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 38px;
  height: 38px;
  color: var(--pink);
  animation: bounce 3s ease-in-out infinite;
  flex-shrink: 0;
}
.logo-text h1 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(120deg, var(--pink), #f09bc0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.logo-sub {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.4px;
}
.header-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}
.nav-link:hover { background: var(--pink-bg); color: var(--pink); }
.nav-link.active { background: var(--pink); color: #fff; box-shadow: 0 4px 14px rgba(236,111,158,0.35); }
.nav-admin {
  background: var(--blue-light);
  color: #3a7ca5;
}
.nav-admin:hover { background: var(--blue); color: #fff; }
.nav-download {
  background: #d9f2e6;
  color: #2a9d6f;
}
.nav-download:hover { background: #2a9d6f; color: #fff; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ===== 容器与分区 ===== */
.container { max-width: 1160px; margin: 0 auto; padding: 28px 24px 40px; }
.section { margin-bottom: 48px; }
.section-head { margin-bottom: 20px; }
.section-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-desc { color: var(--text-light); font-size: 14px; margin-top: 4px; }

/* ===== 分类标签 ===== */
.category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.cat-tab {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.cat-tab:hover { border-color: var(--pink-light); color: var(--pink); }
.cat-tab.active {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
  box-shadow: 0 4px 12px rgba(236,111,158,0.32);
}

/* ===== 站点卡片 ===== */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.site-card {
  background: var(--pink-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.site-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--pink-light);
}
.site-card::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,198,216,0.5), transparent 70%);
}
.site-card-top { display: flex; align-items: center; gap: 12px; }
.site-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ec6f9e, #f09bc0);
}
.site-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-all;
}
.site-card-cat {
  font-size: 12px;
  color: var(--pink);
  background: var(--pink-bg);
  padding: 2px 10px;
  border-radius: 999px;
  display: inline-block;
  margin-top: 4px;
}
.site-card-desc {
  font-size: 13px;
  color: var(--text-light);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.site-card-url {
  font-size: 12px;
  color: var(--blue);
  word-break: break-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-card-hint {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== 图床画廊 ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.22s;
}
.gallery-item:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--shadow-lg); }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-item .img-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 8px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.45));
  color: #fff;
  font-size: 11px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-item:hover .img-meta { opacity: 1; }

/* ===== 空状态 ===== */
.empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-light);
  padding: 50px 20px;
  font-size: 15px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius);
  border: 1.5px dashed var(--border);
}

/* ===== 页脚 ===== */
.site-footer {
  text-align: center;
  padding: 30px 0 10px;
  color: var(--text-light);
  font-size: 13px;
}
.footer-download { margin-top: 10px; }
.footer-download a {
  display: inline-block;
  padding: 10px 22px;
  background: #d9f2e6;
  color: #2a9d6f;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.footer-download a:hover { background: #2a9d6f; color: #fff; }

/* ===== iframe 预览弹窗 ===== */
.modal { display: none; position: fixed; inset: 0; z-index: 200; }
.modal.open { display: block; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(60, 40, 52, 0.45);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}
.modal-window {
  position: relative;
  width: min(920px, 92vw);
  height: min(660px, 88vh);
  margin: 4vh auto 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: popIn 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.modal-browser-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f7f1f4;
  border-bottom: 1px solid var(--border);
}
.browser-dots { display: flex; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.browser-url {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, monospace;
}
.modal-actions { display: flex; align-items: center; gap: 8px; }
.btn-open {
  font-size: 12px;
  color: var(--pink);
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--pink-bg);
}
.btn-open:hover { background: var(--pink); color: #fff; }
.btn-close {
  border: none;
  background: #f0e4ea;
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.btn-close:hover { background: var(--pink); color: #fff; }
.modal-frame-wrap { position: relative; flex: 1; background: #fafafa; }
.modal-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.frame-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-light);
  text-align: center;
  padding: 20px;
}
.fallback-emoji { font-size: 48px; }
.fallback-tip { font-size: 12px; }

/* ===== 图片预览弹窗 ===== */
.modal-image-window {
  position: relative;
  width: min(760px, 92vw);
  margin: 6vh auto 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
  animation: popIn 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-image-window img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 10px;
  background: #fafafa;
}
.btn-close-img {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  z-index: 2;
}
.btn-close-img:hover { background: var(--pink); }
.image-actions { display: flex; gap: 10px; justify-content: center; }
.btn-copy, .btn-download {
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-copy { background: var(--pink); color: #fff; }
.btn-copy:hover { background: #d95f8c; }
.btn-download { background: var(--blue-light); color: #3a7ca5; }
.btn-download:hover { background: var(--blue); color: #fff; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(60, 40, 52, 0.9);
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 300;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 动画 ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .sites-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .section-title { font-size: 22px; }
}
