/*!
 * 前台样式 - 粉色主题
 *
 * ============================================================
 *  河南锅锅岛科技有限公司 · 专注各种网站开发定制
 *  微信: IJG55555    官网: ggdao.net
 * ============================================================
 */
/* ============ 出海教程 - 粉色主题 ============ */
:root {
  --pink-50:  #fff5f8;
  --pink-100: #ffe9f1;
  --pink-200: #ffdae7;
  --pink-300: #ffc2d6;
  --pink-400: #ff9dbd;
  --pink-500: #ff7aa8;
  --pink-600: #ff5c95;
  --pink-700: #ee3e7d;
  --pink-800: #d82d6b;
  --text:     #ff5c95;     /* 正文主色也用粉 */
  --text-dark:#ee3e7d;     /* 略深的粉 */
  --text-2:   #f08ab0;
  --border:   #ffd6e2;
  --shadow:   0 8px 28px rgba(255, 110, 160, .14);
  --radius:   16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
               "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #ffeef4 0%, #ffe2ec 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--pink-600); text-decoration: none; }
a:hover { color: var(--pink-700); }

/* ---------- 容器 ---------- */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- 顶部栏 ---------- */
.header {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 36px;
  margin: 28px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 26px;
  font-weight: 700;
  color: var(--pink-700);
  letter-spacing: 2px;
}
.logo .logo-emoji { font-size: 32px; }
.logo .logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff5f8;
  padding: 2px;
}

.search-box {
  display: flex;
  align-items: stretch;
  background: #ffe1ec;
  border: 2px solid #ff8fb4;
  border-radius: 999px;
  overflow: hidden;
  padding: 0;
  height: 42px;
  box-shadow: 0 4px 12px rgba(255, 143, 180, .18);
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  padding: 0 20px;
  width: 240px;
  color: var(--pink-700);
  font-size: 14.5px;
  height: 100%;
}
.search-box input::placeholder {
  color: #c9a3b5;
  opacity: 1;
}
.search-box button {
  border: none;
  background: #ff7aa8;
  color: #fff;
  width: 58px;
  height: 100%;
  border-radius: 0 999px 999px 0;
  cursor: pointer;
  transition: background .2s;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* 让按钮比外框稍微凸出一点, 贴合参考图 */
  margin: -2px -2px -2px 0;
}
.search-box button:hover { background: var(--pink-600); }
.search-box button svg {
  width: 22px;
  height: 22px;
  display: block;
  color: #fff;
}

/* ---------- 主体布局 ---------- */
.main {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 24px;
  margin-bottom: 36px;
}

/* ---------- 卡片通用 ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--pink-700);
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
  letter-spacing: 1px;
}
.card-title .title-ico {
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(255, 110, 160, .3));
}
/* 面包屑样式: 分类 » 名称 */
.card-title .crumb-label {
  color: var(--pink-600);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 1px;
}
.card-title .crumb-sep {
  color: var(--pink-500);
  font-weight: 500;
  font-size: 24px;
  margin: 0 2px;
}
.card-title .crumb-text {
  color: var(--pink-600);
  font-weight: 500;
  font-size: 24px;
}
/* 侧栏标题 */
.sidebar .card-title {
  font-size: 19px;
  letter-spacing: .5px;
  margin: 0 0 16px;
  padding-bottom: 12px;
}
.sidebar .card-title .title-ico {
  font-size: 22px;
}

/* ---------- 侧边栏分类 ---------- */
.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;         /* 让 sticky 在 grid 里正常工作 */
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--pink-300) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--pink-300);
  border-radius: 3px;
}
.sidebar .cat-list { display: flex; flex-direction: column; gap: 12px; }
.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  background: #ffe4ee;
  border: 1.5px solid #ff9dbd;
  border-radius: 999px;
  padding: 6px 8px 6px 8px;
  color: var(--pink-600);
  font-weight: 500;
  font-size: 15px;
  transition: all .2s;
  min-height: 48px;
}
.cat-item:hover,
.cat-item.active {
  background: #ff7aa8;
  border-color: #ff7aa8;
  box-shadow: 0 6px 18px rgba(255, 110, 160, .35);
  transform: translateX(3px);
}

