/* ============================================================
   全站统一视觉 V2（2026-11-24）
   作用：所有 HTML 页面（含未继承 base.html 的公开页 / H5 / 锁屏页）
        统一字号、按钮、卡片、表格、表单、弹窗、标签与间距。
   约束：仅做视觉覆盖，不改任何页面业务逻辑；打印样式不受影响。
   ============================================================ */
@media screen {
    :root {
        --ui-primary: #2563eb;
        --ui-primary-dark: #1d4ed8;
        --ui-primary-soft: #eff6ff;
        --ui-success: #0f9f6e;
        --ui-warning: #d97706;
        --ui-danger: #dc2626;
        --ui-bg: #f3f6fb;
        --ui-text: #1f2937;
        --ui-heading: #0f172a;
        --ui-muted: #64748b;
        --ui-border: #e3e9f2;
        --ui-radius: 16px;
        --ui-shadow: 0 10px 30px rgba(15, 23, 42, .075);
        --ui-shadow-hover: 0 16px 38px rgba(37, 99, 235, .14);
    }

    body {
        font-size: 16px !important;
        line-height: 1.65;
        color: var(--ui-text);
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }

    h1, h2, h3, h4, h5, h6 {
        color: var(--ui-heading);
        font-weight: 700;
        letter-spacing: -.012em;
    }
    h1 { font-size: 2.15rem !important; }
    h2 { font-size: 1.92rem !important; }
    h3 { font-size: 1.62rem !important; }
    h4 { font-size: 1.4rem !important; }
    h5 { font-size: 1.2rem !important; }
    h6 { font-size: 1.08rem !important; }

    a { transition: color .16s ease, background-color .16s ease, border-color .16s ease; }
    a:focus-visible, button:focus-visible, .btn:focus-visible,
    .form-control:focus-visible, .form-select:focus-visible {
        outline: 3px solid rgba(37, 99, 235, .22);
        outline-offset: 2px;
    }
    ::selection { background: rgba(37, 99, 235, .18); }

    .text-muted, .text-secondary { color: var(--ui-muted) !important; }
    .small { font-size: 14.5px !important; }
    .fw-semibold { font-weight: 650 !important; }

    /* ---------- 后台框架 ---------- */
    .system-name {
        font-size: 20px !important;
        letter-spacing: .6px;
    }
    .top-header > div:last-child { font-size: 15px !important; }
    .logout-btn { font-size: 15px; }
    .menu-section {
        font-size: 13.5px !important;
        letter-spacing: 1.6px;
        color: #9fb0c7 !important;
    }
    .menu-parent {
        font-size: 16.5px !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
    .submenu li a {
        font-size: 15.5px !important;
        padding-top: 9px !important;
        padding-bottom: 9px !important;
        line-height: 1.35;
    }
    .breadcrumb-box {
        font-size: 15.5px !important;
        border-radius: 13px !important;
        padding: 15px 20px !important;
    }
    .breadcrumb {
        font-size: 15px;
        margin-bottom: 0;
    }
    .main-content { padding: 24px 28px 30px !important; }
    .footer-box { font-size: 14px !important; }

    /* 页面标题与右侧按钮组：标题不拆行，按钮自动换行并靠右排列 */
    .main-content .d-flex.justify-content-between > :is(h1, h2, h3, h4, h5, h6) {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .main-content .d-flex.justify-content-between > :is(h1, h2, h3, h4, h5, h6) + div {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
        min-width: 0;
        margin-left: 16px;
    }
    .main-content .d-flex.justify-content-between > :is(h1, h2, h3, h4, h5, h6) + div .ms-2 {
        margin-left: 0 !important;
    }

    /* ---------- 卡片 ---------- */
    .card {
        border: 1px solid var(--ui-border) !important;
        border-radius: var(--ui-radius) !important;
        box-shadow: var(--ui-shadow);
        background: #fff;
    }
    .card-header {
        padding: 16px 22px !important;
        font-size: 16.5px !important;
        font-weight: 700;
        background: #fff;
        border-bottom: 1px solid var(--ui-border) !important;
    }
    .card-body { padding: 22px !important; }
    .card-footer {
        padding: 15px 22px !important;
        background: #fbfcfe;
        border-top: 1px solid var(--ui-border) !important;
        font-size: 15px;
    }
    .card + .card { margin-top: 0; }

    /* ---------- 按钮 ---------- */
    .btn {
        min-height: 41px;
        padding: 8px 16px;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 650;
        line-height: 1.35;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    .btn-sm {
        min-height: 34px;
        padding: 6px 11px;
        border-radius: 8px;
        font-size: 14.5px;
    }
    .btn-lg {
        min-height: 50px;
        padding: 12px 24px;
        border-radius: 12px;
        font-size: 17px;
    }
    .btn-primary {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        border-color: #2563eb;
        box-shadow: 0 6px 16px rgba(37, 99, 235, .22);
    }
    .btn-primary:hover, .btn-primary:focus {
        background: linear-gradient(135deg, #1d4ed8, #1e40af);
        border-color: #1d4ed8;
        box-shadow: 0 8px 20px rgba(37, 99, 235, .28);
        transform: translateY(-1px);
    }
    .btn-success {
        background: linear-gradient(135deg, #10b981, #0f9f6e);
        border-color: #0f9f6e;
        box-shadow: 0 6px 16px rgba(15, 159, 110, .18);
    }
    .btn-success:hover, .btn-success:focus {
        background: linear-gradient(135deg, #0f9f6e, #0b7d57);
        border-color: #0b7d57;
        transform: translateY(-1px);
    }
    .btn-danger {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        border-color: #dc2626;
    }
    .btn-danger:hover, .btn-danger:focus {
        background: linear-gradient(135deg, #dc2626, #b91c1c);
        border-color: #b91c1c;
        transform: translateY(-1px);
    }
    .btn-warning {
        color: #7c3a00 !important;
        background: linear-gradient(135deg, #fbbf24, #f59e0b);
        border-color: #f59e0b;
    }
    .btn-warning:hover, .btn-warning:focus {
        color: #7c3a00 !important;
        background: linear-gradient(135deg, #f59e0b, #d97706);
        border-color: #d97706;
        transform: translateY(-1px);
    }
    .btn-outline-primary {
        color: #1d4ed8;
        border-color: #93c5fd;
        background: #fff;
    }
    .btn-outline-primary:hover, .btn-outline-primary:focus {
        color: #fff;
        background: #2563eb;
        border-color: #2563eb;
    }
    .btn-outline-secondary {
        color: #475569;
        border-color: #cbd5e1;
        background: #fff;
    }
    .btn-outline-secondary:hover, .btn-outline-secondary:focus {
        color: #0f172a;
        background: #f1f5f9;
        border-color: #94a3b8;
    }
    .btn-light {
        background: #fff;
        border-color: #e2e8f0;
        color: #1e293b;
    }
    .btn-group > .btn { border-radius: 0; }
    .btn-group > .btn:first-child { border-radius: 10px 0 0 10px; }
    .btn-group > .btn:last-child { border-radius: 0 10px 10px 0; }

    /* ---------- 表单 ---------- */
    .form-label, .form-check-label, .col-form-label {
        font-size: 15.5px;
        font-weight: 600;
        color: #334155;
        margin-bottom: 7px;
    }
    .form-control, .form-select {
        min-height: 46px;
        padding: 10px 14px;
        border-radius: 10px;
        border: 1px solid #d7dfeb;
        font-size: 16px;
        color: #1e293b;
        background-color: #fff;
        box-shadow: none;
    }
    .form-control::placeholder { color: #94a3b8; font-size: 15px; }
    .form-control:focus, .form-select:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    }
    .form-control-sm, .form-select-sm {
        min-height: 36px;
        padding: 5px 10px;
        font-size: 14.5px;
        border-radius: 8px;
    }
    .form-control-lg, .form-select-lg {
        min-height: 54px;
        font-size: 17px;
        border-radius: 12px;
    }
    textarea.form-control { min-height: 96px; line-height: 1.6; }
    .input-group-text {
        font-size: 15px;
        border-color: #d7dfeb;
        background: #f8fafc;
        color: #475569;
        border-radius: 10px;
    }
    .input-group > .form-control, .input-group > .form-select,
    .input-group > .input-group-text { border-radius: 10px; }
    .form-text { font-size: 14px; color: #64748b; }
    .form-check-input { width: 1.15rem; height: 1.15rem; margin-top: .22em; }
    .invalid-feedback, .valid-feedback { font-size: 14px; }

    /* ---------- 表格 ---------- */
    .table {
        font-size: 15.5px;
        color: #1f2937;
        margin-bottom: 0;
        vertical-align: middle;
    }
    .table > :not(caption) > * > * { padding: 12px 14px; }
    .table thead th {
        font-size: 15px;
        font-weight: 700;
        color: #475569;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0 !important;
        white-space: nowrap;
        vertical-align: middle;
    }
    .table tbody td { vertical-align: middle; border-color: #edf2f7; white-space: nowrap; }
    .table tbody tr:hover > * { background: #f8fbff; }
    .table-striped > tbody > tr:nth-of-type(odd) > * {
        background: #fbfdff;
    }
    .table-responsive { border-radius: 12px; }
    .table .btn-sm { min-height: 30px; padding: 4px 10px; font-size: 14px; }

    /* ---------- 徽章 / 提示 ---------- */
    .badge {
        font-size: 13.5px;
        font-weight: 650;
        padding: .42em .68em;
        border-radius: 8px;
        letter-spacing: .1px;
    }
    .alert {
        font-size: 15.5px;
        border-radius: 12px;
        border-width: 1px;
        padding: 14px 18px;
    }
    .alert .btn-close { padding: 1.15rem; }
    .flash-message .alert { box-shadow: 0 14px 34px rgba(15, 23, 42, .18); }

    /* ---------- 导航 / 标签页 / 分页 ---------- */
    .nav-tabs { border-bottom-color: #e2e8f0; }
    .nav-tabs .nav-link {
        font-size: 15.5px;
        font-weight: 600;
        color: #64748b;
        border-radius: 10px 10px 0 0;
        padding: 11px 18px;
    }
    .nav-tabs .nav-link:hover { color: #1d4ed8; background: #f8fafc; }
    .nav-tabs .nav-link.active {
        color: #1d4ed8;
        background: #fff;
        border-color: #e2e8f0 #e2e8f0 #fff;
    }
    .nav-pills .nav-link {
        font-size: 15.5px;
        font-weight: 600;
        border-radius: 9px;
        padding: 9px 16px;
    }
    .nav-pills .nav-link.active { background: #2563eb; }
    .pagination { font-size: 15px; gap: 4px; }
    .page-link {
        min-width: 38px;
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px !important;
        color: #475569;
        border-color: #e2e8f0;
        padding: 7px 12px;
    }
    .page-link:hover { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
    .page-item.active .page-link { background: #2563eb; border-color: #2563eb; }

    /* ---------- 弹窗 / 下拉 / 列表 ---------- */
    .modal-content { border: 0; border-radius: 18px; box-shadow: 0 28px 70px rgba(15, 23, 42, .28); }
    .modal-header { padding: 19px 24px; border-bottom-color: #e8edf5; }
    .modal-title { font-size: 20px; font-weight: 700; }
    .modal-body { padding: 22px 24px; font-size: 15.5px; }
    .modal-footer { padding: 15px 24px; border-top-color: #e8edf5; gap: 8px; }
    .dropdown-menu {
        font-size: 15.5px;
        border: 1px solid var(--ui-border);
        border-radius: 12px;
        box-shadow: 0 16px 40px rgba(15, 23, 42, .14);
        padding: 7px;
    }
    .dropdown-item { border-radius: 8px; padding: 9px 12px; }
    .dropdown-item:hover { background: #eff6ff; color: #1d4ed8; }
    .list-group { border-radius: 12px; }
    .list-group-item {
        font-size: 15.5px;
        padding: 13px 16px;
        border-color: #edf2f7;
    }
    .list-group-item.active { background: #2563eb; border-color: #2563eb; }
    .accordion { --bs-accordion-border-color: #e3e9f2; }
    .accordion-button { font-size: 15.5px; font-weight: 650; }
    .accordion-body { font-size: 15.5px; }
    .tooltip { font-size: 14px; }
    .popover { font-size: 15px; border-radius: 12px; }
    .offcanvas { font-size: 15.5px; }
    .progress { height: 10px; border-radius: 8px; }
    .progress-bar { border-radius: 8px; }

    /* ---------- 后台首页 ---------- */
    .dashboard-title { font-size: 31px !important; }
    .dashboard-sub { font-size: 15.5px !important; }
    .dashboard-kicker { font-size: 13.5px !important; }
    .hero-title { font-size: 27px !important; }
    .hero-sub { font-size: 15.5px !important; }
    .todo-title { font-size: 16px !important; }
    .todo-hint { font-size: 13.5px !important; }
    .todo-empty { font-size: 15.5px !important; }
    .todo-total small { font-size: 14px !important; }
    .quick-title { font-size: 16px !important; }
    .quick-hint { font-size: 13.5px !important; }
    .metric-label { font-size: 14px !important; }
    .metric-value { font-size: 33px !important; }
    .metric-foot { font-size: 13.5px !important; }
    .stat-mini .mini-label { font-size: 13.5px !important; }
    .stat-mini .mini-value { font-size: 29px !important; }
    .section-title { font-size: 20px !important; }
    .section-sub { font-size: 14.5px !important; }

    /* 财务对账六项指标：三列两行，避免字号放大后每张卡只剩两三个字一行 */
    .finance-summary-row {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
    .finance-summary-row > [class*="col-"] {
        width: auto !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    @media (max-width: 1100px) {
        .finance-summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 640px) {
        .finance-summary-row { grid-template-columns: 1fr; }
    }

    /* ---------- 登录 / 锁屏 / 独立入口页 ---------- */
    .login-card-head h3 { font-size: 29px !important; color: #fff !important; }
    .login-card-head p { font-size: 15.5px !important; color: #dbeafe !important; }
    .login-kicker { font-size: 14px !important; }
    .login-help-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: nowrap;
    }
    .login-help-row span {
        font-size: 14px !important;
        line-height: 1.45;
        color: #64748b;
        flex: 1 1 auto;
        min-width: 0;
    }
    .login-help-row .btn {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 14px !important;
        min-height: 34px;
        padding: 5px 9px;
    }
    .login-form-wrap .form-label { font-size: 16px; }
    .login-form-wrap .form-control { min-height: 50px; font-size: 16.5px; }
    .login-form-wrap .btn { min-height: 50px; font-size: 17px; }
    .lock-page .card,
    .security-page .card { border-radius: 16px !important; }
    .lock-page .card { width: 410px !important; padding: 34px 30px 26px !important; }
    .lock-page h2 { font-size: 26px !important; }
    .lock-page .sub { font-size: 15px !important; }
    .lock-page .who,
    .lock-page label { font-size: 15px !important; }
    .lock-page input[type=password] { height: 46px !important; font-size: 16px !important; border-radius: 9px !important; }
    .lock-page button { height: 46px !important; font-size: 16.5px !important; border-radius: 9px !important; }
    .lock-page .switch,
    .lock-page .tip { font-size: 14px !important; }
    .security-page .card { width: 420px !important; padding: 32px 30px !important; }
    .security-page h2 { font-size: 26px !important; }
    .security-page .sub { font-size: 15px !important; }
    .security-page .who,
    .security-page label { font-size: 15px !important; }
    .security-page input[type=password] { height: 46px !important; font-size: 16px !important; border-radius: 9px !important; }
    .security-page button { height: 46px !important; font-size: 16.5px !important; border-radius: 9px !important; }
    .security-page .tip,
    .security-page a.back { font-size: 14px !important; }

    .h5-page .page-header { padding: 18px 16px !important; }
    .h5-page { overflow-x: hidden; }
    .h5-page .form-card {
        width: calc(100% - 24px);
        margin: 12px auto !important;
        border-radius: 14px !important;
        padding: 18px !important;
        box-sizing: border-box;
    }
    .h5-page .form-label { font-size: 15.5px !important; }
    .h5-page .form-control,
    .h5-page .form-select { width: 100%; min-height: 48px; font-size: 16px; box-sizing: border-box; }
    .h5-page .btn { min-height: 48px; font-size: 16.5px; }
    .h5-page .price-total { font-size: 25px !important; }

    /* ---------- 公开渠道 / 试用页 ---------- */
    .public-page .card { border-radius: 16px !important; }
    .public-page .hero { border-radius: 20px !important; }
    .public-page .btn { min-height: 40px; }
    .public-page .price { font-size: 1.05em; }
    .trial-page .card { border-radius: 18px !important; }
    .trial-page h3, .trial-page h4 { margin-bottom: 12px; }
}
