/* ========== 基础变量 ========== */
:root {
    --navy: #20222a;
    --navy2: #2f4056;
    --blue: #1e9fff;
    --acid: #1e9fff;
    --bg: #f2f2f2;
    --line: #e6e6e6;
    --muted: #999;
    --font: "Microsoft YaHei", sans-serif;
    --display: "Microsoft YaHei", sans-serif;
}

/* ========== 全局重置 ========== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    color: var(--navy);
    margin: 0;
    background: var(--bg);
    font-size: 14px;
}

/* 全局滚动条优化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ========== Layui 覆盖 ========== */
.layui-btn {
    background: var(--blue);
    border-radius: 2px;
}

.layui-btn:hover {
    opacity: .88;
}

.layui-input,
.layui-textarea,
.layui-select {
    border-color: #cdd7df;
    border-radius: 2px;
}

.layui-input:focus,
.layui-textarea:focus {
    border-color: var(--blue) !important;
}

.layui-table {
    border-color: var(--line);
}

.layui-table th {
    background: #f7f7f7;
    color: #333;
    font-weight: 400;
}

.layui-table td {
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ========== 登录页 ========== */
.login-page {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: #333;
    display: grid;
    place-items: center;
}

.login-shell {
    display: block;
    min-height: auto;
    width: 390px;
    max-width: calc(100vw - 32px);
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}

.login-brand {
    display: none;
}

.login-card {
    padding: 38px 42px;
    background: #fff;
}

.login-kicker {
    display: none;
}

.login-card h2 {
    font-size: 22px;
    font-weight: 400;
    text-align: center;
    margin: 0 0 8px;
}

.login-card>p {
    text-align: center;
    margin: 0 0 26px;
    font-size: 13px;
}

.login-card label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-card .layui-form-item {
    margin-bottom: 24px;
}

.login-card .layui-input {
    height: 42px;
}

.login-card .layui-btn {
    height: 42px;
    margin-top: 4px;
    width: 100%;
}

.login-card>small {
    display: none;
}

.login-error {
    padding: 12px 16px;
    background: #fff0f0;
    color: #a52a2a;
    margin-bottom: 20px;
    font-size: 13px;
}

/* ========== 后台布局 ========== */
.admin-body {
    background: var(--bg);
    min-height: 100vh;
}

/* 侧边栏 */
.admin-sidebar {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    padding: 0;
    background: var(--navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform .25s;
}

.admin-brand {
    display: flex;
    align-items: center;
    height: 58px;
    padding: 0 20px;
    gap: 10px;
    background: var(--navy);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.admin-logo {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    background: var(--blue);
    border-radius: 4px;
    color: #fff;
    font-family: var(--display);
    font-weight: 800;
    font-size: 12px;
}

.admin-brand>div:last-child {
    display: flex;
    flex-direction: column;
}

.admin-brand strong {
    font-size: 15px;
    letter-spacing: 0;
    color: #fff;
}

.admin-brand small {
    display: none;
}

/* 导航 */
.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #3a4a5c transparent;
}

.admin-sidebar nav::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar nav::-webkit-scrollbar-thumb {
    background: #3a4a5c;
    border-radius: 2px;
}

.admin-sidebar nav::-webkit-scrollbar-track {
    background: transparent;
}

.nav-label {
    display: none;
}

/* 一级菜单项 */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: 44px;
    color: #bfcbd9;
    border-radius: 0;
    transition: .2s;
    text-decoration: none;
    font-size: 14px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.nav-item.active {
    background: var(--blue);
    color: #fff;
}

.nav-item i {
    font-size: 18px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

/* 二级菜单组 */
.nav-group {}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: 44px;
    color: #bfcbd9;
    cursor: pointer;
    transition: .2s;
    user-select: none;
}

.nav-group-title:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.nav-group-title i:first-child {
    font-size: 18px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.nav-group-title span {
    flex: 1;
    font-size: 14px;
}

.nav-arrow {
    font-size: 12px !important;
    transition: transform .2s;
}

.nav-group.open .nav-arrow {
    transform: rotate(90deg);
}

.nav-group-items {
    display: none;
    background: rgba(0, 0, 0, .15);
}

.nav-group.open .nav-group-items {
    display: block;
}

.nav-group-items .nav-item {
    padding-left: 48px;
    height: 40px;
    font-size: 13px;
}

.nav-group-items .nav-item.active {
    background: var(--blue);
}

/* 侧边栏底部 */
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-footer a {
    padding: 10px 20px;
    color: #8099af;
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-footer a:hover {
    color: #fff;
}

.sidebar-footer i {
    font-size: 18px;
    width: 18px;
    text-align: center;
}

/* 主区域 */
.admin-main {
    margin-left: 220px;
    min-height: 100vh;
}

/* 顶栏 */
.admin-header {
    height: 58px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.sidebar-toggle {
    display: none;
    border: 0;
    background: none;
    font-size: 24px;
    margin-right: 15px;
    cursor: pointer;
}

.admin-header>div:nth-child(2)>span,
.form-toolbar>div>span {
    display: none;
}

.admin-header h1 {
    font-family: var(--display);
    font-size: 16px;
    font-weight: 400;
    margin: 0;
}

.admin-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-user span {
    font-size: 13px;
    color: var(--muted);
}

.admin-user b {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #5fb878;
    color: #fff;
    font-size: 12px;
}

/* 内容区 */
.admin-content {
    padding: 20px;
    max-width: none;
    margin: auto;
}

/* ========== 提示消息 ========== */
.admin-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 17px;
    margin-bottom: 16px;
    border-left: 4px solid;
}

.admin-alert.success {
    background: #f2f9df;
    border-color: #7ea513;
    color: #3c5800;
}

.admin-alert.error {
    background: #fff0f0;
    border-color: #d84040;
    color: #9b2424;
}

/* ========== 工作台 ========== */
.welcome-panel {
    min-height: 0;
    padding: 22px 25px;
    background: #fff;
    color: #333;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.welcome-panel>div>span,
.welcome-panel p {
    display: none;
}

.welcome-panel h2 {
    font-size: 18px;
    font-weight: 400;
    margin: 0;
}

.welcome-panel h2 br {
    display: none;
}

.welcome-panel .layui-btn {
    background: var(--blue);
}

/* 统计卡片 */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: none;
    border: 0;
    margin: 16px 0;
}

.metric-grid>div {
    background: #fff;
    border: 1px solid var(--line);
    padding: 20px 22px;
}

.metric-grid span {
    font-family: var(--font);
    font-size: 13px;
    letter-spacing: 0;
    color: #999;
}

.metric-grid strong {
    display: block;
    font-family: var(--font);
    font-size: 30px;
    font-weight: 400;
    margin: 8px 0 2px;
    color: #333;
}

.metric-grid p {
    margin: 0;
    font-size: 12px;
    color: #999;
}

.metric-grid .highlight {
    background: #fff;
}

.metric-grid .highlight span,
.metric-grid .highlight p {
    font-size: 12px;
    color: #999;
}

/* ========== 面板 ========== */
.admin-panel {
    background: #fff;
    border: 1px solid var(--line);
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: none;
}

.panel-title,
.form-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-title span,
.form-toolbar>div>span {
    display: none;
}

.panel-title h2,
.form-toolbar h2 {
    font-family: var(--display);
    font-size: 16px;
    font-weight: 400;
    margin: 0;
}

.panel-title>a:not(.layui-btn),
.form-toolbar a {
    color: var(--blue);
    text-decoration: none;
}

/* ========== 表格 ========== */
.admin-table-wrap {
    overflow: auto;
}

.layui-table th {
    background: #f6f8fa;
    color: #667b8f;
    font-size: 12px;
}

.layui-table td strong {
    display: block;
}

.layui-table td small {
    display: block;
    color: #93a1ae;
    margin-top: 5px;
}

/* 状态标签 */
.status {
    display: inline-flex;
    padding: 4px 9px;
    font-size: 11px;
    background: #e9edf1;
    color: #607386;
    border-radius: 2px;
}

.status.published,
.status.closed {
    background: #eaf7cd;
    color: #4d6800;
}

.status.draft {
    background: #edf0f3;
}

.status.new {
    background: #fff0cf;
    color: #a15a00;
}

.status.contacted {
    background: #e2efff;
    color: #0b60bb;
}

/* 操作按钮 */
.actions {
    white-space: nowrap;
}

.actions>a,
.actions button {
    color: var(--blue);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
}

.actions form {
    display: inline;
    margin-left: 14px;
}

.actions form button {
    color: #cc4545;
}

.empty-cell {
    text-align: center !important;
    color: #96a4b1 !important;
    padding: 50px !important;
}

/* ========== 表单编辑器 ========== */
.form-toolbar {
    background: #fff;
    border: 1px solid var(--line);
    padding: 16px 20px;
    position: static;
}

.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
}

.form-section h3 {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 400;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin: 0 0 18px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field-wide {
    grid-column: 1 / -1;
}

.form-section label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 400;
    color: #555;
}

.form-section label small {
    font-weight: 400;
    color: #8293a3;
}

.form-section .layui-textarea {
    line-height: 1.7;
}

.switch-row {
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.cover-preview {
    background: #eaf0f5;
    margin-bottom: 17px;
}

.cover-preview img {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: cover;
}

.file-input {
    border: 1px dashed #aebdca;
    padding: 15px;
    background: #f7f9fa;
}

.code-area {
    font-family: Consolas, monospace;
}

.single-form {
    max-width: 1000px;
}

/* ========== 页面卡片 ========== */
.page-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    background: none;
    border: 0;
}

.page-card-grid>a {
    background: #fff;
    border: 1px solid var(--line);
    padding: 20px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    transition: .2s;
    text-decoration: none;
    color: inherit;
}

.page-card-grid>a:hover {
    background: #f5f8fa;
}

.page-card-grid span {
    display: none;
}

.page-card-grid h3 {
    font-size: 16px;
    font-weight: 400;
    margin: 0 0 14px;
}

.page-card-grid p {
    color: var(--muted);
    font-size: 13px;
}

.page-card-grid b {
    color: var(--blue);
    font-size: 12px;
    font-weight: 400;
    margin-top: auto;
}

/* ========== 留言列表 ========== */
.inquiry-list {
    display: grid;
    gap: 12px;
}

.inquiry-list article {
    border: 1px solid var(--line);
    padding: 18px;
}

.inquiry-meta {
    display: flex;
    justify-content: space-between;
}

.inquiry-meta time {
    font-family: var(--display);
    font-size: 11px;
    color: #8497a8;
}

.inquiry-list h3 {
    font-size: 16px;
    font-weight: 400;
}

.inquiry-list h3 small {
    font-family: var(--font);
    font-size: 13px;
    color: var(--muted);
    font-weight: 400;
    margin-left: 10px;
}

.inquiry-contact {
    display: flex;
    gap: 24px;
    color: var(--blue);
}

.inquiry-list article>p {
    background: #f5f7f9;
    padding: 18px;
    color: #40576c;
}

.inquiry-list form {
    display: flex;
    gap: 12px;
}

.inquiry-list select {
    min-width: 120px;
    border: 1px solid var(--line);
    padding: 0 10px;
}

/* ========== 账号页 ========== */
.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.account-info {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 18px;
    font-size: 13px;
}

.account-info dt {
    color: var(--muted);
}

.account-info dd {
    margin: 0;
    font-weight: 700;
}

.account-grid form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.account-grid .layui-btn {
    align-self: flex-start;
}

/* ========== 图片管理 ========== */
.gallery-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.gallery-item {
    border: 1px solid #e6e6e6;
    padding: 10px;
    background: #fafafa;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 200px;
    max-width: 280px;
}

.gallery-thumb {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid #eee;
}

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

.gallery-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.gallery-info label {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    color: #666;
}

/* ========== 响应式 ========== */
@media (max-width: 760px) {
    .admin-sidebar {
        width: 220px;
        transform: translateX(-100%);
    }

    .sidebar-open .admin-sidebar {
        transform: none;
        box-shadow: 20px 0 50px rgba(0, 0, 0, .2);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-header {
        height: 55px;
        padding: 0 18px;
    }

    .sidebar-toggle {
        display: block;
    }

    .admin-content {
        padding: 12px;
    }

    .metric-grid {
        gap: 10px;
        grid-template-columns: 1fr 1fr;
    }

    .welcome-panel {
        padding: 18px;
    }

    .editor-grid>aside {
        display: block;
    }

    .form-toolbar {
        position: static;
        padding: 14px;
    }

    .page-card-grid {
        grid-template-columns: 1fr;
    }

    .account-grid {
        grid-template-columns: 1fr;
    }

    .inquiry-contact {
        flex-direction: column;
        gap: 4px;
    }

    .login-card {
        padding: 30px 26px;
    }
}

/* ý��Ԥ�����ҳ */
.media-thumb {
    display: block;
    width: 72px;
    height: 48px;
    object-fit: cover;
    border: 1px solid #e6edf2;
    border-radius: 3px;
    background: #f5f7f9
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 10px
}

.product-cell .media-thumb {
    width: 56px;
    height: 42px;
    flex-shrink: 0
}

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 0 4px;
    color: #718398;
    font-size: 13px
}

.admin-pagination button {
    border: 1px solid #d9e2ea;
    background: #fff;
    color: #1e9fff;
    border-radius: 3px;
    width: 32px;
    height: 28px;
    cursor: pointer
}

.admin-pagination button:disabled {
    color: #b8c3cc;
    cursor: not-allowed;
    background: #f7f9fa
}

.is-loading {
    opacity: .65;
    cursor: wait
}

.media-preview-video {
    display: block;
    width: 100%;
    max-height: 180px;
    margin-top: 12px;
    background: #111;
    border-radius: 3px
}

/* 侧栏导航强化 */
.admin-sidebar {
    background: #182231;
    color: #d5deea;
    box-shadow: 2px 0 14px rgba(15, 23, 42, .16)
}

.admin-sidebar nav {
    padding: 14px 10px;
    gap: 3px;
    overflow-y: auto
}

.nav-item {
    position: relative;
    margin: 0;
    padding: 11px 20px;
    border-radius: 8px;
    color: #b8c5d4 !important;
    font-size: 14px;
    line-height: 22px;
    transition: background .18s, color .18s, transform .18s
}

.nav-item i {
    width: 20px;
    text-align: center;
    color: #91a4b9;
    font-size: 17px;
    transition: color .18s
}

.nav-item:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff !important;
    transform: translateX(2px)
}

.nav-item:hover i {
    color: #fff
}

.nav-item.active {
    background: linear-gradient(90deg, #1e9fff, #1687e5);
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 5px 12px rgba(30, 159, 255, .28)
}

.nav-item.active:before {
    content: "";
    position: absolute;
    left: -10px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #7dd3fc
}

.nav-item.active i {
    color: #fff
}

.nav-label {
    display: block;
    height: 10px;
    margin: 5px 4px;
    border-top: 1px solid rgba(255, 255, 255, .07)
}

.admin-brand {
    background: #141c29;
    border-bottom-color: rgba(255, 255, 255, .1)
}

.sidebar-footer {
    border-top-color: rgba(255, 255, 255, .1)
}

.sidebar-footer a {
    color: #9eb0c4
}

.sidebar-footer a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff
}