/* ==========================================================================
   蓝白主题（参考 DigiBank 银行 App 稿）
   只在 .env 的 FRONT_THEME=blue 时由 app/layout/theme.blade.php 加载，排在 theme-gold.css 后面。
   各页写死的颜色已被 ops/theme_tokenize.py 包成 var(--t-xxx, 原值)，这里给 --t-* 赋值即可整站换色；
   个别包不到的地方（被属性选择器盯着的内联样式、Blade 表达式里的颜色）在文件后半段单独覆盖。
   ========================================================================== */

:root {
    /* 底与面 */
    --t-bg: #F5F6FB;
    --t-card: #FFFFFF;
    --t-card2: #F3F4FA;
    --t-line: #E8EAF2;

    /* 文字 */
    --t-text: #1E1E2D;
    --t-title: #1E1E2D;
    --t-text2: #87859A;
    --t-text3: #A3A4B5;

    /* 主色 */
    --t-primary: #4044FC;
    --t-primary-dark: #3B37DE;
    --t-primary-soft: #E6E9FF;
    --t-on-primary: #FFFFFF;

    /* 主色渐变三段、渐变里的浅色段 / 深色段 */
    --t-g1: #5C60FF;
    --t-g2: #4044FC;
    --t-g3: #3B37DE;
    --t-ga0: rgba(64, 68, 252, 0);
    --t-ga1: rgba(64, 68, 252, .05);
    --t-ga2: rgba(64, 68, 252, .12);
    --t-gbg: #F5F6FB;
    --t-gcard: #FFFFFF;

    /* 主色的浅底（由浅到深）与描边 */
    --t-pa1: #F1F2FF;
    --t-pa2: #E6E9FF;
    --t-pa3: rgba(64, 68, 252, .22);
    --t-pa4: rgba(64, 68, 252, .5);
    --t-pl1: #DADDFF;
    --t-pl2: #AEB2FF;

    /* 阴影与光晕：白底上要轻 */
    --t-sh0: rgba(40, 44, 120, .04);
    --t-sh1: rgba(40, 44, 120, .07);
    --t-sh2: rgba(40, 44, 120, .10);
    --t-glow1: rgba(64, 68, 252, .10);
    --t-glow2: rgba(64, 68, 252, .20);
    --t-inset: rgba(255, 255, 255, 0);
}

