/* ============================================ */
/* CTCC 中国可信云社区 — 经典绿色主题           */
/* 还原自原站 www.chinasigtc.cn 风格            */
/* 2026 重构 · 致敬经典                        */
/* ============================================ */

/* ── Variables & Reset ─────────────────────── */
:root {
  /* 绿色主题色板 — CTCC 极浅绿 */
  --green-dark:    #1b5e2b;    /* 深绿 — 顶栏/页脚背景 */
  --green-mid:     #388e3c;    /* 中绿 — 按钮/hover */
  --green-light:   #81c784;    /* 亮绿 — 链接/强调 */
  --green-pale:    #f1f8e9;    /* 浅绿 — 卡片背景/分割线 */
  --green-bg:      #fafff5;    /* 页面背景 — 极淡绿 */
  --green-accent:  #a5d6a7;    /* 高亮绿 */

  /* 文字色 */
  --text-primary:   #1b1b1b;
  --text-secondary: #4a4a4a;
  --text-muted:     #888;
  --text-on-dark:   #e0e0e0;

  /* 布局 */
  --max-width: 1200px;
  --radius: 6px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "SimSun", "Helvetica Neue", Arial, sans-serif;
  background: var(--green-bg);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 14px;
}

a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; }

/* ── Header / Top Nav ──────────────────────── */
.header {
  background: var(--green-dark);
  border-bottom: 3px solid var(--green-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  height: 56px;
}

.logo { display: flex; align-items: center; text-decoration: none !important; flex-shrink: 0; margin-right: 0; }
.logo img { display: block; height: 56px; width: auto; }
.logo-text { font-size: 18px; font-weight: bold; color: #ffffff; margin-left: 10px; white-space: nowrap; letter-spacing: 1px; }

/* ── 汉堡按钮 ────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: #e8f5e9;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 4px;
}

/* ── 导航区域（桌面：横排；手机：汉堡控制）─── */
.nav-area {
  display: flex;
  align-items: center;
}

@media (min-width: 769px) {
  .nav-area {
    margin-left: auto;
  }
}

/* 导航栏：一切从左到右 */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-bar > a {
  color: #c8e6c9;
  text-decoration: none;
  padding: 4px 10px;
  font-size: 19.5px;
  border-radius: 3px;
  font-family: inherit;
  white-space: nowrap;
}
.nav-bar > a:first-child { padding-left: 0; }
.nav-bar > a:hover,
.nav-bar > a.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
  text-decoration: none;
}
.nav-vbar {
  color: rgba(255,255,255,0.2);
  font-size: 14px;
  padding: 0 3px;
  flex-shrink: 0;
}

/* 更多下拉 */
.nav-more { position: relative; }
.nav-more-btn {
  background: none;
  border: none;
  color: #c8e6c9;
  padding: 4px 10px;
  font-size: 19.5px;
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.15s;
}
.nav-more-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 140px;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border: 1px solid #e0e0e0;
  z-index: 200;
  padding: 6px 0;
  margin-top: 6px;
}
.nav-dropdown.show { display: block; }
.nav-dropdown a {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.nav-dropdown a:hover,
.nav-dropdown a.active {
  background: var(--green-pale);
  color: var(--green-dark);
  text-decoration: none;
}

/* ── Hero / Banner ─────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1b5e2b 0%, #2e7d32 50%, #43a047 100%);
  color: #fff;
  padding: 40px 15px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(76,175,80,0.15) 0%, transparent 60%);
}
.hero h1 {
  font-size: 28px;
  font-weight: 700;
  position: relative;
  z-index: 1;
  letter-spacing: 1px;
}
.hero .hero-subtitle {
  font-size: 15px;
  color: #a5d6a7;
  margin-top: 6px;
  position: relative;
  z-index: 1;
  font-weight: 500;
}
.hero p {
  font-size: 14px;
  color: #c8e6c9;
  margin-top: 10px;
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
}

/* ── Layout ────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 15px;
}

.page-header {
  background: #fff;
  border-bottom: 1px solid var(--green-pale);
  padding: 20px 15px;
  text-align: center;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--green-dark);
}

/* ── Section Titles ────────────────────────── */
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--green-light);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .badge {
  font-size: 11px;
  background: var(--green-dark);
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 500;
}

