/* 
 * 简约风格优化样式
 * 使用统一的颜色变量系统
 */

/* 导入颜色变量 */
@import url('theme-variables.css');

/* ========== 全局样式重置 ========== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--wb-text-primary);
  background-color: var(--wb-bg-secondary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== 头部样式 ========== */
.header {
  background-color: var(--wb-bg-primary);
  box-shadow: var(--wb-shadow-small);
  position: relative;
  z-index: 100;
}

.header-top {
  border-bottom: 1px solid var(--wb-border-light);
}

.logo {
  font-size: 24px;
  font-weight: 600;
  color: var(--wb-primary);
}

.logo a {
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 40px;
  width: auto;
}

/* ========== 搜索框样式 ========== */
.search-box {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.search-box input[type="search"] {
  width: 100%;
  padding: 10px 45px 10px 15px;
  border: 2px solid var(--wb-border-light);
  border-radius: var(--wb-radius-large);
  background-color: var(--wb-bg-secondary);
  transition: var(--wb-transition);
}

.search-box input[type="search"]:focus {
  background-color: var(--wb-bg-primary);
  border-color: var(--wb-primary);
  box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--wb-primary);
  color: white;
  border: none;
  border-radius: var(--wb-radius-medium);
  padding: 8px 15px;
  cursor: pointer;
  transition: var(--wb-transition);
}

.search-btn:hover {
  background-color: var(--wb-primary-hover);
}

/* ========== 导航菜单样式 ========== */
.nav-menu {
  background-color: var(--wb-bg-primary);
}

.nav-menu ul {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-menu li {
  position: relative;
}

.nav-menu a {
  display: block;
  padding: 15px 20px;
  color: var(--wb-text-primary);
  text-decoration: none;
  transition: var(--wb-transition);
}

.nav-menu a:hover {
  color: var(--wb-primary);
  background-color: var(--wb-bg-secondary);
}



/* ========== 内容卡片样式 ========== */
.content-card {
  background-color: var(--wb-bg-primary);
  border-radius: var(--wb-radius-medium);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--wb-shadow-small);
  transition: var(--wb-transition);
}

.content-card:hover {
  box-shadow: var(--wb-shadow-medium);
  transform: translateY(-2px);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--wb-text-primary);
  margin-bottom: 10px;
}

.card-meta {
  font-size: 12px;
  color: var(--wb-text-light);
  margin-bottom: 15px;
}

.card-content {
  color: var(--wb-text-secondary);
  line-height: 1.8;
}

/* ========== 侧边栏样式 ========== */
.sidebar {
  background-color: transparent;
}

.widget {
  background-color: var(--wb-bg-primary);
  border-radius: var(--wb-radius-medium);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--wb-shadow-small);
}

.widget-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--wb-text-primary);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--wb-border-light);
}

.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget li {
  padding: 8px 0;
  border-bottom: 1px solid var(--wb-border-light);
}

.widget li:last-child {
  border-bottom: none;
}

.widget a {
  color: var(--wb-text-secondary);
  transition: var(--wb-transition);
}

.widget a:hover {
  color: var(--wb-primary);
  padding-left: 5px;
}

/* ========== 主要内容区域 ========== */
.main-content, 
main, 
.container-index,
.container-archive,
.container-single,
.pw:not(.header .pw):not(.category-nav .pw) {
  flex: 1;
}

/* 确保header和category-nav不参与flex布局 */
.header,
.category-nav {
  flex-shrink: 0;
}

/* ========== 页脚样式 ========== */
.footer {
  background-color: var(--wb-bg-dark);
  color: var(--wb-text-white);
  padding: 40px 0 20px;
  margin-top: auto;
  flex-shrink: 0;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-widget h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--wb-text-white);
}

.footer-widget ul {
  list-style: none;
  padding: 0;
}

.footer-widget li {
  margin-bottom: 8px;
}

.footer-widget a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--wb-transition);
}

.footer-widget a:hover {
  color: var(--wb-text-white);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

/* ========== 文章列表样式 ========== */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.post-item {
  background-color: var(--wb-bg-primary);
  border-radius: var(--wb-radius-medium);
  overflow: hidden;
  box-shadow: var(--wb-shadow-small);
  transition: var(--wb-transition);
}

.post-item:hover {
  box-shadow: var(--wb-shadow-medium);
  transform: translateY(-3px);
}

.post-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: var(--wb-bg-light);
}

.post-content {
  padding: 20px;
}

.post-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--wb-text-primary);
  margin-bottom: 10px;
}

.post-excerpt {
  color: var(--wb-text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 15px;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--wb-text-light);
}

/* ========== 标签和分类样式 ========== */
/* 首页卡片中的tag样式 */
.tag {
  display: inline-block;
  padding: 4px 8px;
  background-color: var(--wb-bg-light);
  color: var(--wb-text-secondary);
  border-radius: var(--wb-radius-small);
  font-size: 13px;
  margin: 2px;
  transition: var(--wb-transition);
}

/* 详情页分类标签样式 */
.category-tag {
  display: inline-block;
  padding: 6px 12px;
  background-color: var(--wb-bg-light);
  color: var(--wb-text-secondary);
  border-radius: var(--wb-radius-small);
  font-size: 18px;
  margin: 2px;
  transition: var(--wb-transition);
}

.tag:hover {
  background-color: var(--wb-primary);
  color: var(--wb-text-white);
}

.category-tag:hover {
  background-color: var(--wb-primary);
  color: var(--wb-text-white);
}

/* ========== 分页样式 ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 40px 0;
}

.pagination a,
.pagination span {
  padding: 8px 12px;
  border-radius: var(--wb-radius-small);
  background-color: var(--wb-bg-primary);
  color: var(--wb-text-secondary);
  transition: var(--wb-transition);
  box-shadow: var(--wb-shadow-small);
}

.pagination a:hover {
  background-color: var(--wb-primary);
  color: var(--wb-text-white);
}

.pagination .current {
  background-color: var(--wb-primary);
  color: var(--wb-text-white);
}

/* ========== 表单样式 ========== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--wb-text-primary);
}

.form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-small);
  background-color: var(--wb-bg-primary);
  color: var(--wb-text-primary);
  transition: var(--wb-transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--wb-primary);
  box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .nav-menu ul {
    flex-direction: column;
  }
  
  .post-list {
    grid-template-columns: 1fr;
  }
  
  .footer-widgets {
    grid-template-columns: 1fr;
  }
}

/* ========== 工具类 ========== */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

.rounded { border-radius: var(--wb-radius-medium); }
.shadow { box-shadow: var(--wb-shadow-medium); }

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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