/* ==================== 全局 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    min-height: 100vh;
}
a { color: #6c8cff; text-decoration: none; }
a:hover { color: #8aa4ff; }
input, select, textarea, button { outline: none; font-family: inherit; }

/* ==================== 登录页 ==================== */
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; 
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%); }
.login-container { display: flex; width: 900px; min-height: 560px; border-radius: 16px; 
    background: rgba(255,255,255,0.04); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5); overflow: hidden; }
.login-left { flex: 1; padding: 50px 40px; display: flex; align-items: center; 
    background: linear-gradient(135deg, rgba(108,140,255,0.1) 0%, transparent 100%); }
.login-brand h1 { font-size: 36px; font-weight: 700; color: #fff; margin-bottom: 8px;
    background: linear-gradient(135deg, #6c8cff, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-subtitle { font-size: 16px; color: #888; margin-bottom: 40px; }
.feature-item { padding: 12px 0; font-size: 15px; color: #ccc; 
    border-bottom: 1px solid rgba(255,255,255,0.05); }
.login-right { flex: 0 0 380px; padding: 50px 36px; display: flex; align-items: center; }
.login-form-box { width: 100%; }
.login-tabs { display: flex; margin-bottom: 30px; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.tab-btn { flex: 1; padding: 10px; background: transparent; border: none; color: #888; font-size: 15px; cursor: pointer; transition: all 0.3s; }
.tab-btn.active { background: rgba(108,140,255,0.2); color: #6c8cff; font-weight: 600; }
.auth-form { display: none; }
.auth-form.active { display: block; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: #aaa; margin-bottom: 6px; }
.form-group input { width: 100%; padding: 12px 14px; background: rgba(255,255,255,0.06); 
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #fff; font-size: 14px; transition: 0.3s; }
.form-group input:focus { border-color: #6c8cff; background: rgba(108,140,255,0.08); }
.form-group input::placeholder { color: #555; }
.btn-primary { background: linear-gradient(135deg, #6c8cff, #8b6cff); color: #fff; border: none; 
    padding: 12px 24px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 25px rgba(108,140,255,0.3); }
.btn-full { width: 100%; }
.form-tip { text-align: center; margin-top: 16px; font-size: 13px; color: #888; }
.toast { display: none; position: fixed; top: 30px; left: 50%; transform: translateX(-50%); 
    padding: 14px 30px; border-radius: 8px; font-size: 14px; z-index: 9999; 
    box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.toast.error { background: #e74c3c; color: #fff; }
.toast.success { background: #27ae60; color: #fff; }
.toast.info { background: #2d3748; color: #e0e0e0; }

/* ==================== 后台布局 ==================== */
.dashboard-body { display: flex; height: 100vh; overflow: hidden; }

/* 侧边栏 */
.sidebar { width: 240px; background: #14142a; border-right: 1px solid rgba(255,255,255,0.06); 
    display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-header h2 { font-size: 20px; background: linear-gradient(135deg, #6c8cff, #a78bfa); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-header p { font-size: 12px; color: #666; margin-top: 4px; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: #999; 
    font-size: 14px; cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(108,140,255,0.06); color: #ccc; }
.nav-item.active { background: rgba(108,140,255,0.1); color: #6c8cff; border-left-color: #6c8cff; }
.nav-item .icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06); }
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #6c8cff, #8b6cff); 
    display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; }
.user-name { font-size: 14px; color: #ddd; }
.user-role { font-size: 12px; color: #888; }
.logout-btn { width: 100%; padding: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); 
    border-radius: 6px; color: #999; font-size: 13px; cursor: pointer; transition: 0.2s; }
.logout-btn:hover { background: rgba(231,76,60,0.1); color: #e74c3c; border-color: rgba(231,76,60,0.2); }

/* 主内容区 */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-header { padding: 20px 30px; border-bottom: 1px solid rgba(255,255,255,0.06); 
    background: rgba(15,15,26,0.8); backdrop-filter: blur(10px); }
.main-header h1 { font-size: 22px; color: #fff; }
.main-header p { font-size: 13px; color: #888; margin-top: 4px; }
.main-body { flex: 1; padding: 24px 30px; overflow-y: auto; }

/* ==================== 页面面板 ==================== */
.page-panel { display: none; }
.page-panel.active { display: block; }
.panel-title { font-size: 18px; color: #fff; margin-bottom: 20px; }
.panel-desc { font-size: 13px; color: #888; margin-bottom: 24px; }

/* 卡片 */
.card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); 
    border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 15px; color: #ddd; font-weight: 600; margin-bottom: 16px; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); 
    border-radius: 12px; padding: 20px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 13px; color: #888; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.05); }
th { color: #888; font-weight: 600; background: rgba(255,255,255,0.02); }
td { color: #ccc; }
tr:hover td { background: rgba(108,140,255,0.03); }

/* 按钮 */
.btn { padding: 8px 18px; border-radius: 6px; font-size: 13px; border: none; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-primary { background: linear-gradient(135deg, #6c8cff, #8b6cff); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 15px rgba(108,140,255,0.3); }
.btn-success { background: #27ae60; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: #f39c12; color: #fff; }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.15); color: #ccc; }
.btn-outline:hover { border-color: #6c8cff; color: #6c8cff; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* 表单 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-label { font-size: 13px; color: #aaa; margin-bottom: 6px; display: block; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 12px; background: rgba(255,255,255,0.06); 
    border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: #fff; font-size: 13px; }
.form-textarea { min-height: 120px; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: #6c8cff; }
.form-select option { background: #1a1a2e; color: #fff; }

/* 上传区域 */
.upload-zone { border: 2px dashed rgba(255,255,255,0.15); border-radius: 12px; padding: 40px; 
    text-align: center; cursor: pointer; transition: 0.3s; }
.upload-zone:hover { border-color: #6c8cff; background: rgba(108,140,255,0.05); }
.upload-zone .upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone .upload-text { font-size: 14px; color: #888; }
.upload-zone .upload-hint { font-size: 12px; color: #555; margin-top: 8px; }

/* 网格 */
.grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.grid-item { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); 
    border-radius: 8px; padding: 12px; text-align: center; position: relative; }
.grid-item img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.grid-item .item-name { font-size: 12px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-item .item-del { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; 
    background: rgba(231,76,60,0.8); border: none; border-radius: 50%; color: #fff; font-size: 12px; 
    cursor: pointer; display: none; align-items: center; justify-content: center; }
.grid-item:hover .item-del { display: flex; }

/* 搜索框 */
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; }
.search-bar input { flex: 1; max-width: 300px; padding: 10px 14px; background: rgba(255,255,255,0.06); 
    border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: #fff; font-size: 13px; }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 12px; }
.tag-success { background: rgba(39,174,96,0.15); color: #27ae60; }
.tag-danger { background: rgba(231,76,60,0.15); color: #e74c3c; }
.tag-warning { background: rgba(243,156,18,0.15); color: #f39c12; }
.tag-info { background: rgba(52,152,219,0.15); color: #3498db; }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 20px; }
.pagination button { padding: 6px 14px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 4px; color: #ccc; font-size: 13px; cursor: pointer; }
.pagination button:hover { border-color: #6c8cff; color: #6c8cff; }
.pagination .page-info { font-size: 13px; color: #888; }

/* 弹窗 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(0,0,0,0.6); z-index: 999; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal-box { background: #1a1a2e; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; 
    padding: 30px; width: 520px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal-box h3 { font-size: 18px; color: #fff; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state .empty-text { font-size: 15px; color: #888; }
.empty-state .empty-hint { font-size: 13px; color: #555; margin-top: 8px; }

/* 套餐卡片 */
.package-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 24px; }
.package-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); 
    border-radius: 12px; padding: 28px; text-align: center; position: relative; transition: 0.3s; }
.package-card:hover { transform: translateY(-4px); border-color: rgba(108,140,255,0.3); box-shadow: 0 10px 40px rgba(108,140,255,0.1); }
.package-card.popular { border-color: #6c8cff; background: rgba(108,140,255,0.06); }
.package-card .popular-badge { position: absolute; top: -10px; right: 20px; background: linear-gradient(135deg, #6c8cff, #8b6cff); 
    padding: 4px 16px; border-radius: 20px; font-size: 12px; color: #fff; font-weight: 600; }
.package-card .pkg-name { font-size: 18px; color: #fff; font-weight: 600; margin-bottom: 8px; }
.package-card .pkg-price { font-size: 36px; color: #6c8cff; font-weight: 700; margin-bottom: 4px; }
.package-card .pkg-price span { font-size: 16px; }
.package-card .pkg-meta { font-size: 13px; color: #888; margin-bottom: 20px; }
.package-card .pkg-desc { font-size: 13px; color: #aaa; margin-bottom: 20px; line-height: 1.6; }

/* 视频卡片 */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.video-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); 
    border-radius: 12px; overflow: hidden; transition: 0.3s; }
.video-card:hover { border-color: rgba(108,140,255,0.2); }
.video-card video { width: 100%; height: 180px; background: #000; object-fit: cover; }
.video-card .video-info { padding: 14px 16px; }
.video-card .video-info .video-title { font-size: 14px; color: #ddd; margin-bottom: 6px; }
.video-card .video-info .video-meta { font-size: 12px; color: #666; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* 响应式 */
@media (max-width: 768px) {
    .login-container { flex-direction: column; width: 95%; min-height: auto; }
    .login-left { display: none; }
    .login-right { flex: 1; padding: 40px 24px; }
    .sidebar { width: 60px; }
    .sidebar-header h2, .sidebar-header p, .nav-item span, .user-info .user-name, .user-info .user-role { display: none; }
    .nav-item { justify-content: center; padding: 14px; }
    .nav-item .icon { font-size: 22px; }
    .form-row { grid-template-columns: 1fr; }
    .main-body { padding: 16px; }
}