/* ── Card System (Classic List Style) ───────── */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.15s;
  border: 1px solid #e0e0e0;
  display: flex;
}
.card:hover {
  background: var(--green-pale);
  border-color: var(--green-light);
}

.card-img-wrapper {
  width: 220px;
  min-height: 150px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--green-pale);
}

.card-body {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--green-dark);
  line-height: 1.4;
}
.card-body h3 a {
  color: var(--green-dark);
  text-decoration: none;
}
.card-body h3 a:hover {
  color: var(--green-mid);
  text-decoration: underline;
}
.card-body p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
  flex: 1;
}
.card-body .meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
}

@media (max-width: 768px) {
  .card {
    flex-direction: column;
  }
  .card-img-wrapper {
    width: 100%;
    height: 180px;
  }
}

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--green-mid);
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--green-dark);
  text-decoration: none !important;
  transform: translateY(-1px);
}
.btn-outline {
  border: 1px solid var(--green-light);
  color: var(--green-mid) !important;
  background: transparent;
}
.btn-outline:hover {
  background: var(--green-pale);
  border-color: var(--green-dark);
  text-decoration: none !important;
}

/* ── Section Links ─────────────────────────── */
.section-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.section-links a {
  color: var(--green-mid) !important;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 3px;
  background: var(--green-pale);
  transition: all 0.15s;
}
.section-links a:hover {
  background: var(--green-light);
  color: #fff !important;
  text-decoration: none;
}

/* ── Links Grid ────────────────────────────── */
.links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 12px 0;
}
.links-grid a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.15s;
  border: 1px solid #e0e0e0;
  font-size: 13px;
}
.links-grid a:hover {
  background: var(--green-pale);
  border-color: var(--green-light);
  color: var(--green-dark);
  text-decoration: none;
}
.links-grid img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* ── About Section ─────────────────────────── */
.about-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid #e0e0e0;
  margin-bottom: 20px;
}
.about-section p {
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: 14px;
}

/* ── Detail Page ───────────────────────────── */
.detail-header-img-wrapper {
  width: 100%;
  max-height: 360px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--green-pale);
  margin-bottom: 16px;
}
.detail-header-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.breadcrumb {
  padding: 12px 15px;
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--green-mid); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.detail-meta {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.detail-content {
  line-height: 2;
  color: var(--text-secondary);
  font-size: 14px;
}
.detail-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 12px 0;
}
.detail-content p { margin-bottom: 12px; }
.detail-content h2, .detail-content h3 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--green-dark);
}

/* ── Comments ──────────────────────────────── */
.comments-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid #e0e0e0;
  max-width: 900px;
  margin: 20px auto 0;
}
.comments-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--green-dark);
}
.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--green-pale);
}
.comment-item:last-child { border-bottom: none; }
.comment-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.comment-meta strong { color: var(--text-primary); }
.comment-content { color: var(--text-secondary); line-height: 1.6; font-size: 13px; }
.comment-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--green-pale); }
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 8px;
  font-family: inherit;
  outline: none;
}
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--green-light);
  box-shadow: 0 0 0 2px rgba(42,140,74,0.08);
}
.comment-form textarea { min-height: 80px; resize: vertical; }
.comment-form .form-row { display: flex; gap: 12px; }
.comment-form .form-row input { flex: 1; }

