/* AI社区页面 */

.community-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
}

.stat-box .num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-box .label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.forum-post-list {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.forum-post-header {
  display: grid;
  grid-template-columns: 1fr 80px 80px 80px 140px;
  padding: 12px 20px;
  background: var(--bg-section);
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.forum-post-item {
  display: grid;
  grid-template-columns: 1fr 80px 80px 80px 140px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: var(--transition);
}

.forum-post-item:hover {
  background: var(--bg-section);
}

.forum-post-item .post-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.forum-post-item .post-title a {
  color: var(--text);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-post-item .post-title a:hover {
  color: var(--primary);
}

.forum-post-item .col {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.forum-post-item .last-reply {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.forum-post-item .last-reply .user {
  color: var(--primary);
}

.community-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.post-detail {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-main {
  padding: 30px;
  border-bottom: 1px solid var(--border);
}

.post-main h1 {
  font-size: 24px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.post-author-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary);
}

.author-info .name {
  font-weight: 600;
  font-size: 15px;
}

.author-info .time {
  font-size: 12px;
  color: var(--text-muted);
}

.post-content {
  font-size: 15px;
  line-height: 1.9;
}

.post-content p {
  margin-bottom: 14px;
}

.reply-section {
  padding: 24px 30px;
}

.reply-section h3 {
  font-size: 17px;
  margin-bottom: 20px;
}

.reply-form {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.reply-form textarea {
  flex: 1;
  height: 80px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.reply-form textarea:focus {
  border-color: var(--primary);
}

.reply-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.reply-item .avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.reply-body .reply-header {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.reply-body .reply-header .name {
  font-weight: 600;
  color: var(--text);
}

.reply-body .reply-header .time {
  color: var(--text-muted);
}

.reply-body .reply-text {
  font-size: 14px;
  line-height: 1.7;
}

.reply-nested {
  margin-left: 54px;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-section);
  border-radius: var(--radius);
}

.post-create-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.post-create-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-create-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #f8fbff 100%);
  border-bottom: 1px solid var(--border);
}

.post-create-head-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
}

.post-create-head h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.post-create-head p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.post-create-body {
  padding: 32px;
}

.post-create-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 28px;
  background: #e8f4fd;
  border: 1px solid #bbdefb;
  border-radius: var(--radius);
  font-size: 13px;
  color: #1565c0;
  line-height: 1.6;
}

.post-create-tip .tip-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.post-create-form .form-group {
  margin-bottom: 24px;
}

.post-create-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 15px;
  color: var(--text);
}

.post-create-form .required {
  color: #e53935;
  font-weight: 400;
}

.post-create-form .input-wrap {
  display: block;
  width: 100%;
}

.post-create-form input[type="text"],
.post-create-form select,
.post-create-form textarea {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}

.post-create-form input[type="text"] {
  height: 48px;
}

.post-create-form select {
  height: 48px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.41.59 6 5.17 10.59.59 12 2l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.post-create-form input:focus,
.post-create-form select:focus,
.post-create-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.post-create-form textarea {
  resize: vertical;
  min-height: 280px;
  line-height: 1.8;
}

.post-create-form textarea::placeholder,
.post-create-form input::placeholder {
  color: #bbb;
}

.post-create-form .form-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.post-create-form .form-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.post-create-form .form-actions .btn {
  min-width: 120px;
  height: 44px;
  line-height: 44px;
  padding: 0 24px;
  font-size: 15px;
  border-radius: var(--radius);
}

.post-create-form .form-actions .btn-outline {
  line-height: 42px;
}

.post-create-form .form-actions .btn-accent {
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

.post-create-form .form-actions .btn-accent:hover {
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.35);
}

.post-create-form .form-actions .btn-accent:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.post-create-msg,
.reply-msg {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  display: none;
}

.post-create-msg.success,
.post-create-msg.error,
.reply-msg.success,
.reply-msg.error {
  display: block;
}

.post-create-msg.success,
.reply-msg.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.post-create-msg.error,
.reply-msg.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.reply-login-tip {
  padding: 16px;
  margin-bottom: 24px;
  background: var(--bg-section);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-secondary);
}

.reply-login-tip a {
  color: var(--primary);
  font-weight: 600;
}
