/* ============================================================
   app.css - 液态玻璃风 Liquid Glass 全局设计系统 v3.0
   半透明毛玻璃 + 流动渐变 + 行业主题色变量
   ============================================================ */
:root {
    /* 行业主题色（布局层动态注入 --primary 系列，这里给默认值） */
    --primary: #4f6ef7;
    --primary-2: #7b5cf0;
    --primary-dark: #3b56d9;
    --primary-light: rgba(79,110,247,.12);
    --primary-glow: rgba(79,110,247,.35);

    /* 功能色 */
    --success: #34c77b;
    --warning: #faad14;
    --danger: #ff5a6a;
    --info: #3aa0ff;

    /* 中性灰阶 9 级 */
    --g-1:#ffffff; --g-2:#f7f8fc; --g-3:#f0f2f8; --g-4:#e6e9f2;
    --g-5:#d3d8e6; --g-6:#a8afc4; --g-7:#7a8299; --g-8:#4a5168; --g-9:#1f2433;
    --text: #262b3a;
    --text-secondary: #7a8299;
    --border: rgba(120,135,180,.16);

    /* 背景 */
    --bg: #eef1fa;
    --glass-bg: rgba(255,255,255,.62);
    --glass-bg-strong: rgba(255,255,255,.82);
    --glass-border: rgba(255,255,255,.65);
    --glass-blur: 18px;

    /* 尺寸系统 */
    --r-sm: 8px; --radius: 14px; --r-lg: 20px; --r-pill: 999px;
    --sh-sm: 0 2px 8px rgba(40,55,110,.06);
    --shadow: 0 6px 24px rgba(40,55,110,.10);
    --sh-lg: 0 14px 44px rgba(40,55,110,.16);
    --sh-glow: 0 8px 24px var(--primary-glow);
    --status-bar-height: 0px;
    --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px; line-height: 1.6; color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
}

/* ===== 液态流动背景：两团柔光缓慢流动 ===== */
body::before, body::after {
    content: ''; position: fixed; z-index: -1; border-radius: 50%;
    filter: blur(80px); opacity: .5; pointer-events: none;
}
body::before {
    width: 60vw; height: 60vw; top: -20vw; left: -15vw;
    background: radial-gradient(circle at 30% 30%, var(--primary), transparent 70%);
    animation: liquidFloat 22s var(--ease) infinite alternate;
}
body::after {
    width: 55vw; height: 55vw; bottom: -20vw; right: -15vw;
    background: radial-gradient(circle at 70% 70%, var(--primary-2), transparent 70%);
    animation: liquidFloat 28s var(--ease) infinite alternate-reverse;
}
@keyframes liquidFloat {
    0%   { transform: translate(0,0) scale(1); }
    50%  { transform: translate(6vw,4vh) scale(1.12); }
    100% { transform: translate(-4vw,8vh) scale(.95); }
}
@media (prefers-reduced-motion: reduce) {
    body::before, body::after { animation: none; }
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
h1,h2,h3,h4 { font-weight: 600; letter-spacing: .2px; }
.muted { color: var(--text-secondary); font-size: 13px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ============ 毛玻璃基础类 ============ */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}
/* 不支持 backdrop-filter 时降级为实色 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass, .card, .sidebar, .topbar { background: #fff !important; }
}

/* ---------- 按钮（液态） ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 42px; padding: 10px 20px; border-radius: var(--r-pill);
    border: 1px solid transparent; font-size: 15px; font-weight: 500; cursor: pointer;
    transition: transform .18s var(--ease), box-shadow .18s, background .18s, opacity .18s;
    line-height: 1.4; position: relative; overflow: hidden; white-space: nowrap;
}
.btn:active { transform: scale(.95); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; box-shadow: var(--sh-glow);
}
.btn-primary:hover { box-shadow: 0 10px 28px var(--primary-glow); transform: translateY(-1px); }
.btn-success { background: linear-gradient(135deg,#3ddc84,#2bb36a); color:#fff; box-shadow:0 6px 18px rgba(52,199,123,.3); }
.btn-warning { background: linear-gradient(135deg,#ffc53d,#faad14); color:#fff; }
.btn-danger  { background: linear-gradient(135deg,#ff7a8a,#ff5a6a); color:#fff; box-shadow:0 6px 18px rgba(255,90,106,.28); }
.btn-default { background: var(--glass-bg-strong); color: var(--text); border-color: var(--border); backdrop-filter: blur(8px); }
.btn-default:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline { background: transparent; color: var(--primary); border:1.5px solid var(--primary); }
.btn-sm { min-height: 32px; padding: 5px 14px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 14px 28px; font-size: 17px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 表单（液态聚焦光晕） ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 7px; font-weight: 500; color: var(--g-8); }
.form-control {
    width: 100%; min-height: 44px; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: var(--r-sm);
    font-size: 15px; background: rgba(255,255,255,.8); color: var(--text);
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light); background: #fff;
}
.form-control::placeholder { color: var(--g-6); }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a8299' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; padding-right:36px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check label { margin: 0; font-weight: normal; }
/* 开关 */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position:absolute; inset:0; background:var(--g-5); border-radius:999px; transition:.25s; cursor:pointer; }
.switch .slider::before { content:''; position:absolute; width:20px; height:20px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.25s var(--ease); box-shadow:0 2px 6px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: linear-gradient(135deg,var(--primary),var(--primary-2)); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- 卡片（毛玻璃） ---------- */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 16px; overflow: hidden;
}
.card-header { padding: 16px 18px; font-weight: 600; font-size: 15px; border-bottom: 1px solid var(--border); display:flex; align-items:center; gap:8px; }
.card-body { padding: 18px; }
.card-footer { padding: 13px 18px; border-top: 1px solid var(--border); background: rgba(255,255,255,.4); }

