/* ============================================
   照片直播网站 - 后台管理样式
   ============================================ */

/* 后台布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: var(--transition);
}

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

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.sidebar-header .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-group {
    margin-bottom: 8px;
}

.nav-group-title {
    padding: 8px 24px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.9);
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary-light);
    border-left-color: var(--primary-color);
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger-color);
    color: #fff;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
}

/* 主内容区 */
.admin-main {
    flex: 1;
    margin-left: 260px;
    background: #f1f5f9;
    min-height: 100vh;
}

/* 顶部栏 */
.admin-topbar {
    background: var(--bg-primary);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.topbar-breadcrumb a {
    color: var(--text-secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.topbar-user:hover {
    background: var(--bg-secondary);
}

.topbar-user .user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

.topbar-user .user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* 内容区 */
.admin-content {
    padding: 24px 30px;
}

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

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-icon.blue {
    background: rgba(66, 153, 225, 0.1);
    color: var(--info-color);
}

.stat-card .stat-icon.green {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.stat-card .stat-icon.orange {
    background: rgba(237, 137, 54, 0.1);
    color: var(--warning-color);
}

.stat-card .stat-icon.purple {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.stat-card .stat-info .stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .stat-info .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 面板卡片 */
.panel {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-body {
    padding: 24px;
}

.panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    white-space: nowrap;
}

.data-table td {
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: rgba(102, 126, 234, 0.02);
}

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

.data-table .actions a,
.data-table .actions button {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.data-table .actions .btn-edit {
    background: rgba(66, 153, 225, 0.1);
    color: var(--info-color);
}

.data-table .actions .btn-edit:hover {
    background: var(--info-color);
    color: #fff;
}

.data-table .actions .btn-delete {
    background: rgba(229, 62, 62, 0.1);
    color: var(--danger-color);
}

.data-table .actions .btn-delete:hover {
    background: var(--danger-color);
    color: #fff;
}

.data-table .actions .btn-view {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.data-table .actions .btn-view:hover {
    background: var(--success-color);
    color: #fff;
}

/* 表格中的缩略图 */
.table-thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* 表格中的状态 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.published {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.status-badge.draft {
    background: rgba(160, 174, 192, 0.1);
    color: var(--text-muted);
}

.status-badge.offline {
    background: rgba(229, 62, 62, 0.1);
    color: var(--danger-color);
}

/* 工具栏 */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar .search-input {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    width: 250px;
    transition: var(--transition);
}

.toolbar .search-input:focus {
    border-color: var(--primary-color);
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 50px 30px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.02);
}

.upload-area .upload-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.upload-area .upload-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-area .upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 上传进度 */
.upload-progress {
    margin-top: 20px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.upload-item .upload-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

.upload-item .upload-info {
    flex: 1;
}

.upload-item .upload-name {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-item .progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.upload-item .progress-bar .progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.upload-item .upload-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-item .upload-status.success {
    color: var(--success-color);
}

.upload-item .upload-status.error {
    color: var(--danger-color);
}

/* 照片网格（后台管理） */
.photo-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.photo-grid-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
}

.photo-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-grid-item .photo-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: var(--transition);
    z-index: 10;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid #ccc;
}

.photo-grid-item:hover .photo-checkbox {
    opacity: 1;
    border-color: var(--primary-color);
}

.photo-grid-item .photo-checkbox.checked {
    opacity: 1;
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.photo-grid-item .photo-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    opacity: 0;
    transition: var(--transition);
}

.photo-grid-item:hover .photo-actions {
    opacity: 1;
}

.photo-grid-item .photo-actions button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.photo-grid-item .photo-actions button:hover {
    background: rgba(255,255,255,0.4);
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
}

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

.login-card .login-header .login-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: #fff;
}

.login-card .login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-card .login-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

.login-card .form-control {
    padding: 12px 16px;
    font-size: 0.95rem;
}

.login-card .btn-login {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 8px;
}

/* 设置页面 */
.settings-form .form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    align-items: start;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-form .form-row:last-child {
    border-bottom: none;
}

.settings-form .form-row .row-label {
    padding-top: 10px;
}

.settings-form .form-row .row-label .label-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-form .form-row .row-label .label-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 图片预览上传 */
.image-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.image-upload .preview {
    width: 100px;
    height: 100px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-secondary);
}

.image-upload .preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload .preview .placeholder {
    color: var(--text-muted);
    font-size: 2rem;
}

/* 响应式 */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 200px;
    }
    .admin-main {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    /* 侧边栏隐藏 */
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    
    /* 顶部栏紧凑化 */
    .admin-topbar {
        height: 50px;
        padding: 0 12px;
    }
    
    .topbar-breadcrumb {
        font-size: 0.8rem;
    }
    
    .topbar-user .user-name {
        display: none;
    }
    
    /* 内容区 */
    .admin-content {
        padding: 12px;
    }
    
    /* 统计卡片 - 2列紧凑布局 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }
    
    .stat-card {
        padding: 14px;
        gap: 10px;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .stat-num {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* 面板紧凑化 */
    .panel {
        border-radius: var(--radius-sm);
        margin-bottom: 12px;
    }
    
    .panel-header {
        padding: 12px 14px;
    }
    
    .panel-title {
        font-size: 0.95rem;
    }
    
    .panel-body {
        padding: 14px;
    }
    
    /* 表格转为卡片式布局 */
    .data-table {
        display: block;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tbody {
        display: block;
    }
    
    .data-table tr {
        display: block;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        padding: 12px;
    }
    
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        font-size: 0.85rem;
    }
    
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        margin-right: 10px;
        flex-shrink: 0;
    }
    
    .data-table td:last-child {
        justify-content: flex-end;
        padding-top: 10px;
        margin-top: 6px;
        border-top: 1px solid var(--border-color);
    }
    
    .data-table td:last-child::before {
        display: none;
    }
    
    /* 操作按钮 */
    .data-table .actions {
        display: flex;
        gap: 8px;
    }
    
    .btn-view, .btn-edit, .btn-delete {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-height: 32px;
    }
    
    /* 工具栏 */
    .toolbar {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 14px;
    }
    
    .toolbar-left, .toolbar-right {
        width: 100%;
    }
    
    .toolbar-right {
        flex-direction: column;
    }
    
    .toolbar-right .form-control,
    .toolbar-right select {
        width: 100% !important;
    }
    
    /* 上传区域优化 */
    .upload-area {
        padding: 30px 15px;
        min-height: 120px;
    }
    
    .upload-icon {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .upload-text {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .upload-hint {
        font-size: 0.75rem;
    }
    
    /* 按钮触摸友好 */
    .btn {
        min-height: 40px;
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .btn-sm {
        min-height: 34px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    /* 表单优化 */
    .form-control {
        min-height: 40px;
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .settings-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    /* 汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: none;
        border: none;
        font-size: 1.3rem;
        color: var(--text-primary);
        cursor: pointer;
    }
    
    /* 遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* 照片网格 */
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .photo-grid .photo-item {
        aspect-ratio: 1;
    }
    
    /* 欢迎面板 */
    .panel[style*="gradient"] .panel-body {
        padding: 20px 14px !important;
    }
    
    .panel[style*="gradient"] h2 {
        font-size: 1.2rem !important;
    }
    
    .panel[style*="gradient"] p {
        font-size: 0.85rem !important;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕进一步优化 */
    .admin-content {
        padding: 10px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-num {
        font-size: 1.1rem;
    }
    
    /* 照片网格3列 */
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
    
    /* 表格卡片更紧凑 */
    .data-table tr {
        padding: 10px;
        margin-bottom: 8px;
    }
    
    .data-table td {
        padding: 4px 0;
        font-size: 0.8rem;
    }
    
    /* 按钮 */
    .btn {
        min-height: 38px;
        padding: 8px 14px;
    }
}
