/* ============================================================
   BugTracker · LayUI 风格主题
   通过覆盖 Bootstrap 5 变量/类实现，不改动任何页面标记。
   经典 LayUI 观感：主色 #009688、扁平 2px 圆角、灰边表格、
   深灰导航 #393D49、扁平分页、素雅留白。
   ============================================================ */

:root {
    --layui-primary: #009688;
    --layui-primary-hover: #5FB878;   /* layui 绿 hover */
    --layui-dark: #393D49;            /* layui 经典深灰 */
    --layui-danger: #FF5722;
    --layui-warm: #FFB800;
    --layui-border: #d2d2d2;
    --layui-bg: #f2f2f2;
    /* 主色统一：text-primary/bg-primary-subtle/nav-pills.active 等全部跟随 layui 绿，避免蓝绿混杂 */
    --bs-primary: #009688;
    --bs-primary-rgb: 0, 150, 136;
    --bs-primary-bg-subtle: #d5efec;
    --bs-primary-border-subtle: #a6dfd8;
    --bs-primary-text-emphasis: #05655c;
}

html[data-bs-theme="dark"] {
    --bs-primary-bg-subtle: #10312e;
    --bs-primary-border-subtle: #1d4a45;
    --bs-primary-text-emphasis: #7dcec4;
}

body {
    background-color: var(--layui-bg);
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    font-size: 14px;
    color: #333;
}

