/* ===== 内部交流平台 · 微博风格二期 UI ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --brand: #eb7340;            /* 微博橙 */
  --brand-dark: #d4622e;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #808080;
  --border: #e6e6e6;
  --hover-bg: #f7f7f7;
}
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button {
  cursor: pointer; border: none; border-radius: 20px; padding: 8px 20px;
  background: var(--brand); color: #fff; font-size: 14px;
}
button:hover { background: var(--brand-dark); }
button.secondary { background: #f2f2f2; color: #374151; border: 1px solid var(--border); }
button.secondary:hover { background: #e6e6e6; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }
button.small { padding: 4px 12px; font-size: 12px; }
button:disabled { background: #c4c4c4; cursor: not-allowed; }
input, textarea, select {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); }
textarea { resize: vertical; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 16px; height: 52px;
  display: flex; align-items: center; gap: 20px;
}
.topbar .logo {
  font-size: 18px; font-weight: 700; color: var(--brand); white-space: nowrap;
}
.topbar .logo:hover { color: var(--brand-dark); }
.topbar .search-box { flex: 0 1 320px; position: relative; }
.topbar .search-box input {
  border-radius: 16px; background: #f2f2f2; border: 1px solid transparent;
  padding: 7px 14px; font-size: 13px;
}
.topbar .search-box input:focus { background: #fff; border-color: var(--brand); }
.topbar .spacer { flex: 1; }
.topbar .tb-item {
  position: relative; cursor: pointer; color: #4b5563; font-size: 14px;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
}
.topbar .tb-item:hover { color: var(--brand); background: var(--hover-bg); }
.topbar .bell-badge {
  position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px;
  background: #dc2626; color: #fff; border-radius: 8px; font-size: 11px;
  line-height: 16px; text-align: center; padding: 0 4px; display: none;
}
.user-menu {
  position: absolute; top: 44px; right: 0; width: 140px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); display: none; overflow: hidden;
}
.user-menu a {
  display: block; padding: 10px 14px; font-size: 13px; color: #374151;
}
.user-menu a:hover { background: var(--hover-bg); color: var(--brand); }
.user-menu-wrap { position: relative; }

/* ---------- 三栏布局 ---------- */
.layout {
  max-width: 1100px; margin: 0 auto; padding: 16px;
  display: flex; gap: 16px; align-items: flex-start;
}
.layout .col-left { width: 150px; flex-shrink: 0; position: sticky; top: 68px; }
.layout .col-center { flex: 1; min-width: 0; }
.layout .col-right { width: 250px; flex-shrink: 0; position: sticky; top: 68px; }
.layout.single .col-center { max-width: 700px; margin: 0 auto; }

/* 左侧分类 */
.side-card { background: var(--card); border-radius: 8px; overflow: hidden; }
.side-card .cat-item {
  display: block; padding: 11px 16px; font-size: 14px; color: #374151; cursor: pointer;
  border-left: 3px solid transparent;
}
.side-card .cat-item:hover { background: var(--hover-bg); }
.side-card .cat-item.active {
  background: #fdf3ee; color: var(--brand); border-left-color: var(--brand); font-weight: 600;
}

/* ---------- 卡片信息流 ---------- */
.card {
  background: var(--card); border-radius: 8px; padding: 16px 20px;
  margin-bottom: 12px;
}
.feed-card { transition: box-shadow .15s; }
.feed-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.feed-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.feed-title { font-size: 16px; font-weight: 600; color: var(--text); }
a.feed-title:hover { color: var(--brand); }
.feed-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.feed-content {
  font-size: 14px; line-height: 1.7; color: #374151;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-wrap; word-break: break-word;
}
/* 帖子卡片缩略图网格 */
.feed-thumbs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-top: 10px; max-width: 360px;
}
.feed-thumbs .thumb {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 6px;
  overflow: hidden; border: 1px solid var(--border); cursor: pointer; background: #f5f5f5;
}
.feed-thumbs .thumb img,
.feed-thumbs .thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.feed-thumbs .thumb .play-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); color: #fff; font-size: 22px; pointer-events: none;
}
.feed-thumbs .thumb-more {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); color: #fff; font-size: 18px; font-weight: 600;
}

