/**
 * 全局UI优化样式文件
 * 包含阴影、圆角、过渡效果等现代化设计元素
 */

/* ============================================
   全局卡片优化
   ============================================ */
.card {
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: none !important;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px);
}

.card-content {
    padding: 24px !important;
}

.card-title {
    font-weight: 600 !important;
    margin-bottom: 12px !important;
}

.card-subtitle {
    color: #6c757d !important;
    font-size: 14px !important;
    margin-bottom: 20px !important;
}

/* 渐变卡片优化 */
.card.danger-gradient,
.card.info-gradient,
.card.success-gradient,
.card.warning-gradient {
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
}

.card.danger-gradient:hover,
.card.info-gradient:hover,
.card.success-gradient:hover,
.card.warning-gradient:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-4px) scale(1.02);
}

/* ============================================
   按钮优化
   ============================================ */
.btn,
.waves-effect,
.waves-effect.waves-light.btn {
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 500 !important;
    padding: 10px 20px !important;
    text-transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    line-height: 1.5 !important;
    min-height: 40px !important;
}

.btn:hover,
.waves-effect:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px);
}

/* 确保按钮内文字完全居中 */
.btn,
.waves-effect,
a.btn,
a.waves-effect {
    text-decoration: none !important;
    color: #fff !important;
    position: relative !important;
}

/* 确保按钮内的所有内容居中 */
.btn,
.waves-effect,
a.btn,
a.waves-effect {
    box-sizing: border-box !important;
}

/* 针对链接按钮的特殊处理 */
a.btn,
a.waves-effect {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.btn:active,
.waves-effect:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* 按钮颜色优化 */
.btn.red,
.waves-effect.red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%) !important;
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.3) !important;
}

.btn.blue,
.waves-effect.blue {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%) !important;
    box-shadow: 0 4px 12px rgba(51, 154, 240, 0.3) !important;
}

.btn.green,
.waves-effect.green {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%) !important;
    box-shadow: 0 4px 12px rgba(64, 192, 87, 0.3) !important;
}

.btn.orange,
.waves-effect.orange {
    background: linear-gradient(135deg, #ff922b 0%, #fd7e14 100%) !important;
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.3) !important;
}

/* ============================================
   表格优化
   ============================================ */
.table {
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.table thead th {
    color: #fff !important;
    font-weight: 600 !important;
    padding: 16px !important;
    border: none !important;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.2s ease !important;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background-color: #f8f9fa !important;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table tbody td {
    padding: 14px 16px !important;
    vertical-align: middle !important;
}

/* 表格操作列特殊处理 */
.table tbody td:last-child {
    text-align: center !important;
    white-space: nowrap !important;
}

.table tbody td:last-child .btn,
.table tbody td:last-child .waves-effect {
    vertical-align: middle !important;
    margin: 0 3px !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafbfc;
}

.table-striped tbody tr:nth-of-type(odd):hover {
    background-color: #f0f4f8 !important;
}

/* ============================================
   表单元素优化
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    border-radius: 8px !important;
    border: 2px solid #e0e0e0 !important;
    padding: 10px 14px !important;
    transition: all 0.3s ease !important;
    font-size: 14px !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    outline: none !important;
}

/* ============================================
   标签优化
   ============================================ */
.label {
    border-radius: 6px !important;
    padding: 4px 12px !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.label-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%) !important;
    color: #fff !important;
}

.label-warning {
    background: linear-gradient(135deg, #ffd43b 0%, #fcc419 100%) !important;
    color: #333 !important;
}

.label-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%) !important;
    color: #fff !important;
}

.label-info {
    background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%) !important;
    color: #fff !important;
}

/* ============================================
   开关优化
   ============================================ */
.switch label input[type="checkbox"]:checked + .lever {
    background-color: #51cf66 !important;
}

.switch label .lever {
    border-radius: 15px !important;
    transition: all 0.3s ease !important;
}

.switch label .lever:before {
    border-radius: 50% !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.switch label input[type="checkbox"]:checked + .lever:before {
    box-shadow: 0 3px 8px rgba(81, 207, 102, 0.4) !important;
}

/* ============================================
   容器和页面优化
   ============================================ */
.container-fluid {
    padding: 24px !important;
}

.page-wrapper {
    background: #f5f7fa !important;
    min-height: 100vh;
}

.main-wrapper {
    background: #f5f7fa !important;
}

/* ============================================
   卡片统计数字优化
   ============================================ */
.card-hover {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card-hover::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;
}

.card-hover:hover::before {
    left: 100%;
}

/* ============================================
   输入组优化
   ============================================ */
.input-group {
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.input-group input {
    border: none !important;
    box-shadow: none !important;
}

.input-group .input-group-addon {
    border-radius: 0 !important;
    border: none !important;
    background: #f8f9fa;
}

/* ============================================
   模态框优化
   ============================================ */
.modal {
    border-radius: 16px !important;
    overflow: hidden;
}

.modal-content {
    border-radius: 16px !important;
    border: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.modal-header .modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 16px 24px;
}

/* ============================================
   面包屑导航优化
   ============================================ */
.breadcrumb {
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 20px;
}

.breadcrumb-item {
    font-size: 14px;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #764ba2;
}

/* ============================================
   响应式优化
   ============================================ */
@media (max-width: 768px) {
    .card {
        border-radius: 8px !important;
        margin-bottom: 16px;
    }
    
    .btn {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 10px 8px !important;
    }
}

/* ============================================
   加载动画优化
   ============================================ */
.preloader {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.loader__figure {
    border-color: #667eea transparent #667eea transparent;
}

/* ============================================
   滚动条优化
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ============================================
   图片优化
   ============================================ */
img {
    border-radius: 8px;
    transition: transform 0.3s ease;
}

img:hover {
    transform: scale(1.05);
}

/* ============================================
   操作按钮组优化
   ============================================ */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-group .btn {
    margin: 0;
}

/* ============================================
   表格操作列按钮优化
   ============================================ */
table td .btn,
table td .waves-effect,
table td a.btn,
table td a.waves-effect {
    margin: 2px 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    line-height: 1.5 !important;
    min-height: 36px !important;
    min-width: 80px !important;
    padding: 8px 20px !important;
}

/* 确保按钮内的文字居中 */
table td .btn,
table td .waves-effect {
    position: relative;
}

table td .btn::before,
table td .waves-effect::before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

/* 按钮文字样式 */
table td .btn,
table td .waves-effect,
table td a.btn,
table td a.waves-effect {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px !important;
}

/* ============================================
   统计卡片数字优化
   ============================================ */
.white-text {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.display-6 {
    font-size: 3rem;
    opacity: 0.9;
    transition: transform 0.3s ease;
}

.card-hover:hover .display-6 {
    transform: scale(1.1) rotate(5deg);
}

/* ============================================
   搜索框优化
   ============================================ */
.search-box,
.input-group {
    position: relative;
}

.search-box input,
.input-group input {
    padding-right: 40px;
}

.search-box::after,
.input-group::after {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    pointer-events: none;
}

