/* 评论区样式 - 楼中楼 */
.comments-section {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* 登录提示 */
.login-required {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 2px dashed rgba(194, 65, 12, 0.3);
}

.login-required p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.login-link {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(145deg, #c2410c, #ea580c);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(194, 65, 12, 0.3);
}

.login-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(194, 65, 12, 0.5);
}

.comments-section h2 {
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #333;
    position: relative;
    padding-bottom: 0.5rem;
}

.comments-section h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #c2410c, #ea580c);
    border-radius: 3px;
}

/* 评论表单 */
#comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

#comment-content {
    width: 100%;
    height: 120px;
    padding: 1rem;
    border: 1px solid rgba(221, 221, 221, 0.8);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#comment-content:focus {
    outline: none;
    border-color: #c2410c;
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.2);
}

#comment-form button[type="submit"] {
    align-self: flex-end;
    background: linear-gradient(145deg, #ea580c, #d97706);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

#comment-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 140, 0, 0.4);
}

#comment-form button[type="submit"]:disabled {
    background: linear-gradient(145deg, #cccccc, #dddddd);
    cursor: not-allowed;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transform: none;
}

/* 评论列表 */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 一级评论 */
.comment {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 1.2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    align-items: flex-start;
}

.comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.comment-avatar {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    margin-bottom: 0.5rem;
}

.comment-username {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.comment-content {
    margin: 0.5rem 0;
    line-height: 1.6;
    color: #444;
    word-wrap: break-word;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #999;
}

.comment-time {
    color: #999;
}

.comment-location {
    color: #999;
}

.comment-location::before {
    content: "·";
    margin-right: 0.5rem;
    color: #ccc;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.8rem;
}

.reply-btn,
.expand-replies-btn,
.comment-report-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.reply-btn:hover,
.expand-replies-btn:hover {
    background: rgba(194, 65, 12, 0.1);
    color: #c2410c;
}

.comment-report-btn {
    margin-left: 0.4rem;
    color: #aaa;
}

.comment-report-btn:hover {
    background: rgba(255, 76, 76, 0.1);
    color: #ff4c4c;
}

.expand-replies-btn {
    margin-left: 0.5rem;
    color: #999;
}

.expand-replies-btn:hover {
    color: #c2410c;
}

/* 评论 / 回复点赞按钮（单向，不可取消；已赞呈赭红实心） */
.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.comment-like-btn .ic-heart {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}

.comment-like-btn:hover {
    background: rgba(194, 65, 12, 0.1);
    color: #c2410c;
}

.comment-like-btn.liked {
    color: #c2410c;
}

.comment-like-btn.liked .ic-heart {
    fill: #c2410c;
    stroke: #c2410c;
    transform: scale(1.08);
}

.comment-like-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* 回复行内的地理位置（与一级评论的 comment-location 同风格：· 前缀 + 灰字） */
.reply-location {
    color: #999;
}

.reply-location::before {
    content: "·";
    margin-right: 0.5rem;
    color: #ccc;
}

/* 回复行内的点赞按钮：更小一号 */
.reply-meta .comment-like-btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
}

.reply-meta .comment-like-btn .ic-heart {
    width: 13px;
    height: 13px;
}

/* 回复框 */
.reply-box {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(221, 221, 221, 0.5);
}

.reply-input {
    width: 100%;
    min-height: 80px;
    padding: 0.8rem;
    border: 1px solid rgba(221, 221, 221, 0.8);
    border-radius: 6px;
    background: white;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.reply-input:focus {
    outline: none;
    border-color: #c2410c;
    box-shadow: 0 0 0 2px rgba(194, 65, 12, 0.15);
}

.reply-box-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.cancel-reply-btn,
.submit-reply-btn {
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cancel-reply-btn {
    background: #f0f0f0;
    color: #666;
}

.cancel-reply-btn:hover {
    background: #e0e0e0;
}

.submit-reply-btn {
    background: linear-gradient(145deg, #c2410c, #ea580c);
    color: white;
    box-shadow: 0 2px 8px rgba(194, 65, 12, 0.3);
}

.submit-reply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 65, 12, 0.4);
}

/* 回复容器 */
.replies-container {
    margin-top: 0.5rem;
}

/* 回复列表 */
.replies-list {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(194, 65, 12, 0.2);
}

.reply {
    display: flex;
    gap: 0.8rem;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    transition: all 0.2s ease;
    align-items: flex-start;
}

.reply:hover {
    background: rgba(255, 255, 255, 0.7);
}

.reply-avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.reply-body {
    flex: 1;
    min-width: 0;
}

.reply-header {
    margin-bottom: 0.4rem;
}

.reply-username {
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
}

.reply-to {
    color: #c2410c;
    font-size: 0.9rem;
    font-weight: 500;
}

.reply-content {
    margin: 0.4rem 0;
    line-height: 1.5;
    color: #555;
    font-size: 0.9rem;
    word-wrap: break-word;
}

.reply-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: #999;
}

