/* ===== 明枢院 · 水墨金紫主题 ===== */

:root {
  /* 墨色基调 */
  --bg-deep: #1a1a1f;
  --bg-mid: #252530;
  --bg-card: #2a2a36;
  --bg-hover: #33333f;
  --border: #3a3a48;
  --border-gold: #5a4a2a;

  /* 文字 */
  --text: #e8e4d8;
  --text-muted: #9a968a;
  --text-dim: #6a6660;

  /* 点缀色 */
  --gold: #c9a84c;
  --gold-light: #e0c878;
  --gold-deep: #8a7030;
  --cinnabar: #b5483b;
  --cinnabar-light: #d4655a;
  --jade: #5a8a7a;
  --jade-light: #7aaa9a;

  /* 境界色 */
  --realm-0: #9a968a;   /* 练气 灰白 */
  --realm-1: #5a8a7a;   /* 筑基 青 */
  --realm-2: #c9a84c;   /* 金丹 金 */
  --realm-3: #8a6ab5;   /* 元婴 紫 */
  --realm-4: #6a8ac5;   /* 化神 蓝 */
  --realm-5: #b56a8a;   /* 炼虚 粉 */
  --realm-6: #6ab58a;   /* 合体 绿 */
  --realm-7: #c58a5a;   /* 大乘 橙 */
  --realm-8: #b5483b;   /* 渡劫 朱红 */
  --realm-9: #e0c878;   /* 仙人 金红 */

  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

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

body {
  font-family: "Source Han Sans CN", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  font-size: 15px;
}

h1, h2, h3, h4 {
  font-family: "LXGW WenKai", "Noto Serif SC", "Source Han Serif CN", serif;
  color: var(--text);
  font-weight: 600;
}

a { color: var(--jade-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-light); }

img { max-width: 100%; }

/* ===== 导航栏 ===== */
.navbar {
  background: rgba(26, 26, 31, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-gold);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  font-family: "LXGW WenKai", serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 4px;
  text-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
}
.logo span { color: var(--text); font-size: 14px; letter-spacing: 2px; margin-left: 8px; }
.nav-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}
.nav-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px 8px 36px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.nav-search input:focus { border-color: var(--gold); }
.nav-search::before {
  content: "⌕";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.nav-user:hover { border-color: var(--gold); }
.nav-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--gold);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
}
.btn:hover { border-color: var(--gold); color: var(--gold-light); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  color: var(--bg-deep);
  font-weight: 600;
  border: none;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--bg-deep); }
.btn-cinnabar {
  background: var(--cinnabar);
  color: #fff;
  border: none;
}
.btn-cinnabar:hover { background: var(--cinnabar-light); }
.btn-sm { padding: 4px 12px; font-size: 13px; }

/* ===== 容器 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-gold {
  border-color: var(--border-gold);
  position: relative;
}
.card-gold::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ===== 版块卡片 ===== */
.forum-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color .2s, transform .2s;
}
.forum-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.forum-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.forum-icon {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--bg-deep), var(--bg-card));
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--gold);
}
.forum-title {
  font-family: "LXGW WenKai", serif;
  font-size: 22px;
  color: var(--gold-light);
}
.forum-desc { color: var(--text-muted); font-size: 13px; }
.subforum-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.subforum-item {
  padding: 10px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all .2s;
  cursor: pointer;
}
.subforum-item:hover {
  border-color: var(--jade);
  background: var(--bg-hover);
}
.subforum-name { color: var(--text); font-weight: 500; }
.subforum-meta { color: var(--text-dim); font-size: 12px; }

