/* ===== CSS Variables - Element Plus Theme ===== */
:root {
    /* Primary - Element Plus Blue */
    --primary: #409EFF;
    --primary-light: #66b1ff;
    --primary-dark: #337ecc;
    --primary-lighter: #ecf5ff;

    /* Accent - Element Plus complement */
    --accent: #409EFF;
    --accent-light: #66b1ff;

    /* Background - Light theme */
    --bg-dark: #ffffff;
    --bg-darker: #f5f7fa;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f7fa;

    /* Text - Dark gray */
    --text-primary: #303133;
    --text-secondary: #606266;
    --text-muted: #909399;

    /* Border - Light gray */
    --border: #dcdfe6;
    --border-light: #e4e7ed;

    /* Status colors - Element Plus */
    --success: #67c23a;
    --warning: #e6a23c;
    --error: #f56c6c;

    /* Shadow & Glow */
    --shadow: rgba(0, 0, 0, 0.1);
    --glow: rgba(64, 158, 255, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: var(--bg-darker);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Page Transitions ===== */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
    overflow-y: auto;
}

.page.active {
    opacity: 1;
    visibility: visible;
}

/* ===== Login Page ===== */
#login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    padding: 16px;
}

.bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image:
        linear-gradient(45deg, var(--primary-light) 25%, transparent 25%),
        linear-gradient(-45deg, var(--primary-light) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--primary-light) 75%),
        linear-gradient(-45deg, transparent 75%, var(--primary-light) 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    pointer-events: none;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    width: 100%;
    max-width: 1100px;
    min-height: 600px;
    background: var(--bg-darker);
    border-radius: 8px;
    overflow: hidden;
    box-shadow:
        0 25px 80px var(--shadow),
        0 0 0 1px var(--border);
    position: relative;
    z-index: 1;
}

/* Login Left - Brand Section */
.login-left {
    background: var(--primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 70%, var(--primary-light) 0%, transparent 50%);
    opacity: 0.3;
    animation: pulse 8s ease-in-out infinite;
}

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

.brand-section {
    text-align: center;
    position: relative;
    z-index: 1;
}

.logo-mark {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 72px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 8px;
    margin-bottom: 24px;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

.brand-title {
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 4px;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.brand-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.decoration-line {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    margin: 32px 0;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.brand-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 6px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Login Right - Form Section */
.login-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 50px;
    background: var(--bg-darker);
}

.login-form-wrapper {
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
}

.form-title {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* Form Inputs */
.input-group {
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--glow);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-light);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.toggle-password:hover {
    color: var(--text-secondary);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
}

.checkmark::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid var(--bg-darker);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s;
    position: absolute;
    top: 1px;
}

.remember-me input:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.remember-me input:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

.forgot-password {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    animation: fadeInUp 0.6s ease-out 0.7s both;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    background: var(--primary-light);
    box-shadow: 0 8px 30px rgba(64, 158, 255, 0.4);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
}

.login-btn.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Main Page ===== */
#main-page {
    background: var(--bg-darker);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark.small {
    font-size: 22px;
    letter-spacing: 2px;
    margin-bottom: 0;
    animation: none;
    color: var(--primary);
}

.header-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.user-avatar svg {
    width: 18px;
    height: 18px;
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

.logout-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: #ffffff;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.content-header {
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.page-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
    box-shadow: 0 12px 40px var(--shadow);
}

.feature-card.primary {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.feature-card.primary:hover {
    border-color: var(--primary-light);
    box-shadow: 0 12px 40px rgba(64, 158, 255, 0.2);
}

.card-glow {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(64, 158, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.feature-card:hover .card-glow {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 1;
}

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--primary-light);
    transition: all 0.3s;
}

.card-icon svg {
    width: 26px;
    height: 26px;
}

.card-icon.secondary {
    color: var(--success);
}

.card-icon.tertiary {
    color: var(--warning);
}

.feature-card:hover .card-icon {
    transform: scale(1.1);
    border-color: var(--border-light);
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.6;
}

.card-action {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    transition: gap 0.3s;
}

.card-action svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s;
}

.feature-card:hover .card-action {
    gap: 12px;
}

.feature-card:hover .card-action svg {
    transform: translateX(4px);
}

.feature-card.primary .card-action {
    color: var(--primary);
}

/* Result Section */
.result-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
}

.result-section.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.result-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

.action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.refresh-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.export-btn:hover {
    border-color: var(--success);
    color: var(--success);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 16px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Result Table */
.result-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 640px;
}

.result-table th,
.result-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.result-table th {
    background: var(--bg-dark);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.result-table tbody tr {
    transition: background 0.2s;
}

.result-table tbody tr:hover {
    background: rgba(64, 158, 255, 0.05);
}

.result-table td {
    color: var(--text-primary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.active {
    background: rgba(103, 194, 58, 0.15);
    color: var(--success);
}

.status-badge.active::before {
    background: var(--success);
}

.status-badge.warning {
    background: rgba(230, 162, 60, 0.15);
    color: var(--warning);
}

.status-badge.warning::before {
    background: var(--warning);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive - Mobile First Approach ===== */

/* Small phones (375px and below) */
@media (max-width: 375px) {
    .login-left {
        padding: 32px 16px;
        min-height: 160px;
    }

    .logo-mark {
        font-size: 48px;
        letter-spacing: 4px;
        margin-bottom: 16px;
    }

    .brand-title {
        font-size: 20px;
        letter-spacing: 2px;
    }

    .brand-subtitle {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .login-right {
        padding: 28px 16px;
    }

    .form-title {
        font-size: 22px;
    }

    .form-subtitle {
        margin-bottom: 28px;
    }

    .main-header {
        padding: 10px 16px;
    }

    .header-title {
        display: none;
    }

    .user-info {
        display: none;
    }

    .main-content {
        padding: 20px 16px;
    }

    .page-title {
        font-size: 20px;
    }

    .feature-card {
        padding: 20px;
    }

    .card-icon {
        width: 44px;
        height: 44px;
    }

    .card-icon svg {
        width: 22px;
        height: 22px;
    }

    .card-title {
        font-size: 15px;
    }

    .result-header {
        padding: 14px 16px;
    }

    .result-table th,
    .result-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Tablets and small desktops (768px and below) */
@media (max-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
        min-height: auto;
        border-radius: 12px;
    }

    .login-left {
        padding: 36px 24px;
        min-height: 180px;
    }

    .logo-mark {
        font-size: 56px;
        margin-bottom: 16px;
    }

    .brand-title {
        font-size: 24px;
    }

    .login-right {
        padding: 36px 24px;
    }

    .main-content {
        padding: 24px 16px;
    }

    .main-header {
        padding: 12px 16px;
    }

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

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-table th,
    .result-table td {
        padding: 10px 14px;
    }
}

/* Large tablets (1024px and below) */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

/* ===== Global Loading Overlay ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}
.loading-overlay.active {
    display: flex;
}
.loading-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(64, 158, 255, 0.2);
    border-top-color: var(--primary, #409eff);
    border-radius: 50%;
    animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 2px;
    animation: loading-pulse 1.5s ease-in-out infinite;
}
@keyframes loading-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 刷新按钮旋转动画 */
.refresh-btn.spinning svg {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