.reply-time {
    color: #999;
}

.reply-to-reply-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.reply-to-reply-btn:hover {
    background: rgba(194, 65, 12, 0.1);
    color: #c2410c;
}

/* 加载更多按钮 */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(221, 221, 221, 0.5);
}

.load-more-btn {
    padding: 0.8rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(221, 221, 221, 0.8);
    border-radius: 50px;
    color: #666;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: white;
    border-color: #c2410c;
    color: #c2410c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(194, 65, 12, 0.2);
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast.fade-out {
    animation: fadeOut 0.3s ease;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.toast-success {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
}

.toast-error {
    background: linear-gradient(135deg, #f44336, #ef5350);
}

.toast-warning {
    background: linear-gradient(135deg, #ff9800, #ffa726);
}

.toast-info {
    background: linear-gradient(135deg, #2196f3, #42a5f5);
}

/* Turnstile 验证模态框 */
.turnstile-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.turnstile-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.turnstile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.turnstile-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.turnstile-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.turnstile-close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.turnstile-modal-body {
    padding: 2rem 1.5rem;
    text-align: center;
}

.turnstile-modal-body p {
    margin: 0 0 1.5rem;
    color: #666;
}

#comment-turnstile-widget {
    display: flex;
    justify-content: center;
    min-height: 65px;
}

.turnstile-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.turnstile-cancel-btn,
.turnstile-submit-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.turnstile-cancel-btn {
    background: #f0f0f0;
    color: #666;
}

.turnstile-cancel-btn:hover {
    background: #e0e0e0;
}

.turnstile-submit-btn {
    background: linear-gradient(145deg, #c2410c, #ea580c);
    color: white;
    box-shadow: 0 2px 8px rgba(194, 65, 12, 0.3);
}

.turnstile-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 65, 12, 0.4);
}

.turnstile-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .comments-section {
        padding: 1rem;
    }

    .comment {
        flex-direction: column;
        gap: 0.8rem;
    }

    .comment-avatar {
        width: 40px;
        height: 40px;
    }

    .comment-header {
        gap: 0.5rem;
    }

    .reply {
        flex-direction: column;
        gap: 0.6rem;
    }

    .reply-avatar {
        width: 32px;
        height: 32px;
    }

    .replies-list {
        padding-left: 0.5rem;
    }

    #comment-form button[type="submit"] {
        width: 100%;
    }

    .turnstile-modal-content {
        width: 95%;
        margin: 1rem;
    }

    .turnstile-modal-header,
    .turnstile-modal-body,
    .turnstile-modal-footer {
        padding: 1rem;
    }
}

/* ------------------------------------------------------------
   深色模式适配（变量定义见 /js/common/theme.css）
   ------------------------------------------------------------ */
:root[data-theme="dark"] .reply-input {
    background: var(--surface-subtle, #272019);
    border-color: var(--border-subtle, #3b3128);
    color: var(--ink-primary, #f3ede5);
}
/* 主评论框：原样式 rgba(255,255,255,.9) 白底硬编码，深色下白底浅字看不见 */
:root[data-theme="dark"] #comment-content {
    background: var(--surface-subtle, #272019);
    border-color: var(--border-subtle, #3b3128);
    color: var(--ink-primary, #f3ede5);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
:root[data-theme="dark"] #comment-content::placeholder,
:root[data-theme="dark"] .reply-input::placeholder {
    color: var(--ink-tertiary, #a3988a);
}
:root[data-theme="dark"] .reply-box {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-subtle, #3b3128);
}
:root[data-theme="dark"] .load-more-btn {
    color: var(--ink-tertiary, #a3988a);
    border-color: var(--border-subtle, #3b3128);
}
:root[data-theme="dark"] .load-more-btn:hover {
    background: var(--surface, #211b15);
    color: var(--accent, #e8793a);
    border-color: var(--accent, #e8793a);
}
:root[data-theme="dark"] .turnstile-modal-content {
    background: var(--surface, #211b15);
}
:root[data-theme="dark"] .comment-like-btn {
    color: var(--ink-tertiary, #a3988a);
}
:root[data-theme="dark"] .comment-like-btn.liked {
    color: var(--accent, #e8793a);
}
:root[data-theme="dark"] .comment-like-btn.liked .ic-heart {
    fill: var(--accent, #e8793a);
    stroke: var(--accent, #e8793a);
}