/* ===== 全局 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f5f5;
  color: #333;
}
button { cursor: pointer; border: none; outline: none; font-size: 14px; }
input { outline: none; font-size: 14px; }

/* ===== 首页：左分类 + 右列表 ===== */
.page { display: flex; height: 100vh; }

.sidebar {
  width: 110px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e5e5;
  overflow-y: auto;
}
.category-item {
  padding: 18px 8px;
  text-align: center;
  font-size: 15px;
  color: #666;
  border-left: 3px solid transparent;
  cursor: pointer;
  user-select: none;
}
.category-item.active {
  color: #1a73e8;
  font-weight: bold;
  background: #f0f7ff;
  border-left-color: #1a73e8;
}

.content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}
.header { font-size: 20px; font-weight: bold; text-align: center; margin: 8px 0 20px; }

.empty { text-align: center; color: #999; margin-top: 80px; font-size: 14px; }

.post-item {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.1s;
}
.post-item:active { transform: scale(0.99); }
.post-item .title { font-size: 17px; font-weight: bold; color: #222; }
.post-item .summary { font-size: 14px; color: #666; margin: 8px 0; line-height: 1.6; }
.post-item .time { font-size: 12px; color: #999; }

/* ===== 详情页 ===== */
.detail-page { max-width: 720px; margin: 0 auto; min-height: 100vh; padding-bottom: 90px; }
.detail { padding: 20px; background: #f5f5f5; }
.detail .title { font-size: 22px; font-weight: bold; color: #222; margin-bottom: 12px; }
.meta-row { display: flex; align-items: center; margin-bottom: 20px; }
.tag { font-size: 12px; color: #1a73e8; background: #e8f1fd; padding: 3px 10px; border-radius: 12px; margin-right: 10px; }
.meta-row .time { font-size: 13px; color: #999; }

.section-title { font-size: 15px; font-weight: bold; color: #333; margin: 20px 0 10px; display: flex; align-items: center; }
.refresh-btn {
  margin-left: auto;
  font-size: 12px;
  color: #1a73e8;
  background: #e8f1fd;
  border-radius: 12px;
  padding: 3px 12px;
}
.summary, .contact { font-size: 15px; color: #555; line-height: 1.8; background: #fff; border-radius: 8px; padding: 14px; }

.empty-tip { text-align: center; color: #999; font-size: 13px; padding: 20px 0; }

/* 聊天气泡 */
.bubble-row { display: flex; margin-bottom: 12px; }
.bubble-row.right { justify-content: flex-end; }
.bubble-row.left { justify-content: flex-start; }
.bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
}
.bubble.student { background: #1a73e8; color: #fff; border-top-right-radius: 2px; }
.bubble.admin { background: #fff; color: #333; border-top-left-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.bubble-content { word-break: break-all; }
.bubble-time { font-size: 11px; margin-top: 4px; opacity: 0.7; text-align: right; }

/* 底部输入栏 */
.input-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  max-width: 720px;
  margin: 0 auto;
}
.input {
  flex: 1;
  height: 40px;
  background: #f2f2f2;
  border: none;
  border-radius: 20px;
  padding: 0 16px;
}
.send-btn {
  background: #1a73e8;
  color: #fff;
  border-radius: 20px;
  padding: 0 22px;
  height: 40px;
}

/* ===== 管理后台 ===== */
.admin-page { max-width: 960px; margin: 0 auto; height: 100vh; display: flex; flex-direction: column; }
.admin-header {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}
.admin-header input {
  flex: 1;
  height: 36px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 12px;
}
.admin-header button, .chat-panel .input-bar button {
  background: #1a73e8;
  color: #fff;
  border-radius: 6px;
  padding: 0 18px;
  height: 36px;
}
.admin-body { flex: 1; display: flex; overflow: hidden; }
.conv-list { width: 300px; flex-shrink: 0; overflow-y: auto; border-right: 1px solid #e5e5e5; background: #fafafa; }
.conv-item { padding: 12px 14px; border-bottom: 1px solid #eee; cursor: pointer; background: #fff; }
.conv-item:hover { background: #f5f9ff; }
.conv-item.active { background: #e8f1fd; }
.conv-top { display: flex; justify-content: space-between; font-size: 13px; color: #1a73e8; font-weight: bold; }
.conv-msg { font-size: 13px; color: #666; margin: 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-bottom { display: flex; justify-content: space-between; font-size: 11px; color: #999; }
.unread { color: #fff; background: #ff4d4f; border-radius: 8px; padding: 0 6px; }
.chat-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-panel h3 { padding: 12px 16px; font-size: 15px; border-bottom: 1px solid #eee; background: #fff; }
.chat-list { flex: 1; overflow-y: auto; padding: 16px; }
.chat-panel .input-bar { position: static; max-width: none; margin: 0; }

/* ===== 管理后台：标签页 / 帖子管理 ===== */
.admin-header .tabs { margin-left: auto; display: flex; gap: 8px; }
.tabs button { background: #f2f2f2; color: #333; border-radius: 6px; padding: 0 16px; height: 36px; }
.tabs button.active { background: #1a73e8; color: #fff; }

.posts-pane { flex: 1; overflow-y: auto; padding: 16px; }

.post-form {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto 16px;
}
.post-form .form-title { font-size: 15px; font-weight: bold; }
.post-form input, .post-form select, .post-form textarea {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
}
.post-form textarea { min-height: 80px; resize: vertical; }
.post-form .row { display: flex; gap: 10px; }
.post-form .row input, .post-form .row select { flex: 1; }
.post-form button { background: #1a73e8; color: #fff; border-radius: 6px; height: 38px; }

.post-list { max-width: 720px; margin: 0 auto; }
.post-row {
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.post-row .status { font-size: 12px; border-radius: 10px; padding: 2px 10px; }
.status.on { background: #e6f7e6; color: #2e7d32; }
.status.off { background: #f0f0f0; color: #888; }
.post-row .p-title { font-weight: bold; font-size: 14px; }
.post-row .p-meta { font-size: 12px; color: #999; }
.post-row .p-actions { margin-left: auto; display: flex; gap: 8px; }
.post-row .p-actions button { font-size: 12px; border-radius: 6px; padding: 4px 12px; background: #e8f1fd; color: #1a73e8; }
.post-row .p-actions button.publish { background: #e6f7e6; color: #2e7d32; }
.post-row .p-actions button.danger { background: #ffecec; color: #e53935; }

/* ===== 首页头部 / 我的会话入口 ===== */
.header-bar { display: flex; align-items: center; justify-content: center; position: relative; margin: 8px 0 20px; }
.header-bar .header { margin: 0; }
.my-link {
  position: absolute;
  right: 0;
  font-size: 13px;
  color: #1a73e8;
  text-decoration: none;
  background: #e8f1fd;
  border-radius: 12px;
  padding: 4px 12px;
}

/* ===== 我的会话页 ===== */
.my-page { max-width: 720px; margin: 0 auto; padding: 16px; min-height: 100vh; background: #f5f5f5; }
.my-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.my-title { font-size: 20px; font-weight: bold; }
.back-link { font-size: 14px; color: #1a73e8; text-decoration: none; }
.my-page .conv-item { border-radius: 8px; margin-bottom: 10px; border: none; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.my-page .conv-post { font-weight: bold; color: #222; font-size: 14px; }
.my-page .conv-bottom { justify-content: flex-end; }

/* ===== 总访问量 ===== */
.visits { text-align: center; color: #aaa; font-size: 12px; padding: 24px 0 10px; }
