/* 自定义样式 */
body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
    margin-bottom: 20px;
    border-radius: 12px !important;  /* ✅ 新增：卡片圆角 */
}

.card-header {
    border-bottom: 2px solid #dee2e6;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
    border-radius: 8px !important;  /* ✅ 新增：徽章圆角 */
}

.list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.2s;
    border-radius: 8px !important;  /* ✅ 新增：列表项圆角 */
    margin-bottom: 5px;
}

.list-group-item:hover {
    border-left-color: #0d6efd;
    background-color: #f8f9fa;
}

.btn {
    transition: all 0.3s ease;  /* ✅ 修改：增强过渡效果 */
    border-radius: 8px !important;  /* ✅ 新增：按钮圆角 */
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);  /* ✅ 修改：增强阴影 */
}

.btn:active {
    transform: translateY(0);  /* ✅ 新增：点击效果 */
}

/* ✅ 新增：小按钮圆角 */
.btn-sm {
    border-radius: 6px !important;
}

/* ✅ 新增：超小按钮圆角 */
.btn-xs {
    border-radius: 4px !important;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;  /* ✅ 修改：代码块圆角 */
    font-size: 0.9em;
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

/* ✅ 新增：模态框圆角 */
.modal-content {
    border-radius: 12px !important;
}

.pagination {
    margin-top: 20px;
}

.alert {
    border-left: 4px solid;
    border-radius: 10px !important;  /* ✅ 新增：警告框圆角 */
}

.alert-info {
    border-left-color: #0dcaf0;
}

.alert-success {
    border-left-color: #198754;
}

.alert-danger {
    border-left-color: #dc3545;
}

.alert-warning {
    border-left-color: #ffc107;
}

/* 流程图样式 */
#taskFlow {
    background-color: #fff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .table-responsive {
        font-size: 0.9rem;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;  /* ✅ 修改：上传区域圆角 */
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-area:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
}

/* 统计卡片 */
.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* ==================== ✅ 新增：按钮组和表单圆角美化 ==================== */

/* 按钮组圆角处理 */
.btn-group .btn {
    border-radius: 0 !important;
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.btn-group .btn:only-child {
    border-radius: 8px !important;
}

/* 垂直按钮组圆角 */
.btn-group-vertical .btn {
    border-radius: 0 !important;
}

.btn-group-vertical .btn:first-child {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.btn-group-vertical .btn:last-child {
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.btn-group-vertical .btn:only-child {
    border-radius: 8px !important;
}

/* 表单控件圆角 */
.form-control, .form-select {
    border-radius: 8px !important;
}

/* 输入组圆角 */
.input-group .form-control:first-child {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.input-group .form-control:last-child {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.input-group .btn:first-child {
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

.input-group .btn:last-child {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* 文件操作按钮美化 */
.file-actions .btn {
    border-radius: 8px !important;
    margin: 0 3px;
}

/* 列表组美化 */
.list-group {
    border-radius: 10px !important;
}

.list-group-item:first-child {
    border-top-left-radius: 10px !important;
    border-top-right-radius: 10px !important;
}

.list-group-item:last-child {
    border-bottom-left-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

/* 下拉菜单圆角 */
.dropdown-menu {
    border-radius: 10px !important;
}

/* 分页按钮圆角 */
.pagination .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
}

/* 导航标签圆角 */
.nav-tabs .nav-link {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.nav-pills .nav-link {
    border-radius: 8px !important;
}

/* 进度条圆角 */
.progress {
    border-radius: 8px !important;
}

/* 工具提示圆角 */
.tooltip-inner {
    border-radius: 6px !important;
}

/* 表格圆角 */
.table {
    border-radius: 10px !important;
    overflow: hidden;
}

/* 图片圆角 */
.img-thumbnail {
    border-radius: 8px !important;
}

/* 文件预览图片圆角 */
.file-preview img {
    border-radius: 6px !important;
}

/* ==================== ✅ 新增：移动端图表横向滚动样式 ==================== */

/* 图表滚动容器 */
.chart-scroll-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;  /* iOS 平滑滚动 */
    padding-bottom: 15px;
    margin-bottom: 10px;
}

/* 移动端图表优化 */
@media (max-width: 768px) {
    /* 图表容器高度调整 */
    .chart-scroll-wrapper > div {
        min-width: 900px !important;  /* 确保12个用户有足够宽度 */
        height: 350px !important;
    }

    /* 自定义滚动条样式 */
    .chart-scroll-wrapper {
        scrollbar-width: thin;
        scrollbar-color: #ccc #f5f5f5;
    }

    /* Webkit 浏览器（Chrome、Safari）滚动条 */
    .chart-scroll-wrapper::-webkit-scrollbar {
        height: 8px;
    }

    .chart-scroll-wrapper::-webkit-scrollbar-track {
        background: #f5f5f5;
        border-radius: 4px;
    }

    .chart-scroll-wrapper::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 4px;
        transition: background 0.3s;
    }

    .chart-scroll-wrapper::-webkit-scrollbar-thumb:hover {
        background: #999;
    }

    /* 提示文本样式 */
    .scroll-hint {
        display: block;
        color: #6c757d;
        font-size: 0.85rem;
        margin-top: 5px;
    }

    .scroll-hint i {
        margin-right: 5px;
    }
}

/* 桌面端隐藏提示文本 */
@media (min-width: 769px) {
    .scroll-hint {
        display: none;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .chart-scroll-wrapper > div {
        height: 280px !important;
    }
}

/* 统计表格移动端优化 */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.85rem;
    }

    .table th, .table td {
        padding: 0.5rem;
        white-space: nowrap;
    }

    /* 用户名列宽度 */
    .table td:first-child,
    .table th:first-child {
        min-width: 80px;
    }
}