* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f2f3f5; }

/* ============ 后台布局 ============ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 220px; background: #1e293b; color: #cbd5e1; flex-shrink: 0;
    display: flex; flex-direction: column;
}
.admin-logo {
    height: 60px; display: flex; align-items: center; padding: 0 20px;
    font-size: 17px; font-weight: bold; color: #fff; border-bottom: 1px solid #334155;
}
.admin-menu { flex: 1; padding: 12px 0; }
.admin-menu a {
    display: block; padding: 13px 24px; color: #cbd5e1; text-decoration: none;
    font-size: 14px; transition: all .25s ease; border-left: 3px solid transparent;
}
.admin-menu a:hover { background: #334155; color: #fff; padding-left: 28px; }
.admin-menu a.active { background: linear-gradient(90deg, #2563eb, #3b82f6); color: #fff; border-left-color: #93c5fd; }
.admin-logo { transition: letter-spacing .4s ease; }
.admin-logo:hover { letter-spacing: 1px; }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    height: 60px; background: #fff; display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.admin-content { flex: 1; padding: 20px; overflow: auto; }

/* ============ 视频管理页 ============ */
.video-page { display: flex; height: calc(100vh - 100px); }
.category-panel {
    width: 320px; background: #fff; border-radius: 10px; flex-shrink: 0;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: box-shadow .3s;
}
.category-panel:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.category-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; border-bottom: 1px solid #f3f4f6;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}
.category-panel-header .panel-title { font-size: 14px; font-weight: bold; color: #1f2937; display: flex; align-items: center; }
.category-panel-header .panel-ico { font-style: normal; margin-right: 6px; font-size: 16px; }
.category-tree-wrap { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 6px; }
/* 分类树区域自定义滚动条 */
.category-tree-wrap::-webkit-scrollbar { width: 6px; }
.category-tree-wrap::-webkit-scrollbar-track { background: transparent; }
.category-tree-wrap::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.category-tree-wrap::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.video-panel {
    flex: 1; background: #fff; border-radius: 10px; padding: 16px; overflow: auto; min-width: 0;
    margin-left: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: box-shadow .3s;
}
.video-panel:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
/* 拖拽分隔条 */
.panel-resizer {
    width: 6px; cursor: col-resize; flex-shrink: 0; margin: 0 2px; border-radius: 3px;
    background: transparent; transition: background .2s; align-self: stretch;
}
.panel-resizer:hover, .panel-resizer.dragging { background: #3b82f6; }

/* ============ 播放页 ============ */
.play-wrap { max-width: 900px; margin: 0 auto; padding: 30px 16px; }
.play-title { font-size: 22px; font-weight: bold; margin-bottom: 12px; color: #1f2937; }
.play-desc { color: #6b7280; margin-bottom: 20px; }
.play-video { background: #000; border-radius: 10px; overflow: hidden; }
.play-video video { width: 100%; display: block; max-height: 60vh; background: #000; }

/* 登录页 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #1e3a8a 100%); position: relative; overflow: hidden; }
.login-card { width: 400px; background: #fff; border-radius: 16px; padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: loginIn .6s ease both; position: relative; z-index: 2; }
.login-title { text-align: center; font-size: 22px; font-weight: bold; color: #1f2937; margin-bottom: 6px; }
.login-sub { text-align: center; color: #9ca3af; font-size: 13px; margin-bottom: 28px; }
.captcha-box { display: flex; gap: 10px; align-items: center; }
.captcha-img { height: 38px; border: 1px solid #e5e7eb; border-radius: 4px; cursor: pointer; }
@keyframes loginIn { from { opacity:0; transform: translateY(30px) scale(.96); } to { opacity:1; transform: translateY(0) scale(1); } }
.login-float { position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); z-index: 1; animation: floatBall 7s ease-in-out infinite; }
.login-float.f1 { width: 160px; height: 160px; top: -40px; left: -40px; }
.login-float.f2 { width: 240px; height: 240px; bottom: -80px; right: -60px; animation-delay: 1.5s; }
.login-float.f3 { width: 100px; height: 100px; top: 30%; right: 18%; animation-delay: 3s; }

/* 统计卡片 */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
    position: relative; background: #fff; border-radius: 12px; padding: 22px 20px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: transform .3s ease, box-shadow .3s ease;
}
.stat-card:hover { transform: translateY(-6px); box-shadow: 0 12px 28px rgba(0,0,0,.12); }
.stat-card::before {
    content:''; position:absolute; top:0; left:0; right:0; height:4px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
.stat-card:nth-child(1)::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card .num { font-size: 32px; font-weight: bold; color: #1f2937; line-height: 1.2; }
.stat-card .label { color: #6b7280; font-size: 13px; margin-top: 6px; }
.chart-box {
    background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: box-shadow .3s ease, transform .3s ease;
}
.chart-box:hover { box-shadow: 0 8px 24px rgba(0,0,0,.1); }

/* 首页欢迎横幅 */
.hero-banner {
    position: relative; border-radius: 14px; padding: 28px 30px; margin-bottom: 20px; overflow: hidden;
    background: linear-gradient(120deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
    color: #fff; box-shadow: 0 8px 24px rgba(79,70,229,.3);
}
.hero-banner::after {
    content:''; position:absolute; right:-40px; top:-40px; width:180px; height:180px; border-radius:50%;
    background: rgba(255,255,255,.12); animation: floatBall 6s ease-in-out infinite;
}
.hero-banner::before {
    content:''; position:absolute; right:60px; bottom:-50px; width:120px; height:120px; border-radius:50%;
    background: rgba(255,255,255,.08); animation: floatBall 8s ease-in-out infinite reverse;
}
.hero-banner h1 { font-size: 24px; font-weight: bold; margin-bottom: 8px; }
.hero-banner p { font-size: 14px; opacity: .9; }
@keyframes floatBall { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes fadeInUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
.fade-in-up { animation: fadeInUp .5s ease both; }
.stat-card, .chart-box { animation: fadeInUp .5s ease both; }
.stat-card:nth-child(2) { animation-delay: .08s; }
.stat-card:nth-child(3) { animation-delay: .16s; }
.stat-card:nth-child(4) { animation-delay: .24s; }

.text-danger { color: #ef4444; }
.text-success { color: #10b981; }

/* ============ 通用数据表格美化 ============ */
.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table th {
    background: #f8fafc; color: #64748b; font-weight: 600; padding: 12px 10px;
    font-size: 13px; text-align: left; border-bottom: 2px solid #eef2f7;
}
.data-table td { padding: 11px 10px; font-size: 13px; border-bottom: 1px solid #f3f4f6; color: #374151; }
.data-table tbody tr { transition: background .2s ease; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .empty-tip { text-align: center; color: #9ca3af; padding: 24px; }

/* 筛选区卡片 */
.filter-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    background: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    animation: fadeInUp .4s ease both;
}
.filter-bar .filter-title { font-size: 14px; font-weight: bold; color: #1f2937; margin-right: 4px; }

/* 面板卡片标题 */
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head .panel-title { font-size: 15px; font-weight: bold; color: #1f2937; }
.panel-head .panel-title::before { content:''; display:inline-block; width:4px; height:16px; border-radius:2px;
    background: linear-gradient(180deg,#3b82f6,#8b5cf6); margin-right:8px; vertical-align:-2px; }

/* Tab 美化（系统管理页）——保持 layui 默认 40px 高度，不设 padding 避免选中横条溢出 */
.layui-tab-brief > .layui-tab-title { background:#fff; border-radius:10px 10px 0 0; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.layui-tab-brief > .layui-tab-title li { transition: color .25s, border-color .25s; }
.layui-tab-brief > .layui-tab-title li:hover { color:#2563eb; }
.layui-tab-brief > .layui-tab-content { padding-top:14px; }
.layui-tab-brief .layui-tab-item { background:#fff; border-radius:10px; padding:16px; box-shadow:0 1px 4px rgba(0,0,0,.05); }

/* 系统配置表单卡片 */
.config-card { max-width: 640px; background:#fff; border-radius:10px; padding:20px; box-shadow:0 1px 4px rgba(0,0,0,.05); }
