/**
 * 后台管理系统样式文件
 * 蓝白主题设计
 */

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

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 主容器布局 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #4fc3f7;
}

.nav-item.active a {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: #29b6f6;
}

.nav-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
    background-color: #f5f7fa;
    min-height: 100vh;
}

/* 内容头部 */
.content-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e3f2fd;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1976d2;
    margin: 0;
}

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

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
}

.btn-secondary {
    background: linear-gradient(135deg, #90a4ae, #607d8b);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #607d8b, #455a64);
}

.btn-success {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #388e3c, #2e7d32);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f57c00, #ef6c00);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d32f2f, #c62828);
}

.btn-info {
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0097a7, #00838f);
}

.btn-light {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-light:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

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

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.card-header {
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-bottom: 1px solid #e1f5fe;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1976d2;
    margin: 0;
}

.card-body {
    padding: 20px;
}

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

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

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 40px;
    margin-right: 20px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: #1976d2;
    margin: 0 0 5px 0;
}

.stat-info p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1f5fe;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

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

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1f5fe;
}

/* 搜索和筛选 */
.search-filters {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.search-form input,
.search-form select {
    min-width: 200px;
    padding: 10px 14px;
    border: 2px solid #e1f5fe;
    border-radius: 6px;
    font-size: 14px;
}

/* 媒体列表 */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 24px;
    padding: 0 4px;
}

.media-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
}

.media-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: rgba(0,0,0,0.08);
}

.media-thumbnail {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #666;
    position: relative;
}

.media-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}

.media-info {
    padding: 16px;
}

.media-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.media-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.media-meta .meta-item::before {
    content: '•';
    color: #d1d5db;
    font-weight: bold;
}

.media-meta .meta-item:first-child::before {
    display: none;
}

.media-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.media-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
}

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

.media-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.media-actions .btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
}

.media-actions .btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.media-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.media-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* 屏幕列表 */
.screen-list {
    display: grid;
    gap: 20px;
}

.screen-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.screen-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.screen-name {
    font-size: 20px;
    font-weight: 600;
    color: #1976d2;
    margin: 0 0 8px 0;
}

.screen-code {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.screen-code code {
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #1976d2;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #f0f0f0;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-active {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-inactive {
    background: #ffebee;
    color: #c62828;
}

.status-maintenance {
    background: #fff3e0;
    color: #ef6c00;
}

.screen-details {
    margin-bottom: 20px;
}

.screen-description {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.5;
}

.screen-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.meta-label {
    font-weight: 500;
    color: #666;
}

.meta-value {
    color: #333;
}

.screen-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1f5fe;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1976d2;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(0,0,0,0.1);
    color: #333;
}

.modal form {
    padding: 25px;
}

/* 提示消息 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-success {
    background: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.alert-warning {
    background: #fff3e0;
    color: #ef6c00;
    border-left: 4px solid #ff9800;
}

.alert-info {
    background: #e1f5fe;
    color: #0277bd;
    border-left: 4px solid #03a9f4;
}

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

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

.empty-state a {
    color: #2196f3;
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* 快速操作 */
.quick-actions {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.quick-actions-header {
    margin-bottom: 25px;
    text-align: center;
}

.quick-actions-header h2 {
    color: #1976d2;
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 600;
}

.quick-actions-desc {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.action-group {
    border: 1px solid #e3f2fd;
    border-radius: 12px;
    padding: 20px;
    background: #fafbfc;
}

.action-group h3 {
    color: #1976d2;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e3f2fd;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-buttons .btn {
    display: flex;
    align-items: center;
    padding: 15px 18px;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.action-buttons .btn-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.action-buttons .btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
}

.action-buttons .btn-text strong {
    font-weight: 600;
    margin-bottom: 2px;
}

.action-buttons .btn-text small {
    font-size: 12px;
    opacity: 0.8;
    font-weight: normal;
}

.action-buttons .btn-outline {
    background: white;
    color: #666;
    border-color: #e0e0e0;
}

.action-buttons .btn-outline:hover {
    border-color: #1976d2;
    color: #1976d2;
    background: #f8fbff;
}

.quick-action {
    display: flex;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    color: #1976d2;
}

.quick-action-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.quick-action-text {
    font-weight: 500;
}

/* 最近活动 */
.activity-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.activity-item:hover {
    background: #f8f9fa;
}

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

.activity-icon {
    font-size: 16px;
    margin-right: 15px;
    width: 30px;
    text-align: center;
    color: #666;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.activity-time {
    font-size: 12px;
    color: #999;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* 侧边栏关闭按钮 */
.sidebar-close {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.sidebar-close:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar-close {
        display: block;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px 15px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .media-grid {
        grid-template-columns: 1fr;
    }
    
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form input,
    .search-form select {
        min-width: auto;
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .screen-meta {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px 10px;
    }
    
    .content-header h1 {
        font-size: 24px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .media-actions,
    .screen-actions {
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 打印样式 */
@media print {
    .sidebar,
    .header-actions,
    .media-actions,
    .screen-actions,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .card,
    .media-card,
    .screen-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

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

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

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}