/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e8e8e8;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #1890ff;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info span {
    margin-right: 15px;
    color: #666;
}

.logout-btn {
    background-color: #ff4d4f;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: #ff7875;
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.2);
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    width: 220px;
    height: 100%;
    background-color: #001529;
    padding-top: 80px;
    color: #fff;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: #1890ff;
    color: #fff;
    border-left: 3px solid #fff;
}

.sidebar-menu a i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

/* 主要内容区域 */
.main-content {
    margin-left: 220px;
    padding: 80px 20px 20px;
    min-height: 100vh;
    transition: all 0.3s;
}

.page-title {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 20px;
    font-weight: 500;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.card-header {
    padding: 12px 20px;
    border-bottom: 1px solid #e8e8e8;
    background-color: #fafafa;
}

.card-title {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.card-body {
    padding: 20px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: normal;
    color: #666;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    background-color: #fff;
}

.form-control:hover {
    border-color: #40a9ff;
}

.form-control:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

.form-col {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: normal;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s;
    
    line-height: 1.5;
}

.btn-primary {
    background-color: #1890ff;
    color: white;
    border-color: #1890ff;
}

.btn-primary:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
}

.btn-success {
    background-color: #52c41a;
    color: white;
    border-color: #52c41a;
}

.btn-success:hover {
    background-color: #73d13d;
    border-color: #73d13d;
    box-shadow: 0 2px 8px rgba(82, 196, 26, 0.2);
}

.btn-danger {
    background-color: #ff4d4f;
    color: white;
    border-color: #ff4d4f;
}

.btn-danger:hover {
    background-color: #ff7875;
    border-color: #ff7875;
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.2);
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #666;
    border-color: #d9d9d9;
}

.btn-secondary:hover {
    background-color: #fafafa;
    border-color: #000000;
    color: #40a9ff;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #e8e8e8;
}

.table th, .table td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #e8e8e8;
    vertical-align: middle;
}

.table th {
    background-color: #fafafa;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.table tr:nth-child(even) {
    background-color: #fafafa;
}

.table tr:hover {
    background-color: #e6f7ff;
}

/* 添加链接样式 */
.table a {
    color: #000203;
    text-decoration: none;
}

.table a:hover {
    color: #000000;
    text-decoration: underline;
}

/* 添加状态标签样式 */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
    line-height: 20px;
}

.status-success {
    background-color: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-pending {
    background-color: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

.status-failed {
    background-color: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ffa39e;
}

/* 金额样式 */
.amount {
    font-weight: 500;
    color: #ff4d4f;
}

.text-success {
    color: #52c41a !important;
}

.text-danger {
    color: #ff4d4f !important;
}

/* 操作按钮样式 */
.action-btn {
    padding: 4px 8px;
    font-size: 12px;
    margin: 0 2px;
    height: 24px;
    line-height: 1;
}

/* 搜索区域 */
.search-area {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e8e8;
}

/* 统计卡片 */
.stats-container {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 20px;
}

.stat-card {
    flex: 1;
    min-width: 200px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin: 0 10px 20px;
    text-align: center;
    border: 1px solid #e8e8e8;
    transition: all 0.3s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 500;
    margin: 10px 0;
    color: #333;
}

.stat-card .stat-title {
    font-size: 14px;
    color: #999;
}

.stat-card.primary {
    border-top: 3px solid #1890ff;
}

.stat-card.success {
    border-top: 3px solid #52c41a;
}

.stat-card.danger {
    border-top: 3px solid #ff4d4f;
}

.stat-card.warning {
    border-top: 3px solid #faad14;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.pagination a {
    color: #666;
    padding: 8px 12px;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid #d9d9d9;
    margin: 0 4px;
    font-size: 14px;
    border-radius: 4px;
}

.pagination a.active {
    background-color: #1890ff;
    color: white;
    border: 1px solid #1890ff;
}

.pagination a:hover:not(.active) {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination a.disabled {
    color: #d9d9d9;
    pointer-events: none;
    border-color: #f5f5f5;
}

/* 提示框样式 */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
}

.alert-success {
    color: #52c41a;
    background-color: #f6ffed;
    border-color: #b7eb8f;
}

.alert-danger {
    color: #ff4d4f;
    background-color: #fff1f0;
    border-color: #ffa39e;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f2f5;
    background-image: linear-gradient(135deg, #f0f2f5 0%, #e6f7ff 100%);
}

.login-form {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-weight: 500;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn {
    width: 100%;
    padding: 10px;
    height: 40px;
}

/* 下拉菜单样式 */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8.825L1.763 4.5 2.8 3.45 6 6.75l3.2-3.3L10.237 4.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* 文本域样式 */
textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* 产品图片样式 */
.product-image {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
}

.product-image-large {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
}

/* 图表容器 */
.chart-container {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e8e8e8;
    height: 400px;
}

/* 权限开关 */
.permission-switch {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.permission-switch label {
    margin-left: 10px;
    margin-bottom: 0;
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #1890ff;
}

input:focus + .slider {
    box-shadow: 0 0 1px #1890ff;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-menu a {
        padding: 15px 10px;
        text-align: center;
    }
    
    .sidebar-menu a span {
        display: none;
    }
    
    .sidebar-menu a i {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .form-col {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .stats-container {
        flex-direction: column;
    }
    
    .stat-card {
        margin-bottom: 10px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #1890ff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 3px 7px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border-radius: 10px;
}

.badge-primary {
    color: #fff;
    background-color: #1890ff;
}

.badge-success {
    color: #fff;
    background-color: #52c41a;
}

.badge-danger {
    color: #fff;
    background-color: #ff4d4f;
}

.badge-warning {
    color: #fff;
    background-color: #faad14;
}

/* 文件上传样式 */
.file-upload {
    position: relative;
    overflow: hidden;
    margin: 10px 0;
}

.file-upload input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 100px;
    text-align: right;
    filter: alpha(opacity=0);
    opacity: 0;
    outline: none;
    background: white;
    cursor: pointer;
    display: block;
}

.file-upload-btn {
    border: 1px solid #d9d9d9;
    color: #666;
    background-color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.file-upload-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin-bottom: 20px;
    list-style: none;
    background-color: transparent;
}

.breadcrumb-item {
    font-size: 14px;
    color: #666;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 8px;
    color: #ccc;
}

.breadcrumb-item a {
    color: #1890ff;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #333;
}
