* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #111827;
    color: #fff;
    padding: 24px 16px;
}

.logo-block {
    padding: 0 8px 24px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 16px;
}

.logo-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.logo-subtitle {
    font-size: 13px;
    color: #9ca3af;
}

.menu { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
    display: block;
    color: #d1d5db;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
}
.menu-item:hover, .menu-item.active { background: #1f2937; color: #fff; }

.main {
    flex: 1;
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-title { font-size: 26px; font-weight: 700; }
.page-desc { color: #6b7280; margin-top: 4px; }

.grid-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.card {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15,23,42,.06);
}
.card-title { color: #6b7280; font-size: 14px; margin-bottom: 10px; }
.card-value { font-size: 30px; font-weight: 700; }

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-form { display: flex; gap: 10px; flex-wrap: wrap; }
input[type="text"], input[type="datetime-local"], input[type="number"], input[type="password"], input[type="email"], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    outline: none;
}
textarea { min-height: 100px; resize: vertical; }

.btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 12px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #111827; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-success { background: #16a34a; color: #fff; }

.table-wrap {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15,23,42,.06);
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 14px 12px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}
th { background: #f8fafc; color: #475569; }

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-muted { background: #e5e7eb; color: #4b5563; }

.panel {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15,23,42,.06);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.form-group label {
    display: block;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
    font-weight: 600;
}
.full-span { grid-column: 1 / -1; }

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #eff6ff; color: #1d4ed8; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #111827, #1d4ed8);
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 16px 40px rgba(0,0,0,.18);
}
.login-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.login-desc { color: #6b7280; margin-bottom: 24px; }

.list-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.empty-box {
    padding: 32px;
    text-align: center;
    color: #6b7280;
}

.video-shell {
    min-height: 100vh;
    background: #0f172a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.video-shell-card {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}
.video-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 18px;
    background: #111827;
}
.video-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.5;
}
.video-subtitle {
    color: #cbd5e1;
    text-align: center;
    margin: -8px 0 22px;
    font-size: 14px;
}
.video-hint {
    color: #94a3b8;
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
}
.video-player {
    width: 100%;
    display: block;
    background: #000;
    border-radius: 14px;
}
.center-actions { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 960px) {
    .grid-cards, .list-two, .form-grid { grid-template-columns: 1fr; }
    .sidebar { width: 210px; }
}

@media (max-width: 720px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; }
}


.preview-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
}
.preview-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}
.preview-line {
    color: #374151;
    word-break: break-all;
}
.qr-preview {
    width: 180px;
    height: 180px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 8px;
}
.qr-thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 4px;
    display: block;
}

.qr-thumb {
    width: 92px;
    height: 92px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.qr-preview {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.field-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}
.subtext {
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}
.mono-line {
    margin-top: 6px;
    color: #475569;
    word-break: break-all;
    font-size: 12px;
}
.action-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-sm {
    padding: 8px 10px;
    font-size: 12px;
}
.row-warning td {
    background: #fffbea;
}
.row-expired td {
    background: #fef2f2;
}
.quick-links .action-group {
    gap: 10px;
}

@media (max-width: 640px) {
    .video-shell { padding: 16px; }
    .video-title { font-size: 17px; margin-bottom: 20px; }
    .video-subtitle { margin-bottom: 18px; }
    .video-player { border-radius: 12px; }
}

/* ===== 视频管理页专项优化 ===== */
.videos-page .page-header { margin-bottom: 18px; }
.videos-stats-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 18px;
}
.videos-stats-grid .stat-card {
    padding: 16px 18px;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.videos-stats-grid .card-title {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}
.videos-stats-grid .card-value {
    font-size: 28px;
    line-height: 1;
}
.videos-toolbar-panel {
    padding: 16px 18px;
    margin-bottom: 16px;
}
.videos-toolbar-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.videos-search-input {
    flex: 1 1 420px;
    min-width: 260px;
}
.videos-status-select {
    width: 260px;
    flex: 0 0 260px;
}
.videos-table-wrap table th,
.videos-table-wrap table td {
    padding-top: 16px;
    padding-bottom: 16px;
}
.video-title-line {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.videos-qr-thumb {
    width: 96px;
    height: 96px;
}
.main-actions,
.sub-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.sub-actions { margin-top: 8px; }
.main-actions .btn,
.sub-actions .btn { white-space: nowrap; }
@media (max-width: 1280px) {
    .videos-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .videos-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .videos-status-select { width: 100%; flex: 1 1 100%; }
}
@media (max-width: 640px) {
    .videos-stats-grid { grid-template-columns: 1fr; }
}


.video-actions-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.video-actions-row .btn {
    flex: 0 0 auto;
    line-height: 1.1;
}
.video-actions-row .btn-sm {
    padding: 7px 8px;
    font-size: 12px;
    border-radius: 10px;
}
.videos-page table th:last-child,
.videos-page table td:last-child {
    white-space: nowrap;
    min-width: 190px;
}
@media (max-width: 1500px) {
    .video-actions-row {
        gap: 4px;
    }
    .video-actions-row .btn-sm {
        padding: 6px 7px;
        font-size: 12px;
    }
    .videos-page table th:last-child,
    .videos-page table td:last-child {
        min-width: 180px;
    }
}
