﻿/* 基础样式 */
:root {
    --primary-color: #4361ee;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.6;
}

/* 登录页面样式 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 1;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    transition: transform 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
}

.login-header {
    margin-bottom: 30px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), #3a56d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.logo-icon i {
    font-size: 36px;
    color: white;
}

.login-header h2 {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
}

.login-form .input-group {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e1e5eb;
    transition: border-color 0.3s;
}

.login-form .input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.login-form .input-group-text {
    background-color: #f8f9fa;
    border: none;
    padding: 0.75rem 15px;
}

.login-form .form-control {
    border: none;
    padding: 0.75rem 15px;
    font-size: 15px;
}

.login-form .form-control:focus {
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #3a56d4);
    border: none;
    padding: 12px 24px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(67, 97, 238, 0.3);
}

.login-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.login-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.login-bg .shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(67, 97, 238, 0.05));
}

.login-bg .shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
}

.login-bg .shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
}

.login-bg .shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 10%;
}

/* 主布局 */
.main-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b, #0f172a);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
}

.logo i {
    font-size: 24px;
    color: #60a5fa;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    display: none;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 20px 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.user-details h6 {
    margin: 0;
    font-weight: 500;
}

.user-details small {
    font-size: 12px;
    opacity: 0.7;
}

.nav {
    padding: 0 10px;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.topbar {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left .page-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--primary-color);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-dropdown .btn {
    position: relative;
    padding: 8px 12px;
}

.user-dropdown .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
    padding: 4px 6px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    padding: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-card-primary .stat-icon {
    background: linear-gradient(135deg, var(--primary-color), #3a56d4);
}

.stat-card-success .stat-icon {
    background: linear-gradient(135deg, var(--success-color), #157347);
}

.stat-card-warning .stat-icon {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
}

.stat-card-info .stat-icon {
    background: linear-gradient(135deg, var(--info-color), #0baccc);
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 600;
    margin: 0;
    line-height: 1;
}

.stat-content p {
    margin: 5px 0 0;
    color: #6c757d;
    font-size: 14px;
}

/* 内容卡片 */
.content-card {
    background: white;
    border-radius: 16px;
    margin: 0 30px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h5 {
    font-weight: 600;
    margin: 0;
    color: var(--dark-color);
}

.card-actions {
    display: flex;
    gap: 10px;
}

.card-body {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
    flex: 1;
}

.table {
    margin: 0;
    min-width: 1000px;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e5e7eb;
    padding: 16px 20px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table tbody td {
    padding: 20px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f1f1;
}

.phone-icon {
    width: 36px;
    height: 36px;
    background-color: #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.phone-icon i {
    color: #6c757d;
}

/* 状态徽章 */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 12px;
}

.badge-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

/* 优惠券标签 */
.coupon-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.coupon-tag {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.coupon-tag-5 {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(67, 97, 238, 0.2);
}

.coupon-tag-10 {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(25, 135, 84, 0.2);
}

.coupon-tag-15 {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.coupon-tag-18 {
    background-color: rgba(253, 126, 20, 0.1);
    color: #fd7e14;
    border: 1px solid rgba(253, 126, 20, 0.2);
}

.coupon-tag-20 {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* 按钮组样式 */
.btn-group-sm {
    display: flex;
    gap: 4px;
}

.btn-group-sm .btn {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    min-width: 80px;
}

.btn-group-sm .btn i {
    font-size: 14px;
}

.btn-outline-success {
    color: var(--success-color);
    border-color: var(--success-color);
    background-color: transparent;
}

.btn-outline-success:hover {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
    transform: translateY(-2px);
}

.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background-color: transparent;
}

.btn-outline-danger:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #495057;
}

/* 卡片底部 */
.card-footer {
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}

/* 底部信息 */
.main-footer {
    padding: 20px 30px;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    max-width: 350px;
    min-width: 300px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.notification-success .notification-icon {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
}

.notification-error .notification-icon {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.notification-info .notification-icon {
    background-color: rgba(13, 202, 240, 0.1);
    color: var(--info-color);
}

.notification-warning .notification-icon {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.notification-content {
    flex: 1;
    font-size: 14px;
}

.notification-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
}

.notification-close:hover {
    color: var(--dark-color);
}

/* 加载更多按钮 */
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* 加载覆盖层样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.loading-spinner p {
    margin-top: 15px;
    color: #666;
}

/* 调试信息面板 */
.debug-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 300px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    font-size: 12px;
    z-index: 10000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .topbar,
    .stats-grid,
    .content-card,
    .main-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .btn-group-sm .btn {
        min-width: auto;
        padding: 6px 10px;
    }
    
    .btn-group-sm .btn span:not(.bi) {
        display: none;
    }
}