/* LuluCoding Forum — 统一设计系统
   主色：米色底 #eae3de + 墨绿字 #175a67
   展示字体：Cormorant Garamond，正文：Poppins（中文回退到系统黑体） */

:root {
  --bg: #eae3de;
  --bg-soft: #f3ede8;
  --ink: #175a67;
  --soft: #2a707c;
  --muted: #5f8a90;
  --card: rgba(255, 255, 255, 0.55);
  --card-solid: #fffaf5;
  --line: rgba(23, 90, 103, 0.18);
  --line-strong: rgba(23, 90, 103, 0.35);
  --accent: #c2703d;
  --ok: #2f7d5d;
  --danger: #b3453a;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(23, 90, 103, 0.08);
  --font-display: 'Cormorant Garamond', Georgia, 'Songti SC', serif;
  --font-body: Poppins, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 40px; }
h2 { font-size: 30px; }
h3 { font-size: 22px; }
p { margin: 0 0 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.wrap { max-width: 1360px; margin: 0 auto; padding: 0 32px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ------------------------------- 顶部导航 ------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(234, 227, 222, 0.85);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.logo small {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--soft); transition: 0.18s; }
.nav a:hover { background: rgba(23, 90, 103, 0.08); }
.nav a.active { background: var(--ink); color: #fff; }

.search {
  flex: 1;
  max-width: 320px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  background: var(--card);
}
.search input { border: 0; background: transparent; outline: 0; width: 100%; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
  background: var(--card);
  white-space: nowrap;
}
.user-chip .avatar { width: 28px; height: 28px; font-size: 15px; }
.user-chip .dot {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------- 组件 -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.18s;
  white-space: nowrap;
}
.btn:hover { background: var(--soft); border-color: var(--soft); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { border-color: var(--danger); background: var(--danger); }

.card, .panel {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
}

.panel + .panel { margin-top: 20px; }
.panel h3 { margin-bottom: 14px; }
.panel-title { font-family: var(--font-display); font-size: 20px; margin-bottom: 14px; }

.tag {
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 12px;
  color: var(--soft);
  margin: 0 6px 6px 0;
  background: rgba(255, 255, 255, 0.4);
}
.tag:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(23, 90, 103, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}
.avatar.lg { width: 72px; height: 72px; font-size: 34px; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 11px;
  border: 1px solid var(--line-strong);
  color: var(--soft);
}
.badge.pin { background: var(--accent); border-color: var(--accent); color: #fff; }
.badge.admin { background: var(--ink); border-color: var(--ink); color: #fff; }
.badge.warn { background: var(--amber-soft, #faeeda); border-color: var(--accent); color: var(--accent); }
.badge.ai { background: rgba(83, 74, 183, 0.12); border-color: #534ab7; color: #534ab7; }

/* 弹层 */
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(23, 90, 103, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-mask { position: fixed; }
.modal {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
}
.modal h3 { margin-bottom: 16px; }

/* 后台表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 500; color: var(--muted); font-size: 12px; }
.table tr:last-child td { border-bottom: 0; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.admin-stat { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 16px 18px; }
.admin-stat b { font-family: var(--font-display); font-size: 28px; display: block; }
.admin-stat span { font-size: 12px; color: var(--muted); }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form .input, .inline-form .select { width: auto; flex: 0 0 auto; min-width: 120px; }

.word-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.word-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.5);
}
.word-chip.block { border-color: var(--danger); color: var(--danger); }
.word-chip.review { border-color: var(--accent); color: var(--accent); }
.word-chip.allow { border-color: var(--ok); color: var(--ok); }
.word-chip.off { opacity: 0.4; text-decoration: line-through; }
.word-chip button { border: 0; background: transparent; cursor: pointer; color: inherit; opacity: 0.6; padding: 0; }
.word-chip button:hover { opacity: 1; }

.logo-mark { font-family: var(--font-display); font-size: 34px; margin-bottom: 6px; }

.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* --------------------------------- 布局 -------------------------------- */

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.page-head { padding: 40px 0 26px; }
.page-head h1 { font-size: 44px; margin-bottom: 8px; }
.page-head p { color: var(--muted); max-width: 640px; }

/* -------------------------------- 帖子卡片 ------------------------------- */

.post-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  transition: 0.18s;
}
.post-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.post-card.pinned { background: linear-gradient(180deg, rgba(194, 112, 61, 0.08), var(--card)); }

.post-card h2 { font-size: 26px; margin-bottom: 8px; }
.post-card h2 a:hover { color: var(--accent); }
.post-thumb { display: block; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.post-thumb img { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.post-excerpt { color: var(--soft); margin-bottom: 12px; }

.post-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.author { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.author .avatar { width: 28px; height: 28px; font-size: 14px; }

.act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
}
.act:hover { background: rgba(23, 90, 103, 0.08); color: var(--ink); }
.act.on { color: var(--accent); font-weight: 600; }

/* -------------------------------- 频道列表 ------------------------------- */

.channel { display: flex; flex-direction: column; gap: 2px; }
.channel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: 0.15s;
}
.channel a:hover { background: rgba(23, 90, 103, 0.08); }
.channel a.active { background: var(--ink); color: #fff; }
.channel a .count { margin-left: auto; font-size: 12px; opacity: 0.7; }

/* -------------------------------- 统计条 -------------------------------- */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.stat b { font-family: var(--font-display); font-size: 34px; display: block; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }

/* -------------------------------- 排序标签 ------------------------------- */

.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button, .tabs a {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s;
}
.tabs button.active, .tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* --------------------------------- 表单 -------------------------------- */

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--soft); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card-solid);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: 0;
  transition: 0.15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 90, 103, 0.1); }
.textarea { min-height: 220px; resize: vertical; line-height: 1.8; font-family: ui-monospace, Consolas, 'Microsoft YaHei', monospace; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ------------------------------ 帖子详情 ------------------------------ */

.post-detail { padding: 32px 36px; }
.post-detail h1 { font-size: 38px; }
.post-body { font-size: 15.5px; line-height: 1.9; color: #1f4f58; }
.post-body h2 { font-size: 24px; margin-top: 28px; }
.post-body h3 { font-size: 20px; margin-top: 22px; }
.post-body ul, .post-body ol { padding-left: 22px; margin: 0 0 14px; }
.post-body li { margin-bottom: 6px; }
.post-body code {
  background: rgba(23, 90, 103, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}
.post-body pre {
  background: #173d45;
  color: #e6f2f1;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
}
.post-body pre code { background: transparent; color: inherit; padding: 0; }
.post-body blockquote {
  margin: 16px 0;
  padding: 10px 18px;
  border-left: 3px solid var(--accent);
  background: rgba(194, 112, 61, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--soft);
}
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 8px 0; }

.comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment .body { flex: 1; min-width: 0; }
.comment .who { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.comment p { margin: 0; }

/* ------------------------------ 用户主页 ------------------------------ */

.profile-head { display: flex; gap: 24px; align-items: center; }
.profile-head .info h1 { margin-bottom: 4px; }
.stat-inline { display: flex; gap: 22px; margin-top: 10px; flex-wrap: wrap; }
.stat-inline div { font-size: 13px; color: var(--muted); }
.stat-inline b { font-family: var(--font-display); font-size: 22px; color: var(--ink); display: block; }

/* --------------------------------- 其他 -------------------------------- */

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.pager { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 999;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.demo-banner {
  border: 1px dashed var(--accent);
  color: var(--accent);
  background: rgba(194, 112, 61, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 18px;
}

.skeleton {
  height: 96px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(23, 90, 103, 0.06), rgba(23, 90, 103, 0.12), rgba(23, 90, 103, 0.06));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 18px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

/* -------------------------------- 响应式 -------------------------------- */

@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); }
  .layout > .col-right { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .wrap, .header-inner { padding-left: 18px; padding-right: 18px; }
  .layout { grid-template-columns: 1fr; }
  .layout > .col-right { grid-column: auto; }
  .nav, .search { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .page-head { padding: 26px 0 18px; }
  .page-head h1, h1 { font-size: 30px; }
  .post-detail { padding: 22px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; align-items: flex-start; }
}
