/**
 * 统一样式文件
 * 路径：/assets/css/style.css
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: #f7fafc;
    color: #2d3748;
}

/* 布局 */
.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: #2d3748;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #4a5568;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 400;
}

.sidebar-header p {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 5px;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav .nav-item {
    display: block;
    padding: 12px 20px;
    color: #cbd5e0;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav .nav-item:hover {
    background: #4a5568;
    color: #fff;
}

.sidebar-nav .nav-item.active {
    background: #4299e1;
    color: #fff;
}

.sidebar-nav .nav-item i {
    margin-right: 10px;
    width: 20px;
    display: inline-block;
}

.sidebar-nav .sub-nav {
    padding-left: 45px;
    background: #1a202c;
    display: none;
}

.sidebar-nav .nav-item.active + .sub-nav,
.sidebar-nav .sub-nav:hover {
    display: block;
}

.sidebar-nav .sub-nav a {
    display: block;
    padding: 8px 0;
    color: #a0aec0;
    text-decoration: none;
    font-size: 14px;
}

.sidebar-nav .sub-nav a:hover {
    color: #fff;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
}

/* 顶部导航 */
.top-nav {
    background: #fff;
    padding: 15px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-nav .page-title {
    font-size: 20px;
    color: #2d3748;
}

.top-nav .user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-nav .user-info span {
    color: #718096;
}

.top-nav .user-info a {
    color: #4299e1;
    text-decoration: none;
}

.top-nav .user-info a:hover {
    text-decoration: underline;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 18px;
    color: #2d3748;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: #ebf8ff;
    color: #3182ce;
}

.stat-icon.green {
    background: #f0fff4;
    color: #38a169;
}

.stat-icon.yellow {
    background: #fefcbf;
    color: #d69e2e;
}

.stat-icon.red {
    background: #fee;
    color: #e53e3e;
}

.stat-info h4 {
    font-size: 14px;
    color: #718096;
    margin-bottom: 5px;
}

.stat-info .number {
    font-size: 28px;
    font-weight: bold;
    color: #2d3748;
}

.stat-info .desc {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 5px;
}

/* 表格 */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f7fafc;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #2d3748;
}

table tr:hover {
    background: #f7fafc;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #4299e1;
    color: #fff;
}

.btn-primary:hover {
    background: #3182ce;
}

.btn-success {
    background: #48bb78;
    color: #fff;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
    color: #fff;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-warning {
    background: #ecc94b;
    color: #744210;
}

.btn-warning:hover {
    background: #d69e2e;
}

.btn-secondary {
    background: #a0aec0;
    color: #fff;
}

.btn-secondary:hover {
    background: #718096;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-control.error {
    border-color: #f56565;
}

.form-help {
    font-size: 12px;
    color: #718096;
    margin-top: 5px;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 20px;
    background: #4299e1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
    color: #2d3748;
}

.modal-header .close {
    font-size: 24px;
    cursor: pointer;
    color: #a0aec0;
}

.modal-header .close:hover {
    color: #718096;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 标签 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-warning {
    background: #feebc8;
    color: #744210;
}

.badge-danger {
    background: #fed7d7;
    color: #c53030;
}

.badge-info {
    background: #bee3f8;
    color: #2c5282;
}

/* 提示信息 */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert-danger {
    background: #fed7d7;
    color: #c53030;
    border-left: 4px solid #f56565;
}

.alert-warning {
    background: #feebc8;
    color: #744210;
    border-left: 4px solid #ecc94b;
}

.alert-info {
    background: #bee3f8;
    color: #2c5282;
    border-left: 4px solid #4299e1;
}

/* 分页 */
.pagination {
    margin-top: 20px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-decoration: none;
    color: #4a5568;
}

.pagination a:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.pagination .current {
    background: #4299e1;
    color: #fff;
    border-color: #4299e1;
}

.pagination .total {
    border: none;
    color: #718096;
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-success { color: #48bb78; }
.text-danger { color: #f56565; }
.text-warning { color: #ecc94b; }
.text-info { color: #4299e1; }

.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.ml-20 { margin-left: 20px; }
.mr-20 { margin-right: 20px; }

.p-20 { padding: 20px; }

.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

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

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}