/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
}

#app {
    width: 100%;
    height: 100vh;
}

/* 侧边栏样式 */
.logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #263445;
    color: #fff;
}

.logo h2 {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.sidebar-menu {
    border-right: none;
}

.sidebar-menu .el-menu-item {
    height: 50px;
    line-height: 50px;
}

/* 头部样式 */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.header-content h3 {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    color: #303133;
}

/* 主内容区 */
.el-main {
    background-color: #f0f2f5;
    padding: 20px;
}

/* 统计卡片样式 */
.stat-card {
    text-align: center;
    padding: 20px 0;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #409EFF;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 14px;
    color: #909399;
}

/* 数据概览页面 */
.dashboard .el-card {
    margin-bottom: 20px;
}

/* 转赠记录页面 */
.records .el-form-item {
    margin-bottom: 10px;
}

.records .el-table {
    margin-top: 20px;
}

/* 用户分析页面 */
.user-analysis .el-descriptions {
    margin-bottom: 20px;
}

/* 关系网络页面 */
.network .el-table {
    margin-top: 10px;
}

/* 响应式 - 针对真实手机分辨率优化 */
/* 平板和小屏幕 (< 768px) */
@media (max-width: 768px) {
    /* 隐藏侧边栏 */
    .el-aside {
        display: none !important;
    }

    /* 容器高度调整 - 为底部导航留出空间 */
    #app .el-container {
        height: calc(100vh - 56px) !important;
    }

    /* Header高度固定 */
    .el-header {
        height: 50px !important;
        padding: 0 !important;
    }

    /* 头部内容优化 */
    .header-content {
        padding: 0 12px;
        height: 50px;
    }

    .header-content h3 {
        font-size: 15px;
        font-weight: 600;
    }

    /* 隐藏API信息 */
    .header-content > div {
        display: none !important;
    }

    /* 主内容区优化 */
    .el-main {
        padding: 8px !important;
        padding-bottom: 64px !important; /* 为底部导航留空间 */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 统计卡片 - 改为2x2布局 */
    .dashboard .el-row:first-child .el-col {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
        margin-bottom: 8px;
    }

    .stat-card {
        padding: 12px 0;
        min-height: 85px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .stat-value {
        font-size: 20px;
        margin-bottom: 6px;
        font-weight: 700;
        word-break: break-all;
        line-height: 1.2;
    }

    .stat-label {
        font-size: 11px;
        line-height: 1.3;
        word-break: keep-all;
        white-space: nowrap;
    }

    /* 图表容器 - 改为垂直堆叠 */
    .dashboard > .el-row:last-of-type {
        display: block !important;
    }

    .dashboard > .el-row:last-of-type .el-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 12px;
    }

    /* 卡片间距优化 */
    .el-card {
        margin-bottom: 12px !important;
    }

    /* 卡片内边距 */
    .el-card__body {
        padding: 12px !important;
    }

    .el-card__header {
        padding: 10px 12px !important;
        font-size: 14px;
    }

    /* 时间轴优化 */
    .el-timeline {
        padding-left: 8px;
    }

    .el-timeline-item {
        padding-bottom: 12px;
    }

    .el-timeline-item__timestamp {
        font-size: 11px;
    }

    .el-timeline-item__content .el-card {
        margin-bottom: 0 !important;
    }

    .el-timeline-item__content .el-card__body {
        padding: 8px !important;
        font-size: 12px;
    }

    /* 表格优化 */
    .el-table {
        font-size: 11px;
    }

    .el-table th,
    .el-table td {
        padding: 6px 4px !important;
    }

    .el-table th {
        font-size: 11px;
    }

    /* 表格内的标签 */
    .el-table .el-tag {
        font-size: 10px;
        padding: 0 4px;
        height: 20px;
        line-height: 20px;
    }

    /* 表单优化 */
    .el-form--inline .el-form-item {
        display: block;
        margin-right: 0;
        margin-bottom: 8px;
    }

    .el-form-item__label {
        font-size: 12px;
        padding: 0;
        margin-bottom: 4px;
        display: block;
        text-align: left !important;
    }

    .el-input,
    .el-select,
    .el-date-editor,
    .el-input-number {
        width: 100% !important;
    }

    .el-input__inner {
        font-size: 13px;
        height: 36px;
        line-height: 36px;
    }

    .el-button {
        padding: 8px 15px;
        font-size: 12px;
        height: 36px;
    }

    /* 按钮组优化 */
    .el-form-item .el-button {
        margin-right: 8px;
        margin-bottom: 8px;
    }

    /* 图表高度调整 */
    #trendChart,
    #topUsersChart,
    #userTrendChart,
    #topReceiversChart {
        min-height: 280px !important;
        height: 280px;
    }

    #userNetworkChart {
        min-height: 350px !important;
        height: 350px;
    }

    /* 分页优化 */
    .el-pagination {
        padding: 8px 0;
        text-align: center;
        justify-content: center;
    }

    .el-pagination button,
    .el-pagination .el-pager li {
        min-width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 12px;
    }

    /* 弹窗优化 */
    .el-dialog {
        width: 92% !important;
        margin: 4vh auto !important;
        max-height: 92vh;
    }

    .el-dialog__header {
        padding: 12px 15px;
    }

    .el-dialog__title {
        font-size: 15px;
    }

    .el-dialog__body {
        padding: 15px;
        max-height: calc(92vh - 100px);
        overflow-y: auto;
    }

    /* 描述列表优化 */
    .el-descriptions {
        font-size: 12px;
    }

    .el-descriptions__label {
        font-size: 12px;
    }

    .el-descriptions__content {
        font-size: 12px;
    }

    /* 消息提示 */
    .el-message {
        min-width: 260px;
        font-size: 13px;
        padding: 12px 16px;
    }

    /* 空状态 */
    .el-empty {
        padding: 40px 0;
    }

    .el-empty__description {
        font-size: 13px;
    }

    /* 显示移动端底部导航栏 */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: #fff;
        border-top: 1px solid #e4e7ed;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        z-index: 2000;
        height: 56px;
        padding-bottom: env(safe-area-inset-bottom); /* iOS刘海屏适配 */
    }

    .mobile-bottom-nav .nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #909399;
        cursor: pointer;
        transition: all 0.2s ease;
        padding: 6px 4px;
        gap: 2px;
    }

    .mobile-bottom-nav .nav-item.active {
        color: #409EFF;
        background-color: #f0f9ff;
    }

    .mobile-bottom-nav .nav-item:active {
        background-color: #e6f3ff;
    }

    .mobile-bottom-nav .nav-icon {
        font-size: 20px;
        line-height: 1;
    }

    .mobile-bottom-nav .nav-label {
        font-size: 10px;
        white-space: nowrap;
        font-weight: 500;
        line-height: 1;
    }
}

