/* 基础样式重置 */
:root {
    --admin-bg: #eef4f7;
    --admin-surface: rgba(255, 255, 255, 0.92);
    --admin-surface-solid: #ffffff;
    --admin-border: #d6e1ea;
    --admin-border-strong: #bfd0dc;
    --admin-text: #173042;
    --admin-text-muted: #5f7487;
    --admin-brand-primary: #1b5f7a;
    --admin-brand-secondary: #1d8b79;
    --admin-brand-tertiary: #2f8fc2;
    --admin-sidebar-start: #133f5d;
    --admin-sidebar-end: #185d67;
    --admin-accent: #7dd3fc;
    --admin-accent-soft: rgba(125, 211, 252, 0.18);
    --admin-shadow-lg: 0 20px 40px rgba(15, 34, 58, 0.12);
    --admin-shadow-md: 0 10px 24px rgba(15, 34, 58, 0.07);
    --admin-header-height: 68px;
    --admin-sidebar-width: 280px;
    --admin-sidebar-collapsed: 76px;
    --admin-radius-lg: 18px;
    --admin-radius-md: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--admin-text);
    background:
        radial-gradient(circle at top left, rgba(27, 95, 122, 0.16), transparent 30%),
        radial-gradient(circle at top right, rgba(29, 139, 121, 0.1), transparent 24%),
        linear-gradient(180deg, #f7fbfc 0%, var(--admin-bg) 46%, #e8f0f4 100%);
    overflow-x: hidden;
}

body.sidebar-open {
    overflow: hidden;
}

select {
    font: inherit;
}

/* 管理容器 */
.admin-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--admin-sidebar-width);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
        linear-gradient(180deg, var(--admin-sidebar-start) 0%, var(--admin-sidebar-end) 100%);
    color: white;
    transition: width 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1100;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--admin-shadow-lg);
    padding-bottom: 24px;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(180deg, transparent 0%, rgba(3, 16, 32, 0.18) 100%);
    pointer-events: none;
}

.sidebar.collapsed {
    width: var(--admin-sidebar-collapsed);
}

.sidebar-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(14px);
    background: rgba(11, 39, 70, 0.78);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.logo i {
    font-size: 24px;
    color: #ffd700;
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

/* 导航菜单 */
.sidebar-nav {
    position: relative;
    z-index: 1;
    padding: 14px 10px 0;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    position: relative;
    border-radius: 14px;
    font-weight: 500;
    min-height: 44px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: white;
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
    color: white;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 999px;
    background: var(--admin-accent);
}

.nav-link i:first-child {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding-inline: 0;
}

.sidebar.collapsed .nav-link.active::before {
    left: 8px;
}

.submenu-arrow {
    margin-left: auto !important;
    margin-right: 0 !important;
    transition: transform 0.3s ease;
}

.nav-item.expanded .submenu-arrow,
.has-submenu.expanded .submenu-arrow {
    transform: rotate(180deg);
}

/* 子菜单 */
.submenu {
    list-style: none;
    background: rgba(7, 27, 50, 0.2);
    max-height: 0;
    overflow: hidden;
    margin-top: 6px;
    border-radius: 14px;
    display: block;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 0.28s ease, opacity 0.2s ease, transform 0.2s ease;
}

.nav-item.expanded .submenu,
.has-submenu.expanded .submenu {
    max-height: 640px !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.submenu li {
    margin: 0;
}

.submenu a {
    display: block;
    padding: 10px 14px 10px 44px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 10px;
    margin: 4px 6px;
}

.submenu a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--admin-text-muted);
    box-shadow: 0 8px 18px rgba(15, 34, 58, 0.06);
}

.language-switcher i {
    color: var(--admin-brand-primary);
}

.language-switcher select {
    border: none;
    background: transparent;
    color: var(--admin-text);
    cursor: pointer;
    outline: none;
}

.submenu a.active {
    background-color: rgba(255, 255, 255, 0.16);
    color: white;
    font-weight: 500;
    position: relative;
}

.submenu a.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background-color: var(--admin-accent);
    border-radius: 999px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 20, 35, 0.48);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s ease, visibility 0.24s ease;
    z-index: 1090;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--admin-sidebar-width);
    width: calc(100% - var(--admin-sidebar-width));
    transition: margin-left 0.28s ease, width 0.28s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--admin-sidebar-collapsed);
    width: calc(100% - var(--admin-sidebar-collapsed));
}

