/*
 Theme Name:   Dynamico Child
 Theme URI:    你的网站地址（可选）
 Description:  Dynamico 主题子主题（侧边栏圆形按钮+主题色#F54927+顶部30px）
 Author:       你的名字
 Author URI:   你的个人地址（可选）
 Template:     dynamico
 Version:      1.3.0
 Text Domain:  dynamico-child
*/

/* ==============================================
   1. 手机端侧边栏展开按钮（圆形 + 主题色#F54927 + 顶部30px）
   ============================================== */
.sidebar-toggle-btn {
  display: none; /* 默认隐藏，大屏不显示 */
  position: fixed !important; /* 固定定位，不随滚动动 */
  top: 30px !important; /* 核心修改：距离顶部30px */
  right: 15px !important; /* 距离右侧15px */
  z-index: 9999 !important; /* 最高层级 */
  /* 圆形按钮：宽高一致 + 50%圆角 */
  width: 44px; 
  height: 44px;
  border-radius: 50% !important; /* 恢复圆形 */
  /* 垂直布局：箭头+文字，适配圆形 */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px; /* 缩小间距适配圆形 */
  background: #F54927 !important; /* 主题色 */
  color: #ffffff !important;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  outline: none;
  line-height: 1;
  padding: 0; /* 清除内边距，适配圆形 */
}

/* 按钮内箭头样式（适配圆形） */
.sidebar-toggle-btn .arrow {
  font-size: 16px;
  font-weight: bold;
}

/* 按钮内文字样式（大写SIDEBAR，缩小字体适配圆形） */
.sidebar-toggle-btn .text {
  font-size: 8px; /* 缩小字体适配圆形 */
  text-transform: uppercase; /* 强制大写 */
  letter-spacing: 0.3px;
  font-weight: 600; /* 加粗文字 */
}

/* hover效果（主题色加深） */
.sidebar-toggle-btn:hover {
  background: #E03E1F !important; /* 主题色加深 */
  transform: translateX(-3px); /* 轻微左移 */
}

/* 点击高亮 */
.sidebar-toggle-btn:focus {
  box-shadow: 0 0 0 3px rgba(245, 73, 39, 0.3); /* 主题色高亮 */
}

/* ==============================================
   2. 手机端侧边栏样式（默认隐藏，点击展开）
   ============================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

#secondary.sidebar.widget-area {
  transition: transform 0.3s ease-in-out;
}

/* ==============================================
   3. 返回顶部按钮（圆形 + 主题色#F54927，保持风格统一）
   ============================================== */
.back-to-top {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 15px;
  z-index: 9999;
  /* 圆形按钮：宽高一致 + 50%圆角 */
  width: 44px;
  height: 44px;
  border-radius: 50% !important;
  /* 垂直布局 */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: #F54927 !important; /* 主题色 */
  color: #ffffff !important;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  outline: none;
  line-height: 1;
  padding: 0;
}

.back-to-top .arrow {
  font-size: 16px;
  font-weight: bold;
}

.back-to-top .text {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

/* hover效果（主题色加深） */
.back-to-top:hover {
  background: #E03E1F !important;
  transform: translateY(-3px);
}

/* 点击高亮 */
.back-to-top:focus {
  box-shadow: 0 0 0 3px rgba(245, 73, 39, 0.3);
}

/* ==============================================
   4. 响应式适配
   ============================================== */
/* 手机端（≤768px） */
@media (max-width: 768px) {
  /* 显示侧边栏按钮 */
  .sidebar-toggle-btn {
    display: flex !important;
    width: 40px; /* 手机端圆形按钮缩小 */
    height: 40px;
    top: 30px !important; /* 手机端同步顶部30px */
    right: 10px !important;
  }
  .sidebar-toggle-btn .arrow {
    font-size: 14px;
  }
  .sidebar-toggle-btn .text {
    font-size: 7px; /* 进一步缩小文字适配小圆形 */
  }

  /* 隐藏默认侧边栏 */
  #secondary.sidebar.widget-area {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 280px !important;
    height: 100vh !important;
    background: #ffffff !important;
    z-index: 9999 !important;
    transform: translateX(100%) !important;
    overflow-y: auto !important;
    padding: 25px 20px !important;
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.15) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  #secondary.sidebar.widget-area.sidebar-open {
    transform: translateX(0) !important;
  }

  .sidebar-overlay.show {
    display: block !important;
  }

  /* 返回顶部按钮手机端适配 */
  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 10px;
  }
  .back-to-top .arrow {
    font-size: 14px;
  }
  .back-to-top .text {
    font-size: 7px;
  }
}

