/* ============================================================
   Art Design Pro Style - Admin Panel
   Based on Art Design Pro Design System + Element Plus
   ============================================================ */

/* ==================== Art Design Pro CSS Variables ==================== */
:root {
    /* Art Design Pro Theme Colors */
    --theme-color: #409EFF;
    --theme-color-light: #66b1ff;
    --theme-color-dark: #337ecc;

    /* Art Design Pro Layout Colors */
    --art-sidebar-bg: #001529;
    --art-header-bg: #ffffff;
    --art-content-bg: #f0f2f5;
    --art-card-bg: #ffffff;
    --art-card-border: #e8eaec;

    /* Art Design Pro Text Colors */
    --art-text-primary: #303133;
    --art-text-regular: #606266;
    --art-text-secondary: #909399;
    --art-text-placeholder: #c0c4cc;

    /* Art Design Pro Border & Radius */
    --art-border-color: #e4e7ed;
    --art-border-light: #ebeef5;
    --custom-radius: 8px;

    /* Art Design Pro Shadows */
    --art-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    --art-shadow-md: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
    --art-shadow-lg: 0 6px 16px -8px rgba(0, 0, 0, 0.08), 0 9px 28px 0 rgba(0, 0, 0, 0.05), 0 12px 48px 16px rgba(0, 0, 0, 0.03);

    /* Art Design Pro Gray Scale */
    --art-gray-100: #f5f7fa;
    --art-gray-200: #ebeef5;
    --art-gray-300: #d4d7de;

    /* Status Colors (Art Design Pro) */
    --art-success: #67c23a;
    --art-warning: #e6a23c;
    --art-danger: #f56c6c;
    --art-info: #909399;

    /* Transition */
    --art-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* ==================== Reset & Base ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
        'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    color: var(--art-text-primary);
    background-color: var(--art-content-bg);
    line-height: 1.5715;
}

a {
    color: var(--theme-color);
    text-decoration: none;
    transition: var(--art-transition);
}

a:hover {
    color: var(--theme-color-light);
}

/* Hide unstyled elements before Vue mounts */
[v-cloak] {
    display: none !important;
}

/* ==================== Scrollbar (Art Design Pro Style) ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 0;
}

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

::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: #d4d7de;
    transition: all 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #b0b4bc;
}

/* ==================== Layout ==================== */
.admin-container {
    height: 100vh;
    overflow: hidden;
}

/* ---------- Sidebar (Art Design Pro Style) ---------- */
.admin-aside {
    background: var(--art-sidebar-bg);
    transition: width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    overflow: hidden;
    position: relative;
    z-index: 100;
}

.sidebar-logo {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    transition: var(--art-transition);
}

.sidebar-logo:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-logo .logo-text {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-left: 12px;
    transition: opacity 0.3s;
}

/* Element Plus Menu Override - Art Design Pro Dark Sidebar */
.sidebar-menu {
    border-right: none !important;
    width: 100% !important;
}

.sidebar-menu .el-menu {
    border-right: none;
}

.sidebar-menu .el-menu-item,
.sidebar-menu .el-sub-menu__title {
    height: 48px;
    line-height: 48px;
    font-size: 14px;
    transition: var(--art-transition);
}

.sidebar-menu .el-menu-item:hover,
.sidebar-menu .el-sub-menu__title:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.sidebar-menu .el-menu-item.is-active {
    background-color: var(--theme-color) !important;
    color: #ffffff !important;
    position: relative;
}

.sidebar-menu .el-menu-item.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffffff;
    border-radius: 0 2px 2px 0;
}

.sidebar-menu .el-sub-menu .el-menu-item {
    padding-left: 56px !important;
    height: 44px;
    line-height: 44px;
}

/* Collapsed sidebar tooltip */
.admin-aside .el-menu--collapse .el-menu-item,
.admin-aside .el-menu--collapse .el-sub-menu__title {
    padding: 0;
    text-align: center;
}

/* ---------- Main Container ---------- */
.admin-main-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ---------- Header (Art Design Pro Style) ---------- */
.admin-header {
    background: var(--art-header-bg);
    border-bottom: 1px solid var(--art-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--art-shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--art-text-regular);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--art-transition);
    font-size: 20px;
}

