:root {
    --admin-bg: #f4f6fa;
    --admin-panel: #ffffff;
    --admin-border: #d9e0ea;
    --admin-border-soft: #edf1f6;
    --admin-text: #1f2a37;
    --admin-muted: #667085;
    --admin-primary: #2563eb;
    --admin-primary-dark: #1d4ed8;
    --admin-sidebar: #101828;
    --admin-sidebar-soft: #182230;
    --admin-sidebar-text: #d0d5dd;
    --admin-sidebar-muted: #98a2b3;
    --admin-danger: #dc2626;
    --admin-success: #16a34a;
    --admin-radius: 6px;
}

html,
body {
    min-height: 100%;
    background: var(--admin-bg);
    color: var(--admin-text);
}

body.admin-next-body {
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

body.admin-next-body a {
    color: var(--admin-primary);
}

body.admin-next-body .btn {
    border-radius: 4px;
}

[v-cloak] {
    display: none;
}

.admin-shell {
    min-height: 100vh;
    background: var(--admin-bg);
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
    background: var(--admin-panel);
    border-bottom: 1px solid var(--admin-border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.admin-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    color: var(--admin-text);
    font-weight: 700;
    font-size: 16px;
}

.admin-brand-mark {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--admin-primary);
    border-radius: 6px;
    font-weight: 700;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--admin-muted);
    white-space: nowrap;
}

.admin-region-select {
    height: 30px;
    min-width: 190px;
    margin: 0;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    background: #fff;
    color: var(--admin-text);
}

.admin-logout {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    background: #fff;
    color: var(--admin-text);
}

.admin-logout:hover {
    text-decoration: none;
    border-color: var(--admin-primary);
}

.admin-category-bar {
    position: sticky;
    top: 56px;
    z-index: 999;
    min-height: 42px;
    padding: 0 20px;
    background: var(--admin-panel);
    border-bottom: 1px solid var(--admin-border-soft);
}

.admin-category-bar #tab_menu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 42px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-category-bar #tab_menu li {
    display: block !important;
    padding: 0 !important;
}

.admin-category-bar #tab_menu a {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 4px;
    color: var(--admin-muted);
}

.admin-category-bar #tab_menu li.active a,
.admin-category-bar #tab_menu a:hover {
    background: #e8f0ff;
    color: var(--admin-primary-dark);
    text-decoration: none;
}

.admin-layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: calc(100vh - 98px);
}

.admin-sidebar {
    position: sticky;
    top: 98px;
    height: calc(100vh - 98px);
    overflow: auto;
    background: var(--admin-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-menu-search {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-menu-search input {
    box-sizing: border-box;
    width: 100%;
    height: 34px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: var(--admin-sidebar-soft);
    color: #fff;
}

.admin-menu-search input::placeholder {
    color: var(--admin-sidebar-muted);
}

.admin-menu {
    margin: 0;
    padding: 10px 10px 18px;
    list-style: none;
}

.admin-menu .nav-header {
    margin-top: 8px;
    padding: 0;
    text-shadow: none;
}

.admin-menu .nav-header > a {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 10px;
    color: var(--admin-sidebar-muted);
    font-weight: 700;
    letter-spacing: 0;
}

.admin-menu .nav-header > a:hover {
    color: #fff;
    text-decoration: none;
}

.admin-menu .nav-list {
    margin: 0;
    padding: 0 0 0 6px;
    list-style: none;
}

.admin-menu .nav-list li a {
    display: flex;
    align-items: center;
    min-height: 30px;
    margin: 1px 0;
    padding: 0 10px;
    border-radius: 4px;
    color: var(--admin-sidebar-text);
}

.admin-menu .nav-list li a:hover,
.admin-menu .nav-list li.active a {
    background: rgba(37, 99, 235, 0.22);
    color: #fff;
    text-decoration: none;
}

.admin-content {
    min-width: 0;
    padding: 18px;
}

.admin-content-panel {
    min-height: calc(100vh - 134px);
    background: var(--admin-panel);
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--admin-radius);
    padding: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.admin-content-panel > .well:first-child,
.admin-content-panel #search_option > .well:first-child {
    margin-top: 0;
}

.admin-solo-body {
    padding: 0;
    background: #fff;
}

.admin-solo-root {
    width: 100%;
    min-height: 100vh;
    background: #fff;
}

.admin-vue-page {
    color: var(--admin-text);
}

.admin-vue-page .el-input__inner,
.admin-vue-page .el-select__input,
.admin-vue-page .el-date-editor .el-range-input {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    line-height: inherit;
}

.admin-vue-page .el-textarea__inner {
    margin: 0;
}

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

.admin-page-title {
    margin: 0;
    font-size: 18px;
    line-height: 28px;
    color: var(--admin-text);
}

.admin-page-subtitle {
    margin-top: 2px;
    color: var(--admin-muted);
    font-size: 12px;
}

.admin-filter-form {
    padding: 12px 12px 2px;
    margin-bottom: 12px;
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--admin-radius);
    background: #fbfcfe;
}

.admin-filter-form .el-form-item {
    margin-right: 12px;
    margin-bottom: 10px;
}

.admin-summary-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: -2px 0 12px;
}

