/* ============================================
   企业官网 - 后台样式
   ============================================ */
:root {
    --primary: #1e3a5f;
    --primary-light: #2c5282;
    --primary-dark: #15293f;
    --accent: #c8a96a;
    --success: #2e8b57;
    --danger: #c0392b;
    --warning: #d68910;
    --info: #2874a6;
    --bg: #f3f5f9;
    --sidebar-bg: #1a2942;
    --sidebar-text: #a0aec0;
    --sidebar-active: #c8a96a;
    --card: #ffffff;
    --text: #2c3e50;
    --text-light: #6c7a89;
    --border: #e1e5eb;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

/* ===== Login Page ===== */
.login-body {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 50%, #1a365d 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-wrap {
    width: 100%;
    max-width: 960px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: rgba(255,255,255,0.06);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
}
.login-left {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    color: #fff;
    padding: 50px 44px;
    display: flex;
    flex-direction: column;
}
.login-left .brand {
    display: flex; align-items: center; gap: 14px; margin-bottom: 36px;
}
.login-left .logo-mark {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--accent), var(--accent));
    color: #fff;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 20px;
    box-shadow: 0 6px 16px rgba(200,169,106,0.4);
}
.login-left h1 { font-size: 22px; font-weight: 600; }
.login-left .brand p { font-size: 13px; opacity: 0.7; margin-top: 2px; }
.features { list-style: none; flex: 1; }
.features li { padding: 12px 0; opacity: 0.9; font-size: 14px; line-height: 1.6; }
.copyright { font-size: 12px; opacity: 0.5; margin-top: 20px; }

.login-card {
    background: #fff;
    padding: 50px 44px;
    display: flex; flex-direction: column; justify-content: center;
}
.login-card h2 { font-size: 24px; color: var(--primary); margin-bottom: 6px; }
.login-card .muted { color: var(--text-light); margin-bottom: 24px; }

.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; }
.captcha-img {
    width: 110px; height: 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
    cursor: pointer;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light);
    font-size: 12px;
}
.captcha-img img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 720px) {
    .login-wrap { grid-template-columns: 1fr; max-width: 420px; }
    .login-left { padding: 32px 24px; }
    .login-card { padding: 32px 24px; }
}

/* ===== Admin Layout ===== */
.admin-wrap { display: flex; min-height: 100vh; }

.sidebar {
    width: 230px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar .logo-mark {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent), #d4b87a);
    color: #fff;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
    flex-shrink: 0;
}
.sidebar h1 { font-size: 16px; color: #fff; font-weight: 600; }
.sidebar .brand p { font-size: 11px; opacity: 0.6; margin-top: 2px; }

.menu { flex: 1; padding: 12px 0; }
.menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.menu-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.menu-item.active {
    background: rgba(200,169,106,0.1);
    color: var(--sidebar-active);
    border-left-color: var(--sidebar-active);
}
.mi-icon { font-size: 16px; }
.mi-title { font-size: 14px; }

.sidebar-footer { padding: 12px 20px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.ext-link {
    display: block;
    padding: 8px 0;
    color: var(--sidebar-text);
    font-size: 13px;
}
.ext-link:hover { color: #fff; }

.main { flex: 1; margin-left: 230px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
    background: #fff;
    padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text); }
.topbar-user { font-size: 13px; color: var(--text-light); }

.content { padding: 24px 28px; flex: 1; }

/* ===== Page Head ===== */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 20px; gap: 16px;
}
.page-head h2 { font-size: 22px; color: var(--text); font-weight: 600; }
.page-head .muted { color: var(--text-light); font-size: 13px; margin-top: 4px; }

.page-intro {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 28px 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.page-intro::before {
    content: ''; position: absolute; right: -40px; top: -40px;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(200,169,106,0.2);
}
.page-intro h2 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.page-intro p { opacity: 0.85; font-size: 14px; }

/* ===== Stat Cards ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    padding: 22px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::after {
    content: ''; position: absolute; right: -30px; top: -30px;
    width: 100px; height: 100px; border-radius: 50%;
    opacity: 0.1;
}
.stat-blue::after   { background: #3498db; }
.stat-amber::after  { background: #f39c12; }
.stat-purple::after { background: #9b59b6; }
.stat-green::after  { background: #2ecc71; }
.stat-rose::after   { background: #e74c3c; }
.stat-num { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-light); margin: 4px 0 10px; }
.stat-link { font-size: 13px; color: var(--primary); }

/* ===== Dual Grid ===== */
.dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 1100px) { .dual-grid { grid-template-columns: 1fr; } }

/* ===== Panel ===== */
.panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.panel-head {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: #fafbfc;
}
.panel-head h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.panel-body { padding: 22px; }

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: #fff;
    padding: 6px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    width: fit-content;
}
.tab {
    padding: 8px 18px;
    color: var(--text-light);
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
}
.tab:hover { background: var(--bg); color: var(--text); }
.tab.active { background: var(--primary); color: #fff; }

/* ===== Form ===== */
.form .field { margin-bottom: 18px; }
.form label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text); font-weight: 500; }
.key-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: #f0f2f5;
    color: var(--text-light);
    border-radius: 3px;
    font-size: 11px;
    font-weight: 400;
    font-family: 'SF Mono', Consolas, monospace;
}
.req { color: var(--danger); }
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form input[type="url"],
.form select,
.form textarea {
    width: 100%;
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: #fafbfc;
    font-family: inherit;
    transition: all 0.2s;
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}
.form textarea { resize: vertical; min-height: 80px; }
.form .editor { min-height: 360px; font-family: 'SF Mono', Consolas, monospace; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }

