:root {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --bg-card: rgba(255,255,255,0.05);
    --bg-card-hover: rgba(255,255,255,0.03);
    --border-color: rgba(255,255,255,0.1);
    --text-primary: #fff;
    --text-secondary: #888;
    --text-muted: #666;
    --shadow: rgba(0,0,0,0.3);
}
[data-theme="light"] {
    --bg-primary: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #cbd5e1 100%);
    --bg-card: rgba(255,255,255,0.8);
    --bg-card-hover: rgba(255,255,255,0.95);
    --border-color: rgba(0,0,0,0.1);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow: rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(90deg, #00d4ff, #7c3aed);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #00d4ff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input {
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 30px;
    width: 600px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: #10b981;
    color: #fff;
    border-radius: 8px;
    display: none;
    animation: slideIn 0.3s ease;
}

.toast.error {
    background: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    min-height: 1em;
    min-width: 3em;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

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

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

@keyframes countUp {
    from { opacity: 0.5; transform: scale(1.1); }
    to { opacity: 1; transform: scale(1); }
}

.btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@media (max-width: 768px) {
    body {
        height: auto;
        overflow: auto;
    }
    .container {
        height: auto;
        overflow: visible;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .toast {
        bottom: 15px;
        right: 15px;
        left: 15px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    .modal {
        padding: 20px;
        margin: 10px;
        max-height: 85vh;
    }
    .modal-header h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.9rem;
    }
    .container {
        padding: 10px;
    }
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    .btn-sm {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    .form-group label {
        font-size: 0.85rem;
    }
    .form-group input {
        padding: 8px;
        font-size: 0.9rem;
    }
    .modal {
        padding: 15px;
        margin: 5px;
    }
    .modal-header {
        margin-bottom: 15px;
    }
    .modal-header h2 {
        font-size: 1.1rem;
    }
    .modal-close {
        font-size: 1.3rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    .form-group input:active {
        transform: scale(0.99);
    }
}
