/* =========================================
   1. 全局基础重置
   ========================================= */
:root {
    --fumin-blue: #004ea2;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

a { text-decoration: none; color: inherit; }
input, button, textarea { font-family: inherit; }

.content {
    padding: 20px;
    padding-top: 60px;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================
   2. 首页 (Index) 头部样式
   ========================================= */
.dashboard-container {
    max-width: 600px;
    margin: 0 auto;
    min-height:100vh;
    background: #f8f9fa;
}

/* 首页头部：流动渐变 */
.dashboard-container .nav-header {
    background: linear-gradient(135deg, #0056b3 0%, #003e82 100%);
    color: #fff;
    padding: 40px 25px 45px 25px;
    margin-bottom:10px;
    position: relative;
    z-index: 10;
    border-radius: 0 0 50% 50% / 0 0 25px 25px;
    box-shadow: 0 10px 20px rgba(0, 62, 130, 0.2);
}

.header-main-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.user-info-group {
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.welcome-label { font-size: 15px; opacity: 0.95; font-weight: normal; }
.user-name { font-size: 22px; font-weight: 900; text-shadow: 0 2px 4px rgba(0,0,0,0.1); letter-spacing: 0.5px; }

.weather-float {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: floatIcon 3s ease-in-out infinite;
    margin-left: 5px; position: relative; top: 3px;
}

.sub-slogan {
    margin-top: 15px; font-size: 13px; opacity: 0.9; font-weight: 500;
    display: flex; align-items: center; gap: 6px;
}

.logout-btn {
    font-size: 13px; opacity: 0.8; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 4px 12px; border-radius: 15px;
    transition: 0.2s; background: rgba(0,0,0,0.1);
}
.logout-btn:active { background: rgba(0,0,0,0.2); transform: scale(0.95); }

/* =========================================
   3. 动画定义
   ========================================= */
@keyframes floatIcon {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes avatarPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 62, 130, 0.3); }
    70% { box-shadow: 0 0 0 8px rgba(0, 62, 130, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 62, 130, 0); }
}

/* =========================================
   4. 工具卡片与网格
   ========================================= */
.section-title {
    font-size: 17px; font-weight: 900; color: #333;
    margin: 25px 20px 15px 20px; padding-left: 12px;
    border-left: 5px solid #0056b3;
    display: flex; align-items: center;
}

.grid-box {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 15px; padding: 0 20px 20px 20px;
}

.tool-card {
    background: #fff; border-radius: 16px; padding: 20px 5px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.01);
    transition: all 0.2s;
}
.tool-card:active { transform: scale(0.96); background: #f0f7ff; }
.tool-icon { font-size: 32px; margin-bottom: 10px; }
.tool-name { font-size: 13px; font-weight: bold; color: #555; }

/* =========================================
   5. 子页面悬浮导航
   ========================================= */
body > .nav-header {
    background: transparent !important; box-shadow: none !important;
    margin: 0 !important; padding: 0 !important; height: 0 !important;
    position: fixed; top: 0; left: 0; width: 100%; z-index: 999;
    pointer-events: none;
}
body > .nav-header .header-title,
body > .nav-header > div:not(a) { display: none !important; }

body > .nav-header a {
    pointer-events: auto !important; position: fixed !important;
    top: 15px; right: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #333 !important; font-size: 13px; font-weight: bold;
    text-decoration: none; padding: 8px 18px; border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    border: 1px solid rgba(0,0,0,0.05); backdrop-filter: blur(8px);
    z-index: 1000;
}
body > .nav-header a::after { content: "返回"; margin-left: 4px; }
body > .nav-header a:active { transform: scale(0.95); background: #fff !important; }

/* =========================================
   6. 按钮样式 (纯富民蓝)
   ========================================= */
button, .btn-login, .btn-calc, .btn-main, .btn-action, .btn-start, .portal-btn, .submit-btn {
    background: linear-gradient(180deg, #0056b3 0%, #003e82 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: bold !important;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 62, 130, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
button:active, .btn-login:active { 
    transform: scale(0.97); 
    background: linear-gradient(180deg, #003e82 0%, #003e82 100%) !important;
}

.btn-sub, .btn-reset {
    background: #e4e6e9 !important;
    color: #666 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
/* =========================================
   7. 全局悬浮返回按钮 (大尺寸悬浮球版)
   ========================================= */

/* 给页面底部留出更多空间，防止按钮挡住底部文字 */
body.with-global-nav {
    padding-bottom: 100px !important; 
}

/* 悬浮球核心样式 */
.global-back-btn {
    position: fixed;
    bottom: 50px; /* 稍微提告一点，避免误触底部横条 */
    right: 25px;  /* 距离右侧的距离 */
    z-index: 9999;
    
    /* 增大尺寸：标准悬浮球尺寸 */
    width: 56px;
    height: 56px;
    
    /* 弹性布局：保证图标绝对居中 */
    display: flex; 
    align-items: center; 
    justify-content: center;
    
    /* 颜色：使用更鲜艳的富民蓝渐变，增加立体感 */
    background: linear-gradient(135deg, #0069d9, #003e82);
    color: #ffffff;
    border-radius: 50%;
    
    /* 字体加大 */
    font-size: 28px; 
    line-height: 1;
    font-weight: bold;
    text-decoration: none;
    
    /* 强阴影：营造“浮起来”的感觉 */
    box-shadow: 0 6px 20px rgba(0, 62, 130, 0.4);
    
    /* 点击时的动画 */
    transition: transform 0.1s, box-shadow 0.1s;
    opacity: 1;
}

/* 适配 iPhone 底部安全区 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .global-back-btn {
        bottom: calc(50px + env(safe-area-inset-bottom));
    }
}

/* 按下效果：缩小并减淡阴影 */
.global-back-btn:active {
    transform: scale(0.9);
    box-shadow: 0 2px 10px rgba(0, 62, 130, 0.4);
    background: #003e82; /* 按下变深色 */
}