.cat-item .cat-name {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

/* 左侧图标方块 - 白底圆角, 装载品牌图标 */
.cat-item .cat-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 7px;
  overflow: hidden;
  font-size: 20px;
}
.cat-item .cat-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 分类名 */
.cat-item .cat-name > span:not(.cat-icon) {
  color: var(--pink-600);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.cat-item:hover,
.cat-item:hover .cat-name,
.cat-item.active,
.cat-item.active .cat-name {
  color: #fff !important;
}
.cat-item:hover .cat-name,
.cat-item.active .cat-name {
  font-weight: 700;
}

/* 右侧数字徽章 - 深粉实心圆 */
.cat-item .cat-count {
  flex-shrink: 0;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  background: var(--pink-500);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
}
.cat-item:hover .cat-count,
.cat-item.active .cat-count {
  background: #fff;
  color: var(--pink-600);
}

/* 侧边底部的心心小卡 */
.heart-card {
  margin-top: 20px;
  background: var(--pink-100);
  border: 1.5px dashed var(--pink-300);
  border-radius: var(--radius);
  text-align: center;
  padding: 22px 18px;
  color: var(--pink-700);
  font-size: 14px;
  font-weight: 500;
}
.heart-card .heart { font-size: 28px; display: block; margin-bottom: 8px; }

/* ---------- 文章列表 ---------- */
.article-list { display: flex; flex-direction: column; gap: 16px; }
.article-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffe9f0;
  border: 1px solid #ffd3e0;
  border-radius: 12px;
  padding: 20px 26px;
  color: #333;
  font-weight: 500;
  transition: all .25s;
  overflow: hidden;
}
.article-item:hover {
  background: #ffd9e5;
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(255,110,160,.22);
  color: var(--pink-800);
}
.article-item.highlight {
  background: #ffd9e5;
  color: var(--pink-800);
}
.article-item .title {
  font-size: 16px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: .3px;
}
.article-item .arrow {
  color: var(--pink-400);
  margin-left: 14px;
  font-size: 16px;
  font-weight: 300;
  flex-shrink: 0;
}

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}
.pager a, .pager span {
  min-width: 40px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--pink-50);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--pink-600);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}
.pager a:hover { background: var(--pink-200); }
.pager .current { background: var(--pink-500); color: #fff; border-color: var(--pink-500); }
.pager .disabled { color: #ccc; background: #fafafa; cursor: not-allowed; }

/* ---------- 页脚 ---------- */
.footer {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--pink-600);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  letter-spacing: 1px;
}
.footer .heart-ic { color: var(--pink-500); font-size: 16px; }

/* ---------- 文章详情 ---------- */
.article-detail { padding: 30px 36px; }
.article-detail h1 {
  font-size: 24px;
  color: var(--pink-700);
  margin: 0 0 24px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border);
}
.article-meta {
  color: var(--text-2);
  font-size: 13px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.article-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-meta a { color: var(--pink-600); }
.article-content {
  font-size: 15px;
  line-height: 1.9;
  color: #4a2438;
  word-break: break-word;
}
/* 图片默认居中, 可通过 align-left / align-right 覆盖 */
.article-content img {
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin: 14px auto;
  background: #fff5f8;
}
.article-content img.align-left   { margin-left: 0;    margin-right: auto; }
.article-content img.align-right  { margin-left: auto; margin-right: 0;    }
.article-content img.align-center { margin-left: auto; margin-right: auto; }
.article-content p { margin: 0 0 14px; }
.article-content a { color: var(--pink-600); word-break: break-all; }
.article-content pre { background:#fff5f8; padding:14px; border-radius:8px; overflow:auto; border:1px solid var(--border); }

/* 视频自适应: 直接用宽高比, 保证 iframe / video 都铺满容器 */
.article-content video,
.article-content iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 8px;
  background: #000;
  margin: 14px 0;
}
/* 视频外层的容器 */
.article-content .media-block { margin: 14px 0; }
.article-content .media-block > video,
.article-content .media-block > iframe { margin: 0; }
.article-content blockquote {
  border-left: 3px solid var(--pink-400);
  padding: 6px 14px;
  color: #8a5a70;
  background: #fff5f8;
  margin: 10px 0;
  border-radius: 0 8px 8px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pink-50);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  margin-top: 24px;
  font-size: 14px;
}

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-2);
}

