* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5D33FE;
    --primary-dark: #4a28d4;
    --secondary-color: #0FDDF6;
    --main-gradient: linear-gradient(90deg, #5D33FE 0%, #0FDDF6 100%);
    --main-gradient-reverse: linear-gradient(90deg, #0FDDF6 0%, #5D33FE 100%);
    --main-gradient-active: linear-gradient(90deg, #80e3f6 0%, #a488fe 100%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-gray: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-gray);
}

.hidden {
    display: none !important;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover {
    background-color: rgba(93, 51, 254, 0.05);
    color: var(--primary-color);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--main-gradient);
    color: white;
    box-shadow: 0 4px 6px rgba(93, 51, 254, 0.2);
}

.nav-item svg {
    margin-right: 12px;
    flex-shrink: 0;
}

.nav-group {
    margin-bottom: 0;
}

.nav-parent {
    position: relative;
    cursor: pointer;
}

.nav-parent .flex {
    width: 100%;
}

.nav-arrow {
    transition: transform 0.3s ease;
}

.nav-parent.expanded .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 12px;
}

.nav-submenu.show {
    max-height: 500px;
}

.nav-subitem {
    padding: 10px 12px;
    font-size: 13px;
    margin-top: 4px;
}

.nav-subitem svg {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    background-color: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.modal-content {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-cancel {
    background-color: #f3f4f6;
    color: #6b7280;
}

.modal-btn-cancel:hover {
    background-color: #e5e7eb;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.modal-btn-confirm:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.loading-container {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.card {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #6b7280;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

input[type="text"],
input[type="tel"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background-color: rgba(124, 58, 237, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 主渐变色工具类 - 用于替代 Tailwind 的 purple/indigo 类 */
.bg-gradient-main {
    background: var(--main-gradient);
}

.bg-gradient-main-reverse {
    background: var(--main-gradient-reverse);
}

.text-main {
    color: var(--primary-color);
}

.text-main-light {
    color: var(--secondary-color);
}

.border-main {
    border-color: var(--primary-color);
}

.border-main-light {
    border-color: var(--secondary-color);
}

.bg-main {
    background-color: var(--primary-color);
}

.bg-main-light {
    background-color: var(--secondary-color);
}

.bg-main-opacity-20 {
    background-color: rgba(93, 51, 254, 0.2);
}

.bg-main-opacity-30 {
    background-color: rgba(93, 51, 254, 0.3);
}

.text-main-200 {
    color: rgba(15, 221, 246, 0.8);
}

.hover\:bg-main-light:hover {
    background-color: rgba(15, 221, 246, 0.1);
}

.hover\:text-main:hover {
    color: var(--primary-color);
}

.hover\:from-main-dark:hover {
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
}

@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: -100%;
        transition: left 0.3s ease;
        z-index: 100;
    }

    #sidebar.mobile-open {
        left: 0;
    }
}
