/* 帖子详情与评论区 */
.detail-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    padding: 18px 0 0;
    align-items: start;
}

.detail-side {
    display: grid;
    gap: 16px;
}

.detail-side .panel {
    padding: 20px;
    border-radius: 18px;
}

.detail-header {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.detail-header h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.35;
}

.detail-author img {
    width: 48px;
    height: 48px;
}

.detail-author strong {
    display: block;
    margin-bottom: 4px;
}

.detail-author span,
.detail-metrics span,
.comment-head span,
.comment-toolbar,
.reply-target {
    color: var(--muted);
}

.detail-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 14px;
}

.detail-manage-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 18px;
}

.gallery-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.detail-content {
    color: #374151;
    font-size: 15px;
}

.detail-content p {
    margin: 0 0 14px;
}

.detail-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.detail-actions form {
    margin: 0;
}

.detail-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
}

.detail-icon-btn:hover,
.detail-icon-btn.active {
    color: var(--brand-deep);
    border-color: rgba(22, 119, 255, 0.22);
    background: rgba(22, 119, 255, 0.06);
}

.detail-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.detail-icon-btn.active .detail-icon {
    fill: currentColor;
}

.detail-icon-btn span {
    color: inherit;
    font-size: 14px;
    font-weight: 600;
}

.comment-section {
    padding: 22px 0 40px;
}

.form-panel {
    margin-bottom: 12px;
}

.comment-card {
    padding: 12px;
    border-radius: 18px;
}

.comment-thread-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
}

.comment-avatar {
    width: 48px;
    height: 48px;
}

.comment-avatar-reply {
    width: 32px;
    height: 32px;
}

.comment-content-col,
.thread-panel {
    min-width: 0;
    display: grid;
    gap: 10px;
}

.comment-head-main {
    display: grid;
    gap: 4px;
}

.comment-author-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-author-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(22, 119, 255, 0.12);
    color: var(--brand-deep);
    font-size: 12px;
}

.reply-target {
    font-size: 13px;
}

.comment-body {
    color: #374151;
    font-size: 14px;
}

.comment-body p {
    margin: 0;
}

.comment-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
}

.comment-toolbar.is-reply {
    margin-top: 0;
}

.comment-toolbar form {
    margin: 0;
}

.comment-metric,
.comment-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    font-size: 13px;
    line-height: 1;
    color: var(--muted);
}

.comment-action-btn {
    border: none;
    background: transparent;
    cursor: pointer;
}

.comment-action-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.comment-action-count {
    line-height: 1;
}

.comment-action-btn:hover,
.comment-action-btn.active {
    color: var(--brand-deep);
}

.comment-reply-btn {
    font-size: 13px;
}

.reply-list,
.threaded-reply-list {
    display: grid;
    gap: 10px;
}

.threaded-reply-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0 0;
    border-top: 1px dashed rgba(229, 234, 243, 0.9);
    background: transparent;
}

.reply-item.threaded-reply-item:first-child {
    border-top: none;
    padding-top: 0;
}

.thread-load-more {
    justify-self: start;
    color: var(--muted);
}

.thread-load-more[disabled] {
    cursor: default;
}

.reply-box {
    padding: 12px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    background: var(--surface-soft);
}

.inline-form {
    gap: 10px;
}

.reply-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 980px) {
    .detail-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .detail-shell {
        padding-top: 16px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item img {
        height: 220px;
    }

    .detail-actions,
    .comment-toolbar {
        justify-content: flex-start;
    }

    .comment-thread-card {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .comment-avatar {
        width: 40px;
        height: 40px;
    }
}
