/**
 * 美容院管理系统 - 自定义样式
 * 版本: 2.0
 * 兼容: 手机/平板/电脑
 */

/* ========== 全局样式 ========== */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
    color: #1a1f36;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 链接样式 ========== */
a {
    color: #5c6bc0;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #7986cb;
}

a:active {
    color: #3f51b5;
}

/* ========== 卡片通用样式 ========== */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    margin-bottom: 24px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eef0f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 24px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1f36;
    margin: 0;
}

/* ========== 搜索栏样式 ========== */
.search-bar {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.search-bar .am-form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.search-bar .am-form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.search-bar .am-form-group label {
    display: block;
    font-size: 12px;
    color: #8892b0;
    margin-bottom: 6px;
    font-weight: 500;
}

.search-bar .am-btn-group {
    display: flex;
    gap: 8px;
}

/* ========== 工具栏样式 ========== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.toolbar-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========== 数据表格增强 ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fc;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #5a607f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #eef0f7;
    white-space: nowrap;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #eef0f7;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8f9fc;
}

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

/* ========== 用户头像 ========== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #eef0f7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5c6bc0;
    font-weight: 600;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 20px;
}

/* ========== 状态指示 ========== */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.success { background: #4caf50; }
.status-dot.warning { background: #ff9800; }
.status-dot.danger { background: #f44336; }
.status-dot.info { background: #2196f3; }

/* ========== 金额高亮 ========== */
.amount {
    font-weight: 600;
    color: #f44336;
}

.amount-large {
    font-size: 24px;
}

.amount-success {
    color: #4caf50;
}

/* ========== 数据标签 ========== */
.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: #eef0f7;
    color: #5a607f;
}

.tag-primary { background: rgba(92, 107, 192, 0.1); color: #5c6bc0; }
.tag-success { background: rgba(76, 175, 80, 0.1); color: #4caf50; }
.tag-warning { background: rgba(255, 152, 0, 0.1); color: #ff9800; }
.tag-danger { background: rgba(244, 67, 54, 0.1); color: #f44336; }

/* ========== 进度条 ========== */
.progress {
    height: 8px;
    background: #eef0f7;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-bar-primary { background: linear-gradient(90deg, #5c6bc0, #7986cb); }
.progress-bar-success { background: linear-gradient(90deg, #4caf50, #66bb6a); }
.progress-bar-warning { background: linear-gradient(90deg, #ff9800, #ffb74d); }

/* ========== 表单增强 ========== */
.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1f36;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef0f7;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.form-col {
    padding: 0 8px;
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #5a607f;
    margin-bottom: 6px;
}

.form-label.required::after {
    content: '*';
    color: #f44336;
    margin-left: 4px;
}

/* ========== 提示信息 ========== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.alert i {
    margin-right: 12px;
    font-size: 18px;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    color: #e65100;
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    color: #c62828;
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    color: #1565c0;
}

/* ========== 模态框增强 ========== */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eef0f7;
    background: #fff;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1f36;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eef0f7;
    background: #f8f9fc;
    border-radius: 0 0 12px 12px;
}

/* ========== 空数据状态 ========== */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #8892b0;
}

.no-data i {
    font-size: 48px;
    color: #d0d5dd;
    margin-bottom: 16px;
}

.no-data p {
    margin: 0;
    font-size: 15px;
}

/* ========== 加载状态 ========== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #eef0f7;
    border-top-color: #5c6bc0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== 快捷操作网格 ========== */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    text-decoration: none;
    color: #5a607f;
    transition: all 0.3s ease;
}

.quick-action-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    color: #5c6bc0;
}

.quick-action-item i {
    font-size: 32px;
    margin-bottom: 12px;
    color: #5c6bc0;
}

.quick-action-item span {
    font-weight: 500;
    font-size: 14px;
}

/* ========== 图表容器 ========== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ========== 消息提示 ========== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: #1a1f36;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.toast-success { background: #4caf50; }
.toast-error { background: #f44336; }
.toast-warning { background: #ff9800; }

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

/* ========== 响应式表格 ========== */
@media screen and (max-width: 768px) {
    .data-table {
        display: block;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tbody {
        display: block;
    }
    
    .data-table tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #eef0f7;
        border-radius: 8px;
        background: #fff;
    }
    
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        border-bottom: 1px solid #eef0f7;
    }
    
    .data-table td:last-child {
        border-bottom: none;
    }
    
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #5a607f;
        font-size: 13px;
    }
    
    .data-table .actions {
        flex-wrap: wrap;
    }
}

/* ========== 打印优化 ========== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .data-table th {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
    }
}

/* ========== 动画效果 ========== */
.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.slide-up {
    animation: slideUp 0.3s ease;
}

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

/* ========== 辅助类 ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: #8892b0; }
.text-primary { color: #5c6bc0; }
.text-success { color: #4caf50; }
.text-danger { color: #f44336; }
.text-warning { color: #ff9800; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: 8px; }
.shadow { box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.shadow-lg { box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
