/* ============================================================
   蜂巢论坛 · 样式表（暖蜜主题）
   ============================================================ */
:root {
  --bg: #f6f1e6;
  --card: #ffffff;
  --ink: #3a3226;
  --muted: #8d8168;
  --line: #ecdfc6;
  --brand: #d97706;
  --brand-dark: #b45309;
  --brand-soft: #fdf3df;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(90, 70, 30, .08), 0 4px 14px rgba(90, 70, 30, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.4; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.row-dim { opacity: .55; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 18px;
}
.logo {
  font-size: 19px; font-weight: 800; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; color: var(--brand-dark); }
.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 7px 14px; border-radius: 999px; color: var(--ink);
  font-weight: 600; font-size: 14px;
}
.main-nav a:hover { background: var(--brand-soft); text-decoration: none; }
.main-nav a.active { background: var(--brand); color: #fff; }
.search-box {
  margin-left: auto; display: flex; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 4px 2px 14px;
}
.search-box input {
  border: 0; background: transparent; outline: none;
  font-size: 14px; width: 150px; color: var(--ink);
}
.search-box button {
  border: 0; background: var(--brand); color: #fff; border-radius: 999px;
  width: 30px; height: 30px; cursor: pointer; font-size: 14px;
}
.user-area { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.uname { font-weight: 600; font-size: 14px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 布局 ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 20px 16px 40px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px;
}
.card-pad0 { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.card-pad0 .card-head { padding: 16px 20px 0; }
.narrow { max-width: 520px; }

/* ---------- 首页 hero ---------- */
.hero {
  background: linear-gradient(120deg, #fff8e8, #fdeecb);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.hero h1 { font-size: 24px; margin-bottom: 6px; }
.hero p { margin: 0; }

/* ---------- 版块列表 ---------- */
.board-list { display: flex; flex-direction: column; }
.board-row {
  display: grid; grid-template-columns: 1fr 84px 84px 250px; gap: 12px;
  align-items: center; padding: 14px 20px;
  border-top: 1px solid var(--line); color: var(--ink);
}
.board-fa { width: 1.15em; height: 1.15em; margin-right: 10px; vertical-align: -0.18em; }
h1 .board-fa { margin-right: 12px; }

/* ---------- 附件 ---------- */
.post-atts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.att-img img {
  max-width: 240px; max-height: 170px; border-radius: 10px;
  border: 1px solid var(--line); object-fit: cover;
}
.att-img:hover img { border-color: var(--honey); }
.att-file {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fffdf6; font-size: 13px; color: var(--ink);
}
.att-file:hover { border-color: var(--honey); text-decoration: none; }
.att-manage { display: flex; flex-direction: column; gap: 8px; }
.att-check {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fffdf6; cursor: pointer;
}
.att-check input { width: auto; }
.field-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.field-check input { width: auto; }
.board-list .board-row:first-child { border-top: 0; }
a.board-row:hover { background: #fffdf6; text-decoration: none; }
.board-name { font-weight: 700; font-size: 16px; }
.board-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.board-stat { text-align: center; }
.board-stat b { display: block; font-size: 18px; }
.board-stat span { font-size: 12px; color: var(--muted); }
.board-last { min-width: 0; }
.board-last .ell a { color: var(--ink); }

/* ---------- 帖子列表 ---------- */
.thread-row {
  display: grid; grid-template-columns: 1fr 110px 150px; gap: 12px;
  align-items: center; padding: 13px 20px;
  border-top: 1px solid var(--line); color: var(--ink);
}
.card-pad0 > .thread-row:first-child,
.card-pad0 > a.thread-row:first-child { border-top: 0; }
a.thread-row:hover { background: #fffdf6; text-decoration: none; }
.thread-title { font-weight: 600; font-size: 15.5px; }
.thread-meta { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-size: 13px; color: var(--muted); }
.tag {
  background: var(--brand-soft); color: var(--brand-dark);
  border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.thread-nums { display: flex; gap: 14px; justify-content: flex-end; }
.thread-nums .num { text-align: center; min-width: 44px; }
.thread-nums .num b { display: block; font-size: 16px; }
.thread-nums .num span { font-size: 12px; color: var(--muted); }
.thread-last { text-align: right; min-width: 0; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  border-radius: 6px; padding: 1px 7px; line-height: 1.7;
  vertical-align: 1px;
}
.badge-pin { background: #dc2626; color: #fff; }
.badge-lock { background: #e7e0d0; color: #6b5f45; }
.badge-admin { background: #7c3aed; color: #fff; }
.badge-op { background: var(--brand); color: #fff; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: #fef3c7; color: #b45309; }

/* ---------- 面包屑 / 页头 ---------- */
.crumb { margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.crumb a { color: var(--brand-dark); }
.crumb .sep { margin: 0 8px; color: #c9b995; }
.crumb .cur { color: var(--ink); font-weight: 600; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }

/* ---------- 帖子详情 ---------- */
.thread-head h1 { margin-bottom: 8px; }
.thread-head-meta { margin-bottom: 10px; }
.thread-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.posts { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.post { display: flex; gap: 16px; }
.post-side {
  width: 110px; flex-shrink: 0; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.post-author { font-weight: 700; font-size: 14px; word-break: break-all; }
.avatar {
  display: inline-block; border-radius: 50%;
  text-align: center; font-weight: 700; flex-shrink: 0;
}
.post-main { flex: 1; min-width: 0; }
.post-head { margin-bottom: 8px; }
.post-body { font-size: 15.5px; word-break: break-word; }
.post-body a { word-break: break-all; }
.post-foot { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; }
.post-deleted { opacity: .75; border-style: dashed; }

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-inline { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .fld > span { font-weight: 600; font-size: 14px; }
input, select, textarea {
  font: inherit; color: var(--ink);
  border: 1px solid #d9cba8; border-radius: 8px;
  padding: 9px 12px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, .15);
}
textarea { resize: vertical; }
.form-inline input, .form-inline select { width: auto; }
.form-inline .grow { flex: 1; min-width: 160px; }
.row-input { width: 100%; padding: 6px 8px; font-size: 14px; }
.sort-input { width: 64px !important; padding: 6px 8px; text-align: center; }
.inline-form { display: flex; align-items: center; gap: 6px; }
.form-actions { margin-top: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; border: 1px solid #d9cba8; background: #fff;
  color: var(--ink); border-radius: 8px; padding: 8px 16px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  text-align: center; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-dark); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { color: var(--danger); border-color: #f0c4c4; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--brand-dark); border-color: transparent; background: var(--brand-soft); }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { display: block; width: 100%; }

/* ---------- 提示 / 分页 / 空状态 ---------- */
.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.alert-success { background: var(--ok-soft); color: var(--ok); border: 1px solid #bbf7d0; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 6px 0 18px; flex-wrap: wrap; }
.pg {
  min-width: 34px; height: 34px; line-height: 32px; text-align: center;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--ink); font-size: 14px; padding: 0 10px;
}
a.pg:hover { border-color: var(--brand); color: var(--brand-dark); text-decoration: none; }
.pg.cur { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pg.dots { border: 0; background: transparent; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }

/* ---------- 管理后台 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: 12px; margin-bottom: 0; }
.stat-icon { font-size: 28px; }
.stat-value { font-size: 24px; font-weight: 800; }
.admin-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.admin-link { display: flex; gap: 14px; align-items: center; margin-bottom: 0; color: var(--ink); }
.admin-link:hover { text-decoration: none; border-color: var(--brand); }
.admin-link-icon { font-size: 30px; }
.admin-link-title { font-weight: 700; font-size: 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td {
  text-align: left; padding: 10px 8px; border-top: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table thead th { border-top: 0; color: var(--muted); font-weight: 600; font-size: 13px; }
.admin-table tbody tr:hover { background: #fffdf6; }

/* ---------- 登录 / 安装 ---------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(140deg, #fdf6e3, #f6ecd4);
}
.login-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 32px 30px; width: 100%; max-width: 420px;
}
.login-brand { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.login-card h2 { text-align: center; margin-bottom: 18px; font-size: 19px; }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.install-steps { padding-left: 20px; font-size: 14px; }
.install-steps li { margin-bottom: 8px; }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 18px; border-top: 1px solid var(--line);
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .board-row { grid-template-columns: 1fr 70px 70px; }
  .board-last { display: none; }
  .thread-row { grid-template-columns: 1fr 90px; }
  .thread-last { display: none; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-links { grid-template-columns: 1fr; }
  .search-box input { width: 90px; }
  .uname { display: none; }
  .hero { flex-direction: column; align-items: flex-start; }
  .post { flex-direction: column; gap: 10px; }
  .post-side { width: auto; flex-direction: row; justify-content: flex-start; }
  .admin-table { display: block; overflow-x: auto; }
}
