/**
 * ============================================================
 * 如意验证会员系统 - 主题风格 V2（玻璃拟态 + 渐变配色 + 柔和阴影）
 *   - 主色：蓝紫清新渐变
 *   - 所有卡片/弹出框/按钮/输入框统一圆角 12~18px
 *   - 毛玻璃效果 + 柔和多层阴影
 *   - hover 微交互 + 呼吸留白
 * ============================================================
 */

/* ---------- 全局基础 ---------- */
:root {
    /* 主题色（蓝紫清新系） */
    --ry-primary:        #4f7cff;
    --ry-primary-2:      #7b5cff;
    --ry-primary-3:      #5b8def;
    --ry-success:        #22c55e;
    --ry-success-2:      #10b981;
    --ry-info:           #06b6d4;
    --ry-warning:        #f59e0b;
    --ry-danger:         #ef4444;
    --ry-danger-2:       #f43f5e;

    /* 渐变条 */
    --ry-gradient-primary: linear-gradient(135deg, #4f7cff 0%, #7b5cff 55%, #9b7bff 100%);
    --ry-gradient-success: linear-gradient(135deg, #10b981 0%, #22c55e 55%, #34d399 100%);
    --ry-gradient-info:    linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --ry-gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
    --ry-gradient-danger:  linear-gradient(135deg, #ef4444 0%, #f43f5e 55%, #ec4899 100%);

    /* 背景渐变（页面 body） */
    --ry-page-bg: radial-gradient(1200px 600px at 10% -10%, rgba(79,124,255,.16), transparent 60%),
                  radial-gradient(900px 500px at 110% 10%, rgba(123,92,255,.14), transparent 60%),
                  linear-gradient(180deg, #f5f7ff 0%, #f2f4fb 45%, #eef1fb 100%);

    /* 阴影 */
    --ry-shadow-sm: 0 2px 6px rgba(60,72,120,.08);
    --ry-shadow:    0 10px 30px rgba(60,72,120,.10), 0 4px 10px rgba(60,72,120,.06);
    --ry-shadow-lg: 0 18px 50px rgba(60,72,120,.14), 0 8px 18px rgba(60,72,120,.08);

    /* 圆角 */
    --ry-radius-card:   18px;
    --ry-radius-btn:    12px;
    --ry-radius-input:  14px;
    --ry-radius-alert:  16px;
    --ry-radius-badge:  10px;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1f2740;
}

html { height: 100%; }
body {
    background: var(--ry-page-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 背景装饰圆 */
    overflow-x: hidden;
}
/* 主容器撑满剩余空间（让 .footer.mt-auto 真能靠底，不会跑到页面中间空白区） */
body > .container {
    flex: 1 0 auto;
    width: 100%;
    max-width: 100% !important;
    padding-left: 1rem;
    padding-right: 1rem;
}
/* 超市语音首页挂载点最小高度（防止 Vue 未挂载时整页空白） */
#app-wrapper { min-height: calc(100vh - 56px - 120px); }
#app         { min-height: calc(100vh - 56px - 120px); }
#app .app-container { min-height: calc(100vh - 56px - 120px); }

/* 页面背景装饰圆（纯CSS，不影响性能） */
body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
    filter: blur(60px);
    opacity: .55;
    border-radius: 50%;
}
body::before {
    width: 420px; height: 420px;
    top: -140px; left: -120px;
    background: radial-gradient(circle at 30% 30%, rgba(79,124,255,.55), rgba(79,124,255,0) 70%);
}
body::after {
    width: 520px; height: 520px;
    bottom: -160px; right: -150px;
    background: radial-gradient(circle at 70% 70%, rgba(155,123,255,.45), rgba(155,123,255,0) 72%);
}

/* ---------- 顶部导航栏（毛玻璃 + 渐变） ---------- */
.navbar {
    background: var(--ry-gradient-primary) !important;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 8px 26px rgba(79,124,255,.28);
    padding-top: .7rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid rgba(255,255,255,.18);
}
.navbar-brand {
    font-weight: 700;
    letter-spacing: .4px;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    text-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.navbar .nav-link {
    border-radius: 10px;
    padding: .5rem .9rem !important;
    margin: 0 .15rem;
    transition: all .22s ease;
    color: rgba(255,255,255,.92) !important;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
    background: rgba(255,255,255,.14);
    color: #fff !important;
    transform: translateY(-1px);
}
.navbar .nav-link.active,
body[data-route="index"]      .navbar-nav li:nth-child(1) .nav-link,
body[data-route="change_password"] .navbar-nav li:nth-child(2) .nav-link,
body[data-route="card_recharge"]   .navbar-nav li:nth-child(3) .nav-link,
body[data-route="online_recharge"] .navbar-nav li:nth-child(4) .nav-link {
    background: rgba(255,255,255,.22);
    color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.navbar .dropdown-menu {
    border: none;
    border-radius: var(--ry-radius-card);
    box-shadow: var(--ry-shadow-lg);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    overflow: hidden;
    padding: .4rem;
}
.navbar .dropdown-item {
    border-radius: 10px;
    padding: .55rem .85rem;
    transition: all .18s ease;
    color: #2b3350;
}
.navbar .dropdown-item:hover {
    background: rgba(79,124,255,.10);
    color: var(--ry-primary);
    transform: translateX(2px);
}
.navbar-toggler {
    border-color: rgba(255,255,255,.35) !important;
    border-radius: 10px;
}

/* ---------- 卡片（玻璃拟态 + 圆角 + 大阴影） ---------- */
.card {
    border: none;
    border-radius: var(--ry-radius-card);
    background: rgba(255,255,255,.78);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: var(--ry-shadow);
    transition: transform .25s ease, box-shadow .25s ease;
    border: 1px solid rgba(255,255,255,.65);
    overflow: hidden;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ry-shadow-lg);
}
.card-header {
    border: none !important;
    font-weight: 600;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    letter-spacing: .2px;
}
/* 蓝色 header 卡片：默认用渐变替代 #0d6efd */
.card-header.bg-primary {
    background: var(--ry-gradient-primary) !important;
}
/* 绿色 header 卡片：会员状态等用渐变替代 #198754 */
.card-header.bg-success {
    background: var(--ry-gradient-success) !important;
}
.card-header.bg-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
}
.card-header.bg-info    { background: var(--ry-gradient-info) !important; }
.card-header.bg-warning { background: var(--ry-gradient-warning) !important; }
.card-header.bg-danger  { background: var(--ry-gradient-danger) !important; }

.card-body {
    padding: 1.5rem 1.5rem;
}

/* ---------- 表单 / 输入框 ---------- */
.form-control,
.form-select {
    border: 1.5px solid #e2e6f1;
    border-radius: var(--ry-radius-input) !important;
    padding: .65rem .95rem;
    background: rgba(255,255,255,.85);
    transition: all .2s ease;
    color: #1f2740;
}
.form-control:focus,
.form-select:focus {
    border-color: rgba(79,124,255,.55);
    box-shadow: 0 0 0 4px rgba(79,124,255,.15), var(--ry-shadow-sm);
    background: #fff;
    outline: none;
}
.form-control::placeholder { color: #9aa3bf; }
.form-label { color: #394066; font-weight: 500; margin-bottom: .4rem; }

.input-group-text {
    background: linear-gradient(135deg, #f4f6ff 0%, #eef2ff 100%);
    border: 1.5px solid #e2e6f1;
    border-radius: var(--ry-radius-input) !important;
    color: #5d6a99;
    padding: .65rem .85rem;
}
.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: -1px;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* ---------- 按钮（渐变 + 悬浮上浮） ---------- */
.btn {
    border-radius: var(--ry-radius-btn);
    font-weight: 600;
    padding: .6rem 1.1rem;
    border: none;
    transition: all .22s ease;
    letter-spacing: .2px;
    position: relative;
    overflow: hidden;
}
.btn::after {
    /* 按钮光泽 */
    content: "";
    position: absolute;
    top: 0; left: -120%;
    width: 70%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.28), transparent);
    transform: skewX(-20deg);
    transition: left .65s ease;
}
.btn:hover::after { left: 130%; }
.btn:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 12px 24px rgba(60,72,120,.18);
}
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--ry-gradient-primary);   color:#fff; box-shadow: 0 6px 16px rgba(79,124,255,.28); }
.btn-success   { background: var(--ry-gradient-success);   color:#fff; box-shadow: 0 6px 16px rgba(16,185,129,.28); }
.btn-info      { background: var(--ry-gradient-info);      color:#fff; box-shadow: 0 6px 16px rgba(6,182,212,.24); }
.btn-warning   { background: var(--ry-gradient-warning);   color:#fff; box-shadow: 0 6px 16px rgba(245,158,11,.24); }
.btn-danger    { background: var(--ry-gradient-danger);    color:#fff; box-shadow: 0 6px 16px rgba(239,68,68,.26); }
.btn-secondary {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: #fff; box-shadow: 0 6px 16px rgba(100,116,139,.22);
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-danger,
.btn-outline-secondary {
    background: #fff;
    border: 1.5px solid rgba(60,72,120,.14);
    color: #394066;
}
.btn-outline-primary { border-color: rgba(79,124,255,.45); color: var(--ry-primary); }
.btn-outline-primary:hover { background: var(--ry-gradient-primary); color: #fff; border-color: transparent; }
.btn-outline-success { border-color: rgba(16,185,129,.45); color: var(--ry-success); }
.btn-outline-success:hover { background: var(--ry-gradient-success); color: #fff; border-color: transparent; }
.btn-outline-info    { border-color: rgba(6,182,212,.45);  color: var(--ry-info); }
.btn-outline-info:hover    { background: var(--ry-gradient-info);    color: #fff; border-color: transparent; }
.btn-outline-warning { border-color: rgba(245,158,11,.5);  color: #b45309; }
.btn-outline-warning:hover { background: var(--ry-gradient-warning); color: #fff; border-color: transparent; }
.btn-outline-danger  { border-color: rgba(239,68,68,.45);  color: var(--ry-danger); }
.btn-outline-danger:hover  { background: var(--ry-gradient-danger);  color: #fff; border-color: transparent; }
.btn-outline-secondary { border-color: rgba(100,116,139,.4); color: #475569; }
.btn-outline-secondary:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: #fff; border-color: transparent;
}

/* ---------- 弹出信息框（Bootstrap alert / 各种提示块） ---------- */
.alert {
    border: none;
    border-radius: var(--ry-radius-alert);
    padding: 1rem 1.15rem;
    font-weight: 500;
    box-shadow: var(--ry-shadow-sm);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}
.alert::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: currentColor;
    opacity: .7;
}
.alert-primary { background: linear-gradient(135deg, rgba(79,124,255,.12), rgba(123,92,255,.10)); color: #2b3ea0; border-left: none; }
.alert-success { background: linear-gradient(135deg, rgba(16,185,129,.13), rgba(52,211,153,.10)); color: #065f46; }
.alert-info    { background: linear-gradient(135deg, rgba(6,182,212,.13),  rgba(59,130,246,.11)); color: #0c4a6e; }
.alert-warning { background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(251,146,60,.11)); color: #92400e; }
.alert-danger  { background: linear-gradient(135deg, rgba(239,68,68,.15),  rgba(244,63,94,.11));  color: #991b1b; }
.alert-secondary { background: linear-gradient(135deg, rgba(100,116,139,.12), rgba(148,163,184,.08)); color: #334155; }
.alert-light   { background: rgba(255,255,255,.7); color: #334155; }
.alert > :last-child { margin-bottom: 0; }

/* ---------- Badge ---------- */
.badge {
    border-radius: var(--ry-radius-badge);
    padding: .38rem .65rem;
    font-weight: 600;
    letter-spacing: .2px;
    font-size: .82rem;
    box-shadow: 0 3px 10px rgba(0,0,0,.08);
}
.badge.bg-primary   { background: var(--ry-gradient-primary) !important; }
.badge.bg-success   { background: var(--ry-gradient-success) !important; }
.badge.bg-info      { background: var(--ry-gradient-info) !important; }
.badge.bg-warning   { background: var(--ry-gradient-warning) !important; color:#fff; }
.badge.bg-danger    { background: var(--ry-gradient-danger) !important; }
.badge.bg-secondary { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%) !important; }

/* ---------- 商品卡 / 支付卡（首页底部快捷按钮除外） ---------- */
.goods-card,
.pay-card {
    cursor: pointer;
    transition: all .22s ease;
    border: 1.5px solid #e5e9f5;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    border-radius: var(--ry-radius-card);
    padding: 1rem;
}
.goods-card:hover,
.pay-card:hover {
    border-color: rgba(79,124,255,.5);
    transform: translateY(-3px);
    box-shadow: var(--ry-shadow);
    background: #fff;
}
.goods-card:has(.form-check-input:checked),
.pay-card:has(.form-check-input:checked) {
    border-color: rgba(79,124,255,.7);
    background: linear-gradient(135deg, rgba(79,124,255,.08), rgba(123,92,255,.06));
    box-shadow: 0 10px 28px rgba(79,124,255,.18);
}
.goods-card .price {
    font-size: 1.6rem;
    background: var(--ry-gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    letter-spacing: .4px;
}

/* ---------- 首页快捷操作按钮（三栏） ---------- */
.row .btn.w-100 {
    padding: 1.1rem .7rem;
    border-radius: var(--ry-radius-card) !important;
    background: rgba(255,255,255,.82);
    color: #394066;
    border: 1.5px solid #e5e9f5;
    backdrop-filter: blur(10px);
    transition: all .25s ease;
}
.row .btn.w-100 i.bi {
    font-size: 1.75rem;
    display: block;
    margin-bottom: .45rem;
}
.row .btn-outline-primary.w-100 i.bi { color: var(--ry-primary); }
.row .btn-outline-success.w-100 i.bi { color: var(--ry-success-2); }
.row .btn-outline-info.w-100    i.bi { color: var(--ry-info); }
.row .btn.w-100:hover {
    transform: translateY(-4px);
    color: #fff !important;
}
.row .btn-outline-primary.w-100:hover { background: var(--ry-gradient-primary); border-color: transparent; box-shadow: 0 14px 30px rgba(79,124,255,.28);}
.row .btn-outline-success.w-100:hover { background: var(--ry-gradient-success); border-color: transparent; box-shadow: 0 14px 30px rgba(16,185,129,.28);}
.row .btn-outline-info.w-100:hover    { background: var(--ry-gradient-info);    border-color: transparent; box-shadow: 0 14px 30px rgba(6,182,212,.25);}
.row .btn.w-100:hover i.bi { color: #fff !important; }

/* ---------- 调试/详情面板（pre 块 / 候选清单表） ---------- */
pre {
    border-radius: 14px;
    border: 1px solid rgba(100,116,139,.18);
    background: linear-gradient(135deg, #ffffff, #f8faff);
    padding: .8rem 1rem !important;
    color: #334155;
    font-size: 12.5px;
}
.table {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,.85);
}
.table th, .table td { vertical-align: middle; }
.table thead.table-light {
    background: linear-gradient(135deg, #f3f5ff, #eef1fb) !important;
    color: #394066;
    font-weight: 600;
    border-bottom: 1px solid rgba(100,116,139,.12);
}
hr.my-3 { border-color: rgba(100,116,139,.14); }

/* 调试面板按钮 */
.btn.btn-sm.btn-outline-secondary {
    border-radius: 10px !important;
    padding: .32rem .7rem;
    font-size: .84rem;
}

/* ---------- 页脚 ---------- */
.footer {
    background: transparent;
    margin-top: 3rem;
    padding-bottom: 1.5rem;
}
.footer .container > span {
    display: inline-block;
    padding: .55rem 1.1rem;
    border-radius: 999px;
    background: rgba(255,255,255,.68);
    backdrop-filter: blur(10px);
    color: #5d6a99 !important;
    box-shadow: var(--ry-shadow-sm);
}

/* ---------- 登录 / 注册等"居中卡片"页面：额外加毛玻璃 + 呼吸留白 ---------- */
.page-auth {
    min-height: calc(100vh - 56px - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 0;
}
.page-auth .card {
    padding: 0;
}

/* ---------- 登录 / 注册卡片标题 ---------- */
.text-center.mb-4 h4,
h4.text-center.mb-4 {
    font-weight: 700;
    color: #2b3350;
    letter-spacing: .3px;
}

/* ---------- 兼容老的 mb-4 主容器间距 ---------- */
body > .container {
    padding-top: .5rem;
    padding-bottom: 2rem;
}

/* ---------- 模态框（如果以后用到）统一美化 ---------- */
.modal-content {
    border: none;
    border-radius: var(--ry-radius-card);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    box-shadow: var(--ry-shadow-lg);
}
.modal-header {
    border-bottom: 1px solid rgba(100,116,139,.12);
    background: var(--ry-gradient-primary);
    color: #fff;
    border-radius: var(--ry-radius-card) var(--ry-radius-card) 0 0;
}
.modal-header .btn-close { filter: invert(1); }
.modal-footer { border-top: 1px solid rgba(100,116,139,.12); }

/* ---------- Toast / 浮动提示 ---------- */
.toast {
    border: none;
    border-radius: 14px !important;
    box-shadow: var(--ry-shadow-lg);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 768px) {
    :root {
        --ry-radius-card: 16px;
        --ry-radius-btn:  11px;
        --ry-radius-input:12px;
    }
    body > .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .card-body { padding: 1.2rem; }
    .goods-card .price { font-size: 1.3rem; }
    .navbar-brand { font-size: 1.05rem; }
    .row .btn.w-100 { padding: 1rem .5rem; }
    .row .btn.w-100 i.bi { font-size: 1.5rem; }
}
