/* ========================================
   万代资产管理系统 - 样式文件
   ======================================== */

/* 重置和基础样式 */
* {
    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: #f0f2f5;
}

a {
    color: #1890ff;
    text-decoration: none;
}

a:hover {
    color: #40a9ff;
}

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

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #001529;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    left: 0;
    top: 0;
    z-index: 100;
}

.logo {
    padding: 20px 16px;
    border-bottom: 1px solid #1f3a5c;
    text-align: center;
}

.logo h2 {
    font-size: 18px;
    color: #fff;
    font-weight: 600;
}

.nav-menu {
    padding: 12px 0;
}

.nav-group {
    margin-bottom: 8px;
}

.nav-group-title {
    padding: 8px 24px;
    font-size: 12px;
    color: #8c8c8c;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.2s;
    cursor: pointer;
}

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

.nav-item.active {
    color: #fff;
    background: #1890ff;
}

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

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
}

/* 顶部栏 */
.topbar {
    background: #fff;
    padding: 16px 24px;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #262626;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-weight: 500;
}

.user-role {
    font-size: 12px;
    padding: 2px 8px;
    background: #e6f7ff;
    color: #1890ff;
    border-radius: 4px;
}

.logout-btn {
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #666;
    font-size: 13px;
}

.logout-btn:hover {
    border-color: #ff4d4f;
    color: #ff4d4f;
}

/* 内容区 */
.content-wrapper {
    padding: 24px;
}

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

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 24px;
}

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

.search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 0 8px;
}

/* 表单 */
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-group {
    margin-bottom: 16px;
}

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

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

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

.required {
    color: #ff4d4f;
}

.form-text {
    font-size: 12px;
    color: #8c8c8c;
    margin-top: 4px;
    display: block;
}

.form-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
}

.input-group {
    display: flex;
}

.input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-text {
    padding: 8px 12px;
    background: #fafafa;
    border: 1px solid #d9d9d9;
    border-left: none;
    border-radius: 0 6px 6px 0;
    color: #8c8c8c;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: #fff;
    color: #333;
    line-height: 1.4;
}

.btn:hover {
    opacity: 0.85;
}