.sidebar-toggle:hover {
    background: var(--art-gray-100);
    color: var(--art-text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--art-transition);
    outline: none;
}

.admin-user-info:hover {
    background: var(--art-gray-100);
}

.admin-username {
    font-size: 14px;
    color: var(--art-text-primary);
    font-weight: 500;
}

/* ---------- Content Area ---------- */
.admin-content {
    background: var(--art-content-bg);
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* ==================== Page Header (Art Design Pro Style) ==================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--art-text-primary);
    margin: 0;
}

.page-header .page-desc {
    font-size: 14px;
    color: var(--art-text-secondary);
    margin-top: 4px;
}

/* ==================== Cards (Art Design Pro Style) ==================== */
.art-card {
    background: var(--art-card-bg);
    border-radius: var(--custom-radius);
    border: 1px solid var(--art-card-border);
    box-shadow: var(--art-shadow-sm);
    overflow: hidden;
    transition: var(--art-transition);
}

.art-card:hover {
    box-shadow: var(--art-shadow-md);
}

.art-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--art-border-light);
}

.art-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--art-text-primary);
    margin: 0;
}

.art-card-body {
    padding: 20px;
}

/* ==================== Stat Cards (Art Design Pro Style) ==================== */
.art-stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.art-stat-card {
    background: var(--art-card-bg);
    border-radius: var(--custom-radius);
    padding: 24px;
    box-shadow: var(--art-shadow-sm);
    border: 1px solid var(--art-card-border);
    transition: var(--art-transition);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.art-stat-card:hover {
    box-shadow: var(--art-shadow-md);
    transform: translateY(-2px);
}

.art-stat-card-info h4 {
    font-size: 14px;
    font-weight: 400;
    color: var(--art-text-secondary);
    margin-bottom: 8px;
}

.art-stat-card-info .stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--art-text-primary);
    line-height: 1.2;
}

.art-stat-card-info .stat-desc {
    font-size: 12px;
    color: var(--art-text-secondary);
    margin-top: 8px;
}

.art-stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--custom-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.art-stat-card-icon.blue {
    background: #ecf5ff;
    color: var(--theme-color);
}

.art-stat-card-icon.green {
    background: #f0f9eb;
    color: var(--art-success);
}

.art-stat-card-icon.orange {
    background: #fdf6ec;
    color: var(--art-warning);
}

.art-stat-card-icon.red {
    background: #fef0f0;
    color: var(--art-danger);
}

/* ==================== Table Card (Art Design Pro Style) ==================== */
.art-table-card {
    background: var(--art-card-bg);
    border-radius: var(--custom-radius);
    border: 1px solid var(--art-card-border);
    box-shadow: var(--art-shadow-sm);
    overflow: hidden;
}

.art-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--art-border-light);
    flex-wrap: wrap;
    gap: 12px;
}

.art-table-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.art-table-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.art-table-info {
    font-size: 14px;
    color: var(--art-text-secondary);
}

.art-table-info strong {
    color: var(--art-text-primary);
}

/* Element Plus Table Override - Art Design Pro Style */
.art-table-card .el-table {
    --el-table-border-color: var(--art-border-light);
    --el-table-header-bg-color: var(--art-gray-100);
    --el-table-row-hover-bg-color: #ecf5ff;
    font-size: 14px;
}

.art-table-card .el-table th.el-table__cell {
    font-weight: 600;
    color: var(--art-text-regular);
}

.art-table-card .el-table .el-table__cell {
    padding: 12px 0;
}

/* ==================== Search Form (Art Design Pro Style) ==================== */
.art-search-card {
    background: var(--art-card-bg);
    border-radius: var(--custom-radius);
    border: 1px solid var(--art-card-border);
    box-shadow: var(--art-shadow-sm);
    margin-bottom: 16px;
    padding: 20px;
}

.art-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==================== Quick Actions (Art Design Pro Style) ==================== */
.art-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ==================== Status Tags (Art Design Pro Style) ==================== */
.art-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.art-status-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.art-status-dot.success::before { background: var(--art-success); }
.art-status-dot.warning::before { background: var(--art-warning); }
.art-status-dot.danger::before { background: var(--art-danger); }
.art-status-dot.info::before { background: var(--art-info); }

