/* ============================================================
   运城作家协会 - 全站公共样式
   参考 xazjw.cn 风格，传统文学配色
   ============================================================ */

:root {
  --primary: #B8372D;       /* 中国红 */
  --primary-dark: #8C2A22;
  --secondary: #2C3E50;     /* 墨色 */
  --accent: #C4975A;        /* 金色 */
  --bg-warm: #FDF8F0;       /* 宣纸米色 */
  --bg-card: #FFFFFF;
  --text-primary: #2C2C2A;
  --text-secondary: #666;
  --text-light: #999;
  --border: #E8E2D9;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'STSong', serif;
  background: var(--bg-warm);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; }

/* ---------- 容器 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶部通栏 ---------- */
.topbar {
  background: var(--secondary);
  color: #ccc;
  font-size: 12px;
  line-height: 36px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar a { color: #ccc; margin-left: 16px; }
.topbar a:hover { color: #fff; }

/* ---------- 头部横幅 ---------- */
.header-banner {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #6B1D15 100%);
  overflow: hidden;
}
.header-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(196,151,90,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%);
}
.header-banner .banner-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex-direction: row;
  gap: 24px;
}
.banner-logo {
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  margin-bottom: 8px;
}
.banner-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex-direction: row;
  gap: 24px;
}
.banner-logo-svg {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}
.banner-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.banner-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 4px;
}

/* ---------- 导航栏 ---------- */
.navbar {
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(184,55,45,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar ul {
  display: flex;
  list-style: none;
  justify-content: center;
  gap: 4px;
}
.navbar li a {
  display: block;
  padding: 14px 28px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1px;
  border-bottom: 3px solid transparent;
  transition: all 0.25s;
}
.navbar li a:hover,
.navbar li a.active {
  background: rgba(255,255,255,0.12);
  border-bottom-color: #FFD700;
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  padding: 14px 0;
  font-size: 13px;
  color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

/* ---------- 卡片通用 ---------- */
.card {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.card-body { padding: 20px; }
.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

/* ---------- 区块标题 ---------- */
.section-title {
  text-align: center;
  margin-bottom: 30px;
}
.section-title h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 3px;
  position: relative;
  display: inline-block;
  padding: 0 30px;
}
.section-title h2::before,
.section-title h2::after {
  content: '◆';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 10px;
}
.section-title h2::before { left: 0; }
.section-title h2::after { right: 0; }
.section-title p {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 6px;
  letter-spacing: 1px;
}

/* ---------- 网格布局 ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .navbar ul { flex-wrap: wrap; }
  .navbar li a { padding: 10px 16px; font-size: 13px; }
  .banner-logo { font-size: 22px; letter-spacing: 3px; }
  .header-banner { height: 160px; }
  .banner-inner { flex-direction: column !important; gap: 10px !important; }
  .banner-logo-svg { width: 60px; height: 60px; }
}

/* ---------- 会员卡片（首页风采）---------- */
.member-card-sm {
  text-align: center;
  padding: 24px 16px;
}
.member-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 3px 10px rgba(184,55,45,0.2);
}
.member-card-sm h3 { font-size: 16px; margin-bottom: 4px; }
.member-card-sm .member-id { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.member-card-sm .member-works { font-size: 13px; color: var(--text-secondary); }

/* ---------- 公告列表 ---------- */
.notice-list { list-style: none; }
.notice-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  align-items: center;
  font-size: 14px;
}
.notice-list li:last-child { border-bottom: none; }
.notice-list .notice-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 10px;
  flex-shrink: 0;
}
.notice-list .notice-date { margin-left: auto; color: var(--text-light); font-size: 12px; white-space: nowrap; }

/* ---------- 作品展示 ---------- */
.work-item {
  padding: 16px;
  text-align: center;
}
.work-cover {
  height: 140px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f5f0e8, #e8e0d4);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  font-size: 32px;
  color: var(--accent);
}
.work-item h4 { font-size: 14px; margin-bottom: 2px; }
.work-item p { font-size: 12px; color: var(--text-light); }
.work-item.work-clickable { cursor: pointer; }
.work-cat {
  display:inline-block; font-size:11px; color:var(--accent);
  background:#FDF8E0; padding:2px 10px; border-radius:10px; margin-top:6px;
}

/* ---------- 文章详情弹窗 ---------- */
.article-modal-overlay {
  position: fixed; top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.55); z-index: 999;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.article-modal-overlay.show { display: flex; }
.article-modal-box {
  background: #fff; border-radius: 14px; width: 100%; max-width: 700px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 16px 50px rgba(0,0,0,0.25);
  animation: modalIn 0.3s ease;
}
.article-modal-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:20px 24px; border-bottom:1px solid var(--border);
  position: sticky; top:0; background:#fff; border-radius:14px 14px 0 0;
}
.article-modal-header h3 { font-size:18px; color:var(--secondary); padding-right:16px; line-height:1.4; }
.article-modal-close {
  background:none;border:none;font-size:26px;cursor:pointer;color:#999;line-height:1;
  padding:0 4px; flex-shrink:0;
}
.article-modal-close:hover { color: var(--primary); }
.article-meta {
  padding:10px 24px; font-size:13px; color:var(--text-light);
  border-bottom:1px solid #f5f0ea;
}
.article-modal-body { padding: 24px; }
.article-desc {
  font-size:15px; color:var(--text-secondary); line-height:2; text-indent:2em;
}
.article-content-pre {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', serif;
  font-size:14px; line-height:2; color:var(--text-secondary);
  white-space: pre-wrap; word-wrap: break-word;
}