/* ===== 帖子列表 ===== */
.thread-list { list-style: none; }
.thread-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.thread-item:last-child { border-bottom: none; }
.thread-main { flex: 1; min-width: 0; }
.thread-title {
  font-size: 16px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-item:hover .thread-title { color: var(--gold-light); }
.thread-info { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.thread-stats {
  text-align: right;
  color: var(--text-dim);
  font-size: 13px;
  min-width: 80px;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}
.tag-pin { background: var(--cinnabar); color: #fff; }
.tag-essence { background: var(--gold); color: var(--bg-deep); }
.tag-hot { background: var(--jade); color: #fff; }

/* ===== 境界 ===== */
.realm-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid currentColor;
}
.realm-0 { color: var(--realm-0); }
.realm-1 { color: var(--realm-1); }
.realm-2 { color: var(--realm-2); }
.realm-3 { color: var(--realm-3); }
.realm-4 { color: var(--realm-4); }
.realm-5 { color: var(--realm-5); }
.realm-6 { color: var(--realm-6); }
.realm-7 { color: var(--realm-7); }
.realm-8 { color: var(--realm-8); }
.realm-9 {
  color: var(--realm-9);
  text-shadow: 0 0 8px rgba(224, 200, 120, 0.5);
  animation: glow 2s ease-in-out infinite;
}
@keyframes glow {
  0%, 100% { text-shadow: 0 0 8px rgba(224, 200, 120, 0.5); }
  50% { text-shadow: 0 0 16px rgba(224, 200, 120, 0.8); }
}

/* ===== 修为进度条 ===== */
.cultivation-bar {
  height: 8px;
  background: var(--bg-deep);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.cultivation-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  border-radius: 4px;
  transition: width .3s;
}

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 14px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--gold);
}
.form-textarea { resize: vertical; min-height: 120px; }

/* ===== 帖子详情 ===== */
.post-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.post-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--gold);
  flex-shrink: 0;
}
.post-user-info { flex: 1; }
.post-username { font-weight: 600; color: var(--text); }
.post-floor { color: var(--text-dim); font-size: 13px; }
.post-content {
  color: var(--text);
  word-break: break-word;
}
.post-content img { border-radius: var(--radius-sm); margin: 8px 0; }

/* ===== 交互按钮 ===== */
.action-bar {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all .2s;
  font-family: inherit;
}
.action-btn:hover { color: var(--gold); background: var(--bg-hover); }
.action-btn.active { color: var(--cinnabar); }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}
.pagination a, .pagination span {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.pagination a:hover { border-color: var(--gold); color: var(--gold-light); }
.pagination .active {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
}

/* ===== 管理后台 ===== */
.admin-section { margin-bottom: 32px; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th, .admin-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--gold); font-weight: 600; }
.admin-table tr:hover { background: var(--bg-hover); }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.stat-value {
  font-family: "LXGW WenKai", serif;
  font-size: 32px;
  color: var(--gold);
  font-weight: 700;
}
.stat-label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 32px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

/* ===== 工具类 ===== */
.text-gold { color: var(--gold); }
.text-cinnabar { color: var(--cinnabar); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.hide { display: none !important; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .navbar-inner { padding: 0 12px; gap: 12px; }
  .nav-search { max-width: none; }
  .container { padding: 12px; }
  .subforum-list { grid-template-columns: 1fr; }
  .thread-stats { display: none; }
}

/* ===== 水墨仙侠装饰 ===== */

/* 云纹边角装饰 */
.cloud-border {
  position: relative;
}
.cloud-border::before,
.cloud-border::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  border: 1px solid var(--border-gold);
  opacity: 0.4;
  pointer-events: none;
}
.cloud-border::before {
  top: 4px; left: 4px;
  border-right: none;
  border-bottom: none;
}
.cloud-border::after {
  bottom: 4px; right: 4px;
  border-left: none;
  border-top: none;
}

/* 符文分隔线 */
.rune-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
  margin: 24px 0;
  position: relative;
}
.rune-divider::after {
  content: "卍";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  color: var(--gold);
  padding: 0 12px;
  font-size: 14px;
}

/* 标题印章 */
.title-seal {
  display: inline-block;
  background: var(--cinnabar);
  color: #fff;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 2px;
  font-weight: 700;
  letter-spacing: 2px;
  transform: rotate(-2deg);
}

/* 帖子卡片悬停光效 */
.post-block {
  position: relative;
  overflow: hidden;
}
.post-block:hover::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.05), transparent);
  animation: shine 0.6s ease;
}
@keyframes shine {
  to { left: 100%; }
}

/* 导航栏 logo 描边效果 */
.logo {
  text-shadow: 0 0 12px rgba(201, 168, 76, 0.3), 0 0 24px rgba(201, 168, 76, 0.15);
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-gold); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* 选中文字颜色 */
::selection { background: var(--gold); color: var(--bg-deep); }

/* 空状态水墨插画占位 */
.empty-ink {
  font-size: 48px;
  color: var(--border-gold);
  margin-bottom: 12px;
}

/* 首字下沉（帖子正文首字） */
.drop-cap::first-letter {
  font-family: "LXGW WenKai", serif;
  font-size: 2.5em;
  float: left;
  line-height: 1;
  padding: 4px 8px 0 0;
  color: var(--gold);
}