/* ==================== Empty State (Art Design Pro Style) ==================== */
.art-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--art-text-secondary);
}

.art-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ==================== Pagination (Art Design Pro Style) ==================== */
.art-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 20px;
}

.art-pagination-info {
    margin-right: auto;
    font-size: 14px;
    color: var(--art-text-secondary);
}

/* ==================== Login Page (Art Design Pro Style) ==================== */
.login-page {
    display: flex;
    min-height: 100vh;
    background: #1a1a2e;
    position: relative;
    overflow: hidden;
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
    padding: 40px;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: loginPulse 8s ease-in-out infinite;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: loginPulse 10s ease-in-out infinite reverse;
}

@keyframes loginPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.login-left .login-illustration {
    position: relative;
    z-index: 1;
    text-align: center;
}

.login-left .login-illustration svg {
    width: 320px;
    height: 320px;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

.login-left .login-slogan {
    position: relative;
    z-index: 1;
    margin-top: 40px;
    text-align: center;
}

.login-left .login-slogan h2 {
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px;
}

.login-left .login-slogan p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.login-left .float-element {
    position: absolute;
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

.login-left .float-element:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; }
.login-left .float-element:nth-child(2) { top: 60%; right: 15%; animation-delay: 2s; }
.login-left .float-element:nth-child(3) { bottom: 20%; left: 20%; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.login-right {
    width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 60px;
    position: relative;
}

.login-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-card .login-header {
    text-align: left;
    margin-bottom: 48px;
}

.login-card .login-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
}

.login-card .login-subtitle {
    font-size: 15px;
    color: #8c8c8c;
    margin: 0;
}

.login-card .login-btn {
    width: 100%;
    height: 48px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login-card .login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ==================== Login Form (Art Design Pro Style) ==================== */
.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--art-text-primary);
    margin-bottom: 8px;
}

.input-group {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--art-text-secondary);
    display: flex;
    align-items: center;
    z-index: 1;
}

.input-group .form-control {
    width: 100%;
    height: 46px;
    padding: 0 16px 0 44px;
    font-size: 14px;
    color: var(--art-text-primary);
    background: #fff;
    border: 1px solid var(--art-border-color);
    border-radius: var(--custom-radius);
    outline: none;
    transition: var(--art-transition);
}

.input-group .form-control::placeholder {
    color: var(--art-text-placeholder);
}

.input-group .form-control:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 13px;
    color: var(--art-text-secondary);
}

/* ==================== Slider Captcha (Art Design Pro Style) ==================== */
.slider-captcha {
    position: relative;
    width: 100%;
    height: 46px;
    background: var(--art-gray-100);
    border: 1px solid var(--art-border-color);
    border-radius: var(--custom-radius);
    overflow: hidden;
    margin-bottom: 22px;
    user-select: none;
}

.slider-captcha .slider-track {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: rgba(64, 158, 255, 0.12);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    padding-left: 56px;
}

.slider-captcha .slider-track.success {
    background: rgba(103, 194, 58, 0.15);
}

.slider-captcha .slider-track .slider-text {
    color: var(--art-success);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.slider-captcha .slider-btn {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 42px;
    height: 40px;
    background: #ffffff;
    border: 1px solid var(--art-border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: left 0.3s, box-shadow 0.2s;
}

.slider-captcha .slider-btn:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.slider-captcha .slider-btn:active {
    cursor: grabbing;
}

.slider-captcha .slider-btn svg {
    width: 18px;
    height: 18px;
    color: var(--art-text-secondary);
    flex-shrink: 0;
}

.slider-captcha .slider-placeholder {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--art-text-placeholder);
    font-size: 14px;
    pointer-events: none;
}

/* ==================== Responsive ==================== */
@media screen and (max-width: 1024px) {
    .art-stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .art-stat-cards {
        grid-template-columns: 1fr;
    }

    .admin-content {
        padding: 12px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .art-search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-username {
        display: none;
    }
}

@media screen and (min-width: 1440px) {
    .admin-content {
        max-width: 1400px;
    }
}

/* ==================== Print ==================== */
@media print {
    .admin-aside,
    .admin-header {
        display: none !important;
    }

    .admin-main-container {
        margin-left: 0 !important;
    }

    .admin-content {
        padding: 0;
    }
}