/* ---------- 导航栏：layui 经典深灰 ---------- */
.navbar.bg-dark,
.navbar-dark {
    --bs-navbar-bg: var(--layui-dark);
    background-color: var(--layui-dark) !important;
    border-bottom: none;
}
.navbar .navbar-brand { color: #fff; font-size: 17px; letter-spacing: 1px; }
.navbar .nav-link { color: rgba(255,255,255,.75); font-size: 14px; padding-left: .9rem; padding-right: .9rem; }
.navbar .nav-link:hover,
.navbar .nav-link.active { color: #fff; background-color: rgba(255,255,255,.06); border-radius: 2px; }
.navbar .dropdown-menu { border-radius: 2px; border-color: #e6e6e6; box-shadow: 0 2px 8px rgba(0,0,0,.12); font-size: 14px; }
.navbar .dropdown-item:hover { background-color: #f2f2f2; color: var(--layui-primary); }

/* ---------- 按钮：扁平、2px 圆角、layui 色系 ---------- */
.btn { border-radius: 2px; font-size: 14px; padding: .375rem .8rem; transition: all .15s; }
.btn-sm { padding: .2rem .6rem; font-size: 12.5px; }
.btn:focus { box-shadow: none; }

.btn-primary {
    --bs-btn-bg: var(--layui-primary);
    --bs-btn-border-color: var(--layui-primary);
    --bs-btn-hover-bg: var(--layui-primary-hover);
    --bs-btn-hover-border-color: var(--layui-primary-hover);
    --bs-btn-active-bg: #00877a;
    --bs-btn-active-border-color: #00877a;
    --bs-btn-disabled-bg: var(--layui-primary);
    --bs-btn-disabled-border-color: var(--layui-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--layui-primary);
    --bs-btn-border-color: var(--layui-primary);
    --bs-btn-hover-bg: var(--layui-primary);
    --bs-btn-hover-border-color: var(--layui-primary);
    --bs-btn-active-bg: var(--layui-primary);
    --bs-btn-active-border-color: var(--layui-primary);
}
.btn-danger {
    --bs-btn-bg: var(--layui-danger);
    --bs-btn-border-color: var(--layui-danger);
    --bs-btn-hover-bg: #ff6d3d;
    --bs-btn-hover-border-color: #ff6d3d;
}
.btn-outline-danger {
    --bs-btn-color: var(--layui-danger);
    --bs-btn-border-color: var(--layui-danger);
    --bs-btn-hover-bg: var(--layui-danger);
    --bs-btn-hover-border-color: var(--layui-danger);
    --bs-btn-active-bg: var(--layui-danger);
}
.btn-warning {
    --bs-btn-color: #333;
    --bs-btn-bg: var(--layui-warm);
    --bs-btn-border-color: var(--layui-warm);
    --bs-btn-hover-bg: #ffc42e;
    --bs-btn-hover-border-color: #ffc42e;
    --bs-btn-active-color: #333;
}
.btn-outline-warning {
    --bs-btn-color: #c98d00;
    --bs-btn-border-color: var(--layui-warm);
    --bs-btn-hover-color: #333;
    --bs-btn-hover-bg: var(--layui-warm);
    --bs-btn-hover-border-color: var(--layui-warm);
}
.btn-secondary {
    --bs-btn-bg: #8d8d8d;
    --bs-btn-border-color: #8d8d8d;
    --bs-btn-hover-bg: #a0a0a0;
    --bs-btn-hover-border-color: #a0a0a0;
}
.btn-outline-secondary {
    --bs-btn-color: #666;
    --bs-btn-border-color: var(--layui-border);
    --bs-btn-hover-bg: #eee;
    --bs-btn-hover-border-color: var(--layui-border);
    --bs-btn-hover-color: #333;
}
.btn-success {
    --bs-btn-bg: var(--layui-primary-hover);
    --bs-btn-border-color: var(--layui-primary-hover);
    --bs-btn-hover-bg: #6fc38a;
    --bs-btn-hover-border-color: #6fc38a;
}
.btn-info {
    --bs-btn-color: #fff;
    --bs-btn-bg: #1E9FFF;
    --bs-btn-border-color: #1E9FFF;
    --bs-btn-hover-bg: #4ab1ff;
    --bs-btn-hover-border-color: #4ab1ff;
}

/* ---------- 表单控件：细边框、2px 圆角、聚焦主色 ---------- */
.form-control, .form-select {
    border-radius: 2px;
    border-color: var(--layui-border);
    font-size: 14px;
    box-shadow: none;
}
.form-control:focus, .form-select:focus {
    border-color: var(--layui-primary);
    box-shadow: 0 0 0 3px rgba(0,150,136,.12);
}
.form-label { font-size: 13.5px; color: #555; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--layui-primary); border-color: var(--layui-primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(0,150,136,.12); border-color: var(--layui-primary); }
.input-group-text { border-radius: 2px; background-color: #fafafa; }

/* ---------- 表格：layui 经典灰边 + 表头浅灰 ---------- */
.table {
    --bs-table-hover-bg: #f8f8f8;
    margin-bottom: 0;
}
.table > thead > tr > th {
    background-color: #f2f2f2;
    color: #555;
    font-weight: 500;
    border-bottom: 1px solid #e6e6e6;
    white-space: nowrap;
    padding: .65rem .75rem;
}
.table > tbody > tr > td { padding: .6rem .75rem; color: #444; vertical-align: middle; }
.table-bordered { border-color: #e6e6e6; }
.table-bordered > :not(caption) > * > * { border-color: #e6e6e6; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-striped-bg: #fafafa; }

/* ---------- 卡片：layui-card 观感 ---------- */
.card {
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e6e6e6;
    font-weight: 500;
    color: #333;
    padding: .7rem 1rem;
}
.card-body { padding: 1rem; }

/* ---------- 徽章 ---------- */
.badge { border-radius: 2px; font-weight: 400; font-size: 12px; padding: .25em .5em; }
.bg-primary { background-color: var(--layui-primary) !important; }
.bg-success { background-color: var(--layui-primary-hover) !important; }
.bg-danger  { background-color: var(--layui-danger) !important; }
.bg-warning { background-color: var(--layui-warm) !important; color: #333 !important; }
.bg-info    { background-color: #1E9FFF !important; }
.bg-secondary { background-color: #8d8d8d !important; }
.text-primary { color: var(--layui-primary) !important; }

/* ---------- 分页：layui-laypage 扁平方块风 ---------- */
.pagination { margin-bottom: 0; }
.page-link {
    border-radius: 0 !important;
    border-color: var(--layui-border);
    color: #333;
    font-size: 13.5px;
    padding: .35rem .7rem;
    margin-right: 4px;
    background-color: #fff;
}
.page-item:first-child .page-link,
.page-item:last-child .page-link { border-radius: 0 !important; }
.page-link:hover { background-color: #f2f2f2; color: var(--layui-primary); border-color: var(--layui-border); }
.page-item.active .page-link {
    background-color: var(--layui-primary);
    border-color: var(--layui-primary);
    color: #fff;
}
.page-item.disabled .page-link { background-color: #fafafa; color: #bbb; }

/* ---------- 提示条：layui 左侧竖线风 ---------- */
.alert { border-radius: 2px; border: none; border-left: 4px solid transparent; font-size: 14px; }
.alert-danger  { background: #fff1f0; border-left-color: var(--layui-danger); color: #c0392b; }
.alert-success { background: #f0f9eb; border-left-color: var(--layui-primary-hover); color: #3a7d52; }
.alert-warning { background: #fff8e6; border-left-color: var(--layui-warm); color: #9c7c1e; }
.alert-info    { background: #eaf6ff; border-left-color: #1E9FFF; color: #2b6da8; }

/* ---------- 进度条 ---------- */
.progress { border-radius: 0; background-color: #eee; height: 14px; }
.progress-bar { border-radius: 0; }

/* ---------- 下拉/模态 ---------- */
.modal-content { border-radius: 2px; border: none; }
.modal-header { border-bottom-color: #e6e6e6; }
.modal-footer { border-top-color: #e6e6e6; }
.dropdown-menu { border-radius: 2px; font-size: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.dropdown-item:hover { background-color: #f2f2f2; }

/* ---------- 链接与标题 ---------- */
a { color: var(--layui-primary); text-decoration: none; }
a:hover { color: var(--layui-primary-hover); }
h1, h2, h3, h4, h5, h6 { font-weight: 500; }
.text-secondary { color: #8d8d8d !important; }

/* ---------- 页脚 ---------- */
.layui-footer {
    padding: 12px 0;
    text-align: center;
    color: #8d8d8d;
    font-size: 13px;
    border-top: 1px solid #e6e6e6;
    background-color: #fff;
}

/* ---------- 看板列微调 ---------- */
.kanban-col .card { border-top: 3px solid var(--layui-primary); }

/* ============================================================
   暗色主题（增强76）：html[data-bs-theme="dark"] 时覆盖上方硬编码浅色
   ============================================================ */
html[data-bs-theme="dark"] body { background-color: #141619; color: #d6d8db; }
html[data-bs-theme="dark"] .form-label { color: #b8bcc2; }
html[data-bs-theme="dark"] .text-secondary { color: #8d9198 !important; }
html[data-bs-theme="dark"] .card { border-color: #2a2e33; box-shadow: 0 1px 2px rgba(0,0,0,.4); background-color: #1b1e21; }
html[data-bs-theme="dark"] .card-header { background-color: #22262b; border-bottom-color: #2a2e33; color: #e6e8eb; }
html[data-bs-theme="dark"] .table { --bs-table-hover-bg: #22262b; }
html[data-bs-theme="dark"] .table > thead > tr > th { background-color: #22262b; color: #b8bcc2; border-bottom-color: #2a2e33; }
html[data-bs-theme="dark"] .table > tbody > tr > td { color: #cfd2d6; }
html[data-bs-theme="dark"] .table-bordered { border-color: #2a2e33; }
html[data-bs-theme="dark"] .table-bordered > :not(caption) > * > * { border-color: #2a2e33; }
html[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-striped-bg: #1d2125; }
html[data-bs-theme="dark"] .page-link { background-color: #1b1e21; border-color: #2a2e33; color: #cfd2d6; }
html[data-bs-theme="dark"] .page-link:hover { background-color: #22262b; color: #5FB878; border-color: #2a2e33; }
html[data-bs-theme="dark"] .page-item.disabled .page-link { background-color: #17191c; color: #55585d; }
html[data-bs-theme="dark"] .alert-danger  { background: #3a1d18; color: #f1948a; }
html[data-bs-theme="dark"] .alert-success { background: #16301f; color: #7dcea0; }
html[data-bs-theme="dark"] .alert-warning { background: #38290d; color: #e2c258; }
html[data-bs-theme="dark"] .alert-info    { background: #14283a; color: #7fb3dd; }
html[data-bs-theme="dark"] .input-group-text { background-color: #22262b; border-color: #3a3f45; color: #cfd2d6; }
html[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #b8bcc2; --bs-btn-border-color: #3a3f45;
    --bs-btn-hover-bg: #22262b; --bs-btn-hover-border-color: #3a3f45; --bs-btn-hover-color: #e6e8eb;
}
html[data-bs-theme="dark"] .modal-content { background-color: #1b1e21; }
html[data-bs-theme="dark"] .modal-header, html[data-bs-theme="dark"] .modal-footer { border-color: #2a2e33; }
html[data-bs-theme="dark"] .dropdown-item:hover { background-color: #22262b; }
html[data-bs-theme="dark"] .dropdown-menu { background-color: #1b1e21; border-color: #2a2e33; }
html[data-bs-theme="dark"] .progress { background-color: #22262b; }
html[data-bs-theme="dark"] .layui-footer { background-color: #1b1e21; border-top-color: #2a2e33; }
html[data-bs-theme="dark"] .bg-warning { color: #222 !important; }
html[data-bs-theme="dark"] .nav-link.text-body,
html[data-bs-theme="dark"] a.text-body { color: #d6d8db !important; }

/* ---------- 暗色补充：表单控件 / 通知 / 日历（样式反馈修复） ---------- */
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
    background-color: #1b1e21;
    border-color: #3a3f45;
    color: #d6d8db;
}
html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus { background-color: #1b1e21; color: #e6e8eb; }
html[data-bs-theme="dark"] .form-control::placeholder { color: #6c7178; }
/* form-select 下拉箭头反白（Bootstrap 5.3 变量，双保险直接覆盖 background-image） */
html[data-bs-theme="dark"] .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-image: var(--bs-form-select-bg-img);
}
html[data-bs-theme="dark"] .btn-light {
    --bs-btn-bg: #22262b; --bs-btn-border-color: #2a2e33; --bs-btn-color: #d6d8db;
    --bs-btn-hover-bg: #2a2e33; --bs-btn-hover-border-color: #3a3f45; --bs-btn-hover-color: #e6e8eb;
    --bs-btn-active-bg: #2a2e33; --bs-btn-active-color: #e6e8eb;
}
html[data-bs-theme="dark"] .bg-white { background-color: #1b1e21 !important; }
html[data-bs-theme="dark"] .text-dark { color: #e6e8eb !important; }
html[data-bs-theme="dark"] .nav-pills { --bs-nav-pills-border-radius: 2px; }
html[data-bs-theme="dark"] .nav-pills .nav-link { color: #cfd2d6; }
html[data-bs-theme="dark"] .nav-pills .nav-link:hover { color: #e6e8eb; }
html[data-bs-theme="dark"] .nav-pills .nav-link.active { background-color: var(--layui-primary); color: #fff; }
html[data-bs-theme="dark"] .list-group-item { background-color: #1b1e21; border-color: #2a2e33; }
html[data-bs-theme="dark"] .bg-primary-subtle { background-color: #10312e !important; }
html[data-bs-theme="dark"] .bg-light-subtle { background-color: #17191c !important; }
html[data-bs-theme="dark"] .btn-link { color: var(--layui-primary-hover); }
html[data-bs-theme="dark"] .badge.bg-primary { color: #fff; }