/* 旧的全局变量（各页 <html style="--primary:..."> 与 theme-gold.css 的 :root）一并改成蓝白 */
:root,
html[style*="--bg"],
html[style*="--primary"] {
    --primary: #4044FC !important;
    --primary-rgb: 64, 68, 252 !important;
    --primary-light: #E6E9FF !important;
    --primary-dark: #3B37DE !important;
    --primary-gradient: linear-gradient(135deg, #5C60FF 0%, #4044FC 45%, #3B37DE 100%) !important;
    --btn-bg: linear-gradient(135deg, #5C60FF 0%, #4044FC 50%, #3B37DE 100%) !important;
    --bg: #F5F6FB !important;
    --bg-tab: #FFFFFF !important;
    --bg-tabbar: #FFFFFF !important;
    --bg-card: #FFFFFF !important;
    --bg-input: #F3F4FA !important;
    --bg-elevated: #FFFFFF !important;
    --border: #E8EAF2 !important;
    --border-gold: #DADDFF !important;
    --text: #1E1E2D !important;
    --text-sub: #87859A !important;
    --text-muted: #A3A4B5 !important;
    --text-gray: #87859A !important;
    --btn-text: #FFFFFF !important;
}

html, body {
    background: #F5F6FB !important;
    color: #1E1E2D;
}

/* ---------- 包不到的地方：SVG 属性里的金色（stroke="" / fill="" 不是 CSS，var() 用不了）---------- */
svg[stroke="#D4AF37" i], svg [stroke="#D4AF37" i], svg [stroke="#F4E4BC" i], svg[stroke="#F4E4BC" i],
svg [stroke="#FFD966" i], svg [stroke="#8B6914" i], svg [stroke="#E8B341" i], svg[stroke="#E8B341" i],
svg [stroke="#B8860B" i] { stroke: var(--t-primary); }
svg[fill="#D4AF37" i], svg [fill="#D4AF37" i], svg [fill="#F4E4BC" i], svg [fill="#FFD966" i],
svg [fill="#8B6914" i] { fill: var(--t-primary); }
svg [stop-color="#F4E4BC" i] { stop-color: var(--t-g1); }
svg [stop-color="#D4AF37" i], svg [stop-color="#FFD966" i] { stop-color: var(--t-g2); }
svg [stop-color="#8B6914" i] { stop-color: var(--t-g3); }

/* ---------- 包不到的地方：被 theme-gold.css 的属性选择器盯着、没有改动的内联金色渐变按钮 ---------- */
[style*="linear-gradient(135deg,#F4E4BC"],
[style*="linear-gradient(135deg, #F4E4BC"] {
    background: linear-gradient(135deg, var(--t-g1), var(--t-g2), var(--t-g3)) !important;
    color: var(--t-on-primary) !important;
    border-color: transparent !important;
}
a[style*="linear-gradient(135deg,#F4E4BC"] svg,
button[style*="linear-gradient(135deg,#F4E4BC"] svg,
div[style*="linear-gradient(135deg,#F4E4BC,#D4AF37,#8B6914)"] + svg {
    stroke: var(--t-on-primary) !important;
    color: var(--t-on-primary) !important;
}

/* ---------- 逐处补丁（包不到、又不值得动模板的）---------- */
:root { --t-income: #16A870; }                          /* 流水里的进账金额：黑金是亮黄，白底上改绿 */
#popup-notice-header svg { fill: var(--t-on-primary); }  /* 首页公告弹窗标题图标 */

/* 浅色页头统一蓝底白字；深色禁用本样式表，继续使用原黑金配色。
   仅在页头内覆盖文字变量，正文和底部悬浮导航继续使用浅色主题。 */
html[data-front-theme="light"] :is(.top-nav, .page-nav, .catalog-nav, .hub-nav,
    .overview-nav, .top-header, .top-bar, .p-header, .page-header, .header-with-logo,
    .welcome-nav, .nav-bar-wrap, .navigation, .logo-area, header) {
    --t-text: #FFFFFF;
    --t-title: #FFFFFF;
    --t-text2: #E6E9FF;
    --t-text3: #E6E9FF;
    --t-primary: #FFFFFF;
    --t-line: rgba(255, 255, 255, .22);
    --t-pa1: rgba(255, 255, 255, .12);
    --t-pa2: rgba(255, 255, 255, .14);
    --t-pl1: rgba(255, 255, 255, .35);
    --t-pl2: rgba(255, 255, 255, .6);
    --primary: #FFFFFF;
    --text: #FFFFFF;
    --text-sub: #E6E9FF;
    background: #4044FC !important;
    color: #FFFFFF !important;
    border-bottom-color: var(--t-line) !important;
}

/* 旧版 header 内另有背景层，需一并覆盖，避免蓝底被白色导航盖住。 */
html[data-front-theme="light"] header :is(.header, .van-nav-bar),
html[data-front-theme="light"] .nav-bar-wrap :is(.nav-bar, .nav-bar-content),
html[data-front-theme="light"] .navigation .navigation-content,
html[data-front-theme="light"] .top-header .date-bar {
    background: #4044FC !important;
    border-bottom-color: rgba(255, 255, 255, .22) !important;
}

html[data-front-theme="light"] :is(.top-nav, .page-nav, .catalog-nav, .hub-nav,
    .overview-nav, .top-bar, .header-with-logo, .welcome-nav, .nav-bar-wrap, .navigation, header)
    :is(a, button, .title, .nav-title, .nav-action, .nav-back, .van-nav-bar__title, .van-icon) {
    color: #FFFFFF !important;
}

html[data-front-theme="light"] .p-header .pdac-brand {
    -webkit-text-fill-color: #FFFFFF;
}