.btn-primary {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.btn-success {
    background: #52c41a;
    border-color: #52c41a;
    color: #fff;
}

.btn-warning {
    background: #faad14;
    border-color: #faad14;
    color: #fff;
}

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

.btn-info {
    background: #13c2c2;
    border-color: #13c2c2;
    color: #fff;
}

.btn-default {
    background: #fff;
    border-color: #d9d9d9;
    color: #595959;
}

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

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

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

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

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

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

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

.table-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

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

.status-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-warning {
    background: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

.status-danger {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.status-info {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.status-default {
    background: #fafafa;
    color: #8c8c8c;
    border: 1px solid #d9d9d9;
}

/* 提示框 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

.alert-danger {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
}

.alert-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #096dd9;
}

.alert-warning {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #d48806;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #595959;
    cursor: pointer;
}

.page-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.page-btn.active {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

/* 统计卡片 */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 200px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.stat-icon {
    font-size: 36px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #262626;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: #8c8c8c;
    margin-top: 4px;
}

.stat-blue { border-left: 4px solid #1890ff; }
.stat-green { border-left: 4px solid #52c41a; }
.stat-orange { border-left: 4px solid #faad14; }
.stat-red { border-left: 4px solid #ff4d4f; }

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

.col-md-8 {
    flex: 0 0 calc(66.666% - 10px);
    min-width: 400px;
}

.col-md-4 {
    flex: 0 0 calc(33.333% - 10px);
    min-width: 300px;
}

/* 直播间设备分布 */
.room-device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.room-device-item {
    background: #fafafa;
    padding: 16px;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s;
}

.room-device-item:hover {
    background: #e6f7ff;
}

.room-device-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.room-device-count {
    font-size: 20px;
    font-weight: 700;
    color: #1890ff;
}

/* 迷你统计 */
.mini-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.mini-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #262626;
}

.mini-stat-label {
    font-size: 12px;
    color: #8c8c8c;
}

.text-warning { color: #faad14; }
.text-danger { color: #ff4d4f; }

/* 待寄送列表 */
.pending-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #fafafa;
    border-radius: 6px;
}

.pending-name {
    font-weight: 500;
}

.pending-user {
    font-size: 12px;
    color: #8c8c8c;
}

/* 库存预警 */
.low-stock-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.low-stock-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff2f0;
    border-radius: 4px;
    font-size: 13px;
}

.low-stock-name {
    color: #cf1322;
}

.low-stock-num {
    font-weight: 600;
    color: #cf1322;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #8c8c8c;
}

/* 直播间卡片 */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.room-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}

.room-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.room-card-header {
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-card-header h3 {
    font-size: 16px;
}

.room-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
}

.type-indoor {
    background: rgba(255, 255, 255, 0.2);
}

.type-outdoor {
    background: rgba(255, 193, 7, 0.3);
}

.room-card-body {
    padding: 16px;
}

.room-card-body p {
    margin-bottom: 8px;
    font-size: 13px;
    color: #595959;
}

.room-device-count {
    font-size: 18px;
    font-weight: 700;
    color: #1890ff;
}

.room-card-footer {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e8e8e8;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1890ff;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #1890ff;
}

.timeline-content {
    background: #fafafa;
    padding: 16px;
    border-radius: 8px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.timeline-time {
    color: #8c8c8c;
}

.timeline-action {
    font-weight: 500;
}

.timeline-body p {
    margin-bottom: 6px;
    font-size: 13px;
}

/* 调拨方向 */
.transfer-direction {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
}

.transfer-box {
    flex: 1;
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.transfer-box h4 {
    margin-bottom: 12px;
    color: #262626;
}

.transfer-arrow {
    font-size: 32px;
    color: #1890ff;
    font-weight: bold;
}

/* 信息表格 */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

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

.info-table th {
    background: #fafafa;
    font-weight: 500;
    color: #8c8c8c;
    width: 100px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

/* 设备详情图片 */
.device-detail-img {
    max-width: 100%;
    border-radius: 8px;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 检查照片 */
.transfer-images {
    margin-top: 8px;
}

.image-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.thumb-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

/* 库存数字 */
.stock-num {
    font-size: 16px;
    font-weight: 600;
}

.stock-low {
    color: #ff4d4f;
}

.stock-warning {
    font-size: 12px;
    color: #ff4d4f;
    margin-left: 8px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

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

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

.modal-header h3 {
    font-size: 16px;
}

.modal-close {
    font-size: 20px;
    cursor: pointer;
    color: #8c8c8c;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 登录页面 */
.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-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

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

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

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

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

.login-form .form-control {
    padding: 10px 14px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.login-footer p {
    font-size: 12px;
    color: #bfbfbf;
}

/* 链接样式 */
.link {
    color: #1890ff;
    cursor: pointer;
}

.link:hover {
    color: #40a9ff;
    text-decoration: underline;
}

code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    color: #c7254e;
}

/* 响应式 - 平板 */
@media (max-width: 992px) {
    .sidebar {
        width: 60px;
    }
    
    .logo h2,
    .nav-item span:not(.nav-icon),
    .nav-group-title {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .col-md-8,
    .col-md-4 {
        flex: 0 0 100%;
        min-width: auto;
    }
}

/* 响应式 - 手机 */
@media (max-width: 768px) {
    /* 侧边栏 - 手机上改成抽屉式 */
    .sidebar {
        width: 220px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .logo h2,
    .nav-item span:not(.nav-icon),
    .nav-group-title {
        display: block;
    }
    
    /* 遮罩层 */
    .sidebar-mask {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }
    
    .sidebar-mask.show {
        display: block;
    }
    
    /* 主内容区 */
    .main-content {
        margin-left: 0;
    }
    
    /* 顶部栏 */
    .topbar {
        padding: 12px 16px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .user-name {
        display: none;
    }
    
    .user-role {
        display: none;
    }
    
    /* 汉堡菜单按钮 */
    .menu-toggle {
        display: inline-block !important;
        margin-right: 12px;
        font-size: 20px;
        cursor: pointer;
        color: #666;
    }
    
    /* 内容区 */
    .content-wrapper {
        padding: 12px;
    }
    
    /* 卡片 */
    .card-header {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    /* 工具栏 */
    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }
    
    .toolbar-right {
        display: flex;
        gap: 8px;
    }
    
    .toolbar-right .btn {
        flex: 1;
    }
    
    /* 搜索表单 */
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form .form-control,
    .search-form .btn {
        width: 100%;
    }
    
    /* 统计卡片 */
    .stats-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .stat-card {
        min-width: auto;
        padding: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    /* 表格 - 横向滚动 */
    .data-table {
        min-width: 600px;
    }
    
    .card-body {
        overflow-x: auto;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* 表单 */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        min-width: auto;
    }
    
    /* 按钮 */
    .btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* 调拨方向 */
    .transfer-direction {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    
    .transfer-arrow {
        transform: rotate(90deg);
        font-size: 24px;
    }
    
    /* 直播间卡片 */
    .rooms-grid {
        grid-template-columns: 1fr;
    }
    
    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .page-btn {
        padding: 8px 12px;
        min-width: 36px;
        text-align: center;
    }
    
    /* 弹窗 */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    /* 时间线 */
    .timeline {
        padding-left: 20px;
    }
    
    .timeline-dot {
        left: -16px;
    }
    
    /* 信息表格 */
    .info-table th {
        width: 80px;
        font-size: 13px;
    }
    
    .info-table th,
    .info-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* 批量操作栏 */
    #batchBar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch !important;
    }
    
    #batchBar > div:last-child {
        display: flex;
        gap: 8px;
    }
    
    #batchBar .btn {
        flex: 1;
    }
    
    /* 快速操作按钮 */
    .quick-actions .btn {
        padding: 12px;
        font-size: 14px;
    }
    
    /* 登录页 */
    .login-box {
        padding: 32px 24px;
    }
    
    .login-header h1 {
        font-size: 20px;
    }
}

/* 汉堡菜单按钮 - 默认隐藏，手机端显示 */
.menu-toggle {
    display: none;
}
