/* 小说评论页面样式 - Win11 风格 */

/* 评论容器 */
.comments-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== 卡片内容区内边距（与book-info-new.css一致） ===== */
.win-card-inner {
    padding: 16px 18px;
}

/* ===== 小说信息条 ===== */
.novel-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
}

.novel-bar-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.novel-bar-info {
    flex: 1;
    min-width: 0;
}

.novel-bar-info h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin: 0;
}

.novel-bar-info p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
    margin: 2px 0 0;
}

/* ===== 评论表单 ===== */
.comment-input-wrap {
    display: flex;
    flex-direction: column;
}

#commentContent {
    width: 100%;
    border: none;
    padding: 0;
    font-size: 14px;
    resize: none;
    min-height: 70px;
    font-family: inherit;
    color: var(--text-primary);
    line-height: 1.6;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}

#commentContent:focus {
    outline: none;
}

#commentContent::placeholder {
    color: var(--text-muted);
}

.comment-input-hint {
    font-size: 11px;
    color: var(--text-muted);
    padding: 6px 0 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    border-top: 1px solid var(--border-light);
}

.comment-input-hint i {
    color: var(--primary);
    font-size: 12px;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.char-count {
    font-size: 12px;
    color: var(--text-muted);
}

.char-count.warn {
    color: #ffa502;
}

.char-count.danger {
    color: var(--primary);
}

/* ===== 按钮 ===== */
.submit-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.submit-btn i {
    font-size: 12px;
}

.submit-btn:hover {
    opacity: 0.9;
}

.submit-btn:active {
    transform: scale(0.96);
}

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

/* 登录提示 */
.login-prompt {
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
}

.login-prompt p {
    margin-bottom: 10px;
    font-size: 14px;
}

.login-link {
    display: inline-block;
    text-decoration: none;
}

/* ===== 排序 ===== */
.sort-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
    padding: 0;
}

.sort-tabs {
    display: flex;
    gap: 4px;
}

.sort-tab {
    background: none;
    border: 1px solid transparent;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
}

.sort-tab:hover {
    color: var(--primary);
}

.sort-tab.active {
    color: var(--primary);
    background: var(--primary-bg-light);
    border-color: var(--primary);
}

/* ===== 评论卡片 ===== */
.comment-card {
    margin-bottom: 8px;
}

.comment-card:hover {
    border-color: var(--border-light);
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 10px;
    flex-shrink: 0;
    display: block;
    text-decoration: none;
}

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

.user-info {
    flex: 1;
    min-width: 0;
}

.username {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    text-decoration: none;
}

.username:hover {
    color: var(--primary);
}

.comment-time {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* ===== 阅读进度 ===== */
.reading-progress {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    line-height: 1.3;
}

.reading-progress i {
    font-size: 11px;
}

.reading-progress.reading-not-started {
    background: var(--border-light);
    color: var(--text-muted);
}

.reading-progress.reading-started {
    background: var(--primary-bg-light);
    color: var(--primary);
}

.reading-progress.reading-in-progress {
    background: var(--primary-bg-light);
    color: var(--primary-text);
}

.reading-progress.reading-completed {
    background: var(--primary-bg-light);
    color: var(--primary-dark);
}

.reading-progress .chapter-name,
.reading-progress .last-read-time {
    color: inherit;
    opacity: 0.8;
}

/* ===== 评论内容 ===== */
.comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 8px;
    word-break: break-word;
}

/* ===== 评论操作按钮 ===== */
.comment-actions-bilibili {
    display: flex;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
    padding: 4px 8px;
    border-radius: 4px;
    -webkit-tap-highlight-color: transparent;
}

.action-btn:hover {
    color: var(--primary);
}

.action-btn.liked {
    color: var(--primary);
}

.action-btn.liked i {
    animation: heartBeat 0.5s ease;
}

.action-btn.disliked {
    color: var(--text-secondary);
}

.action-count {
    font-size: 13px;
}

/* ===== 空评论 ===== */
.empty-comments {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.4;
    display: block;
}

.empty-comments p {
    font-size: 14px;
}

/* ===== 加载状态 ===== */
.loading-comments {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
}

.loading-comments i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.loading-comments p {
    font-size: 14px;
}

/* ===== 重试按钮 ===== */
.retry-btn {
    margin-top: 10px;
    padding: 6px 16px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.retry-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* ===== 加载更多 ===== */
.loading-more {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.loading-more i {
    margin-right: 6px;
}

.no-more-comments {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

.no-more-comments i {
    margin-right: 4px;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
    pointer-events: none;
}

.toast.toast-error {
    background: rgba(255,23,68,0.9);
}

.toast.toast-success {
    background: rgba(46,125,50,0.9);
}

/* ===== 动画 ===== */
@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .comments-container {
        padding: 0 12px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        margin-right: 8px;
    }

    .username {
        font-size: 12px;
    }

    .comment-text {
        font-size: 13px;
    }

    .action-btn {
        font-size: 12px;
        padding: 3px 6px;
    }

    .sort-tab {
        padding: 4px 10px;
        font-size: 11px;
    }

    #commentContent {
        font-size: 16px;
        min-height: 60px;
    }

    .submit-btn {
        padding: 5px 14px;
        font-size: 12px;
    }

    .reading-progress {
        font-size: 10px;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .novel-bar-inner {
        padding: 10px 14px;
    }

    .novel-bar-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .novel-bar-info h2 {
        font-size: 14px;
    }

    #commentContent {
        min-height: 50px;
    }

    .submit-btn {
        padding: 4px 12px;
        font-size: 11px;
    }
}
