/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f7fa;
}

a {
    color: #409eff;
    text-decoration: none;
}

a:hover {
    color: #66b1ff;
}

/* ===== 登录页 ===== */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 22px;
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    color: #999;
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    color: #999;
    font-size: 12px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

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

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #304156;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #1f2d3d;
    background: #2b3a4b;
}

.logo-icon {
    margin-right: 8px;
    font-size: 22px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bfcbd9;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #263445;
    color: #fff;
}

.nav-item.active {
    background: #263445;
    color: #409eff;
    border-left-color: #409eff;
}

.nav-icon {
    margin-right: 10px;
    font-size: 16px;
}

/* 主内容区 */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: #303133;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-name {
    color: #606266;
    font-size: 14px;
}

.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

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

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
}

.card-body {
    padding: 20px;
}

.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }

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

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

.stat-icon-blue { background: #ecf5ff; color: #409eff; }
.stat-icon-green { background: #f0f9eb; color: #67c23a; }
.stat-icon-orange { background: #fdf6ec; color: #e6a23c; }
.stat-icon-purple { background: #f5f0ff; color: #9c27b0; }

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #303133;
    margin-bottom: 4px;
}

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

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

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}

.table th {
    background: #fafafa;
    font-weight: 600;
    color: #606266;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f5f7fa;
}

.table .text-center {
    text-align: center;
}

.mono {
    font-family: "SF Mono", Monaco, Inconsolata, "Roboto Mono", monospace;
    font-size: 13px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.4;
    vertical-align: middle;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

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

.btn-primary {
    background: #409eff;
    border-color: #409eff;
    color: #fff;
}

.btn-primary:hover {
    background: #66b1ff;
    border-color: #66b1ff;
    color: #fff;
}

.btn-success {
    background: #67c23a;
    border-color: #67c23a;
    color: #fff;
}

.btn-success:hover {
    background: #85ce61;
    border-color: #85ce61;
    color: #fff;
}

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

.btn-danger:hover {
    background: #f78989;
    border-color: #f78989;
    color: #fff;
}

.btn-outline {
    background: #fff;
    border-color: #dcdfe6;
    color: #606266;
}

.btn-outline:hover {
    background: #ecf5ff;
    border-color: #409eff;
    color: #409eff;
}

.btn-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

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

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

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    color: #606266;
    transition: border-color 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: #409eff;
}

.form-control:disabled {
    background: #f5f7fa;
    color: #c0c4cc;
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ebeef5;
    display: flex;
    gap: 10px;
}

.required {
    color: #f56c6c;
}

/* 搜索表单 */
.search-form .form-row {
    align-items: flex-end;
}

.search-form .form-group {
    margin-bottom: 0;
}

/* ===== 提示框 ===== */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: #f0f9eb;
    border: 1px solid #e1f3d8;
    color: #67c23a;
}

.alert-error {
    background: #fef0f0;
    border: 1px solid #fde2e2;
    color: #f56c6c;
}

/* ===== 状态标签 ===== */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fdf6ec;
    color: #e6a23c;
}

.status-picked {
    background: #f0f9eb;
    color: #67c23a;
}

.status-returned {
    background: #fef0f0;
    color: #f56c6c;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.badge-orange {
    background: #fdf6ec;
    color: #e6a23c;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ebeef5;
}

.page-link {
    padding: 6px 14px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    color: #606266;
    font-size: 13px;
    transition: all 0.2s;
}

.page-link:hover {
    border-color: #409eff;
    color: #409eff;
}

.page-info {
    color: #909399;
    font-size: 13px;
}

/* ===== 布局行 ===== */
.row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.col {
    flex: 1;
    min-width: 0;
}

.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-8 { flex: 0 0 66.667%; max-width: 66.667%; }

/* ===== 快递公司列表 ===== */
.courier-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.courier-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f5f7fa;
    border-radius: 4px;
}

.courier-name {
    font-weight: 500;
    color: #303133;
}

.courier-count {
    color: #909399;
    font-size: 13px;
}

/* ===== 快捷操作 ===== */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-muted { color: #909399; font-weight: normal; font-size: 13px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .logo-text,
    .nav-item span:not(.nav-icon) {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .col-4,
    .col-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .topbar {
        padding: 0 10px;
    }
    
    .content {
        padding: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
}
