/*!
 * 得意Blog - 自定义主题优化样式
 * Based on classic-22 (Pico CSS)
 * 设计语言: 清爽现代 · 柔和渐变 · 卡片化
 */

/* ========== 配色方案 ========== */
[data-theme="customize"] {
  /* 主色: 靛蓝(现代感) */
  --pico-primary: #4F6EF7 !important;
  --pico-primary-hover: #3A56D4 !important;
  --pico-primary-hover-background: #3A56D4 !important;
  --pico-primary-background: #4F6EF7 !important;
  --pico-primary-focus: rgba(79, 110, 247, 0.2) !important;

  /* 背景: 浅灰蓝(比纯白柔和) */
  --pico-background-color: #F5F7FB !important;
  --pico-color: #2D3541 !important;

  /* 次级元素 */
  --pico-secondary: #6B7A99 !important;
  --pico-muted-color: #8A94A6 !important;
  --pico-muted-border-color: #E4E9F2 !important;
  --pico-form-element-border-color: rgba(79, 110, 247, 0.2) !important;
  --pico-code-background-color: #EEF1F8 !important;
  --pico-h1-color: #1F2733 !important;
  --pico-h2-color: #252E3D !important;
  --pico-card-background-color: #FFFFFF !important;
}

/* ========== 全局排版 ========== */
body {
  background: linear-gradient(180deg, #F5F7FB 0%, #EEF2FA 100%);
  min-height: 100vh;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ========== 导航栏 ========== */
.site-navbar {
  background: linear-gradient(135deg, #4F6EF7 0%, #6C8CFF 50%, #7C5CFC 100%) !important;
  box-shadow: 0 2px 20px rgba(79, 110, 247, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.site-navbar .brand {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.site-navbar .desc {
  color: rgba(255, 255, 255, 0.75) !important;
  font-size: 0.875rem;
}

.site-navbar nav li a {
  transition: all 0.2s ease;
  border-radius: 8px !important;
}

.site-navbar nav li a:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

.site-navbar nav li a.active {
  background-color: rgba(255, 255, 255, 0.2) !important;
  font-weight: 600;
}

/* 搜索框 */
.site-navbar input[type="search"] {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
  border-radius: 100px !important;
  transition: all 0.25s ease;
}

.site-navbar input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
}

.site-navbar input[type="search"]:focus {
  background-color: rgba(255, 255, 255, 0.95) !important;
  color: #2D3541 !important;
  border-color: transparent !important;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2) !important;
}

/* 导航搜索框（图标+输入框） */
.nav-search-item {
  margin-left: 0.25rem;
}

.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}

.nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
  z-index: 1;
}

.nav-search-input {
  width: 140px !important;
  padding: 0.45rem 0.9rem 0.45rem 2.1rem !important;
  font-size: 0.875rem !important;
  background-image: none !important;  /* 清除 Pico 自带放大镜背景图标，避免与手动 SVG 重叠 */
}

.nav-search-input:focus {
  width: 200px !important;
}

.nav-search-input:focus ~ .nav-search-icon,
.nav-search:focus-within .nav-search-icon {
  color: #4F6EF7 !important;
}

/* ========== 搜索建议下拉面板 ========== */
.nav-user {
  position: relative;
}

.nav-user .nav-search-item {
  margin-left: 0.35rem;
}

.nav-user .nav-search {
  margin-right: 0;
}

.search-suggest {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(31, 39, 51, 0.2);
  border: 1px solid #EEF1F7;
  overflow: hidden;
  padding: 0.4rem 0;
  z-index: 300;
}

.search-suggest.show {
  display: block;
}

.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  color: #2D3541 !important;
  font-size: 0.9rem;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease, color 0.15s ease;
}

.search-suggest-item::before {
  content: '\1F50D';
  font-size: 0.8rem;
  opacity: 0.55;
  flex-shrink: 0;
}

.search-suggest-item:hover {
  background: rgba(79, 110, 247, 0.08);
  color: #4F6EF7 !important;
}

.search-suggest-empty {
  padding: 0.9rem 1rem;
  color: #8A93A6;
  font-size: 0.85rem;
  text-align: center;
}

/* ========== Hero 区域 ========== */
.site-hero {
  text-align: center;
  padding: 3.5rem 1rem 2.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(180deg, rgba(79, 110, 247, 0.08) 0%, rgba(245, 247, 251, 0) 100%);
}

.site-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: #1F2733;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}

.site-hero .hero-desc {
  font-size: 1.1rem;
  color: #6B7A99;
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

/* ========== 文章卡片化 ========== */
main.container {
  padding-top: 1rem;
}

.post {
  background: var(--pico-card-background-color, #fff);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(31, 39, 51, 0.06);
  padding: 2.5rem 2.5rem 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(228, 233, 242, 0.8);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.post:hover {
  box-shadow: 0 8px 32px rgba(79, 110, 247, 0.12);
  transform: translateY(-2px);
}

.post .entry-header {
  margin-bottom: 1.5rem;
}

.post .entry-title {
  font-size: 1.6rem;
  font-weight: 700;
}

.post .entry-title a {
  color: #1F2733 !important;
  transition: color 0.2s ease;
  text-decoration: none !important;
}

.post .entry-title a:hover {
  color: var(--pico-primary) !important;
}

/* 文章元信息: 日期/分类/评论 做成小徽章 */
.post .entry-meta li {
  display: inline-flex;
  align-items: center;
  background: #F0F3FA;
  padding: 4px 12px;
  border-radius: 100px;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: #6B7A99;
}

.post .entry-meta li a {
  color: #6B7A99;
  text-decoration: none;
}

.post .entry-meta li a:hover {
  color: var(--pico-primary);
}

.post .entry-meta .feather-calendar:before,
.post .entry-meta .feather-folder:before,
.post .entry-meta .feather-message:before {
  margin-right: 0.35rem;
  opacity: 0.6;
}

/* ========== 正文排版 ========== */
.fmt {
  font-size: 1.02rem;
  line-height: 1.85;
  color: #3A4353;
}

.fmt p {
  margin-bottom: 1.2rem;
}

.fmt h2, .fmt h3 {
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #EEF1F8;
}

.fmt a {
  color: var(--pico-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fmt blockquote {
  border-left: 4px solid var(--pico-primary);
  background: #F5F7FC;
  border-radius: 0 12px 12px 0;
  padding: 1rem 1.5rem;
  color: #5A6474;
}

.fmt code {
  background: #EEF1F8;
  color: #4F6EF7;
  border-radius: 6px;
  padding: 2px 6px;
}

.fmt pre {
  background: #1F2733;
  border-radius: 12px;
  padding: 1.25rem;
}

.fmt pre code {
  background: transparent;
  color: #E4E9F2;
}

.fmt img {
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(31, 39, 51, 0.1);
}

/* ========== 页脚 ========== */
.site-footer {
  margin-top: 3rem;
  padding: 2rem 0 1.5rem;
  background: #fff;
  border-top: 1px solid #E4E9F2;
}

.site-footer a {
  color: var(--pico-primary);
  text-decoration: none;
}

/* ========== 评论区域 ========== */
.comment-body {
  border-radius: 12px !important;
  background: #F8FAFD;
  border-color: #E4E9F2 !important;
}

.comment-author cite a {
  color: #252E3D !important;
}

/* ========== 按钮 ========== */
[role="button"], button, [type="submit"] {
  border-radius: 10px !important;
  font-weight: 600;
}

/* ========== 响应式 ========== */
@media (max-width: 767px) {
  .post {
    padding: 1.5rem 1.25rem;
  }
  .site-hero {
    padding: 2.5rem 1rem 1.5rem;
  }
  .site-hero h1 {
    font-size: 1.75rem;
  }
  main.container {
    padding-top: 0.5rem;
  }
}

/* ========== 站点 Hero 区域（首页顶部） ========== */
.site-hero {
  position: relative;
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  margin: 0 0 2rem;          /* 原 -1rem -1rem 导致横向溢出，去掉 */
  background: linear-gradient(135deg, #4F6EF7 0%, #6C8CFF 55%, #7C5CFC 100%);
  color: #fff;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 8px 32px rgba(79, 110, 247, 0.25);
}

.site-hero::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.site-hero::after {
  content: "";
  position: absolute;
  bottom: -70%;
  left: -15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.site-hero h1 {
  position: relative;
  z-index: 1;
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.site-hero .hero-desc {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 38rem;
  margin: 0 auto 1.75rem;
  line-height: 1.8;
}

.site-hero .hero-tag {
  position: relative;
  z-index: 1;
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.site-hero .hero-tag span {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.4rem 1.1rem;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* ========== Hero 大搜索框（首页顶部） ========== */
.hero-search {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;                /* 输入框与按钮之间留缝隙，彻底分离 */
  max-width: 36rem;
  margin: 0 auto 1.75rem;
  background: transparent;    /* 容器不再自绘白底 */
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  transition: none;
}

.hero-search:focus-within {
  box-shadow: none;
}

.hero-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #8A93A6;
  pointer-events: none;
  z-index: 1;
}

.hero-search-input {
  flex: 1;
  width: auto !important;      /* 覆盖 Pico input width:100% */
  min-width: 0;
  border: none !important;
  background: #fff !important; /* 输入框自带白底 */
  padding: 0.85rem 1.2rem !important; /* 无图标，左右均衡留白 */
  font-size: 1rem !important;
  color: #1F2733 !important;
  margin: 0 !important;
  border-radius: 100px !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.2s ease;
}

.hero-search-input:focus {
  border: none !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(255, 255, 255, 0.25) !important;
}

.hero-search-input::placeholder {
  color: #A5AEC0;
}

.hero-search-btn {
  flex-shrink: 0;
  width: auto !important;      /* 覆盖 Pico button[type=submit] width:100% */
  border: none !important;
  background: linear-gradient(135deg, #4F6EF7 0%, #6C8CFF 100%) !important;
  color: #fff !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  padding: 0.85rem 1.7rem !important;
  border-radius: 100px !important;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 14px rgba(79, 110, 247, 0.35);
}

.hero-search-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Hero 搜索框的下拉建议 */
.hero-search .search-suggest {
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  min-width: 0;
  text-align: left;
}

.hero-search .search-suggest-item {
  color: #2D3541 !important;
}

.hero-search .search-suggest-item:hover {
  color: #4F6EF7 !important;
}

@media (max-width: 767px) {
  .site-hero {
    margin: 0 0 2rem !important;   /* 重置桌面端负 margin，防止横向溢出 */
    padding: 2.75rem 1rem 2rem;
    border-radius: 0 0 16px 16px;
  }
  .site-hero h1 {
    font-size: 1.9rem;
  }
  /* Hero 大搜索框移动端 */
  .hero-search {
    max-width: 100%;
    margin-bottom: 1.25rem;
    gap: 0.4rem;              /* 移动端按钮与输入框间距略收窄 */
  }
  .hero-search-input {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
  }
  .hero-search-icon {
    left: 14px;
  }
  .hero-search-btn {
    padding: 0.65rem 1.1rem !important;
    font-size: 0.875rem !important;
  }
  /* 导航搜索框移动端自适应 */
  .nav-search-item {
    margin-left: 0;
    width: 100%;
  }
  .nav-search {
    width: 100%;
  }
  .nav-search-input {
    width: 100% !important;
    padding: 0.6rem 0.9rem 0.6rem 2.3rem !important;
  }
  .nav-user .nav-search-item {
    padding: 0.5rem 0.75rem !important;
  }
  .search-suggest {
    min-width: 0;
    width: 100%;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
  }
}

/* 文章卡片微调：去掉过多的留白分隔线 */
.post-separator {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #E4E9F2, transparent);
  margin: 0 0 1.5rem;
  opacity: 0.6;
}

/* 首页文章列表间距 */
main.container .container-thin .post {
  margin-bottom: 1.75rem;
}

/* ========== 标题卡片模式（列表页只显示标题） ========== */
.post-title-only {
  padding: 1.5rem 2rem;
  text-align: center;
  margin-bottom: 1rem !important;
}

.post-title-only .entry-header {
  margin-bottom: 0 !important;
}

.post-title-only .entry-title {
  font-size: 1.35rem !important;
  font-weight: 600;
  margin-bottom: 0 !important;
}

.post-title-only .entry-title a {
  color: #252E3D !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
  display: inline-block;
}

.post-title-only .entry-title a:hover {
  color: var(--pico-primary) !important;
}

.post-title-only .entry-meta {
  margin-top: 0.75rem;
  justify-content: center;
}

.post-title-only .entry-meta li {
  margin-right: 0.5rem;
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .post-title-only {
    padding: 1.1rem 1.25rem;
  }
  .post-title-only .entry-title {
    font-size: 1.15rem !important;
  }
}

/* ========== 文章缩略图 ========== */
.post-thumb-link {
  display: block;
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
  max-height: 260px;
}

.post-thumb {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.post-thumb-link:hover .post-thumb {
  transform: scale(1.03);
  opacity: 0.92;
}

/* ========== 网盘下载按钮 ========== */
.pan-download {
  margin: 2rem 0;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(79, 110, 247, 0.06), rgba(124, 92, 252, 0.06));
  border: 1px dashed rgba(79, 110, 247, 0.35);
  border-radius: 14px;
}

.pan-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2.2rem;
  background: linear-gradient(135deg, #4F6EF7 0%, #7C5CFC 100%);
  color: #fff !important;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 100px;
  box-shadow: 0 4px 16px rgba(79, 110, 247, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none !important;
}

.pan-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(79, 110, 247, 0.45);
  color: #fff !important;
}

.pan-download-btn:active {
  transform: translateY(0);
}

.pan-download-tip {
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
  color: #8A93A6;
}

/* ========== 登录后下载（锁定态） ========== */
.pan-download-locked {
  border-style: solid;
  border-color: rgba(79, 110, 247, 0.25);
  background: linear-gradient(135deg, rgba(79, 110, 247, 0.05), rgba(124, 92, 252, 0.05));
  color: #4F6EF7;
}

.pan-download-locked > svg {
  margin-bottom: 0.5rem;
}

.pan-locked-title {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #3A4A6B;
}

.pan-locked-tip {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  color: #8A93A6;
}

.pan-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 2rem;
  background: linear-gradient(135deg, #4F6EF7 0%, #7C5CFC 100%);
  color: #fff !important;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 100px;
  box-shadow: 0 4px 16px rgba(79, 110, 247, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none !important;
}

.pan-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(79, 110, 247, 0.45);
  color: #fff !important;
}

.pan-register-tip {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: #8A93A6;
}

.pan-register-tip a {
  color: #4F6EF7;
  font-weight: 500;
  text-decoration: none;
}

.pan-register-tip a:hover {
  text-decoration: underline;
}
