/* --- 评论与相关文章 布局容器 --- */
.comment-area-flex {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
    align-items: stretch;
}

/* 统一的卡片样式 */
.comment-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    display: flex;
    flex-direction: column;
}

.left-side {
    flex: 6.5;
}

.right-side {
    flex: 3.5;
    max-height: 480px;
}

.comment-card h3 {
    margin-top: 0;
    margin-bottom: 1.2rem;
    color: var(--title-color);
    font-size: 1.2em;
}

/* --- 表单内部组件 --- */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-form .input-group {
    display: flex;
    gap: 1rem;
}

.comment-form input {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    font-family: inherit;
    font-size: 1em;
    color: var(--main-text);
    width: 100%;
    box-sizing: border-box;
}

.comment-form textarea {
    min-height: 120px;
    height: 150px;
    resize: vertical;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    font-family: inherit;
    font-size: 1.1em;
    color: var(--main-text);
    width: 100%;
    box-sizing: border-box;
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
    font-size: 0.95em;
    color: var(--main-text);
    opacity: 0.5;
}

.comment-form button {
    align-self: flex-start;
    padding: 10px 25px;
    background: var(--title-color);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.comment-form button:hover {
    background: var(--sidebar-text);
    transform: scale(1.05);
}

/* --- 滑动条样式 --- */
.comment-submit-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.slider-container {
    position: relative;
    width: 240px;
    height: 44px;
    background-color: var(--sub-bg);
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    user-select: none;
    touch-action: pan-y; /* Fix: Prevent horizontal swipe conflict */
}

.slider-handle,
.slider-track {
    transition: left 0.3s ease, width 0.3s ease, background 0.3s ease;
}

.slider-track {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 22px;
    background: linear-gradient(to right, #f8d8a0, var(--accent-color));
    border-radius: 22px;
    z-index: 1;
}

.slider-text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9em;
    color: var(--sidebar-text);
    z-index: 2;
}

.slider-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px var(--shadow-color);
    cursor: grab;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-color);
}

.slider-handle::after {
    content: "»";
    font-size: 1.2em;
}

.slider-handle:empty::after {
    content: "";
}

#submit-comment:disabled {
    background-color: #ccc;
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- 相关文章列表 --- */
.related-posts-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.related-posts-container::-webkit-scrollbar {
    width: 4px;
}

.related-posts-container::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

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

.related-posts-list li {
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.related-link {
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 0.95em;
    transition: 0.2s;
}

.related-link:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

/* --- 评论列表展示 --- */
.comment-list-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px dashed var(--border-color);
}

.comment-item {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    align-items: flex-start;
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 5px;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    flex-shrink: 0;
}

.comment-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    margin-bottom: 0.6rem;
}

.comment-author {
    font-weight: bold;
    color: var(--sidebar-text);
    font-size: 1.1em;
}

.cancel-reply-link {
    cursor: pointer;
    color: #ff4d4d;
    margin-left: 10px;
    font-weight: normal;
    text-decoration: underline;
    transition: color 0.2s;
}

.cancel-reply-link:hover {
    color: #ff0000;
    font-weight: bold;
}

#reply-tip {
    border-left: 4px solid var(--accent-color);
    background: var(--sub-bg);
    padding: 8px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--sidebar-text);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-date {
    font-size: 0.85em;
    color: var(--main-text);
    opacity: 0.6;
}

.comment-text {
    color: var(--main-text);
    line-height: 1.6;
}



/* 回复的目标用户高亮 */
.reply-target {
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 8px;
    background: var(--sub-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.reply-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--sidebar-text);
    font-size: 0.8em;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

/* 根评论头部新按钮样式 */
.reply-btn-header {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    font-size: 0.85em;
    cursor: pointer;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.7;
}

.reply-btn-header:hover {
    background: var(--sub-bg);
    color: var(--accent-color);
    opacity: 1;
}

/* 调整提示区域样式 */
#reply-tip strong {
    color: var(--title-color);
}

/* 根评论基础样式 */
.main-floor {
    padding: 1.5rem 1.2rem !important;
    border-bottom: 1px solid var(--border-color);
}

/* 子评论包裹盒子 (Bilibili 风格) */
.sub-comments-list {
    background: var(--sub-bg);
    border-radius: 8px;
    padding: 10px 15px;
    margin-top: 12px;
}

/* 单条子评论 */
.sub-comment-item {
    display: flex;
    gap: 10px;
    font-size: 0.95em;
    margin-bottom: 12px;
}

.sub-comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.sub-comment-right {
    flex: 1;
}

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

.sub-comment-author {
    font-weight: bold;
    color: var(--sidebar-text);
}

/* 子评论里的元数据和微型回复按钮 */
.sub-comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.sub-comment-meta .comment-date {
    font-size: 0.8em;
    color: var(--main-text);
    opacity: 0.6;
}

.reply-btn-mini {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    font-size: 0.85em;
    cursor: pointer;
    padding: 0;
}

.reply-btn-mini:hover {
    color: var(--accent-color);
}

/* 联系方式卡片 */
.contact-card {
    background: var(--sub-bg);
    border-left: 5px solid var(--accent-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    color: var(--main-text);
    font-size: 1.1em;
}

.contact-card a {
    color: var(--accent-color);
    font-weight: bold;
    text-decoration: none;
}

/* 分页组件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 3rem;
    padding-bottom: 2rem;
}

.p-btn,
.p-num {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--sidebar-text);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.p-num.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.p-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.p-btn:hover:not(:disabled),
.p-num:hover:not(.active) {
    background: var(--sub-bg);
    border-color: var(--accent-color);
}

.p-dots {
    color: var(--main-text);
    opacity: 0.5;
}