/* 页头 */
.page-header { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
.page-header h2 { font-size: 20px; }
.page-header .btn { margin-left:auto; }

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th, .table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { background: rgba(247,248,252,.7); font-weight: 600; color: var(--text-secondary); font-size: 13px; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--primary-light); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- 徽章/标签 ---------- */
.badge { display: inline-flex; align-items:center; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight:500; }
.badge-success { background: rgba(52,199,123,.14); color: #1fa463; }
.badge-warning { background: rgba(250,173,20,.16); color: #d48806; }
.badge-danger  { background: rgba(255,90,106,.13); color: var(--danger); }
.badge-info    { background: rgba(58,160,255,.13); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.tag { display: inline-block; padding: 2px 9px; background: var(--g-3); border-radius: var(--r-pill); font-size: 12px; color:var(--g-7); }

/* ---------- 提示框 ---------- */
.alert { padding: 13px 16px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: 14px; border:1px solid transparent; }
.alert-success { background: rgba(52,199,123,.12); color: #1fa463; border-color: rgba(52,199,123,.3); }
.alert-warning { background: rgba(250,173,20,.13); color: #d48806; border-color: rgba(250,173,20,.3); }
.alert-danger  { background: rgba(255,90,106,.1); color: var(--danger); border-color: rgba(255,90,106,.3); }
.alert-info    { background: rgba(58,160,255,.1); color: #0968c9; border-color: rgba(58,160,255,.3); }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-secondary); }
.empty-state .empty-icon { font-size: 56px; margin-bottom: 14px; opacity:.6; }
.empty-state p { margin-bottom: 14px; }

/* ---------- 统计卡片（液态） ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
    position: relative; overflow:hidden;
    background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--sh-sm);
}
.stat-card::before {
    content:''; position:absolute; right:-24px; top:-24px; width:84px; height:84px;
    border-radius:50%; background: radial-gradient(circle,var(--primary-glow),transparent 70%); opacity:.5;
}
.stat-icon { font-size: 22px; margin-bottom: 8px; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--g-9); letter-spacing:-.5px; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.stat-trend { font-size: 12px; margin-top: 6px; }

/* ---------- 分页 ---------- */
.pagination { list-style: none; display: flex; gap: 7px; margin: 18px 0; flex-wrap: wrap; }
.pagination li a, .pagination li span {
    display: inline-flex; align-items:center; justify-content:center; min-width: 38px; min-height: 38px; padding: 6px 12px;
    border: 1px solid var(--border); border-radius: var(--r-sm); text-align: center;
    background: var(--glass-bg-strong); transition:.15s;
}
.pagination li a:hover { border-color: var(--primary); color: var(--primary); }
.pagination li.active span { background: linear-gradient(135deg,var(--primary),var(--primary-2)); color: #fff; border-color: transparent; }
.pagination li.disabled span { color: var(--g-5); }

/* ---------- 面包屑/选项卡 ---------- */
.breadcrumb { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }
.nav-tabs { display: flex; gap:4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.nav-tabs a { padding: 10px 18px; white-space: nowrap; color: var(--text-secondary); border-radius: var(--r-sm) var(--r-sm) 0 0; font-weight:500; transition:.15s; }
.nav-tabs a.active { color: var(--primary); background: var(--primary-light); }

/* ---------- 模态框（玻璃） ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(30,38,70,.4); backdrop-filter: blur(4px); display: none; z-index: 100; }
.modal-mask.show { display: flex; align-items: center; justify-content: center; animation: fadeIn .2s; }
.modal-content { background: var(--glass-bg-strong); backdrop-filter: blur(24px); border:1px solid var(--glass-border); border-radius: var(--r-lg); width: 90%; max-width: 480px; padding: 24px; box-shadow: var(--sh-lg); animation: popIn .25s var(--ease); }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes popIn { from{opacity:0; transform:scale(.92) translateY(10px)} to{opacity:1; transform:scale(1) translateY(0)} }

/* ---------- 登录页 ---------- */
html, body { margin: 0; padding: 0; }
.login-body { position: relative; min-height: 100vh; min-height: 100dvh; overflow-x:hidden;
    background: linear-gradient(150deg, var(--primary) 0%, var(--primary-2) 55%, #9b6cf5 100%); }
.login-bg { position: fixed; inset: 0; z-index: 0;
    background:
        radial-gradient(circle at 18% 22%, rgba(255,255,255,.22), transparent 40%),
        radial-gradient(circle at 82% 78%, rgba(255,255,255,.18), transparent 42%),
        linear-gradient(150deg, var(--primary) 0%, var(--primary-2) 55%, #9b6cf5 100%);
}
.login-bg::before, .login-bg::after { content:''; position:absolute; border-radius:50%; filter:blur(60px); }
.login-bg::before { width:50vw;height:50vw;top:-12vw;left:-10vw;background:rgba(255,255,255,.18);animation:liquidFloat 20s var(--ease) infinite alternate; }
.login-bg::after { width:45vw;height:45vw;bottom:-14vw;right:-8vw;background:rgba(255,255,255,.14);animation:liquidFloat 26s var(--ease) infinite alternate-reverse; }
.login-box {
    position: relative; z-index: 1; max-width: 400px; margin: 7vh auto 0;
    background: rgba(255,255,255,.16); backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255,255,255,.35); border-radius: 24px; padding: 34px 26px;
    box-shadow: 0 20px 60px rgba(30,20,80,.3); color:#fff;
}
.login-box .form-control { background: rgba(255,255,255,.9); }
.login-box .muted { color: rgba(255,255,255,.85); }
.login-logo { text-align: center; font-weight: 700; font-size: 19px; margin-bottom: 6px; }
.login-title { text-align: center; font-size: 21px; margin-bottom: 22px; font-weight:600; }

/* ---------- 加载/骨架屏 ---------- */
.loading { text-align: center; padding: 24px; color: var(--text-secondary); }
.skeleton { background: linear-gradient(90deg,var(--g-3) 25%,var(--g-2) 37%,var(--g-3) 63%); background-size:400% 100%; animation:shimmer 1.4s infinite; border-radius:8px; }
@keyframes shimmer { 0%{background-position:100% 0} 100%{background-position:-100% 0} }

/* ---------- Toast ---------- */
.toast { position: fixed; top: calc(var(--status-bar-height) + 14px); left:50%; transform:translateX(-50%);
    z-index: 999; padding: 11px 22px; border-radius: var(--r-pill); font-size: 14px; color:#fff;
    background: rgba(31,36,51,.88); backdrop-filter: blur(12px); box-shadow: var(--shadow); animation: popIn .2s var(--ease); }

/* APP 沉浸式 */
.app-immersive { padding-top: var(--status-bar-height); }
.topbar { padding-top: var(--status-bar-height); }

/* ============ 平板 >=768 ============ */
@media (min-width: 768px) {
    body { font-size: 14px; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .login-box { margin-top: 11vh; padding: 42px; }
    .table { min-width: 0; }
}
@media (min-width: 1024px) {
    .stat-grid { gap: 16px; }
}

/* ============================================================
   补充：后台表单布局/工具类兼容
   ============================================================ */
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.form-actions { display: flex; gap: 10px; padding-top: 8px; flex-wrap: wrap; }
.radio-inline, .checkbox-inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; cursor: pointer; }
.radio-inline input, .checkbox-inline input { width: auto; min-height: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); font-size: 13px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filter-bar .form-control { width: auto; flex: 0 1 auto; }
.row { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.text-lg { font-size: 17px; }
.text-xl { font-size: 22px; font-weight: 700; }
.fw-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; } .mt-3{margin-top:14px;} .mb-2{margin-bottom:8px;} .mb-3{margin-bottom:14px;}
.gap-2 { gap: 8px; } .flex{display:flex;align-items:center;} .flex-between{display:flex;align-items:center;justify-content:space-between;} .flex-wrap{flex-wrap:wrap;}
@media (max-width: 767px) {
    .form-row, .form-row-3, .row { grid-template-columns: 1fr; }
}
