/* ==================== 项目明细表头列筛选 ==================== */
.detail-table thead .thead-labels th {
    border-bottom: none;
    padding-bottom: 0.25rem;
    white-space: nowrap;
    font-size: 0.875rem;
}
.detail-table thead .thead-filters th {
    padding-top: 0;
    padding-bottom: 0.5rem;
    font-weight: normal;
    vertical-align: top;
    background-color: #f9fafb;
}
.detail-table .col-filter {
    font-size: 0.75rem;
    min-width: 3.5rem;
    padding: 0.2rem 0.35rem;
}
.detail-table .col-filter::placeholder {
    color: #9ca3af;
    font-size: 0.7rem;
}

/* ==================== 全局样式 ==================== */
body {
    background-color: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}

/* ==================== 登录页 ==================== */
.login-wrapper {
    /* 主题强调色（淡色系） */
    --la1: #6366f1;
    --la2: #8b5cf6;
    --la-glow: rgba(99, 102, 241, 0.25);
    --lt: #a5b4fc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 50%, #fef3f2 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* 登录宣传主题配色 - 淡色系 */
.login-theme-indigo { --la1: #6366f1; --la2: #8b5cf6; --la-glow: rgba(99,102,241,0.25); --lt: #a5b4fc; }
.login-theme-teal   { --la1: #14b8a6; --la2: #06b6d4; --la-glow: rgba(20,184,166,0.25); --lt: #5eead4; }
.login-theme-gold   { --la1: #f59e0b; --la2: #f97316; --la-glow: rgba(245,158,11,0.25); --lt: #fcd34d; }
.login-theme-neon   { --la1: #ec4899; --la2: #8b5cf6; --la-glow: rgba(236,72,153,0.25); --lt: #f9a8d4; }

.login-stage {
    width: 100%;
    max-width: 1120px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 48px;
}

/* ---------- 左侧品牌宣传区 ---------- */
.login-hero {
    color: #1e293b;
    padding: 10px 0;
    animation: heroFade 0.8s ease both;
}

@keyframes heroFade {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 999px;
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(6px);
    margin-bottom: 22px;
}

.login-hero-title {
    font-size: 2.9rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 18px;
    background: linear-gradient(90deg, #1e293b 0%, #334155 35%, var(--la1) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 30px var(--la-glow);
}

.login-hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #475569;
    margin-bottom: 26px;
}

.login-hero-subtitle b { color: #1e293b; }

.login-hero-features {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.login-hero-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    color: #334155;
    padding: 8px 0;
}

.login-hero-features li i {
    flex: 0 0 34px;
    height: 34px;
    width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--la1), var(--la2));
    box-shadow: 0 6px 16px var(--la-glow);
}

.login-hero-stats {
    display: flex;
    gap: 14px;
}

.login-hero-stats > div {
    flex: 1;
    text-align: center;
    padding: 14px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(8px);
}

.login-hero-stats span {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
}

.login-hero-stats small { color: #64748b; }

/* ---------- 右侧登录卡片 ---------- */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 42px 40px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.1);
    animation: heroFade 0.9s ease both;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    background: linear-gradient(135deg, var(--la1) 0%, var(--la2) 100%);
    box-shadow: 0 12px 28px var(--la-glow);
}

.login-card .form-label {
    font-weight: 600;
    color: #374151;
}

.login-card .input-group-text {
    background: #f9fafb;
    border-right: none;
    color: #9ca3af;
}

.login-card .form-control {
    border-left: none;
    padding: 11px 12px;
}

.login-card .form-control:focus {
    border-color: var(--la1);
    box-shadow: 0 0 0 0.2rem var(--la-glow);
}

.login-card .input-group:focus-within .input-group-text {
    border-color: var(--la1);
}

.login-card .btn-primary {
    background: linear-gradient(135deg, var(--la1) 0%, var(--la2) 100%);
    border: none;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--la-glow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--la-glow);
    filter: brightness(1.05);
}

.login-tip {
    line-height: 1.7;
    border-top: 1px dashed #e5e7eb;
    padding-top: 14px;
}

/* ---------- 登录页响应式 ---------- */
@media (max-width: 991px) {
    .login-stage {
        grid-template-columns: 1fr;
        max-width: 460px;
        gap: 30px;
    }
    .login-hero {
        text-align: center;
    }
    .login-hero-features {
        display: inline-block;
        text-align: left;
    }
    .login-hero-title { font-size: 2.2rem; }
}

/* ==================== 导航栏 ==================== */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-link.active {
    font-weight: 600;
}

/* ==================== 统计卡片 ==================== */
.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.12);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-blue {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4338ca;
}

.stat-blue .text-muted { color: #6366f1 !important; }
.stat-blue .stat-icon { color: #6366f1; }

.stat-green {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    color: #0d9488;
}

.stat-green .text-muted { color: #14b8a6 !important; }
.stat-green .stat-icon { color: #14b8a6; }

.stat-orange {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #d97706;
}

.stat-orange .text-muted { color: #f59e0b !important; }
.stat-orange .stat-icon { color: #f59e0b; }

.stat-purple {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    color: #7c3aed;
}

.stat-purple .text-muted { color: #8b5cf6 !important; }
.stat-purple .stat-icon { color: #8b5cf6; }

/* ==================== 项目卡片 ==================== */
.project-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* ==================== 表格 ==================== */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
}

/* 充值审核：操作列固定在右侧，避免被宽表挤出可视区 */
.recharge-review-table {
    overflow-x: auto;
}
.recharge-review-table .table-op-col {
    position: sticky;
    right: 0;
    z-index: 2;
    min-width: 150px;
    white-space: nowrap;
    background: #fff;
    box-shadow: -6px 0 8px -4px rgba(99, 102, 241, 0.08);
}
.recharge-review-table thead .table-op-col {
    background: #f9fafb;
    z-index: 3;
}
.recharge-review-table tbody tr:hover .table-op-col {
    background: #f9fafb;
}

/* ==================== Tab 样式 ==================== */
.nav-tabs .nav-link {
    color: #6b7280;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: #6366f1;
    font-weight: 600;
}

/* ==================== 卡片 ==================== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.06);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    border-radius: 12px 12px 0 0 !important;
}

/* ==================== 按钮 ==================== */
.btn {
    border-radius: 8px;
    font-weight: 500;
}

.btn-primary {
    background-color: #6366f1;
    border-color: #6366f1;
}

.btn-primary:hover {
    background-color: #4f46e5;
    border-color: #4f46e5;
}

/* ==================== Alert ==================== */
.alert {
    border-radius: 10px;
    border: none;
}

/* ==================== Badge ==================== */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .stat-card h3 {
        font-size: 1.3rem;
    }

    .login-card {
        margin: 20px;
        padding: 30px;
    }
}

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f9fafb;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ==================== 顶部导航：防菜单挤压 ==================== */
/* 菜单项增多后 Bootstrap 会把 .nav-link 压到极窄，中文被拆成一字一行（竖排）。
   改为「文字不折行 + 整项换行」，窄屏最多两行而不是竖向叠字。 */
@media (min-width: 992px) {
    .navbar-nav {
        flex-wrap: wrap;
    }
    .navbar-nav .nav-item {
        flex-shrink: 0;
    }
    .navbar-nav .nav-link {
        white-space: nowrap;
    }
}

@media (min-width: 992px) and (max-width: 1600px) {
    .navbar .navbar-brand {
        font-size: 1rem;
    }
    .navbar-nav .nav-link {
        padding-left: .55rem;
        padding-right: .55rem;
        font-size: .9rem;
    }
}

/* 计税工具条的「年份」选择器：避免 flex 压缩后中文被拆成竖排。
   特异性高于页面内联的 .th-year-pick，无需改模板即可生效。 */
.th-toolbar .th-year-pick { flex-shrink: 0; }
.th-toolbar .th-year-pick label,
.th-toolbar .th-year-count { white-space: nowrap; }

/* ==================== 全站数据表：表头吸顶 ==================== */
/* 配合 static/js/table-sticky.js 使用。脚本会给「该吸顶的落点」加 .ts-sticky：
   - 裸表格（没有 .table-responsive 包裹）→ 加在 table 上；
   - 用 .table-responsive 包裹且表格放得下 → 加在容器上，同时放开 overflow
     （sticky 会被祖先 overflow 截断，不放开就粘不住）。
   宽表保留横向滚动、不吸顶，避免撑破卡片。
   背景色由脚本按单元格实际计算值写进 --ts-bg，防止透明后数据透上来。 */
.ts-sticky {
    overflow: visible;
}

.ts-sticky > thead > tr > th,
.ts-sticky > table > thead > tr > th {
    position: sticky;
    top: var(--ts-top, 0px);
    z-index: 3;
    background-color: var(--ts-bg, #f8f9fa);
    background-clip: padding-box;
    /* border-collapse: collapse 时 th 的下边框会随内容滚走，用内阴影补一条 */
    box-shadow: inset 0 -1px 0 #cfd4da;
}