/* 手机竖屏 (< 576px) - 针对360px-428px真实分辨率优化 */
@media (max-width: 576px) {
    /* 更紧凑的header */
    .el-header {
        height: 44px !important;
    }

    .header-content {
        height: 44px;
        padding: 0 10px;
    }

    .header-content h3 {
        font-size: 14px;
    }

    /* 主内容区 */
    .el-main {
        padding: 6px !important;
        padding-bottom: 60px !important;
    }

    /* 统计卡片进一步压缩 */
    .stat-card {
        padding: 10px 0;
        min-height: 70px;
    }

    .stat-value {
        font-size: 18px;
        margin-bottom: 4px;
        font-weight: 700;
        word-break: break-all;
    }

    .stat-label {
        font-size: 10px;
        word-break: keep-all;
    }

    /* 卡片间距 */
    .el-card {
        margin-bottom: 10px !important;
    }

    .el-card__body {
        padding: 10px !important;
    }

    .el-card__header {
        padding: 8px 10px !important;
        font-size: 13px;
    }

    /* 时间轴 */
    .el-timeline-item__content .el-card__body {
        padding: 6px !important;
        font-size: 11px;
    }

    /* 表格 */
    .el-table {
        font-size: 10px;
    }

    .el-table th,
    .el-table td {
        padding: 4px 2px !important;
    }

    .el-table .el-tag {
        font-size: 9px;
        padding: 0 3px;
        height: 18px;
        line-height: 18px;
        transform: scale(0.95);
    }

    /* 表单 */
    .el-form-item {
        margin-bottom: 6px;
    }

    .el-form-item__label {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .el-input__inner {
        font-size: 12px;
        height: 34px;
        line-height: 34px;
    }

    .el-button {
        padding: 6px 12px;
        font-size: 11px;
        height: 34px;
    }

    /* 图表 */
    #trendChart,
    #topUsersChart,
    #userTrendChart,
    #topReceiversChart {
        min-height: 240px !important;
        height: 240px;
    }

    #userNetworkChart {
        min-height: 300px !important;
        height: 300px;
    }

    /* 分页 */
    .el-pagination button,
    .el-pagination .el-pager li {
        min-width: 26px;
        height: 26px;
        line-height: 26px;
        font-size: 11px;
    }

    /* 弹窗全屏 */
    .el-dialog {
        width: 100% !important;
        margin: 0 !important;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .el-dialog__body {
        padding: 12px;
        max-height: calc(100vh - 90px);
    }

    /* 描述列表 */
    .el-descriptions {
        font-size: 11px;
    }

    .el-descriptions__label,
    .el-descriptions__content {
        font-size: 11px;
    }

    /* 空状态 */
    .el-empty {
        padding: 30px 0;
    }

    .el-empty__image {
        width: 80px;
    }

    .el-empty__description {
        font-size: 12px;
    }

    /* 底部导航栏优化 */
    .mobile-bottom-nav {
        height: 52px;
    }

    .mobile-bottom-nav .nav-icon {
        font-size: 18px;
    }

    .mobile-bottom-nav .nav-label {
        font-size: 9px;
    }
}

