/* 后台样式 - 高级渐变风格 */
:root {
    --primary-color: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #7c3aed;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-dark: #0c0c1d;
    --bg-card: rgba(30, 30, 50, 0.8);
    --bg-glass: rgba(40, 40, 70, 0.6);
    --border-color: rgba(139, 92, 246, 0.2);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    --gradient-accent: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f43f5e 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* 动态渐变背景 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 60%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    padding: 48px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.login-logo {
    font-size: 52px;
    margin-bottom: 16px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.login-box h2 {
    margin-bottom: 32px;
    font-weight: 600;
    font-size: 26px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 15, 35, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.3s;
}

.login-box input::placeholder {
    color: var(--text-muted);
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.login-box button {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.login-tip {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* 管理界面布局 */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo-icon {
    font-size: 28px;
}

.sidebar-header .logo-text {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: all 0.3s;
    position: relative;
}

.sidebar-nav a:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.sidebar-nav a.active {
    color: white;
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.sidebar-nav a .badge {
    background: var(--gradient-accent);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.sidebar-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
}

.sidebar-footer a:hover {
    color: var(--primary-light);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
    min-height: 100vh;
}

.panel {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
}

.panel-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.panel-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

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

.stat-card {
    background: rgba(15, 15, 35, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.stat-card .icon.purple { background: rgba(139, 92, 246, 0.2); }
.stat-card .icon.cyan { background: rgba(6, 182, 212, 0.2); }
.stat-card .icon.green { background: rgba(16, 185, 129, 0.2); }
.stat-card .icon.orange { background: rgba(245, 158, 11, 0.2); }

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 13px;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr {
    background: rgba(15, 15, 35, 0.4);
}

.data-table tr td:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.data-table tr td:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.data-table tr:hover {
    background: rgba(15, 15, 35, 0.7);
}

/* 按钮 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary-color);
}

.btn-small {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-secondary);
    transition: all 0.3s;
}

.btn-small:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: var(--danger-color) !important;
}

.btn-danger:hover {
    background: var(--danger-color) !important;
    color: white !important;
}

.btn-success {
    background: rgba(16, 185, 129, 0.15) !important;
    color: var(--success-color) !important;
}

.btn-success:hover {
    background: var(--success-color) !important;
    color: white !important;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 15, 35, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.title-input {
    font-size: 24px;
    font-weight: 600;
    padding: 16px 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-textarea {
    min-height: 300px;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', monospace;
    line-height: 1.6;
}

.editor-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.preview {
    padding: 20px;
    background: rgba(15, 15, 35, 0.4);
    border-radius: var(--radius-sm);
    overflow-y: auto;
    max-height: 400px;
    color: var(--text-primary);
    line-height: 1.8;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* 状态标签 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.published {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.status-badge.draft {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.status-badge.info {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary-light);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.category-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

/* 文件上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(15, 15, 35, 0.3);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-area:hover {
    border-color: var(--primary-color);
}

.upload-area:hover::before {
    opacity: 0.05;
}

.upload-area.dragover {
    border-color: var(--accent-color);
}

.upload-area.dragover::before {
    opacity: 0.1;
}

.upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 48px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upload-text {
    font-size: 16px;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* 文件网格 */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.file-card {
    background: rgba(15, 15, 35, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
    border-color: var(--primary-color);
}

.file-card.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.3);
}

.file-preview {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 35, 0.8);
    overflow: hidden;
    flex-shrink: 0;
}

.file-preview img,
.file-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview .file-icon {
    font-size: 36px;
    opacity: 0.5;
}

.file-info {
    padding: 10px;
    flex: 1;
    min-height: 0;
}

.file-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.file-meta {
    font-size: 10px;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.file-actions .btn-small {
    padding: 4px 8px;
    font-size: 11px;
}

/* 评论卡片 */
.comment-card {
    background: rgba(15, 15, 35, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 16px;
}

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

.comment-author {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.comment-time {
    color: var(--text-muted);
    font-size: 12px;
}

.comment-text {
    margin-bottom: 12px;
    line-height: 1.6;
}

.comment-meta {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 12px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 6px;
    margin-bottom: 12px;
}

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

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

/* 设置表单 */
.settings-form {
    max-width: 400px;
}

.settings-form h3 {
    margin-bottom: 16px;
    font-weight: 600;
}

.settings-section {
    margin-bottom: 32px;
}

.upload-preview {
    background: rgba(15, 15, 35, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    margin-bottom: 12px;
}

/* 响应式 */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar .logo-text,
    .sidebar-nav a span {
        display: none;
    }
    
    .sidebar-nav a {
        justify-content: center;
        padding: 14px;
    }
    
    .main-content {
        margin-left: 80px;
    }
    
    .editor-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .panel {
        padding: 20px;
    }
}