/* 顶部头部 */
.top-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(247, 251, 252, 0.86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(191, 208, 220, 0.78);
    padding: 0 24px;
    min-height: var(--admin-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 8px 20px rgba(15, 34, 58, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.menu-toggle {
    background: rgba(27, 95, 122, 0.09);
    border: none;
    font-size: 18px;
    color: var(--admin-brand-primary);
    cursor: pointer;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.menu-toggle:hover {
    background-color: rgba(27, 95, 122, 0.16);
    transform: translateY(-1px);
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--admin-text-muted);
    flex-wrap: wrap;
    min-width: 0;
}

.breadcrumb-item {
    position: relative;
    white-space: nowrap;
}

.breadcrumb-separator {
    color: #9aa7bb;
    font-size: 12px;
}

.breadcrumb-current {
    color: var(--admin-text);
    font-weight: 700;
    white-space: nowrap;
}

/* 头部右侧 */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* 通知按钮 */
.notification-dropdown {
    position: relative;
}

.notification-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
    position: relative;
}

.notification-btn:hover {
    background-color: #f8f9fa;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #dc3545;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
}

.user-btn {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(191, 208, 220, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 7px 12px;
    border-radius: 12px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-btn:hover,
.user-dropdown.show .user-btn {
    background-color: #ffffff;
    border-color: var(--admin-border-strong);
    box-shadow: 0 10px 22px rgba(15, 34, 58, 0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: var(--admin-text);
}

.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(200, 211, 226, 0.84);
    border-radius: 14px;
    box-shadow: var(--admin-shadow-md);
    min-width: 188px;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    list-style: none;
    padding: 8px;
}

.user-dropdown:hover .user-menu,
.user-dropdown.show .user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu li {
    margin: 0;
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    color: var(--admin-text);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 10px;
}

.user-menu a:hover {
    background-color: #eef6f8;
}

.user-menu .divider {
    height: 1px;
    background: #e7eef7;
    margin: 8px 0;
}

/* 内容包装器 */
.content-wrapper {
    flex: 1;
    min-width: 0;
    padding: 22px;
    overflow: visible;
}

/* Shared page chrome */
.page-header-modern {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 22%),
        linear-gradient(135deg, var(--admin-brand-primary) 0%, var(--admin-brand-secondary) 62%, var(--admin-brand-tertiary) 100%);
    color: white;
    border-radius: var(--admin-radius-lg);
    padding: 1.6rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 16px 34px rgba(20, 57, 73, 0.18);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.1rem;
}

.header-main {
    flex: 1;
    min-width: 0;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 0 0 0.35rem;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.page-subtitle {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.55;
    opacity: 0.92;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-modern:hover {
    transform: translateY(-1px);
}

.page-header-modern .btn-modern {
    border-width: 1px;
    box-shadow: 0 10px 24px rgba(10, 37, 64, 0.16);
}

.page-header-modern .btn-outline-primary.btn-modern,
.page-header-modern .btn-outline-secondary.btn-modern,
.page-header-modern .btn-outline-info.btn-modern {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.24);
    color: #f4fbff;
    backdrop-filter: blur(10px);
}

.page-header-modern .btn-outline-primary.btn-modern:hover,
.page-header-modern .btn-outline-secondary.btn-modern:hover,
.page-header-modern .btn-outline-info.btn-modern:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.34);
    color: #ffffff;
}

.page-header-modern .btn-outline-warning.btn-modern {
    background: linear-gradient(135deg, #ffe2a8 0%, #ffbd59 100%);
    border-color: rgba(255, 214, 102, 0.62);
    color: #734400;
}

.page-header-modern .btn-outline-warning.btn-modern:hover {
    background: linear-gradient(135deg, #ffd98d 0%, #f7ad38 100%);
    border-color: rgba(244, 176, 61, 0.72);
    color: #5b3600;
}

.page-header-modern .btn-outline-success.btn-modern,
.page-header-modern .btn-success.btn-modern {
    background: linear-gradient(135deg, #0f8a72 0%, #127360 100%);
    border-color: rgba(16, 138, 114, 0.72);
    color: #ffffff;
}

.page-header-modern .btn-outline-success.btn-modern:hover,
.page-header-modern .btn-success.btn-modern:hover {
    background: linear-gradient(135deg, #0d7b66 0%, #105f4f 100%);
    border-color: rgba(15, 107, 90, 0.78);
    color: #ffffff;
}

.stats-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    padding: 1rem 1.2rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--admin-text);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(222, 232, 239, 0.8);
}

.stat-item {
    min-width: 108px;
}

.stat-value {
    display: block;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
    color: var(--admin-text);
}

.stat-label {
    display: block;
    color: var(--admin-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    align-self: stretch;
    min-height: 40px;
    background: #dbe3f0;
}

.search-panel {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid #dfe8ef;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.search-container {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.search-input-group {
    position: relative;
    flex: 1 1 280px;
    min-width: 260px;
}

.search-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    z-index: 1;
}

.search-input {
    width: 100%;
    min-width: 0;
    padding-left: 2.5rem !important;
}

.filter-group {
    display: flex;
    gap: 0.65rem;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    min-width: 0;
}

.filter-select {
    flex: 1 1 140px;
    min-width: 0;
    max-width: 100%;
}

.action-group {
    display: flex;
    gap: 0.5rem;
}

.search-btn,
.reset-btn {
    min-width: 48px;
    min-height: 40px;
    border-radius: 10px;
}

.card {
    border: 1px solid #dfe8ef;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
}

.card-header {
    padding: 1rem 1.1rem;
    background: linear-gradient(180deg, #fbfdfd 0%, #f3f8f9 100%);
    border-bottom: 1px solid #e9f0f4;
}

.card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--admin-text);
}

.card-actions {
    color: var(--admin-text-muted);
    font-size: 0.9rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.detail-grid .detail-item,
.detail-grid > div {
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .top-header {
        padding-inline: 18px;
    }

    .content-wrapper {
        padding: 18px;
    }

    .header-content {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: min(82vw, var(--admin-sidebar-width));
        transform: translateX(-100%);
        box-shadow: none;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--admin-shadow-lg);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .top-header {
        min-height: 64px;
        padding: 10px 16px;
        align-items: center;
    }
    
    .content-wrapper {
        padding: 16px;
    }

    .page-header-modern {
        padding: 1.15rem;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .stat-divider {
        display: none;
    }

    .search-input-group,
    .filter-group,
    .action-group,
    .btn-modern {
        width: 100%;
        min-width: 0;
    }

    .filter-group {
        flex-direction: column;
    }

    .action-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .breadcrumb {
        font-size: 12px;
        gap: 6px;
    }

    .header-right {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .user-btn {
        padding-inline: 10px;
    }

    .user-name {
        max-width: 96px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 560px) {
    .top-header {
        padding-inline: 12px;
    }

    .breadcrumb {
        display: none;
    }

    .content-wrapper {
        padding: 12px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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