:root {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-active: #1e40af;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;

    --success-50: #f0fdf4;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;

    --warning-50: #fffbeb;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;

    --error-50: #fef2f2;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --error-border: #fecaca;

    --text-900: #0f172a;
    --text-800: #1e293b;
    --text-700: #334155;
    --text-600: #475569;
    --text-500: #64748b;
    --text-400: #94a3b8;
    --text-300: #cbd5e1;
    --text-200: #e2e8f0;
    --text-100: #f1f5f9;
    --text-50: #f8fafc;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-disabled: #cbd5e1;

    --bg-page: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    --bg-active: #f1f5f9;
    --bg-disabled: #f8fafc;

    --border-light: #f1f5f9;
    --border-default: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-focus: #2563eb;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);

    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 20px;
    --font-size-3xl: 24px;

    --spacing-1: 4px;
    --spacing-2: 8px;
    --spacing-3: 12px;
    --spacing-4: 16px;
    --spacing-5: 20px;
    --spacing-6: 24px;
    --spacing-8: 32px;
    --spacing-10: 40px;
    --spacing-12: 48px;

    --sidebar-width: 220px;
    --header-height: 56px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

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

html, body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

a {
    text-decoration: none;
    color: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: var(--font-size-base);
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}
.btn-primary:active {
    background: var(--primary-active);
    border-color: var(--primary-active);
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border-color: var(--border-default);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-danger {
    background: var(--error);
    color: white;
    border-color: var(--error);
}
.btn-danger:hover {
    background: var(--error-500);
    border-color: var(--error-500);
}

.btn-sm {
    padding: 5px 12px;
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: 10px 20px;
    font-size: var(--font-size-lg);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input, .select, .textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: white;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.input::placeholder, .textarea::placeholder {
    color: var(--text-tertiary);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}
.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    line-height: 1.6;
}
.badge-primary { background: var(--primary-light); color: var(--primary-700); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-default { background: var(--text-100); color: var(--text-600); }

.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--font-size-base);
    z-index: 2000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.info { background: var(--primary); }
.toast.warning { background: var(--warning); }

.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    background: var(--text-50);
    border-bottom: 1px solid var(--border-default);
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}
.table tr:hover td {
    background: var(--bg-hover);
}
.table .empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: 40px;
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: var(--font-size-xs);
    background: var(--primary-light);
    color: var(--primary-700);
    border-radius: var(--radius-sm);
    margin-right: 6px;
    margin-bottom: 4px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
.empty-state p {
    font-size: var(--font-size-base);
    margin-bottom: 4px;
}
.empty-state .empty-hint {
    font-size: var(--font-size-sm);
    color: var(--text-400);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-400);
}
