/**
 * B站数据实时监控系统 - 全局样式
 */

/* ==================== CSS变量 ==================== */
:root {
    --primary-color: #00a1d6;
    --primary-dark: #0084b4;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --text-color: #333;
    --text-secondary: #666;
    --text-light: #999;
    --border-color: #e8e8e8;
    --bg-color: #f5f5f5;
    --white: #fff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

/* ==================== 布局容器 ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 作品列表页面使用更宽的容器 */
body.videos-page .container {
    max-width: 1600px;
}

/* ==================== 头部导航 ==================== */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo svg {
    width: 28px;
    height: 28px;
}

.nav {
    display: flex;
    gap: 5px;
}

.nav a {
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: all 0.3s;
}

.nav a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav a.active {
    background: var(--primary-color);
    color: var(--white);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.user-info span {
    font-size: 13px;
}

.btn-logout {
    color: var(--danger-color);
    padding: 6px 12px;
    border: 1px solid var(--danger-color);
    border-radius: var(--radius);
    font-size: 12px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--danger-color);
    color: var(--white);
}

/* ==================== 自动刷新提示条 ==================== */
.refresh-bar {
    background: linear-gradient(90deg, var(--warning-color), #ffd666);
    color: #333;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    display: none;
}

.refresh-bar.show {
    display: block;
}

.refresh-bar strong {
    color: var(--danger-color);
    font-weight: bold;
}

/* ==================== 页面标题 ==================== */
.page-header {
    padding: 30px 0 20px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 5px;
}

/* ==================== 卡片样式 ==================== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #3d9a0a;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #d59400;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #d93636;
}

.btn-default {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-default:hover {
    background: #e8e8e8;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ==================== 表格样式 ==================== */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    font-size: 13px;
}

.table td {
    font-size: 13px;
}

/* 作品列表表格优化 */
.table-videos th:first-child,
.table-videos td:first-child {
    width: 120px;
}

.table-videos th:nth-child(2),
.table-videos td:nth-child(2) {
    width: 100px;
}

.table-videos th:nth-child(3),
.table-videos td:nth-child(3) {
    max-width: 300px;
}

.table-videos td:nth-child(3) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table tbody tr:hover {
    background: #fafafa;
}

.table .status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-normal {
    background: #e6f7ff;
    color: var(--primary-color);
}

.status-offline {
    background: #fff2e8;
    color: var(--danger-color);
}

.table .actions {
    display: flex;
    gap: 5px;
}

/* ==================== 模态框 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== 统计卡片网格 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}

.stat-card.highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card.highlight .stat-label {
    color: rgba(255,255,255,0.8);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-card.highlight .stat-value {
    color: var(--white);
}

.stat-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card.highlight .stat-icon {
    background: rgba(255,255,255,0.2);
}

/* ==================== 登录页面 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 90%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form .btn {
    width: 100%;
    margin-top: 10px;
}

.login-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: var(--danger-color);
    padding: 10px 15px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    font-size: 13px;
    display: none;
}

.login-error.show {
    display: block;
}

/* ==================== 首页样式 ==================== */
.home-hero {
    background: linear-gradient(135deg, var(--primary-color), #0084b4);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 50px;
    text-align: center;
    margin-bottom: 30px;
}

.home-hero h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.home-hero p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.home-hero .btn {
    background: var(--white);
    color: var(--primary-color);
    font-weight: 600;
}

.home-hero .btn:hover {
    background: #f0f0f0;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), #0084b4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.feature-item h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-color);
}

.feature-item p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== 分页样式 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s;
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.pagination .disabled {
    color: var(--text-light);
    pointer-events: none;
}

/* ==================== 提示消息 ==================== */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius);
    color: var(--white);
    font-size: 14px;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast-success {
    background: var(--success-color);
}

.toast-error {
    background: var(--danger-color);
}

.toast-warning {
    background: var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-color);
}

/* ==================== 底部 ==================== */
.footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-light);
    font-size: 13px;
    margin-top: 40px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        gap: 0;
    }
    
    .nav a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .page-header {
        padding: 20px 0 15px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .home-hero {
        padding: 30px 20px;
    }
    
    .home-hero h1 {
        font-size: 24px;
    }
    
    .login-box {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 15px;
    }
    
    .modal {
        width: 95%;
        margin: 10px;
    }
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--text-light); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
