/* 哔哩哔哩视频数据查询应用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #fb7299;
    --secondary-color: #00b5ff;
    --success-color: #00c851;
    --warning-color: #ffbb33;
    --danger-color: #ff4444;
    --info-color: #33b5e5;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 32px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    background: var(--light-color);
    color: var(--gray-color);
}

.status-indicator.ready i { color: var(--gray-color); }
.status-indicator.loading i { color: var(--warning-color); animation: pulse 1s infinite; }
.status-indicator.success i { color: var(--success-color); }
.status-indicator.error i { color: var(--danger-color); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 搜索区域 */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.search-container h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--dark-color);
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--gray-color);
    font-size: 18px;
    pointer-events: none;
}

#bvInput {
    width: 100%;
    padding: 16px 50px 16px 45px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

#bvInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(251, 114, 153, 0.1);
}

.clear-btn {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
}

.clear-btn:hover {
    background: var(--light-color);
    color: var(--dark-color);
}

.search-btn {
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color), #ff8fab);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.search-btn:active {
    transform: translateY(0);
}

.tips {
    text-align: center;
    color: var(--gray-color);
    font-size: 14px;
}

.tips i {
    margin-right: 6px;
    color: var(--info-color);
}

/* 加载状态 */
.loading-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 60px 30px;
    text-align: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误提示 */
.error-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 60px 30px;
    text-align: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.error-icon {
    font-size: 48px;
    color: var(--danger-color);
}

.error-container h3 {
    font-size: 24px;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.error-container p {
    color: var(--gray-color);
    margin-bottom: 20px;
}

.retry-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.retry-btn:hover {
    background: #ff8fab;
    transform: translateY(-2px);
}

/* 数据展示区域 */
.data-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.data-header h3 {
    font-size: 20px;
    color: var(--dark-color);
}

.auto-refresh-control {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: var(--transition);
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.refresh-label {
    font-size: 14px;
    color: var(--dark-color);
}

.refresh-interval {
    padding: 6px 10px;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    background: white;
}

.refresh-interval:disabled {
    background: var(--light-color);
    color: var(--gray-color);
}

.last-update {
    font-size: 12px;
    color: var(--gray-color);
}

/* 视频信息卡片 */
.video-info-card {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.video-basic-info {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.video-thumbnail {
    position: relative;
    flex-shrink: 0;
    width: 200px;
    height: 125px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.video-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
    line-height: 1.4;
    margin: 0;
}

.video-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.upload-time,
.video-category {
    font-size: 14px;
    color: var(--gray-color);
    background: var(--light-color);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
}

.video-description {
    font-size: 14px;
    color: var(--gray-color);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 作者信息 */
.author-section h3 {
    font-size: 18px;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.author-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.author-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-label {
    font-size: 12px;
    color: var(--gray-color);
}

/* 数据统计 */
.stats-section h3 {
    font-size: 18px;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-card.primary .stat-icon { background: linear-gradient(135deg, var(--primary-color), #ff8fab); }
.stat-card.success .stat-icon { background: linear-gradient(135deg, var(--success-color), #00e676); }
.stat-card.warning .stat-icon { background: linear-gradient(135deg, var(--warning-color), #ffca28); }
.stat-card.danger .stat-icon { background: linear-gradient(135deg, var(--danger-color), #ff6b6b); }
.stat-card.info .stat-icon { background: linear-gradient(135deg, var(--info-color), #4fc3f7); }
.stat-card.secondary .stat-icon { background: linear-gradient(135deg, var(--gray-color), #78909c); }

.stat-content {
    flex: 1;
}

.stat-content .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-content .stat-label {
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 8px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.up { color: var(--success-color); }
.stat-trend.down { color: var(--danger-color); }
.stat-trend { color: var(--gray-color); }

/* 图表区域 */
.chart-section h3 {
    font-size: 18px;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.chart-container {
    height: 300px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 20px;
}

/* 历史记录 */
.history-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h3 {
    font-size: 18px;
    color: var(--dark-color);
}

.clear-history-btn {
    padding: 8px 16px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-history-btn:hover {
    background: #ff6b6b;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--light-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-thumbnail {
    width: 60px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.history-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.history-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-color);
    flex-wrap: wrap;
}

/* 页脚 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 20px 30px;
    margin-top: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    color: var(--gray-color);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    color: var(--gray-color);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary-color);
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: var(--transition);
    max-width: 90%;
    box-shadow: var(--shadow);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { background: var(--success-color); }
.toast.warning { background: var(--warning-color); }
.toast.error { background: var(--danger-color); }
.toast.info { background: var(--info-color); }

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .video-basic-info {
        flex-direction: column;
    }
    
    .video-thumbnail {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .data-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .auto-refresh-control {
        width: 100%;
        justify-content: space-between;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .history-item {
        flex-direction: column;
        text-align: center;
    }
    
    .history-meta {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .search-section,
    .data-section,
    .history-section {
        padding: 20px;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .author-card {
        flex-direction: column;
        text-align: center;
    }
    
    .author-stats {
        justify-content: center;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 动画效果 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 打印样式 */
@media print {
    .header,
    .search-section,
    .loading-section,
    .error-section,
    .footer,
    .toast {
        display: none !important;
    }
    
    .data-section,
    .history-section {
        box-shadow: none;
        background: white;
    }
    
    .auto-refresh-control {
        display: none !important;
    }
}