/**
 * SMS Web Common Styles
 * 毛玻璃现代化风格 - 浅色系
 */

/* ========================================
   1. CSS Variables (颜色变量)
   ======================================== */
:root {
    /* 主色调 */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #818cf8;
    --secondary-color: #764ba2;
    
    /* 渐变背景 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* 背景色 */
    --bg-body: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-light: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    
    /* 文字颜色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #ffffff;
    
    /* 边框与阴影 */
    --border-color: rgba(255, 255, 255, 0.3);
    --border-light: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 2px 8px rgba(102, 126, 234, 0.1);
    --shadow-md: 0 8px 32px rgba(102, 126, 234, 0.15);
    --shadow-lg: 0 16px 48px rgba(102, 126, 234, 0.2);
    --shadow-card: 0 8px 32px rgba(102, 126, 234, 0.12);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 毛玻璃效果 */
    --glass-blur: blur(12px);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ========================================
   2. Base Styles (基础样式)
   ======================================== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   3. Glassmorphism Components (毛玻璃组件)
   ======================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ========================================
   4. Form Elements (表单元素)
   ======================================== */
.form-control-glass {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all var(--transition-normal);
    width: 100%;
}

.form-control-glass:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: #ffffff;
}

.form-control-glass::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

/* ========================================
   5. Buttons (按钮样式)
   ======================================== */
.btn-gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-gradient:active {
    transform: translateY(0);
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-gradient:hover::before {
    left: 100%;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   6. Cards (卡片样式)
   ======================================== */
.card-modern {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    transition: all var(--transition-normal);
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header-modern {
    background: transparent;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.card-title-modern {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ========================================
   7. Tables (表格样式)
   ======================================== */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: rgba(102, 126, 234, 0.08);
    color: var(--text-primary);
    font-weight: 600;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid rgba(102, 126, 234, 0.15);
}

.table-modern thead th:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

.table-modern thead th:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

.table-modern tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.08);
    vertical-align: middle;
}

.table-modern tbody tr {
    transition: background var(--transition-fast);
}

.table-modern tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   8. Badges & Status (徽章与状态)
   ======================================== */
.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.badge-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.badge-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.badge-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.badge-primary {
    background: var(--gradient-primary);
    color: white;
}

/* ========================================
   9. Alerts & Notifications (警告与通知)
   ======================================== */
.alert-modern {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: none;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.1) 100%);
    border-left: 4px solid #10b981;
    color: #065f46;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(248, 113, 113, 0.1) 100%);
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

/* ========================================
   10. Toast Notifications (Toast提示)
   ======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-modern {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid var(--primary-color);
}

.toast-modern.toast-success {
    border-left-color: #10b981;
}

.toast-modern.toast-error {
    border-left-color: #ef4444;
}

.toast-modern.toast-warning {
    border-left-color: #f59e0b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ========================================
   11. Navigation (导航样式)
   ======================================== */
.nav-pills-modern .nav-link {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: all var(--transition-normal);
    border: 1px solid transparent;
}

.nav-pills-modern .nav-link:hover {
    background: rgba(255, 255, 255, 0.4);
}

.nav-pills-modern .nav-link.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   12. Pagination (分页样式)
   ======================================== */
.pagination-modern {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-modern .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-normal);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.pagination-modern .page-link:hover {
    background: var(--primary-color);
    color: white;
}

.pagination-modern .page-item.active .page-link {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.pagination-modern .page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}

/* ========================================
   13. Modal (模态框)
   ======================================== */
.modal-modern .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-modern .modal-header {
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    padding: 20px 24px;
}

.modal-modern .modal-title {
    font-weight: 700;
    color: var(--text-primary);
}

.modal-modern .modal-body {
    padding: 24px;
}

.modal-modern .modal-footer {
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    padding: 16px 24px;
}

.modal-backdrop-modern {
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(4px);
}

/* ========================================
   14. Loading & Spinner (加载动画)
   ======================================== */
.spinner-modern {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ========================================
   15. Statistics Cards (统计卡片)
   ======================================== */
.stat-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 16px;
}

.stat-card .stat-icon.primary {
    background: var(--gradient-primary);
}

.stat-card .stat-icon.success {
    background: var(--gradient-success);
}

.stat-card .stat-icon.warning {
    background: var(--gradient-warning);
}

.stat-card .stat-icon.info {
    background: var(--gradient-info);
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========================================
   16. Responsive Utilities (响应式工具)
   ======================================== */
@media (max-width: 576px) {
    :root {
        --radius-lg: 12px;
    }
    
    .glass-card,
    .card-modern {
        padding: 16px;
    }
    
    .btn-gradient,
    .btn-glass {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
    
    .toast-container {
        left: 10px;
        right: 10px;
    }
    
    .toast-modern {
        min-width: auto;
    }
}

@media (min-width: 576px) and (max-width: 992px) {
    .glass-card,
    .card-modern {
        padding: 20px;
    }
}

/* ========================================
   17. Scrollbar (滚动条样式)
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* ========================================
   18. Selection (选中样式)
   ======================================== */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

/* ========================================
   19. Focus States (焦点状态)
   ======================================== */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   20. Utility Classes (工具类)
   ======================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.shadow-glass {
    box-shadow: var(--shadow-card);
}

.rounded-modern {
    border-radius: var(--radius-lg);
}

.transition-all {
    transition: all var(--transition-normal);
}

