/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary-color: #1a73e8;
    --primary-dark: #0d47a1;
    --primary-light: #4285f4;
    --secondary-color: #5f6368;
    --accent-color: #00c853;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --light-color: #f8f9fa;
    --dark-color: #202124;
    --gray-light: #dadce0;
    --gray-dark: #5f6368;
    --card-bg: rgba(255, 255, 255, 0.95);
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition: all 0.3s ease;
}

body {
    background: linear-gradient(135deg, #0c2461 0%, #1e3799 100%);
    color: var(--dark-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 登录页面 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    z-index: 10;
    position: relative;
}

.login-header {
    color: white;
    padding: 40px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo i {
    font-size: 3.5rem;
    color: var(--primary-light);
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 10px;
}

.login-form-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card .card-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-card h2 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-form .form-group {
    margin-bottom: 25px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(26, 115, 232, 0.3);
}

.login-hint {
    margin-top: 20px;
    padding: 15px;
    background: rgba(26, 115, 232, 0.1);
    border-radius: 10px;
    text-align: center;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.feature {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 15px;
}

.feature h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.feature p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    color: var(--gray-dark);
    font-size: 0.9rem;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
}

/* 粒子背景 */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 控制面板 */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo i {
    font-size: 2rem;
}

.sidebar-logo h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.sidebar-nav {
    padding: 30px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--accent-color);
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: #f5f7fb;
    min-height: 100vh;
}

/* 顶部栏 */
.topbar {
    height: var(--header-height);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title h1 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.logout-btn {
    padding: 8px 20px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    padding: 30px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-card.warning {
    border-top-color: var(--warning-color);
}

.stat-card.danger {
    border-top-color: var(--danger-color);
}

.stat-card.success {
    border-top-color: var(--accent-color);
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(26, 115, 232, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.stat-card.warning .stat-icon {
    background: rgba(255, 152, 0, 0.1);
}

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

.stat-card.danger .stat-icon {
    background: rgba(244, 67, 54, 0.1);
}

.stat-card.danger .stat-icon i {
    color: var(--danger-color);
}

.stat-card.success .stat-icon {
    background: rgba(0, 200, 83, 0.1);
}

.stat-card.success .stat-icon i {
    color: var(--accent-color);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1;
}

.stat-label {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-top: 10px;
}

/* 客户管理 */
.content-area {
    padding: 30px;
}

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

.action-buttons {
    display: flex;
    gap: 15px;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 115, 232, 0.3);
}

.btn-secondary {
    background: var(--light-color);
    color: var(--secondary-color);
    border: 1px solid var(--gray-light);
}

.btn-secondary:hover {
    background: var(--gray-light);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

/* 表格 */
.table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.data-table th {
    padding: 20px;
    text-align: left;
    color: white;
    font-weight: 600;
    border: none;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--gray-light);
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(26, 115, 232, 0.05);
}

.data-table td {
    padding: 20px;
    color: var(--secondary-color);
}

.data-table .status {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status.active {
    background: rgba(0, 200, 83, 0.1);
    color: var(--accent-color);
}

.status.expired {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger-color);
}

.status.pending {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: transparent;
}

.btn-icon.edit {
    color: var(--primary-color);
    background: rgba(26, 115, 232, 0.1);
}

.btn-icon.edit:hover {
    background: var(--primary-color);
    color: white;
}

.btn-icon.delete {
    color: var(--danger-color);
    background: rgba(244, 67, 54, 0.1);
}

.btn-icon.delete:hover {
    background: var(--danger-color);
    color: white;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.close-modal:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary-color);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--gray-light);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    
    .login-features {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(26, 115, 232, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* 消息提示 */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.alert-success {
    background: rgba(0, 200, 83, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(0, 200, 83, 0.2);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}