/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f6f7f8;
    color: #222;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.header h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #00a1d6;
    text-align: center;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.file-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #e3e5e7;
    transition: all 0.3s;
}

.file-input-row:hover {
    border-color: #00a1d6;
    background: #f0f8ff;
}

.separator {
    color: #999;
    font-size: 14px;
    font-weight: 500;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #00a1d6;
    color: #00a1d6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.file-label:hover {
    background: #00a1d6;
    color: white;
}

.input-section input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e3e5e7;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-section input[type="text"]:focus {
    outline: none;
    border-color: #00a1d6;
}

.input-section button {
    padding: 12px 24px;
    background: #00a1d6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.input-section button:hover {
    background: #0084b6;
}

.input-section button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.file-selected {
    color: #00a1d6;
    font-size: 14px;
    font-weight: 500;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00a1d6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.progress-info {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #00a1d6;
}

.progress-info p {
    margin: 4px 0;
    color: #333;
}

.progress-info p:first-child {
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 视频信息样式 */
.video-info {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.video-info h2 {
    margin-bottom: 16px;
    color: #333;
    font-size: 20px;
}

.info-row {
    display: flex;
    margin-bottom: 8px;
}

.info-row .label {
    font-weight: 500;
    width: 100px;
    color: #666;
}

/* 评论区样式 */
.comments-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.comments-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e3e5e7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comments-header h3 {
    font-size: 18px;
    color: #333;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sort-options {
    display: flex;
    gap: 8px;
}

.export-btn {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.export-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.export-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.sort-btn {
    padding: 6px 12px;
    border: 1px solid #e3e5e7;
    background: white;
    color: #666;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.sort-btn.active,
.sort-btn:hover {
    background: #00a1d6;
    color: white;
    border-color: #00a1d6;
}

.comments-list {
    max-height: 800px;
    overflow-y: auto;
}

/* 单条评论样式 */
.comment-item {
    padding: 16px 24px;
    border-bottom: 1px solid #f1f2f3;
    transition: background 0.3s;
}

.comment-item:hover {
    background: #fafbfc;
}

.comment-main {
    display: flex;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.username {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.vip-badge {
    background: linear-gradient(45deg, #fb7299, #ff9478);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.level-badge {
    background: #00a1d6;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.top-badge {
    background: linear-gradient(45deg, #ff6b35, #ff8e3c);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(255, 107, 53, 0.3);
}

/* 置顶评论特殊样式 */
.comment-item:has(.top-badge) {
    background: linear-gradient(135deg, #fff8f0 0%, #fef7f0 100%);
    border-left: 4px solid #ff6b35;
    position: relative;
}

.comment-item:has(.top-badge):hover {
    background: linear-gradient(135deg, #fff4e6 0%, #fef0e6 100%);
}

.comment-item:has(.top-badge)::before {
    content: "📌";
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 16px;
    opacity: 0.6;
}

.pendant {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #999;
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color 0.3s;
}

.like-btn:hover {
    color: #00a1d6;
}

.like-btn.liked {
    color: #00a1d6;
}

.comment-time {
    color: #999;
}

/* 回复样式 */
.replies {
    margin-top: 12px;
    border-left: 2px solid #f1f2f3;
    padding-left: 16px;
}

.reply-item {
    padding: 12px 0;
    border-bottom: 1px solid #f8f9fa;
}

.reply-item:last-child {
    border-bottom: none;
}

.reply-main {
    display: flex;
    gap: 8px;
}

.reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.reply-content {
    flex: 1;
    min-width: 0;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.reply-text {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 6px;
    word-wrap: break-word;
}

.reply-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #999;
}

.reply-to {
    color: #00a1d6;
    font-weight: 500;
}

/* 错误信息样式 */
.error-message {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.error-message h3 {
    color: #ff6b6b;
    margin-bottom: 12px;
}

.error-message p {
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .comments-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .comment-item {
        padding: 12px 16px;
    }
    
    .comment-main {
        gap: 8px;
    }
    
    .avatar {
        width: 32px;
        height: 32px;
    }
}

/* 滚动条样式 */
.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.comments-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
.comment-item {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 评论数旁边的加载指示器 */
.loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    font-size: 12px;
    color: #00a1d6;
}

.loading-text {
    font-weight: 500;
}

.loading-dots {
    display: inline-flex;
    gap: 2px;
}

.loading-dots .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #00a1d6;
    animation: loadingDots 1.4s infinite both;
}

.loading-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}