/* ========================================
   巡检系统 - 自定义样式 (移动端优先)
   ======================================== */

/* 全局 */
body {
    background-color: #f5f6fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* 卡片 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    border-radius: 12px 12px 0 0 !important;
    padding: 0.85rem 1rem;
}
.card-header h5 {
    font-size: 1rem;
    font-weight: 600;
}

/* 可点击卡片 */
.card-clickable {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* 统计卡片 - 左侧彩色边框 */
.card.border-primary { border-left: 4px solid #0d6efd !important; }
.card.border-success { border-left: 4px solid #198754 !important; }
.card.border-danger  { border-left: 4px solid #dc3545 !important; }
.card.border-warning { border-left: 4px solid #ffc107 !important; }

/* 表格 */
.table th {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    color: #6c757d;
}
.table td {
    font-size: 0.85rem;
    vertical-align: middle;
}

/* 导航栏 */
.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 面包屑 */
.breadcrumb {
    background: none;
    padding: 0.5rem 0;
}

/* 按钮增强 (移动端友好) */
.btn {
    border-radius: 8px;
    font-weight: 500;
}
.btn-lg {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* 表单控件 */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 0.85rem;
}
.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* 下拉菜单项表单 */
.dropdown-item form {
    margin: 0;
}
.dropdown-item button {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 0.25rem 1rem;
    cursor: pointer;
}

/* 签到成功页动画 */
.bi-check-circle.text-success {
    animation: scaleIn 0.5s ease-out;
}
@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* 异常列表 */
.list-group-item-warning {
    background-color: #fff8e1;
    border-left: 3px solid #ffc107;
}

/* Badge 增强 */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* 二维码容器 */
[id^="qrcode-"] {
    padding: 4px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}
[id^="qrcode-"] img {
    display: block;
    border-radius: 4px;
}

/* 扫码模态框 */
#scannerModal .modal-content {
    border-radius: 14px;
    overflow: hidden;
}
#qr-reader {
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #dee2e6;
}
#qr-reader video {
    border-radius: 8px;
}
#qr-reader-error {
    white-space: pre-wrap;
    word-break: break-all;
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .card-header h5 {
        font-size: 0.9rem;
    }

    .table td, .table th {
        font-size: 0.78rem;
        padding: 0.5rem 0.35rem;
    }

    h2 {
        font-size: 1.4rem !important;
    }

    /* 移动端隐藏二维码列（屏幕太小看不清），保留链接 */
    [id^="qrcode-"] {
        width: 60px !important;
        height: 60px !important;
    }
    [id^="qrcode-"] img {
        width: 60px !important;
        height: 60px !important;
    }

    /* 移动端全宽按钮 */
    .btn {
        width: 100%;
        margin-bottom: 0.3rem;
    }

    /* 表格横向滚动 */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* 导航下拉菜单全宽 */
    .dropdown-menu {
        width: 100%;
    }
}

/* 极小屏（320px-375px） */
@media (max-width: 375px) {
    .navbar-brand {
        font-size: 0.95rem;
    }
    .card-body {
        padding: 0.75rem;
    }
    .table td, .table th {
        font-size: 0.72rem;
        padding: 0.35rem 0.25rem;
    }
}