/* 大屏（≥769px） */
@media (min-width: 769px) {
  .sidebar-toggle-btn {
    display: none !important;
  }

  .sidebar-overlay {
    display: none !important;
  }

  #secondary.sidebar.widget-area {
    position: static !important;
    width: auto !important;
    height: auto !important;
    transform: none !important;
    background: inherit !important;
    box-shadow: none !important;
    padding: inherit !important;
    margin: inherit !important;
    overflow: visible !important;
  }
}

/* ==============================================
   5. 全局优化
   ============================================== */
#secondary.sidebar.widget-area::-webkit-scrollbar {
  width: 6px !important;
}
#secondary.sidebar.widget-area::-webkit-scrollbar-thumb {
  background: #e0e0e0 !important;
  border-radius: 3px !important;
}

html, body {
  overflow-x: visible !important;
  position: relative !important;
  height: 100% !important;
}

#colophon.site-footer {
    background-color: inherit !important; /* 继承#333333 */
}

/* ==============================================
   子主题404页面样式（适配浅色背景）
   ============================================== */
/* 1. 404页面核心容器适配浅色背景 */
#primary.content-area,
main#main.site-main,
section.error-404.not-found {
    background-color: #f9f9f9 !important; /* 浅色背景（匹配主题默认浅色） */
    color: #333 !important; /* 基础文字深色，保证可读性 */
}

/* 2. 404页面整体布局 */
.error-404 {
    padding: 80px 20px;
    text-align: center;
    min-height: 60vh; /* 保证页面高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important; /* 清除默认边距 */
}

/* 3. 404内容包裹层 */
.error-404__wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 4. 404数字标题（主题色突出） */
.error-404__title {
    margin-bottom: 30px;
}
.error-404__number {
    display: block;
    font-size: 8rem;
    font-weight: 700;
    color: #F54927; /* 保留主题色，浅色背景更醒目 */
    line-height: 1;
    margin-bottom: 15px;
}
.error-404__text {
    font-size: 2rem;
    color: #222; /* 深色文字，适配浅色背景 */
    font-weight: 500;
}

/* 5. 提示文字 */
.error-404__desc {
    font-size: 1.1rem;
    color: #666; /* 浅一点的深色，避免太厚重 */
    line-height: 1.8;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 6. 操作按钮区域 */
.error-404__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

/* 7. 返回首页按钮（适配浅色背景） */
.error-404__btn--home {
    display: inline-block;
    padding: 12px 30px;
    background-color: #F54927;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(245, 73, 39, 0.2); /* 浅色背景阴影更柔和 */
}
.error-404__btn--home:hover {
    background-color: #E03E1F;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(245, 73, 39, 0.3);
}

/* 8. 404搜索框样式（适配浅色背景） */
.error-404__search {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}
.error-404__search .search-form {
    display: flex;
    gap: 10px;
}
.error-404__search .search-field {
    flex: 1;
    padding: 12px 15px;
    background-color: #fff; /* 白色搜索框，适配浅色背景 */
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}
.error-404__search .search-field:focus {
    border-color: #F54927;
    box-shadow: 0 0 0 2px rgba(245, 73, 39, 0.1);
}
.error-404__search .search-submit {
    padding: 12px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}
.error-404__search .search-submit:hover {
    background-color: #F54927;
    border-color: #F54927;
    color: #fff;
}

/* 9. 响应式适配（手机端） */
@media (max-width: 768px) {
    .error-404__number {
        font-size: 5rem;
    }
    .error-404__text {
        font-size: 1.5rem;
    }
    .error-404__desc {
        font-size: 1rem;
        padding: 0 10px;
    }
    .error-404__actions {
        flex-direction: column;
        gap: 15px;
    }
    .error-404__search {
        min-width: 100%;
        max-width: 100%;
    }
    .error-404 {
        padding: 60px 20px;
        min-height: 50vh;
    }
}

/* 10. 兜底：确保404页面body背景为主题浅色 */
body.error404 {
    background-color: #f9f9f9 !important; /* 匹配主题浅色背景，可替换为#ffffff */
}