/* ── Flashes ───────────────────────────────── */
.flashes { margin-bottom: 12px; }
.flash {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 6px;
}
.flash.danger, .flash.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}
.flash.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}
.flash.info, .flash.warning {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

/* ── Pagination ────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 20px 0;
}

/* ── Empty State ───────────────────────────── */
.empty-section {
  text-align: center;
  padding: 40px 15px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Search ────────────────────────────────── */
.search-form {
  display: flex;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto 20px;
}
.search-form input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}
.search-form input[type="text"]:focus {
  border-color: var(--green-light);
}

/* ── BBS / Forum ───────────────────────────── */
.post-list {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid #e0e0e0;
  overflow: hidden;
}
.post-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--green-pale);
  transition: all 0.1s;
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: var(--green-bg); }
.post-item.sticky { background: #f9fbe7; }
.post-item .post-icon { font-size: 16px; margin-right: 12px; width: 24px; text-align: center; }
.post-item .post-main { flex: 1; min-width: 0; }
.post-item .post-title {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-item .post-title:hover { color: var(--green-mid); }
.post-item .post-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.post-item .post-meta .tag {
  background: var(--green-pale);
  color: var(--green-dark);
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 11px;
}
.post-item .post-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.post-item .post-stats span { display: flex; align-items: center; gap: 3px; }

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.top-bar .info { color: var(--text-muted); font-size: 13px; }

/* ── Footer ────────────────────────────────── */
.footer {
  background: #1b5e2b;
  color: #a5d6a7;
  padding: 24px 15px;
  text-align: center;
  font-size: 12px;
  border-top: 3px solid #2e7d32;
  margin-top: 20px;
}
.footer a {
  color: var(--green-light);
  text-decoration: none;
}
.footer a:hover { color: #fff; text-decoration: underline; }

/* ── Admin ─────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #e0e0e0;
}
.admin-table th {
  background: var(--green-dark);
  color: #fff;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
}
.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--green-pale);
  font-size: 13px;
}
.admin-table tr:hover td { background: var(--green-bg); }

/* ── Responsive ────────────────────────────── */

/* 平板竖屏 768-1024px */
@media (min-width: 768px) and (max-width: 1024px) {
  .header-inner { padding: 0 10px; height: 42px; }
  .nav-bar > a { padding: 4px 8px; font-size: 17px; }
  .nav-more-btn { padding: 4px 8px; font-size: 17px; }
  .nav-vbar { padding: 0 2px; }
}

/* 手机 ≤768px */
@media (max-width: 768px) {
  .hero h1 { font-size: 22px; }
  .header-inner {
    height: auto;
    padding: 8px 12px;
  }

  /* 汉堡按钮显示 */
  .hamburger { display: block; }

  /* nav-area默认隐藏，汉堡展开显示 */
  .nav-area {
    display: none;
    width: 100%;
    margin-top: 6px;
    padding: 4px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
  }
  .nav-area.open { display: flex; }

  .nav-bar {
    width: 100%;
    flex-direction: column;
  }
  .nav-bar > a {
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    border-radius: 0;
    width: 100%;
  }
  .nav-bar > a:last-of-type { border-bottom: none; }
  .nav-vbar { display: none; }

  /* 更多在手机端展开 */
  .nav-more { width: 100%; }
  .nav-more-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    border-radius: 0;
    background: rgba(255,255,255,0.05);
    color: #c8e6c9;
  }
  .nav-more-btn:hover { background: rgba(255,255,255,0.12); }
  .nav-dropdown {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: rgba(0,0,0,0.15);
    margin: 0;
    padding: 0;
  }
  .nav-dropdown a {
    padding: 10px 24px;
    font-size: 14px;
    color: #c8e6c9;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .nav-dropdown a:last-child { border-bottom: none; }
  .nav-dropdown a:hover,
  .nav-dropdown a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
  }

  .card-grid { grid-template-columns: 1fr; }
  .post-item { flex-direction: column; align-items: flex-start; gap: 4px; }
  .post-item .post-stats { align-self: flex-end; }
  .detail-header-img-wrapper { max-height: 240px; }
  .comment-form .form-row { flex-direction: column; gap: 0; }
}
