/* =====================================
   女性健康论坛 · 温暖优雅主题
   Women's Health Forum - Warm Elegant
   ===================================== */

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans SC', -apple-system, 'Microsoft YaHei', sans-serif;
  background: #fdfbf7;
  color: #3d3d3d;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--theme); text-decoration: none; transition: color .2s; }
a:hover { color: var(--theme); opacity: .8; }
img { max-width: 100%; height: auto; }

/* Layout */
.site-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; width: 100%; }
.main { flex: 1; padding-top: 30px; padding-bottom: 50px; }

/* Header */
.header {
  background: #fff;
  box-shadow: 0 2px 20px rgba(0,0,0,.04);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 2px solid var(--theme-light, #f5e6e8);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 28px; }
.logo-text {
  font-size: 22px; font-weight: 700; color: var(--theme);
  letter-spacing: 1px;
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 8px 16px; border-radius: 20px; font-size: 14px;
  color: #666; transition: all .2s;
}
.nav a:hover { background: var(--theme-light, #f5e6e8); color: var(--theme); }
.nav .btn-register {
  background: var(--theme); color: #fff;
  padding: 8px 20px; font-weight: 500;
}
.nav .btn-register:hover { opacity: .9; background: var(--theme); }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-username {
  font-size: 14px; color: var(--theme); font-weight: 500;
  padding: 8px 12px;
}
.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: #666; }

/* Hero Section */
.hero {
  text-align: center; padding: 60px 40px 50px;
  background: linear-gradient(135deg, var(--theme-light, #fdf2f4) 0%, #fff5f0 100%);
  border-radius: 24px; margin-bottom: 40px;
  position: relative; overflow: hidden;
}
.hero h1 { font-size: 36px; font-weight: 700; color: #3d3d3d; margin-bottom: 12px; }
.hero p { font-size: 18px; color: #888; margin-bottom: 28px; }
.btn-lg { padding: 14px 40px; font-size: 16px; }

/* Buttons */
.btn {
  display: inline-block; padding: 10px 24px; border-radius: 25px;
  font-size: 14px; font-weight: 500; border: none; cursor: pointer;
  transition: all .25s; text-align: center;
  background: #f0f0f0; color: #555;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.btn-primary { background: var(--theme); color: #fff; }
.btn-primary:hover { background: var(--theme); opacity: .9; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-small { padding: 4px 12px; font-size: 12px; border-radius: 12px; }

/* Section Titles */
.section { margin-bottom: 40px; }
.section-title {
  font-size: 22px; font-weight: 600; color: #3d3d3d;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 2px solid var(--theme-light, #f5e6e8);
}

/* Cards */
.card {
  background: #fff; border-radius: 16px; padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  transition: all .3s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }

/* Category Grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.category-card {
  background: #fff; border-radius: 16px; padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
  transition: all .3s; display: flex; align-items: center; gap: 16px;
}
.category-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.cat-icon { font-size: 36px; flex-shrink: 0; }
.cat-info h3 { font-size: 17px; font-weight: 600; color: #3d3d3d; margin-bottom: 4px; }
.cat-info p { font-size: 13px; color: #999; }
.cat-count { font-size: 12px; color: #bbb; margin-top: 6px; display: block; }

/* Thread List */
.thread-list { display: flex; flex-direction: column; gap: 2px; }
.thread-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; background: #fff; border-radius: 12px;
  transition: all .2s; border: 1px solid transparent;
}
.thread-item:hover { border-color: var(--theme-light, #f5e6e8); background: #fffbfa; }
.thread-main { flex: 1; min-width: 0; }
.thread-cat {
  font-size: 11px; color: var(--theme); background: var(--theme-light, #f5e6e8);
  padding: 2px 10px; border-radius: 10px; display: inline-block; margin-bottom: 4px;
}
.thread-title { font-size: 15px; font-weight: 500; color: #3d3d3d; }
.thread-meta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; font-size: 13px; color: #aaa; }
.badge-pin { background: #f39c12; color: #fff; padding: 1px 8px; border-radius: 8px; font-size: 11px; }
.badge-essence { background: var(--theme); color: #fff; padding: 1px 8px; border-radius: 8px; font-size: 11px; }

/* Post Cards */
.post-card {
  display: flex; gap: 20px; padding: 24px;
  background: #fff; border-radius: 16px; margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.post-sidebar { text-align: center; min-width: 60px; }
.post-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 18px; margin: 0 auto 6px;
}
.post-avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.post-username { font-size: 13px; color: #888; }
.post-content { flex: 1; min-width: 0; }
.reply-time { font-size: 12px; color: #bbb; margin-top: 12px; }

/* Markdown Body */
.markdown-body { line-height: 1.8; color: #444; }
.markdown-body p { margin-bottom: 12px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 20px 0 10px; color: #3d3d3d; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; margin-bottom: 12px; }
.markdown-body blockquote {
  border-left: 3px solid var(--theme); background: var(--theme-light, #fdf2f4);
  padding: 12px 16px; margin: 12px 0; border-radius: 0 8px 8px 0; color: #666;
}

/* Forms */
.form { max-width: 700px; margin: 0 auto; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; color: #555; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid #e8e0dc;
  border-radius: 12px; font-size: 15px; font-family: inherit;
  transition: border-color .2s; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--theme); box-shadow: 0 0 0 3px var(--theme-light, #fdf2f4);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group small { color: #aaa; font-weight: 400; }

/* Auth Forms */
.auth-form {
  max-width: 400px; margin: 40px auto; padding: 40px;
  background: #fff; border-radius: 24px; box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.auth-form h1 { text-align: center; font-size: 24px; margin-bottom: 30px; color: #3d3d3d; }
.auth-link { text-align: center; margin-top: 20px; font-size: 14px; color: #888; }

/* Messages */
.msg-success {
  padding: 12px 16px; background: #e8f5e9; color: #2e7d32;
  border-radius: 12px; margin-bottom: 16px; font-size: 14px;
}
.msg-error {
  padding: 12px 16px; background: #fce4ec; color: #c62828;
  border-radius: 12px; margin-bottom: 16px; font-size: 14px;
}

/* Reply Section */
.reply-section { margin-top: 30px; }
.reply-section h3 { font-size: 18px; margin-bottom: 20px; color: #3d3d3d; }
.reply-form { background: #fff; padding: 24px; border-radius: 16px; margin-top: 24px; }
.reply-form h4 { margin-bottom: 12px; color: #555; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: #aaa; }
.empty-state p { font-size: 16px; }

/* Error Pages */
.error-page { text-align: center; padding: 80px 20px; }
.error-page h1 { font-size: 80px; color: var(--theme); margin-bottom: 10px; }
.error-page p { font-size: 20px; color: #888; margin-bottom: 30px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { text-align: center; }
.stat-card h3 { font-size: 32px; color: var(--theme); margin-bottom: 4px; }
.stat-card p { font-size: 14px; color: #888; }

/* Admin */
.admin-nav { display: flex; gap: 12px; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f0ece8; }
.table th { background: var(--theme-light, #fdf2f4); color: #555; font-weight: 500; }
.table tr:hover td { background: #fffcfa; }

/* Sister Sites */
.sister-sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.sister-card { text-align: center; }
.sister-card.active { border: 2px solid var(--theme); }
.sister-card h3 { font-size: 18px; margin-bottom: 6px; color: #3d3d3d; }
.sister-card p { font-size: 13px; color: #999; }

/* Search */
.search-form { display: flex; gap: 12px; margin-bottom: 20px; }
.search-form input { flex: 1; padding: 12px 20px; border: 1.5px solid #e8e0dc; border-radius: 25px; font-size: 15px; }
.search-form input:focus { outline: none; border-color: var(--theme); }
.search-form button { padding: 12px 32px; }

/* Page Header */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 26px; color: #3d3d3d; }
.page-header p { color: #888; font-size: 14px; }
.cat-icon-lg { font-size: 48px; display: block; margin-bottom: 8px; }
.cat-tag { display: inline-block; padding: 3px 14px; border-radius: 12px; font-size: 12px; }
.thread-info { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; color: #888; flex-wrap: wrap; }
.back-link { display: inline-block; margin-bottom: 16px; font-size: 14px; color: #888; }
.back-link:hover { color: var(--theme); }

/* Footer */
.footer {
  background: #fff; border-top: 1px solid #f0ece8;
  padding: 30px 0; text-align: center; margin-top: auto;
}
.footer p { font-size: 13px; color: #aaa; margin-bottom: 6px; }
.footer a { color: #888; }
.footer a:hover { color: var(--theme); }
.footer-links { margin-bottom: 8px; }
.footer-links a { font-size: 14px; }
.icp { margin-top: 4px; }
.icp a { font-size: 12px; color: #ccc; }
.icp a:hover { color: #999; }
.sep { color: #ddd; margin: 0 8px; }

/* Site Links Section */
.site-links { margin-top: 30px; }

/* Responsive */
@media (max-width: 768px) {
  .wrap { padding: 0 16px; }

  /* 顶栏 */
  .header-inner { height: 50px; }
  .logo-icon { font-size: 22px; }
  .logo-text { font-size: 17px; letter-spacing: 0; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; font-size: 22px; }
  .nav {
    display: none; position: absolute; top: 50px; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 8px 16px 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,.1); border-radius: 0 0 16px 16px;
    z-index: 99;
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; padding: 12px 16px; font-size: 15px; border-radius: 10px; }
  .nav-user { width: 100%; flex-direction: row; justify-content: space-between; padding: 8px 16px; }
  .nav .btn-register { text-align: center; }

  /* 主内容 */
  .main { padding-top: 20px; padding-bottom: 30px; }

  /* Hero */
  .hero { padding: 32px 20px 30px; border-radius: 16px; margin-bottom: 24px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 15px; margin-bottom: 20px; }
  .btn-lg { padding: 12px 32px; font-size: 15px; }

  /* 分类网格 */
  .category-grid { grid-template-columns: 1fr; gap: 12px; }
  .category-card { padding: 16px 20px; }
  .cat-icon { font-size: 28px; }
  .cat-info h3 { font-size: 15px; }

  /* 帖子列表 */
  .thread-item { padding: 14px 16px; border-radius: 10px; flex-direction: column; gap: 6px; }
  .thread-title { font-size: 14px; line-height: 1.5; }
  .thread-meta { font-size: 12px; flex-wrap: wrap; gap: 8px; }
  .thread-cat { font-size: 10px; }

  /* 帖子详情 */
  .post-card { flex-direction: column; padding: 16px; border-radius: 12px; gap: 12px; }
  .post-sidebar { display: flex; flex-direction: row; align-items: center; gap: 10px; min-width: auto; }
  .post-avatar { width: 36px; height: 36px; font-size: 14px; margin: 0; }
  .post-avatar.sm { width: 28px; height: 28px; font-size: 12px; }
  .post-username { font-size: 13px; }
  .thread-info { font-size: 12px; gap: 10px; flex-wrap: wrap; }

  /* 版块页 */
  .page-header h1 { font-size: 20px; }
  .cat-icon-lg { font-size: 36px; }

  /* 表单 */
  .form-group input, .form-group select, .form-group textarea { padding: 10px 14px; font-size: 15px; border-radius: 10px; }
  .auth-form { padding: 24px 18px; margin: 20px 0; border-radius: 16px; }
  .auth-form h1 { font-size: 20px; }

  /* 搜索 */
  .search-form { flex-direction: column; gap: 10px; }
  .search-form input { padding: 10px 16px; }
  .search-form button { width: 100%; }

  /* 图库 */
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery-item img { height: 120px; }

  /* 管理后台 */
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .admin-nav { flex-direction: column; gap: 8px; }
  .admin-nav .btn { width: 100%; text-align: center; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 10px; }

  /* 版块导航 */
  .sister-sites { grid-template-columns: 1fr; gap: 12px; }
  .sister-card { padding: 16px; }

  /* 底部 */
  .footer { padding: 20px 0; }
  .footer p { font-size: 12px; }
  .footer-links a { font-size: 13px; }
  .icp a { font-size: 11px; }

  /* 通用 */
  .section-title { font-size: 18px; margin-bottom: 14px; }
  .section { margin-bottom: 24px; }
  .back-link { font-size: 13px; margin-bottom: 12px; }
  .btn { padding: 8px 20px; font-size: 13px; }
  .section-title h2 { font-size: 18px; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 12px; }
  .hero { padding: 24px 16px 24px; border-radius: 12px; }
  .hero h1 { font-size: 20px; }
  .hero p { font-size: 14px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gallery-item img { height: 100px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card h3 { font-size: 24px; }

  /* 帖子列表在极小屏优化 */
  .thread-item { padding: 12px 14px; }
  .thread-title { font-size: 13px; }
  .post-card { padding: 12px; }
  .reply-form { padding: 16px; }

  /* 导航用户区适应 */
  .nav { padding: 8px 12px 14px; }
  .nav a { padding: 10px 14px; font-size: 14px; }

  /* 管理表格横滚 */
  .table-wrap { overflow-x: auto; }
}
}