/* 加载动画 */
.el-loading-mask {
    background-color: rgba(255, 255, 255, 0.8);
}

/* 卡片阴影 */
.el-card {
    border-radius: 4px;
}

.el-card.is-hover-shadow:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 表格样式优化 */
.el-table {
    font-size: 14px;
}

.el-table th {
    background-color: #f5f7fa;
    color: #606266;
    font-weight: 600;
}

.el-table td {
    padding: 12px 0;
}

/* 按钮样式 */
.el-button {
    border-radius: 4px;
}

/* 标签样式 */
.el-tag {
    border-radius: 4px;
}

/* 分页样式 */
.el-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* 图表容器 */
#trendChart,
#topUsersChart,
#userTrendChart,
#topReceiversChart,
#userNetworkChart {
    width: 100%;
    min-height: 350px;
}

#userNetworkChart {
    min-height: 500px;
}

/* 对话框样式 */
.el-dialog__header {
    background-color: #f5f7fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e4e7ed;
}

.el-dialog__body {
    padding: 20px;
}

/* 描述列表样式 */
.el-descriptions {
    margin-top: 10px;
}

.el-descriptions__label {
    font-weight: 600;
    color: #606266;
}

/* 空状态样式 */
.el-empty {
    padding: 60px 0;
}

/* 表单样式 */
.el-form-item__label {
    font-weight: 500;
    color: #606266;
}

/* 输入框样式 */
.el-input__inner {
    border-radius: 4px;
}

/* 选择器样式 */
.el-select {
    width: 100%;
}

/* 日期选择器样式 */
.el-date-editor {
    width: 100%;
}

/* 消息提示样式 */
.el-message {
    min-width: 380px;
    border-radius: 4px;
}

/* 移动端底部导航栏 */
.mobile-bottom-nav {
    display: none; /* 默认隐藏 */
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 图片样式 */
.el-image {
    border-radius: 4px;
}

/* 数字输入框样式 */
.el-input-number {
    width: 150px;
}

/* 表格图片样式 */
.el-table .el-image {
    cursor: pointer;
}

/* 链接按钮样式 */
.el-button--text {
    padding: 0;
}

/* 表格悬停效果 */
.el-table tbody tr:hover > td {
    background-color: #f5f7fa !important;
}

/* 卡片标题样式 */
.el-card__header {
    font-weight: 600;
    color: #303133;
}

/* 标签颜色 */
.el-tag--success {
    background-color: #f0f9ff;
    border-color: #c6e2ff;
    color: #409eff;
}

.el-tag--warning {
    background-color: #fef0f0;
    border-color: #fde2e2;
    color: #f56c6c;
}

.el-tag--danger {
    background-color: #fef0f0;
    border-color: #fde2e2;
    color: #f56c6c;
}
