/* 评论系统样式 */
:root {
    --author-color: #f59e0b;
    --author-bg: rgba(245, 158, 11, 0.12);
    --author-border: rgba(245, 158, 11, 0.4);
    --author-glow: rgba(245, 158, 11, 0.2);
}

.comment-section {
    max-width: 850px;
    margin: 60px auto 0;
    padding: 0 24px;
}

.comment-title {
    font-size: 26px;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* 评论表单 */
.comment-form-wrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 36px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.comment-form .form-group {
    margin-bottom: 20px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 评论列表 */
.comment-list {
    margin-top: 40px;
}

.comment-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.comment-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

/* 作者专属样式 */
.comment-item-author {
    border: 1px solid var(--author-border);
    border-left: 5px solid var(--author-color);
    background: var(--author-bg);
    box-shadow: 0 4px 15px var(--author-glow);
}

.comment-item-author .comment-author {
    color: var(--author-color);
}

.author-badge {
    background: var(--author-color);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
}

.comment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.comment-author {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
    display: flex;
    align-items: center;
}

.comment-time {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    line-height: 1.5;
    flex-shrink: 0;
}

.comment-content {
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 18px;
    font-size: 15px;
}

/* 长评论折叠 */
.comment-content.collapsed {
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.comment-content.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(transparent, var(--glass-bg));
}

.comment-item-author .comment-content.collapsed::after {
    background: linear-gradient(transparent, var(--author-bg));
}

.expand-btn {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    border: none;
    margin-top: -10px;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.expand-btn:hover {
    color: #2563eb;
    text-decoration: underline;
}

.comment-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.08);
}

.action-btn.liked {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

/* 回复区域 */
.reply-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.reply-form {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.reply-form.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.reply-form input,
.reply-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 12px;
    font-family: inherit;
    transition: all 0.2s;
}

.reply-form input:focus,
.reply-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.reply-form textarea {
    min-height: 80px;
    resize: vertical;
}

.reply-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.reply-form-actions button {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.reply-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.reply-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.reply-cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.reply-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.reply-list {
    margin-top: 16px;
    padding-left: 12px;
    border-left: 2px solid var(--primary-color);
}

.reply-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.reply-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--glass-border);
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.reply-author {
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.reply-to {
    color: var(--text-secondary);
    font-size: 12px;
}

.reply-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.reply-content {
    color: var(--text-primary);
    font-size: 14.5px;
    line-height: 1.6;
}

/* 隐藏的密码框提示 */
.admin-password-field {
    display: none;
    margin-bottom: 12px;
}

.admin-password-field.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 100px; }
}

/* 加载和空状态 */
.loading-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.status-message {
    padding: 14px 24px;
    border-radius: 14px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 500;
    animation: slideIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #16a34a;
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

@media (max-width: 768px) {
    .comment-section {
        padding: 0 16px;
    }
    
    .comment-form-wrapper {
        padding: 20px;
        border-radius: 16px;
    }

    .comment-item {
        padding: 20px;
        border-radius: 16px;
    }

    .comment-author {
        font-size: 15px;
    }

    .reply-list {
        padding-left: 8px;
    }

    .comment-header {
        flex-direction: column;
        gap: 4px;
    }

    .comment-time {
        text-align: left;
    }
}
