body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.navbar-brand {
    font-weight: 600;
}

.badge {
    font-weight: 500;
}

.list-group-item {
    border-left: 0;
    border-right: 0;
}

.list-group-item:first-child {
    border-top: 0;
}

/* 登录页面 */
.card.shadow {
    border-radius: 10px;
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 53, 0.25);
}

/* 按钮样式 */
.btn {
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* 卡片内部间距 */
.card-body .mb-4:last-child {
    margin-bottom: 0 !important;
}

/* 状态栏 */
.bg-white.border-bottom {
    background-color: #fff !important;
}

/* 日志列表 */
.list-group-item small {
    display: block;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    .col-md-8,
    .col-md-4 {
        margin-bottom: 20px;
    }
}

/* 加载动画 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* 模态框 */
.modal-content {
    border-radius: 10px;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* JSON预览 */
pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 白名单编辑 */
textarea {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
}

/* 卡片组 */
.card.mb-2 {
    transition: all 0.2s;
}

.card.mb-2:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* 状态指示器 */
#connectionStatus {
    font-size: 0.875rem;
}

#connectionStatus .bi-circle-fill {
    font-size: 0.5rem;
    vertical-align: middle;
    margin-right: 0.25rem;
}

/* 操作按钮组 */
.card-footer .btn {
    margin-right: 0.5rem;
}

.card-footer .btn:last-child {
    margin-right: 0;
}

/* 空状态 */
.text-muted.text-center {
    padding: 2rem;
}

/* 产品选择页 */
.product-card {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
}

.product-card.border-primary,
.product-card.border-success {
    border-width: 2px;
}

.product-card .product-icon {
    font-size: 3rem;
    line-height: 1;
}

/* 设备日志页面 */
.device-list {
    max-height: calc(100vh - 300px);
    min-height: 220px;
    overflow-y: auto;
}

.device-item {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.device-item:hover {
    border-color: #0dcaf0;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
}

.device-item.active {
    border-color: #0dcaf0;
    border-width: 2px;
    background-color: #f0fbff;
}

.log-toolbar .form-label {
    font-size: 0.8rem;
}

.log-viewer {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #343a40;
    border-radius: 6px;
    padding: 0.75rem;
    min-height: 360px;
    max-height: calc(100vh - 390px);
    overflow: auto;
    white-space: pre;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 0;
}

#fileInfo {
    font-weight: 400;
}

/* 小屏幕优化 */
@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }

    .log-viewer {
        min-height: 260px;
        max-height: 60vh;
        font-size: 0.72rem;
    }

    .device-list {
        max-height: 320px;
    }
}