.cover-preview {
    margin-bottom: 10px;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    width: fit-content;
}
.cover-preview img { max-width: 200px; max-height: 120px; display: block; border-radius: 4px; }

.form-actions {
    display: flex; gap: 12px; align-items: center;
    margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--border);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    border: 1.5px solid transparent;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 32px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }
.btn-danger { color: var(--danger); border-color: #f5b7b1; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-link { background: transparent; border-color: transparent; color: var(--text-light); }
.btn-link:hover { color: var(--primary); border-color: transparent; }

/* ===== Alerts ===== */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 13px;
    border-left: 3px solid;
}
.alert code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.alert-success { background: #eafaf1; color: var(--success); border-color: var(--success); }
.alert-error   { background: #fdecea; color: var(--danger); border-color: var(--danger); }
.alert-info    { background: #e8f4fc; color: var(--info); border-color: var(--info); }

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex; gap: 10px; margin-bottom: 18px; align-items: center;
}
.filter-bar input, .filter-bar select {
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    font-family: inherit;
}
.filter-bar input { width: 240px; }
.filter-bar select { width: 160px; }

/* ===== Data Table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: #fafbfc;
    color: var(--text-light);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.data-table tr:hover td { background: #fafbfc; }
.data-table .empty { text-align: center; color: var(--text-light); padding: 40px 0; }
.data-table .actions { display: flex; gap: 6px; }
.muted { color: var(--text-light); }

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    background: #ecf0f1;
    color: var(--text-light);
    font-size: 11px;
    text-decoration: none;
}
.tag:hover { color: var(--text); }
.tag-amber { background: #fdf2e9; color: #d68910; }

/* ===== Thumb Grid (Dashboard) ===== */
.thumb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 18px;
}
.thumb {
    display: block;
    aspect-ratio: 1.6;
    overflow: hidden;
    border-radius: 6px;
    background: #fafbfc;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.thumb:hover img { transform: scale(1.05); }

/* ===== Image Grid (Image Manager) ===== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 18px;
}
.image-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}
.image-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ic-thumb { aspect-ratio: 1.4; overflow: hidden; background: #fafbfc; }
.ic-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ic-info { padding: 12px; }
.ic-title {
    font-size: 13px; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 6px;
}
.ic-meta { margin-bottom: 8px; }
.ic-actions { display: flex; gap: 6px; }

/* ===== Video Grid ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 18px;
}
.video-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}
.video-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.vc-thumb { position: relative; aspect-ratio: 16/9; background: #000; overflow: hidden; }
.vc-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.vc-no-cover {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; font-size: 48px;
}
.play-icon {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 50px; height: 50px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    padding-left: 4px;
}
.vc-info { padding: 12px; }
.vc-title {
    font-size: 13px; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 6px;
}

/* ===== Pager ===== */
.pager-wrap { padding: 16px 0; display: flex; justify-content: center; }
.pager ul { display: flex; gap: 4px; list-style: none; }
.pager li a, .pager li span {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
    min-width: 36px;
    text-align: center;
}
.pager li a:hover { border-color: var(--primary); color: var(--primary); }
.pager li.active a, .pager li.active span { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager li.disabled span { color: #ccc; cursor: not-allowed; }

@media (max-width: 920px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .topbar { padding: 12px 16px; }
    .content { padding: 16px; }
    .grid-2 { grid-template-columns: 1fr; }
}
