/* ============================================================
   新模版内容区样式覆盖层
   在保留 Bootstrap 交互类的前提下，将内容区(卡片/表单/表格/按钮/弹窗)
   统一为新模版(Tailwind)风格：圆角、浅色、柔和阴影
   ============================================================ */

/* ---------- 全局字体：与 tem.html 参考模版保持一致 ---------- */
body,
html {
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 16px;
    color: #374151;
}
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 输入框/按钮/表格等统一字体为参考模版，字号由各自的 text-* 类控制 */
.form-control,
.btn,
.table td,
.table th,
input,
select,
textarea {
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* ============================================================
   模拟 Tailwind preflight 的表单/按钮基础重置（仅作用于原生元素，
   不影响 Bootstrap 的 .btn/.form-control 等类选择器样式）
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}
button,
input,
optgroup,
select,
textarea {
    font: inherit;
    color: inherit;
    line-height: inherit;
}
button {
    background-color: transparent;
    background-image: none;
    border: 0 solid;
    padding: 0;
    text-transform: none;
}
button,
[type='button'],
[type='reset'],
[type='submit'] {
    -webkit-appearance: button;
    cursor: pointer;
}
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
}


/* ---------- 卡片：圆角 + 柔和阴影 ---------- */
.card {
    border: 1px solid #eef2ff !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.06) !important;
}
.card-header {
    background: #fff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}
.card-body {
    background: #fff !important;
}

/* ---------- 表单控件：统一输入框风格 ---------- */
.form-control {
    border-radius: 0.5rem !important;
    border-color: #e2e8f0 !important;
    font-size: 0.8125rem !important;
    color: #374151 !important;
    background: #fff !important;
}
.form-control:focus {
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
}
.form-group label,
.col-form-label {
    color: #4b5563 !important;
    font-size: 0.8125rem !important;
}

/* ---------- 按钮：圆角统一 ---------- */
.btn {
    border-radius: 0.5rem !important;
}
.btn-primary {
    background: #3B82F6 !important;
    border-color: #3B82F6 !important;
}
.btn-primary:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
}

/* ---------- 表格：表头浅色 ---------- */
.table thead th {
    background: #f8fafc !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
    border-bottom: 1px solid #eef2ff !important;
    white-space: nowrap;
}
.table tbody td {
    font-size: 0.8125rem !important;
    color: #374151 !important;
    border-bottom: 1px solid #f8fafc !important;
}
.table-hover tbody tr:hover {
    background-color: #f0f7ff !important;
}

/* ---------- 弹窗：圆角 + 阴影 ---------- */
.modal-content {
    border-radius: 0.75rem !important;
    border: none !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}
.modal-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* ---------- 分页器：圆角 ---------- */
.pagination > li > a,
.pagination > li > span {
    border-radius: 0 !important;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
    border-radius: 0.375rem 0 0 0.375rem !important;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
    border-radius: 0 0.375rem 0.375rem 0 !important;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover {
    background: #3B82F6 !important;
    border-color: #3B82F6 !important;
}

/* ---------- 区块标题 ---------- */
.section-title-bar {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    padding-left: 0.625rem;
    border-left: 3px solid #3B82F6;
    line-height: 1.2;
}

/* ============================================================
   React 风格表单控件（输入框/下拉框统一），纯 CSS 实现，不依赖 Tailwind @apply
   ============================================================ */
input.form-input,
select.form-input,
textarea.form-input {
    width: 100% !important;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.375rem !important;
    font-size: 0.75rem !important;
    line-height: 1.25rem !important;
    color: #374151 !important;
    background-color: #fff !important;
    outline: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-sizing: border-box;
}
input.form-input:hover,
select.form-input:hover,
textarea.form-input:hover {
    border-color: #d1d5db !important;
}
input.form-input:focus,
select.form-input:focus,
textarea.form-input:focus {
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
}
select.form-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25em 1.25em;
    padding-right: 2rem !important;
}
input.form-input::placeholder,
select.form-input::placeholder,
textarea.form-input::placeholder {
    color: #9ca3af;
}
/* select 的下拉 option 统一深色文字 */
select.form-input option {
    color: #374151 !important;
    background: #fff !important;
}

/* ============================================================
   新模版自定义工具类（从 tem.html <style type="text/tailwindcss"> 迁移）
   纯 CSS 实现，避免 Play CDN @apply 编译报错导致全局 utility 失效
   ============================================================ */

/* 背景渐变（页面底色） */
.bg-gradient-main {
    background: linear-gradient(135deg, #f0f7ff 0%, #eef2ff 50%, #f5f3ff 100%);
}

/* 渐变文字标题 */
.text-gradient-title {
    background: linear-gradient(90deg, #3B82F6 0%, #8B5CF6 50%, #EC4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 搜索框渐变边框 */
.search-gradient-border {
    background: linear-gradient(90deg, #3B82F6, #8B5CF6, #EC4899);
    padding: 2px;
    border-radius: 12px;
}

/* 卡片柔和阴影 */
.card-shadow {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.06);
}

/* 侧边栏激活项 */
.sidebar-item-active {
    background-color: #E0F2FE !important;
    color: #0284C7 !important;
}

/* 表格表头单元格 */
.table-th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    background-color: rgba(249, 250, 251, 0.8);
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
}

/* 表格数据单元格 */
.table-td {
    padding: 1rem;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f9fafb;
    white-space: nowrap;
}

/* 顶部导航项 */
.nav-item {
    position: relative;
    transition: color 0.2s;
}
.nav-item.active {
    color: #3B82F6;
    font-weight: 500;
}
@media (min-width: 768px) {
    .nav-item.active::after {
        content: '';
        position: absolute;
        bottom: -14px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: #3B82F6;
    }
}

/* 隐藏滚动条但保持滚动 */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* select.form-input 保留原生外观 */
select.form-input {
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important;
    background-image: none !important;
    padding-right: 0.75rem !important;
}

/* 高级筛选折叠容器 */
.filter-collapse-wrap {
    overflow: hidden;
    transition: max-height 0.3s ease;
}
