/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    transition: all 0.3s ease;
}

/* 动态背景和元素大小适配 */
@media (min-width: 1920px) {
    /* 超大屏幕 (4K/5K显示器) */
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    }
    
    .sidebar {
        width: 300px;
    }
    
    .sidebar-header h2 {
        font-size: 1.8rem;
    }
    
    .nav-item {
        padding: 18px 25px;
        font-size: 1.1rem;
    }
    
    .nav-item i {
        font-size: 1.2rem;
        width: 24px;
    }
    
    .topbar {
        padding: 25px 40px;
    }
    
    .topbar-left h3 {
        font-size: 1.8rem;
    }
    
    .content-section {
        padding: 40px;
    }
    
    .content-header h2 {
        font-size: 2.5rem;
    }
    
    .stat-card {
        padding: 30px;
    }
    
    .stat-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .stat-info h3 {
        font-size: 2.5rem;
    }
    
    .stat-info p {
        font-size: 1.1rem;
    }
}

@media (min-width: 1440px) and (max-width: 1919px) {
    /* 大屏幕 (1440p显示器) */
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .sidebar {
        width: 280px;
    }
    
    .sidebar-header h2 {
        font-size: 1.6rem;
    }
    
    .nav-item {
        padding: 16px 22px;
        font-size: 1.05rem;
    }
    
    .nav-item i {
        font-size: 1.1rem;
        width: 22px;
    }
    
    .topbar {
        padding: 22px 35px;
    }
    
    .topbar-left h3 {
        font-size: 1.6rem;
    }
    
    .content-section {
        padding: 35px;
    }
    
    .content-header h2 {
        font-size: 2.2rem;
    }
    
    .stat-card {
        padding: 28px;
    }
    
    .stat-icon {
        width: 65px;
        height: 65px;
        font-size: 1.6rem;
    }
    
    .stat-info h3 {
        font-size: 2.2rem;
    }
    
    .stat-info p {
        font-size: 1rem;
    }
}

@media (min-width: 1200px) and (max-width: 1439px) {
    /* 标准大屏幕 (1200p显示器) */
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .sidebar {
        width: 260px;
    }
    
    .sidebar-header h2 {
        font-size: 1.5rem;
    }
    
    .nav-item {
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .nav-item i {
        font-size: 1rem;
        width: 20px;
    }
    
    .topbar {
        padding: 20px 30px;
    }
    
    .topbar-left h3 {
        font-size: 1.5rem;
    }
    
    .content-section {
        padding: 30px;
    }
    
    .content-header h2 {
        font-size: 2rem;
    }
    
    .stat-card {
        padding: 25px;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .stat-info h3 {
        font-size: 2rem;
    }
    
    .stat-info p {
        font-size: 0.9rem;
    }
}

/* 页面切换 */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 1rem;
}

.login-form {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* 登录页脚 */
.login-footer,
.register-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a,
.register-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover,
.register-footer a:hover {
    text-decoration: underline;
}

/* 注册页面样式 */
.register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.register-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.6s ease-out;
}

.register-header {
    text-align: center;
    margin-bottom: 30px;
}

.register-header h1 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 10px;
}

.register-header p {
    color: #666;
    font-size: 1rem;
}

/* 仪表板样式 */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: #f8f9fa;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

.sidebar-header h2 {
    color: #667eea;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 1rem;
}

.nav-item:hover {
    background: #f8f9fa;
    border-left-color: #667eea;
}

.nav-item.active {
    background: #f0f2ff;
    border-left-color: #667eea;
    color: #667eea;
}