.feed-actions {
  margin-top: 12px; padding-top: 8px; border-top: 1px solid #f2f2f2;
  display: flex; font-size: 13px; color: var(--muted);
}
.feed-actions .act {
  flex: 1; text-align: center; cursor: pointer; padding: 4px 0; border-radius: 4px;
  user-select: none;
}
.feed-actions .act:hover { color: var(--brand); background: var(--hover-bg); }
.feed-actions .act.on { color: var(--brand); font-weight: 600; }

/* 标签 */
.tag {
  display: inline-block; font-size: 12px; padding: 1px 8px;
  border-radius: 10px; background: #fdf3ee; color: var(--brand);
}
.tag.top { background: #fee2e2; color: #b91c1c; }
.anon { color: #059669; font-weight: 600; }
.muted-text { color: var(--muted); font-size: 13px; }

/* 发帖框 */
.composer { padding: 14px 16px; }
.composer textarea { border: none; background: #f7f8fa; border-radius: 8px; }
.composer .composer-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.composer .composer-bar select { width: 130px; }
.composer .composer-bar .grow { flex: 1; }

/* 排序 tab */
.sort-tabs { display: flex; background: var(--card); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.sort-tabs .st {
  flex: 0 0 auto; padding: 10px 20px; font-size: 14px; color: #4b5563; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.sort-tabs .st:hover { color: var(--brand); }
.sort-tabs .st.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.sort-tabs .st.search-tag { color: #059669; font-weight: 600; }

/* 右侧栏 */
.right-card { background: var(--card); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.right-card h3 { font-size: 14px; margin-bottom: 10px; color: var(--text); }
.right-card .hot-item {
  display: block; padding: 7px 0; font-size: 13px; color: #374151;
  border-bottom: 1px solid #f5f5f5; cursor: pointer;
}
.right-card .hot-item:last-child { border-bottom: none; }
.right-card .hot-item:hover { color: var(--brand); }
.right-card .hot-rank {
  display: inline-block; width: 18px; text-align: center; font-weight: 700;
  color: #c4c4c4; margin-right: 6px;
}
.right-card .hot-item:nth-child(-n+4) .hot-rank { color: var(--brand); }
.right-card .ann-item { padding: 7px 0; font-size: 13px; border-bottom: 1px solid #f5f5f5; }
.right-card .ann-item:last-child { border-bottom: none; }
.right-card .ann-item .ann-title { font-weight: 600; color: #374151; }
.right-card .ann-item .ann-body { color: var(--muted); margin-top: 2px; line-height: 1.5; }

/* ---------- 评论 ---------- */
.comment { border-left: 3px solid #eee; padding: 8px 0 8px 12px; margin-top: 10px; }
.reply { border-left: 3px solid #f5f5f5; padding: 6px 0 6px 12px; margin-top: 8px; background: #fafafa; border-radius: 0 6px 6px 0; }
.actions { margin-top: 8px; display: flex; gap: 16px; font-size: 12px; align-items: center; }
.actions span { cursor: pointer; color: var(--muted); }
.actions span:hover { color: var(--brand); }

/* ---------- 通知 ---------- */
.notif-item {
  display: flex; gap: 10px; padding: 14px 4px; border-bottom: 1px solid #f2f2f2; cursor: pointer;
}
.notif-item:hover { background: var(--hover-bg); }
.notif-item.unread { background: #fdf8f4; }
.notif-item .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #dc2626; margin-top: 7px; flex-shrink: 0;
}
.notif-item .dot.read { background: transparent; }
.notif-item .n-body { flex: 1; min-width: 0; }
.notif-item .n-text { font-size: 14px; color: var(--text); }
.notif-item .n-time { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- 通用 ---------- */
.form-row { margin-bottom: 12px; }
label { display: block; font-size: 13px; color: #374151; margin-bottom: 4px; }
.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; display: none; }
.msg.error { display: block; background: #fee2e2; color: #b91c1c; }
.msg.success { display: block; background: #d1fae5; color: #065f46; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; }
th { background: #fafafa; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: #fff; color: #374151; border: 1px solid var(--border); border-radius: 16px; }
.tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 14px 0; font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .layout .col-left, .layout .col-right { width: 100%; position: static; }
  .layout .col-left .side-card { display: flex; flex-wrap: wrap; }
  .layout .col-left .cat-item { border-left: none; border-bottom: 3px solid transparent; padding: 8px 12px; }
  .layout .col-left .cat-item.active { border-bottom-color: var(--brand); }
  .topbar .search-box { display: none; }
  .layout .col-right { order: 3; }
}
