/* ==========================================================
 * 社区模块专用样式
 * 对应 cbt-app 的 pages/post/list/index.vue + pages/post/detail/index.vue
 * ========================================================== */

.post-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-item {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: var(--transition);
    cursor: pointer;
}

.post-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-soft);
    flex-shrink: 0;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author {
    flex: 1;
    min-width: 0;
}

.post-author .name {
    font-size: 15px;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 2px;
}

.post-author .meta {
    font-size: 12px;
    color: var(--text-light);
}

.post-topic {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.post-images img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.post-footer {
    display: flex;
    gap: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    color: var(--text-light);
    font-size: 13px;
}

.post-footer span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-footer svg {
    flex-shrink: 0;
}

/* 帖子详情 */
.post-detail {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 32px;
}

.post-detail-head {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.post-detail-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
    line-height: 1.4;
}

.post-detail-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-detail-author .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-soft);
    flex-shrink: 0;
}

.post-detail-author .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-detail-author .info .name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.post-detail-author .info .meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.post-detail-body {
    color: var(--text-color);
    line-height: 1.9;
    font-size: 15px;
    min-height: 200px;
}

.post-detail-body p {
    margin-bottom: 12px;
}

.post-detail-body img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 12px 0;
}

.post-detail-body h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 24px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.post-detail-body h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 20px 0 12px;
}

.post-detail-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 16px 0 10px;
}

.post-detail-body h4,
.post-detail-body h5,
.post-detail-body h6 {
    font-size: 16px;
    font-weight: 600;
    margin: 14px 0 8px;
}

.post-detail-body ul,
.post-detail-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.post-detail-body li {
    margin-bottom: 6px;
}

.post-detail-body blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    color: var(--text-secondary);
    font-style: italic;
}

.post-detail-body del {
    text-decoration: line-through;
    color: var(--text-light);
}

.post-detail-body code {
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #e74c3c;
}

.post-detail-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 16px 0;
}

.post-detail-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 13px;
}

.post-detail-body a {
    color: var(--primary-color);
    text-decoration: underline;
}

.post-detail-body a:hover {
    color: var(--primary-dark);
}

.post-detail-body hr {
    border: none;
    border-top: 1px dashed var(--border-light);
    margin: 24px 0;
}

.post-detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.post-detail-body th,
.post-detail-body td {
    border: 1px solid var(--border-light);
    padding: 10px 12px;
    text-align: left;
}

.post-detail-body th {
    background: var(--bg-light);
    font-weight: 600;
}

.post-detail-body tr:nth-child(even) {
    background: #fafafa;
}

.post-detail-stats {
    display: flex;
    gap: 24px;
    padding: 20px 0;
    border-top: 1px dashed var(--border-light);
    border-bottom: 1px dashed var(--border-light);
    margin: 24px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.post-detail-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.post-detail-back:hover {
    color: var(--primary-color);
}

/* ============== 评论区 ============== */
.comment-section {
    margin-top: 8px;
}

.comment-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    padding: 16px 0 20px;
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
}

.comment-section-title .count {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-light);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-item {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-light);
}

.comment-item:last-child {
    border-bottom: 0;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-soft);
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-light);
}

.comment-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.comment-lawyer-tag {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.comment-time {
    color: var(--text-light);
    font-size: 12px;
}

.comment-content {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
    word-break: break-word;
}

.comment-content p {
    margin: 0;
}

.comment-actions {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-light);
}

.comment-actions span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: default;
}

.comment-actions svg {
    flex-shrink: 0;
}

.comment-empty {
    padding: 48px 0;
    text-align: center;
    color: var(--text-light);
}

.comment-empty .empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.comment-empty p {
    font-size: 14px;
    color: var(--text-light);
}

@media (max-width: 640px) {
    .post-detail { padding: 20px; }
    .post-detail-title { font-size: 22px; }
    .post-images {
        grid-template-columns: repeat(2, 1fr);
    }
}