.nav-item i {
    margin-right: 10px;
    width: 20px;
    transition: all 0.3s ease;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e1e5e9;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.topbar {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.topbar-left h3 {
    color: #333;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.user-info {
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 内容区域 */
.content-section {
    display: none;
    flex: 1;
    padding: 30px;
    transition: all 0.3s ease;
}

.content-section.active {
    display: block;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.content-header h2 {
    color: #333;
    font-size: 2rem;
    transition: all 0.3s ease;
}

/* 统计卡片 */
.stream-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    transition: all 0.3s ease;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-info h3 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e1e5e9;
    color: #666;
    text-align: left;
    vertical-align: middle;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #333;
    font-size: 1.3rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 通知样式 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.notification {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    border-left: 4px solid #28a745;
}

.notification.error {
    border-left: 4px solid #dc3545;
}

.notification.warning {
    border-left: 4px solid #ffc107;
}

.notification.info {
    border-left: 4px solid #17a2b8;
}

.notification-icon {
    font-size: 1.2rem;
}

.notification.success .notification-icon {
    color: #28a745;
}

.notification.error .notification-icon {
    color: #dc3545;
}

.notification.warning .notification-icon {
    color: #ffc107;
}

.notification.info .notification-icon {
    color: #17a2b8;
}

.notification-message {
    flex: 1;
    color: #333;
    font-weight: 500;
}

/* 中等屏幕适配 (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .sidebar {
        width: 240px;
    }
    
    .sidebar-header h2 {
        font-size: 1.4rem;
    }
    
    .nav-item {
        padding: 14px 18px;
        font-size: 0.95rem;
    }
    
    .nav-item i {
        font-size: 0.95rem;
        width: 18px;
    }
    
    .topbar {
        padding: 18px 25px;
    }
    
    .topbar-left h3 {
        font-size: 1.4rem;
    }
    
    .content-section {
        padding: 25px;
    }
    
    .content-header h2 {
        font-size: 1.8rem;
    }
    
    .stat-card {
        padding: 22px;
    }
    
    .stat-icon {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }
    
    .stat-info h3 {
        font-size: 1.8rem;
    }
    
    .stat-info p {
        font-size: 0.85rem;
    }
}

/* 平板屏幕适配 (769px - 991px) */
@media (min-width: 769px) and (max-width: 991px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .sidebar {
        width: 220px;
    }
    
    .sidebar-header h2 {
        font-size: 1.3rem;
    }
    
    .nav-item {
        padding: 13px 16px;
        font-size: 0.9rem;
    }
    
    .nav-item i {
        font-size: 0.9rem;
        width: 16px;
    }
    
    .topbar {
        padding: 16px 22px;
    }
    
    .topbar-left h3 {
        font-size: 1.3rem;
    }
    
    .content-section {
        padding: 22px;
    }
    
    .content-header h2 {
        font-size: 1.6rem;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .stat-info h3 {
        font-size: 1.6rem;
    }
    
    .stat-info p {
        font-size: 0.8rem;
    }
}

/* 确保大屏幕保持垂直侧边栏布局 */
@media (min-width: 769px) {
    .dashboard {
        flex-direction: row;
    }
    
    .sidebar {
        width: 250px;
        height: 100vh;
        order: 1;
        display: flex;
        flex-direction: column;
    }
    
    .main-content {
        order: 2;
        flex: 1;
    }
    
    .sidebar-nav {
        display: block;
        padding: 20px 0;
        flex: 1;
    }
    
    .sidebar-nav ul {
        display: block;
        list-style: none;
    }
    
    .nav-item {
        white-space: normal;
        border-left: 3px solid transparent;
        border-bottom: none;
        min-width: auto;
        text-align: left;
        padding: 15px 20px;
        display: block;
    }
    
    .nav-item.active {
        border-left-color: #667eea;
        border-bottom: none;
    }
    
    .nav-item i {
        display: inline;
        margin-right: 10px;
        font-size: 1rem;
        width: 20px;
    }
    
    .user-info {
        flex-direction: row;
        gap: 15px;
        align-items: center;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 10px 0;
    }
    
    .sidebar-nav ul {
        display: flex;
        min-width: max-content;
        gap: 0;
    }
    
    .nav-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        min-width: 120px;
        text-align: center;
        padding: 12px 15px;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom-color: #667eea;
    }
    
    .nav-item i {
        display: block;
        margin: 0 0 5px 0;
        font-size: 1.2rem;
    }
    
    .stream-stats {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .topbar {
        padding: 15px 20px;
    }
    
    .topbar-left h3 {
        font-size: 1.3rem;
    }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
    .sidebar-header {
        padding: 15px;
    }
    
    .sidebar-header h2 {
        font-size: 1.3rem;
    }
    
    .nav-item {
        min-width: 100px;
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
    
    .topbar {
        padding: 12px 15px;
    }
    
    .topbar-left h3 {
        font-size: 1.2rem;
    }
    
    .user-info {
        font-size: 0.9rem;
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }
    
    .user-info .btn {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .modal-content {
        width: 98%;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
}

/* 小屏幕底部导航模式 */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
        min-height: 100vh;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        order: 2;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: white;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        border-top: 1px solid #e0e0e0;
    }
    
    .sidebar-header {
        display: none;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 8px 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar-nav ul {
        display: flex;
        min-width: max-content;
        gap: 0;
        margin: 0;
        padding: 0 10px;
        list-style: none;
        width: 100%;
        justify-content: space-around;
    }
    
    .nav-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        min-width: 60px;
        text-align: center;
        padding: 8px 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        flex: 1;
        max-width: 80px;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom-color: #667eea;
        background: #f0f2ff;
    }
    
    .nav-item i {
        display: block;
        margin: 0 0 4px 0;
        font-size: 1.1rem;
        width: auto;
        color: #666;
    }
    
    .nav-item.active i {
        color: #667eea;
    }
    
    .nav-item span {
        display: block;
        font-size: 0.7rem;
        color: #666;
        line-height: 1.1;
        text-align: center;
    }
    
    .nav-item.active span {
        color: #667eea;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        padding-bottom: 80px; /* 为底部导航留出空间 */
        order: 1;
    }
    
    .content-section {
        padding: 15px;
    }
    
    /* 确保所有导航项都能显示 */
    .nav-item {
        min-height: 60px;
    }
    
    /* 优化小屏幕下的导航项显示 */
    .nav-item span {
        word-break: keep-all;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    /* 顶部导航栏小屏幕优化 */
    .topbar-right .btn {
        padding: 8px;
        min-width: auto;
    }
    
    .topbar-right .btn i {
        display: block;
        font-size: 1.1rem;
        margin-bottom: 3px;
    }
    
    .topbar-right .btn span {
        display: none;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
    }
    
    .user-info span {
        font-size: 0.8rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .sidebar {
        width: 50px;
    }
    
    .sidebar-header h2 {
        font-size: 1rem;
    }
    
    .sidebar-header h2 i {
        font-size: 1.3rem;
    }
    
    .nav-item {
        padding: 12px 8px;
        font-size: 0.85rem;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
    
    .topbar {
        padding: 10px 12px;
    }
    
    .topbar-left h3 {
        font-size: 1.1rem;
    }
    
    .user-info {
        font-size: 0.85rem;
        flex-direction: column;
        gap: 6px;
        align-items: flex-end;
    }
    
    .user-info .btn {
        font-size: 0.75rem;
        padding: 3px 6px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 推流密钥样式 */
.push-code-container {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    max-width: 100%;
    overflow: hidden;
    text-align: left;
}

.push-code-container:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

.push-code {
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin: 0;
    border: 1px solid #e9ecef;
    line-height: 1.4;
    text-align: left;
}

.copy-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #6c757d;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.push-code-container:hover .copy-icon {
    opacity: 1;
}

.push-code-container:active {
    transform: translateY(0);
    background: #e9ecef;
}

/* 表格列宽调整 */
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    min-width: 300px;
    max-width: 500px;
    width: 40%;
}

.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 20%;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 20%;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    width: 10%;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    width: 10%;
}

/* 播放器模态框样式 */
.player-modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
}

.player-container {
    text-align: center;
}

.player-container video {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #000;
}

.player-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.player-controls .btn {
    flex: 1;
    min-width: 120px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #999;
}

.empty-state p {
    font-size: 1rem;
    color: #bbb;
}

/* 流量统计页面样式 */
.statistics-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.stream-filter {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    visibility: visible !important;
    opacity: 1 !important;
}

.stream-filter label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.stream-select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    color: #333;
    min-width: 250px;
    max-width: 300px;
    transition: border-color 0.2s ease;
}

.stream-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.stream-select option {
    padding: 8px 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.date-range-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.date-range-selector label {
    font-weight: 600;
    color: #333;
    margin: 0;
    white-space: nowrap;
}

.date-input {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.statistics-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.statistics-overview .stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.statistics-overview .stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.statistics-overview .stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* 峰值流量日期显示样式 */
.statistics-overview .stat-card:nth-child(3) .stat-value small {
    display: block;
    color: #666;
    font-size: 0.8em;
    margin-top: 4px;
    font-weight: normal;
    line-height: 1.2;
}

/* 响应式峰值流量日期显示 */
@media (max-width: 768px) {
    .statistics-overview .stat-card:nth-child(3) .stat-value small {
        font-size: 0.75em;
        margin-top: 2px;
    }
}

@media (max-width: 480px) {
    .statistics-overview .stat-card:nth-child(3) .stat-value small {
        font-size: 0.7em;
        margin-top: 1px;
    }
}

/* 图表容器样式 */
.charts-container {
    margin-bottom: 30px;
}

.chart-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.chart-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header h3 {
    color: #333;
    font-size: 1.3rem;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 5px;
}

.chart-controls .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.chart-controls .btn.active {
    background: #667eea;
    color: white;
}

.chart-container {
    padding: 25px;
    height: 400px;
    position: relative;
}

.chart-container canvas {
    max-height: 100%;
}

/* 表格头部样式 */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.table-header h3 {
    color: #333;
    font-size: 1.3rem;
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 10px;
}

/* 响应式设计 - 流量统计 */

/* 大屏幕优化 (1200px+) */
@media (min-width: 1200px) {
    .statistics-overview {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .chart-container {
        height: 450px;
    }
    
    .date-range-selector {
        gap: 15px;
    }
}

/* 中等屏幕 (992px - 1199px) */
@media (max-width: 1199px) and (min-width: 993px) {
    .statistics-overview {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .chart-container {
        height: 400px;
    }
}

/* 平板屏幕 (768px - 992px) */
@media (max-width: 992px) and (min-width: 769px) {
    .statistics-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .date-range-selector {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .date-range-selector label {
        min-width: 80px;
    }
    
    .date-range-selector input {
        flex: 1;
        min-width: 120px;
    }
    
    .statistics-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .chart-container {
        height: 350px;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .chart-controls {
        justify-content: center;
    }
}

/* 手机屏幕 (最大768px) */
@media (max-width: 768px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    .statistics-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .date-range-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 15px;
    }
    
    .date-range-selector > * {
        width: 100%;
    }
    
    .date-range-selector label {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .date-input {
        padding: 10px 12px;
        font-size: 1rem;
    }
    
    .stream-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 15px;
    }
    
    .stream-filter > * {
        width: 100%;
    }
    
    .stream-filter label {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .stream-select {
        padding: 10px 12px;
        font-size: 1rem;
        min-width: auto;
    }
    
    .statistics-overview {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
    
    .chart-container {
        height: 300px;
        padding: 15px;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 15px 20px;
    }
    
    .chart-header h3 {
        font-size: 1.1rem;
        text-align: center;
    }
    
    .chart-controls {
        justify-content: center;
        gap: 8px;
    }
    
    .chart-controls .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .table-header h3 {
        font-size: 1.1rem;
        text-align: center;
    }
    
    .table-actions {
        justify-content: center;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

/* 小手机屏幕 (最大480px) */
@media (max-width: 480px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    .content-section {
        padding: 15px;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        margin-bottom: 20px;
    }
    
    .content-header h2 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .statistics-controls {
        gap: 10px;
    }
    
    .date-range-selector {
        padding: 12px;
        gap: 8px;
    }
    
    .stream-filter {
        padding: 12px;
        gap: 8px;
    }
    
    .stream-filter label {
        font-size: 0.85rem;
    }
    
    .stream-select {
        font-size: 0.9rem;
        padding: 8px 10px;
    }
    
    .statistics-overview {
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px;
        gap: 15px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .stat-info h3 {
        font-size: 1.3rem;
    }
    
    .stat-info p {
        font-size: 0.8rem;
    }
    
    .chart-container {
        height: 250px;
        padding: 10px;
    }
    
    .chart-header {
        padding: 12px 15px;
    }
    
    .chart-controls .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 400px;
    }
}

/* 超小屏幕 (最大360px) */
@media (max-width: 360px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    .content-section {
        padding: 10px;
    }
    
    .content-header h2 {
        font-size: 1.3rem;
    }
    
    .date-range-selector {
        padding: 10px;
    }
    
    .stat-card {
        padding: 12px;
        gap: 12px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-info h3 {
        font-size: 1.2rem;
    }
    
    .chart-container {
        height: 220px;
        padding: 8px;
    }
    
    .chart-header {
        padding: 10px 12px;
    }
    
    .chart-header h3 {
        font-size: 1rem;
    }
    
    .data-table {
        font-size: 0.75rem;
        min-width: 350px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 4px;
    }
}

/* 统计列表样式 */
.statistics-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.statistics-list .empty-state {
    padding: 40px;
    text-align: center;
    color: #666;
}

.statistics-list .empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}

.statistics-list .empty-state h3 {
    margin: 10px 0;
    color: #999;
}

.statistics-list .empty-state p {
    color: #aaa;
    margin: 0;
}

/* 日期分组样式 */
.date-group {
    border-bottom: 1px solid #eee;
}

.date-group:last-child {
    border-bottom: none;
}

.date-group-header {
    display: flex;
    align-items: center;
    padding: 18px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.date-group-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.date-group-header .date-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-group-header .date-info .date {
    font-weight: 700;
    color: #495057;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.date-group-header .date-info .summary {
    color: #6c757d;
    font-size: 0.95rem;
    background: #fff;
    padding: 6px 12px;
    border-radius: 15px;
    border: 1px solid #dee2e6;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.date-group-header .toggle-icon {
    color: #667eea;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #fff;
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.date-group-header:hover .toggle-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.date-group-header.expanded .toggle-icon {
    transform: rotate(90deg) scale(1.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.date-group-content {
    display: none;
    background: white;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.date-group-content.expanded {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

/* 流详情样式 */
.stream-details {
    padding: 0;
    background: #fafbfc;
}

.stream-item {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1fr;
    gap: 15px;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.stream-item:last-child {
    border-bottom: none;
}

.stream-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stream-item .stream-id {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
    word-break: break-all;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.stream-item .stream-tag {
    font-size: 0.9rem;
    color: #495057;
    text-align: center;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #90caf9;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.stream-item .stream-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stream-item .stream-size {
    text-align: right;
    font-weight: 600;
    color: #333;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.stream-item .stream-size-mb {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 400;
    margin-top: 2px;
}

.stream-item .stream-percentage {
    text-align: center;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

.stream-item .stream-percentage:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

/* 流管理Tag样式 */
.tag-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stream-tag {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    border: 1px solid #90caf9;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 80px;
    max-width: 120px;
    word-break: break-all;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stream-tag:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stream-tag.tag-empty {
    background: #f5f5f5;
    color: #999;
    border: 1px dashed #ccc;
    font-style: italic;
}

.stream-tag.tag-empty:hover {
    background: #e0e0e0;
    color: #666;
    border-color: #999;
}

/* 直播状态样式 */
.live-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.live-status.live-on {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.live-status.live-off {
    background: linear-gradient(135deg, #a4b0be, #747d8c);
    color: white;
    box-shadow: 0 2px 8px rgba(164, 176, 190, 0.3);
}

.live-status i {
    font-size: 0.7rem;
    animation: pulse 2s infinite;
}

.live-status.live-on i {
    color: #ff4757;
}

.live-status.live-off i {
    color: #a4b0be;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 响应式直播状态样式 */
@media (max-width: 768px) {
    .live-status {
        font-size: 0.8rem;
        padding: 3px 6px;
        gap: 4px;
    }
    
    .live-status i {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .live-status {
        font-size: 0.75rem;
        padding: 2px 4px;
        gap: 3px;
    }
    
    .live-status i {
        font-size: 0.6rem;
    }
}

/* Tag编辑模态框样式 */
#tagEditModal .modal-content {
    max-width: 400px;
    margin: 10% auto;
}

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

#tagEditModal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

#tagEditModal .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

#tagEditModal .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#tagEditModal .form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
}

#tagEditModal .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

#tagEditModal .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#tagEditModal .btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

#tagEditModal .btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

#tagEditModal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#tagEditModal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stream-item {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 15px;
    }
    
    .stream-item .stream-id,
    .stream-item .stream-tag,
    .stream-item .stream-size,
    .stream-item .stream-percentage {
        text-align: center;
        margin-bottom: 8px;
    }
    
    .date-group-header {
        padding: 15px 20px;
    }
    
    .date-group-header .date-info {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .date-group-header .date-info .date {
        font-size: 1.1rem;
    }
    
    .date-group-header .date-info .summary {
        font-size: 0.9rem;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .stream-item {
        padding: 10px 12px;
    }
    
    .stream-item .stream-id {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    .stream-item .stream-tag {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    .stream-item .stream-size {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    .stream-item .stream-percentage {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .nav-item {
        min-width: 50px;
        max-width: 60px;
        padding: 6px 2px;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
    
    .nav-item span {
        font-size: 0.65rem;
    }
    
    .sidebar-nav ul {
        padding: 0 5px;
    }
}