/* ---------- 底部 Footer ---------- */
.footer {
  background: var(--secondary);
  color: rgba(255,255,255,0.65);
  padding: 36px 0 20px;
  margin-top: 50px;
  font-size: 13px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 24px;
}
.footer h4 {
  color: #fff;
  font-size: 16px;
  margin-bottom: 14px;
  letter-spacing: 2px;
}
.footer p { line-height: 1.8; }
.footer-links a { display: block; margin-bottom: 6px; color: rgba(255,255,255,0.6); font-size: 13px; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
}

/* ---------- 按钮通用 ---------- */
.btn {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--secondary);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(184,55,45,0.1); }

/* ---------- 查询页专用 ---------- */
.query-box {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 40px auto;
}
.query-form { margin-top: 24px; }
.query-inputs { display: flex; gap: 12px; margin-bottom: 16px; }
.query-inputs input { flex: 1; }
.query-result { margin-top: 30px; }

/* 会员查询结果卡片 */
.query-member-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 28px;
  margin-bottom: 16px;
  animation: fadeInUp 0.35s ease;
  display: flex;
  align-items: center;
  gap: 24px;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.qm-avatar {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 600; color: #fff;
}
.qm-info { flex: 1; }
.qm-info h3 { font-size: 20px; margin-bottom: 4px; }
.qm-info .qm-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.qm-works { display: flex; flex-wrap: wrap; gap: 8px; }
.qm-work-tag {
  padding: 5px 14px; border-radius: 20px; font-size: 13px;
  background: #FEF3F2; color: var(--primary);
}

/* ---------- 后台管理专用 ---------- */
.admin-layout { display: flex; min-height: calc(100vh - 200px); }
.admin-sidebar {
  width: 220px; background: var(--secondary); color: #fff;
  padding: 20px 0; flex-shrink: 0;
}
.admin-sidebar h3 {
  padding: 0 20px 16px;
  font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 12px;
}
.admin-sidebar a {
  display: block;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  transition: all 0.2s;
}
.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.admin-main { flex: 1; padding: 24px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.admin-table th {
  background: var(--bg-warm);
  font-weight: 600;
  color: var(--secondary);
  font-size: 13px;
}
.admin-table tr:hover td { background: #FAFAF6; }

@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .query-inputs { flex-direction: column; }
  .query-member-card { flex-direction: column; text-align: center; }
  .qm-works { justify-content: center; }
}

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }
.hidden { display: none !important; }

/* ---------- 页面入场动画 ---------- */
.fade-in {
  animation: pageFadeIn 0.5s ease;
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