/* ---------- 加载动画 (进入网站时) ---------- */
#page-loader {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #ffe5ee, #ffd1e0);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .6s ease, visibility .6s ease;
}
#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.heart-loader {
  width: 80px;
  height: 80px;
  position: relative;
  animation: heart-beat 1s ease-in-out infinite;
}
.heart-loader::before,
.heart-loader::after {
  content: "";
  position: absolute;
  top: 0;
  width: 40px;
  height: 64px;
  background: var(--pink-500);
  border-radius: 40px 40px 0 0;
  box-shadow: 0 6px 20px rgba(255,77,141,.4);
}
.heart-loader::before {
  left: 40px;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
}
.heart-loader::after {
  left: 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}
.loader-text {
  margin-top: 26px;
  color: var(--pink-700);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
}
.loader-dots::after {
  content: "";
  display: inline-block;
  width: 1em; text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes heart-beat {
  0%,100% { transform: scale(1); }
  25%     { transform: scale(1.15); }
  50%     { transform: scale(.95); }
  75%     { transform: scale(1.1); }
}
@keyframes dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}

/* 飘落小心心 */
.falling-heart {
  position: fixed;
  top: -30px;
  color: var(--pink-400);
  font-size: 20px;
  opacity: .8;
  pointer-events: none;
  animation: fall linear forwards;
  z-index: 9998;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .container { padding: 0 20px; }
  .main { grid-template-columns: 1fr; gap: 20px; }
  .header { flex-direction: column; gap: 16px; padding: 18px 22px; }
  .search-box { width: 100%; }
  .search-box input { flex: 1; width: auto; }

  /* 移动端: 取消侧栏吸顶 */
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
  /* 移动端: 侧边栏分类横向滑动展示更紧凑 */
  .sidebar .cat-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cat-item {
    padding: 6px 12px;
    font-size: 13px;
  }
  .heart-card { margin-top: 14px; }
}

@media (max-width: 600px) {
  .container { padding: 0 12px; }
  .header { margin: 14px auto; padding: 14px 16px; }
  .logo { font-size: 18px; }
  .logo .logo-emoji { font-size: 22px; }

  .card { padding: 16px; }
  .card-title { font-size: 15px; margin-bottom: 12px; padding-bottom: 10px; }
  .card-title .crumb-label,
  .card-title .crumb-sep,
  .card-title .crumb-text { font-size: 18px; }

  /* 文章列表 - 手机上允许标题换行, 不再单行截断 */
  .article-item {
    padding: 12px 14px;
    border-radius: 8px;
  }
  .article-item .title {
    white-space: normal;
    line-height: 1.5;
    font-size: 14px;
    word-break: break-word;
  }

  /* 分页按钮 - 紧凑模式 */
  .pager {
    flex-wrap: wrap;
    gap: 6px;
  }
  .pager a, .pager span {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  /* 文章详情 */
  .article-detail { padding: 20px 18px; }
  .article-detail h1 { font-size: 20px; }
  .article-content { font-size: 14.5px; line-height: 1.8; }
  /* 手机端: 竖图/长图限高, 避免撑满整个屏幕 */
  .article-content img {
    max-height: 360px;
    margin: 10px auto;
  }

  .footer { font-size: 13px; padding: 16px; }

  /* 加载动画缩小 */
  .heart-loader { width: 64px; height: 64px; }
  .heart-loader::before, .heart-loader::after {
    width: 32px; height: 52px; border-radius: 32px 32px 0 0;
  }
  .heart-loader::before { left: 32px; }
}
