/* ========================================
   香皂 www.xiangzaohe.cn - 全局样式
   风格: 作者档案风格 (author-profile)
   主色调: #673ab7
   ======================================== */

/* CSS 变量定义 */
:root {
  --accent-color: #673ab7;
  --accent-light: #9575cd;
  --accent-dark: #512da8;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f6fc;
  --bg-card: #fff;
  --border-color: #e8e5ee;
  --shadow-sm: 0 2px 8px rgba(103, 58, 183, 0.08);
  --shadow-md: 0 4px 16px rgba(103, 58, 183, 0.12);
  --shadow-lg: 0 8px 32px rgba(103, 58, 183, 0.15);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --max-width: 1200px;
  --header-height: 64px;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   页头 Header
   ======================================== */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 0;
  position: relative;
}

.nav a:hover,
.nav a.active {
  color: var(--accent-color);
}

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-color);
  border-radius: 2px;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 240px;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  background: var(--bg-secondary);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-color);
  width: 280px;
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  opacity: 0.5;
}

/* ========================================
   个人资料头部 (Profile Header)
   ======================================== */
.profile-header {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  padding: 60px 24px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  background: #fff;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.profile-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.profile-role {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.profile-bio {
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.85;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.profile-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  position: relative;
  z-index: 1;
}

.social-link {
  padding: 10px 20px;
  background: rgba(255,255,255,0.15);
  border-radius: 24px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
  transform: translateY(-2px);
}

/* ========================================
   面包屑导航
   ======================================== */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--accent-color);
}

.breadcrumb span {
  margin: 0 8px;
}

/* ========================================
   内容区域
   ======================================== */
.content-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--accent-color);
  border-radius: 2px;
}

/* ========================================
   文章卡片
   ======================================== */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  display: flex;
  gap: 20px;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-thumb {
  width: 160px;
  height: 120px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
}

.article-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.4;
}

.article-title a {
  color: inherit;
}

.article-title a:hover {
  color: var(--accent-color);
}

.article-excerpt {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 12px;
  flex: 1;
}

.article-meta {
  display: flex;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========================================
   三栏文章列表 (首页)
   ======================================== */
.three-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.column {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.column-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-primary);
}

.column-list {
  list-style: none;
}

.column-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.column-list a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  display: block;
  transition: all 0.3s ease;
}

.column-list a:hover {
  color: var(--accent-color);
  padding-left: 8px;
}

/* ========================================
   分类页样式
   ======================================== */
.category-header {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-bottom: 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.category-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.category-desc {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 20px;
}

.category-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.page-item {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.3s ease;
}

.page-item:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.page-item.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

/* ========================================
   文章详情页
   ======================================== */
.article-detail {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.article-detail-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.article-detail-meta {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.article-featured-image {
  width: 100%;
  height: 400px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  overflow: hidden;
}

.article-body {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 20px;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--text-primary);
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text-primary);
}

.article-body ul,
.article-body ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
}

/* 相关文章 */
.related-section {
  margin-top: 48px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.related-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.related-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.related-thumb {
  height: 160px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.related-info {
  padding: 16px;
}

.related-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ========================================
   404 页面
   ======================================== */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 16px;
  opacity: 0.8;
}

.error-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
}

.error-actions {
  display: flex;
  gap: 16px;
}

.btn {
  padding: 12px 28px;
  border-radius: 24px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* ========================================
   页脚 Footer
   ======================================== */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.footer-links a:hover {
  color: var(--accent-color);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1024px) {
  .three-columns {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .nav {
    display: none;
  }

  .search-box input {
    width: 160px;
  }

  .search-box input:focus {
    width: 180px;
  }

  .profile-header {
    padding: 40px 16px;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
  }

  .profile-name {
    font-size: 1.5rem;
  }

  .profile-role {
    font-size: 1rem;
  }

  .profile-social {
    flex-wrap: wrap;
    gap: 12px;
  }

  .social-link {
    padding: 8px 16px;
    font-size: 0.8125rem;
  }

  .content-wrapper {
    padding: 24px 16px;
  }

  .three-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .column {
    padding: 20px;
  }

  .article-card {
    flex-direction: column;
    padding: 20px;
  }

  .article-thumb {
    width: 100%;
    height: 180px;
  }

  .category-stats {
    gap: 24px;
  }

  .article-detail {
    padding: 24px;
  }

  .article-detail-title {
    font-size: 1.5rem;
  }

  .article-featured-image {
    height: 240px;
    font-size: 4rem;
  }

  .article-body {
    font-size: 1rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .error-code {
    font-size: 5rem;
  }

  .error-actions {
    flex-direction: column;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 16px 24px;
  }
}

@media (max-width: 480px) {
  .logo span {
    display: none;
  }

  .category-header {
    padding: 24px 20px;
  }

  .category-title {
    font-size: 1.375rem;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .page-item {
    min-width: 36px;
    height: 36px;
    font-size: 0.875rem;
  }
}