.admin-table-wrap {
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--admin-radius);
    overflow: hidden;
}

.admin-table-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 0 0;
}

.admin-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.admin-json-preview {
    margin: 0;
    padding: 14px;
    max-height: 620px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    background: #111827;
    color: #f9fafb;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.55;
}

.admin-section-card {
    margin-bottom: 14px;
}

.admin-inline-controls,
.admin-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-form-tip {
    color: var(--admin-danger);
    font-size: 12px;
    line-height: 20px;
}

.admin-break-text {
    word-break: break-all;
}

.admin-muted-text {
    color: var(--admin-muted);
}

.admin-danger-text {
    color: var(--admin-danger);
}

.user-data-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px 10px;
    margin-bottom: 12px;
}

.user-data-field-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    margin: 0;
    font-weight: 400;
}

.user-data-condition-panel {
    overflow-x: auto;
}

.admin-media-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.admin-media-title {
    margin-bottom: 8px;
    color: var(--admin-muted);
    font-size: 12px;
}

.admin-media-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 36px;
}

.admin-media-thumb {
    display: inline-flex;
    width: 120px;
    height: 120px;
    border: 1px solid var(--admin-border-soft);
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}

.admin-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-table-media-thumb {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    max-width: 100%;
    padding: 0;
    border: 1px solid var(--admin-border-soft);
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
    box-sizing: border-box;
    cursor: pointer;
}

.admin-table-media-thumb--image {
    background: #f5f7fb;
}

.admin-table-media-thumb--video {
    background: #111827;
}

.admin-table-media-thumb:hover {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.admin-table-media-thumb__media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-table-media-thumb__badge {
    position: absolute;
    right: 3px;
    bottom: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 16px;
    padding: 0 4px;
    border-radius: 3px;
    background: rgba(17, 24, 39, 0.78);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
}

.admin-table-media-thumb__play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.66);
}

.admin-table-media-thumb__play::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 7px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid #fff;
}

.admin-media-dialog .el-dialog__body {
    padding: 12px 16px 16px;
}

.admin-media-preview {
    display: flex;
    justify-content: center;
    width: 100%;
}

.admin-media-preview__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    max-height: calc(88vh - 120px);
    overflow: hidden;
    border-radius: 6px;
    background: #fff;
}

.admin-media-preview__stage img,
.admin-media-preview__stage video {
    max-width: 100%;
    max-height: calc(88vh - 120px);
    object-fit: contain;
    background: #000;
}

.admin-media-preview__stage img {
    width: auto;
    min-width: min(360px, 100%);
}

.admin-media-preview__stage video {
    width: auto;
    min-width: min(520px, 100%);
}

.admin-menu-privilege-panel {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--admin-border-soft);
    border-radius: var(--admin-radius);
    background: #fbfcfe;
}

.admin-menu-privilege-panel .checkbox {
    margin: 4px 0;
}

.admin-menu-privilege-panel table {
    width: 100%;
    margin: 8px 0 12px;
}

.admin-muted {
    color: var(--admin-muted);
}

.admin-frame-dialog .el-dialog__body {
    padding: 0;
}

.admin-frame-dialog iframe {
    display: block;
    width: 100%;
    min-height: 640px;
    border: 0;
    background: #fff;
}

.banner-thumb-next {
    width: 120px;
    height: 54px;
    border-radius: 4px;
    background: #f5f5f5;
    object-fit: cover;
}

.banner-edit-page {
    padding: 18px;
}

.banner-edit-form {
    max-width: 860px;
}

.banner-image-preview {
    width: 180px;
    height: 82px;
    border-radius: 4px;
    object-fit: cover;
    background: #f5f5f5;
}

.banner-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 980px) {
    .admin-topbar {
        height: auto;
        min-height: 56px;
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 10px 14px;
    }

    .admin-topbar-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .admin-category-bar {
        top: 96px;
        padding: 0 12px;
    }

    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        position: relative;
        top: 0;
        height: auto;
        max-height: 320px;
    }

    .admin-content {
        padding: 12px;
    }

    .admin-content-panel {
        min-height: 0;
        padding: 12px;
    }
}
