/*!
 * 超博AI财报管家 · 租户端 SaaS 视觉规范（v1.0.4）
 *
 * 本文件在 app.css 之后加载，只负责「外壳 + 通用组件」的整体升级：
 *   浅灰近白侧栏（分组菜单）、毛玻璃顶栏（用户下拉）、卡片 / 统计卡 / 表格 /
 *   按钮 / 表单 / 徽标 / 分页 / 空态 / 登录页左右分栏。
 * 页面专属样式（指标卡、报告页、上传解析、套餐卡等）仍留在 app.css。
 */

/* ============ 设计令牌（覆盖 app.css） ============ */
:root {
    /* 主色沿用 app.css 原品牌蓝 #1e5eff */
    --primary: #1e5eff;
    --primary-dark: #1749cc;
    --primary-deep: #123fb3;
    --primary-light: #eaf1ff;
    --primary-ring: rgba(30, 94, 255, .18);
    /* 侧栏：中性灰蓝，稳稳压住左侧，与内容区拉开层次 */
    --sidebar-from: #eef1f8;
    --sidebar-mid: #e7ebf4;
    --sidebar-to: #dee3ef;
    --bg: #f4f6fb;
    --card: #ffffff;
    --ink: #0f1a2e;
    --text: #1f2437;
    --text-2: #656f83;
    --text-3: #9aa3b5;
    --line: #e8ecf5;
    --line-soft: #f1f4fa;
    --radius: 14px;
    --radius-sm: 10px;
    --ok: #12b76a;
    --warn: #f79009;
    --danger: #f04438;
    --info: #2e90fa;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
    --shadow-md: 0 6px 18px rgba(16, 24, 40, .09);
    --shadow-lg: 0 18px 48px rgba(16, 24, 40, .16);
    --side-w: 244px;
}

::selection {
    background: var(--primary-ring);
}

/* 细腻滚动条，长列表页更耐看 */
.side-nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.side-nav::-webkit-scrollbar-thumb {
    background: #dfe5f0;
    border-radius: 6px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: #dfe5f0;
    border-radius: 6px;
}

/* ============ 外壳布局 ============ */
.app {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.side {
    width: var(--side-w);
    flex: 0 0 var(--side-w);
    background: linear-gradient(180deg, var(--sidebar-from) 0%, var(--sidebar-mid) 58%, var(--sidebar-to) 100%);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(15, 26, 46, .08);
    overflow: hidden;
}

/* 侧栏顶部一层极淡的品牌蓝柔光，浅底上增加一点通透感 */
.side::before {
    content: "";
    position: absolute;
    left: -80px;
    top: -130px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30, 94, 255, .12) 0%, rgba(30, 94, 255, 0) 70%);
    pointer-events: none;
}

.side > * {
    position: relative;
    z-index: 1;
}

.side-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(15, 26, 46, .07);
}

.side-logo .logo-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 11px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-logo .logo-mark svg,
.side-logo .logo-mark img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.side-logo strong {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: .3px;
    line-height: 1.35;
}

/* 品牌行文字区允许收缩：副标题为中文长句时可安全换行，不撑破侧边栏 */
.side-logo > div:not(.logo-mark) {
    min-width: 0;
}

.side-logo span {
    display: block;
    font-size: 11px;
    color: #6f7a92;
    letter-spacing: .2px;
    line-height: 1.5;
    margin-top: 3px;
}

.side-nav {
    flex: 1;
    padding: 8px 12px 16px;
    overflow-y: auto;
}

.side-group-title {
    padding: 16px 12px 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.4px;
    color: #6f7a92;
}

.side-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #38415a;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 3px;
    position: relative;
    transition: background .18s, color .18s, transform .18s;
}

.side-item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    opacity: .85;
    transition: opacity .18s;
}

.side-item:hover {
    background: rgba(15, 26, 46, .07);
    color: var(--ink);
}

.side-item:hover svg {
    opacity: 1;
}

.side-item.active {
    background: rgba(30, 94, 255, .14);
    color: var(--primary);
    font-weight: 600;
}

.side-item.active::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--primary);
}

.side-item.active svg {
    opacity: 1;
}

.side-item .side-tag {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(30, 94, 255, .14);
    color: var(--primary);
    letter-spacing: .3px;
}

.side-item.active .side-tag {
    background: var(--primary);
    color: #fff;
}

.side-foot {
    padding: 12px;
    border-top: 1px solid rgba(15, 26, 46, .07);
}

.quota-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.95;
}

.quota-box .quota-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-3);
    font-size: 11.5px;
    letter-spacing: .6px;
    margin-bottom: 4px;
}

.quota-box b {
    color: var(--ink);
    font-weight: 600;
}

.quota-box .quota-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.quota-upgrade {
    display: block;
    margin-top: 10px;
    text-align: center;
    background: var(--primary);
    color: #fff !important;
    border-radius: 9px;
    padding: 8px 0;
    font-size: 12.5px;
    font-weight: 600;
}

.side-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 9px 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.side-contact-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.side-contact-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.quota-upgrade:hover {
    background: var(--primary-dark);
    color: #fff !important;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ============ 顶栏 ============ */
.topbar {
    height: 64px;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.crumb {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 16.5px;
    font-weight: 650;
    color: var(--ink);
    letter-spacing: .2px;
    white-space: nowrap;
}

.crumb a {
    color: var(--text-2);
    font-weight: 500;
    font-size: 14px;
}

.crumb a:hover {
    color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-2);
}

.tenant-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text-2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12.5px;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
}

.tenant-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(18, 183, 106, .16);
    flex: 0 0 6px;
}

.top-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all .16s;
}

.top-ico:hover {
    color: var(--primary);
    border-color: #c3d8ff;
    background: #fafcff;
}

.top-ico svg {
    width: 17px;
    height: 17px;
}

.top-ico .ico-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
    border: 1.5px solid #fff;
}

.top-user {
    position: relative;
}

.top-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    padding: 0 12px 0 6px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: all .16s;
    box-shadow: var(--shadow-xs);
}

.top-user-btn:hover {
    border-color: #c3d8ff;
    background: #fafcff;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7aa5ff, var(--primary));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 600;
    flex: 0 0 30px;
}

.top-user-name {
    display: block;
    text-align: left;
    line-height: 1.25;
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-user-name em {
    display: block;
    font-style: normal;
    font-size: 11.5px;
    color: var(--text-3);
    font-weight: 400;
}

.top-user-btn .caret {
    width: 14px;
    height: 14px;
    color: var(--text-3);
    transition: transform .18s;
}

.top-user.open .caret {
    transform: rotate(180deg);
}

.user-menu {
    position: absolute;
    right: 0;
    top: 48px;
    min-width: 186px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
}

.top-user.open .user-menu {
    display: block;
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 9px;
    font-size: 13px;
    color: var(--text-2);
}

.user-menu a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.user-menu a.danger:hover {
    background: #feeceb;
    color: var(--danger);
}

.user-menu a svg {
    width: 16px;
    height: 16px;
    opacity: .8;
}

.user-menu .user-menu-head {
    padding: 10px 11px 8px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.7;
}

.user-menu .user-menu-head b {
    display: block;
    color: var(--text);
    font-size: 13.5px;
}

.user-menu .sep {
    height: 1px;
    background: var(--line-soft);
    margin: 5px 4px;
}

/* ============ 内容区 ============ */
.page {
    padding: 22px 24px 56px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.page-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 650;
    color: var(--ink);
    letter-spacing: -.2px;
}

.page-head p {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.7;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============ Hero ============ */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #f1f6ff 0%, #e8f0ff 58%, #e3ecfe 100%);
    border: 1px solid #dde8fb;
    border-radius: 16px;
    padding: 28px 30px;
    color: var(--ink);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 10px 26px rgba(30, 94, 255, .08);
}

.hero::before {
    content: "";
    position: absolute;
    right: -60px;
    top: -90px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30, 94, 255, .1) 0%, rgba(30, 94, 255, 0) 68%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(30, 94, 255, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 94, 255, .07) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(520px 320px at 12% 0%, #000 0%, transparent 78%);
    mask-image: radial-gradient(520px 320px at 12% 0%, #000 0%, transparent 78%);
    pointer-events: none;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero h1 {
    margin: 0 0 9px;
    font-size: 24px;
    font-weight: 650;
    letter-spacing: .3px;
}

.hero p {
    margin: 0;
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero .btn {
    height: 40px;
    padding: 0 20px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s;
}

.hero .btn:hover {
    background: #f7faff;
    border-color: #c9dbfb;
    color: var(--primary);
}

.hero .btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 22px rgba(30, 94, 255, .24);
}

.hero .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

/* ============ 卡片 ============ */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    margin-bottom: 20px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14.5px;
    font-weight: 650;
    color: var(--ink);
}

.card-title::before {
    content: "";
    width: 3px;
    height: 15px;
    border-radius: 3px;
    background: linear-gradient(180deg, #7aa5ff, var(--primary));
    flex: 0 0 3px;
}

.card-title .title-sub {
    font-size: 12.5px;
    font-weight: 400;
    color: var(--text-3);
}

.title-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    padding: 4px 10px;
    border: 1px solid var(--primary-light);
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    vertical-align: middle;
    transition: all .2s;
}

.title-contact-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.title-contact-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.card-body {
    padding: 18px 20px;
}

.card-body.np {
    padding: 0;
}

.card-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--line-soft);
    background: #fcfdff;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* 表格横向滚动容器 */
.table-wrap {
    width: 100%;
    overflow-x: auto;
}

/* ============ 统计卡 ============ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
    transition: transform .2s, box-shadow .2s;
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat::after {
    content: "";
    position: absolute;
    right: -46px;
    top: -46px;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-light) 0%, rgba(238, 242, 255, 0) 72%);
    pointer-events: none;
}

.stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.stat-label {
    color: var(--text-2);
    font-size: 13px;
}

.stat-ico {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eaf2ff, #dbe8ff);
    color: var(--primary);
}

.stat-ico svg {
    width: 19px;
    height: 19px;
}

.stat-ico.ok {
    background: linear-gradient(135deg, #e7f8ef, #d7f4e6);
    color: #0e9f5c;
}

.stat-ico.warn {
    background: linear-gradient(135deg, #fef3e2, #fdeacd);
    color: #c97706;
}

.stat-ico.info {
    background: linear-gradient(135deg, #e8f3ff, #d9ebff);
    color: #1570cd;
}

.stat-ico.violet {
    background: linear-gradient(135deg, #f1edff, #e7defd);
    color: #6f5bd6;
}

.stat-value {
    position: relative;
    z-index: 1;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.6px;
    margin-top: 10px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.stat-value small {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-2);
    margin-left: 5px;
    letter-spacing: 0;
}

.stat-sub {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: var(--text-3);
    margin-top: 7px;
}

.stat-sub b {
    color: var(--text-2);
    font-weight: 600;
}

/* ============ 快捷入口 ============ */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
    gap: 14px;
}

.quick {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: all .18s;
}

.quick:hover {
    border-color: #c3d8ff;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-ico {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eaf2ff, #d9e7ff);
    color: var(--primary);
}

.quick-ico svg {
    width: 20px;
    height: 20px;
}

/* 图标色变体：与 .stat-ico 同色系，用于「企业常用服务」外链卡片 */
.quick-ico.info {
    background: linear-gradient(135deg, #e8f3ff, #d9ebff);
    color: #1570cd;
}

.quick-ico.violet {
    background: linear-gradient(135deg, #f1edff, #e7defd);
    color: #6f5bd6;
}

.quick-ico.warn {
    background: linear-gradient(135deg, #fef3e2, #fdeacd);
    color: #c97706;
}

.quick b {
    display: block;
    font-size: 13.5px;
    color: var(--ink);
    font-weight: 600;
}

.quick span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-3);
}

.quick .quick-go {
    margin-left: auto;
    color: var(--text-3);
}

.quick .quick-go svg {
    width: 16px;
    height: 16px;
}

/* ============ 表格 ============ */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: .3px;
    color: var(--text-3);
    background: #fafbfe;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13.5px;
    color: var(--text);
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: #f8faff;
}

.table .empty {
    text-align: center;
    color: var(--text-3);
    padding: 46px 0;
}

.table .cell-main {
    font-weight: 600;
    color: var(--ink);
}

.table .cell-sub {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-3);
}

.table .cell-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

/* ============ 徽标与进度 ============ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    background: #f0f2f7;
    color: var(--text-2);
}

.badge-ok {
    background: #e7f8ef;
    color: #0e9f5c;
}

.badge-warn {
    background: #fef3e2;
    color: #c97706;
}

.badge-danger {
    background: #feeceb;
    color: #d92d20;
}

.badge-info {
    background: var(--primary-light);
    color: var(--primary);
}

.progress {
    height: 7px;
    border-radius: 7px;
    background: #eef1f7;
    overflow: hidden;
    min-width: 90px;
}

.progress-bar {
    height: 100%;
    border-radius: 7px;
    background: linear-gradient(90deg, #7aa5ff, var(--primary));
    transition: width .45s ease;
}

/* ============ 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all .16s;
    box-shadow: var(--shadow-xs);
    white-space: nowrap;
}

.btn:hover {
    border-color: #d3daea;
    background: #fafcff;
    color: var(--primary);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(30, 94, 255, .3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.btn-danger {
    background: #fff;
    border-color: #f7c8c4;
    color: var(--danger);
}

.btn-danger:hover {
    background: #fff5f4;
    border-color: #f0a9a3;
    color: var(--danger);
}

.btn-sm {
    height: 31px;
    padding: 0 11px;
    font-size: 12.5px;
    border-radius: 8px;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-block {
    width: 100%;
}

.btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
    box-shadow: none;
}

/* ============ 表单 ============ */
.form-item {
    margin-bottom: 17px;
}

.form-item label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 7px;
}

.form-item .req::after {
    content: " *";
    color: var(--danger);
}

.input,
.select,
.textarea {
    width: 100%;
    height: 40px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .16s, box-shadow .16s;
    outline: none;
}

.select {
    padding-right: 32px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3b5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 15px;
    -webkit-appearance: none;
    appearance: none;
}

.textarea {
    height: auto;
    min-height: 96px;
    padding: 11px 13px;
    line-height: 1.7;
    resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: #d9e0ee;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.input::placeholder,
.textarea::placeholder {
    color: #aeb6c6;
}

.form-tip {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 7px;
    line-height: 1.7;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 16px;
}

/* ============ 弹窗 ============ */
.modal-mask {
    background: rgba(15, 24, 48, .5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.modal {
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(15, 24, 48, .32);
}

.modal-head {
    padding: 17px 22px;
    font-size: 15px;
    font-weight: 650;
    color: var(--ink);
    border-bottom: 1px solid var(--line-soft);
}

.modal-body {
    padding: 20px 22px;
}

.modal-foot {
    padding: 15px 22px;
    border-top: 1px solid var(--line-soft);
    background: #fcfdff;
    border-radius: 0 0 16px 16px;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    transition: all .16s;
}

.modal-close:hover {
    background: #f2f5fb;
    color: var(--text);
}

/* ============ 筛选条 ============ */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-bar .input,
.filter-bar .select {
    width: auto;
    min-width: 168px;
    height: 36px;
    border-radius: 9px;
}

.filter-bar .btn {
    height: 36px;
}

/* ============ 分页 ============ */
.pager {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--line-soft);
    background: #fcfdff;
    border-radius: 0 0 var(--radius) var(--radius);
}

.pager-info {
    margin-right: auto;
    font-size: 12.5px;
    color: var(--text-3);
}

.pagination {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 13px;
    color: var(--text-2);
    background: #fff;
    transition: all .16s;
}

.pagination li a:hover {
    border-color: #c3d8ff;
    color: var(--primary);
}

.pagination li.active span {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(30, 94, 255, .26);
}

.pagination li.disabled span {
    color: var(--text-3);
    background: #f7f9fc;
}

/* ============ 空态 ============ */
.empty,
.empty-box {
    text-align: center;
    color: var(--text-3);
    padding: 46px 16px;
    font-size: 13px;
}

.empty-box::before {
    content: "";
    display: block;
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #f2f5fb url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab3c5' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 7h16v13H4z'/%3E%3Cpath d='M4 11h16'/%3E%3Cpath d='M9 15h6'/%3E%3C/svg%3E") center/24px no-repeat;
}

/* ============ 标签页 ============ */
.tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    padding: 0 2px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--text-2);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: all .16s;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

/* ============ 登录 / 注册（左右分栏） ============ */
.auth-shell {
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: #fff;
}

.auth-aside {
    flex: 1.06;
    position: relative;
    overflow: hidden;
    padding: 54px 58px;
    color: #fff;
    display: flex;
    flex-direction: column;
    background: radial-gradient(760px 520px at 10% -14%, rgba(86, 142, 255, .45) 0%, rgba(86, 142, 255, 0) 62%),
        radial-gradient(620px 480px at 106% 108%, rgba(10, 30, 76, .4) 0%, rgba(10, 30, 76, 0) 62%),
        linear-gradient(158deg, #143a78 0%, #1a4da5 52%, #2260d8 100%);
}

.auth-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(620px 420px at 16% 12%, #000 0%, transparent 76%);
    mask-image: radial-gradient(620px 420px at 16% 12%, #000 0%, transparent 76%);
    pointer-events: none;
}

.auth-aside > * {
    position: relative;
    z-index: 1;
}

.auth-brand-row {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 58px;
}

.auth-brand-row .logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-brand-row .logo-mark svg,
.auth-brand-row .logo-mark img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.auth-brand-row b {
    display: block;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .4px;
}

/* 品牌行副标题：中文价值主张，字号/字距/亮度按中文排版适配 */
.auth-brand-row span {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    letter-spacing: .6px;
    color: rgba(255, 255, 255, .68);
}

.auth-aside h2 {
    margin: 0 0 16px;
    font-size: 27px;
    font-weight: 650;
    line-height: 1.5;
    letter-spacing: .4px;
}

.auth-aside h2 em {
    font-style: normal;
    background: linear-gradient(90deg, #b9cfff, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-quote {
    margin: 0 0 30px;
    max-width: 430px;
    font-size: 13.5px;
    line-height: 1.9;
    color: rgba(255, 255, 255, .8);
}

.auth-points {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 440px;
}

.auth-points li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    font-size: 13.5px;
    color: #fff;
    line-height: 1.6;
}

.auth-points .tick {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .24);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.auth-points .tick svg {
    width: 12px;
    height: 12px;
}

.auth-aside-foot {
    margin-top: auto;
    padding-top: 28px;
    font-size: 12px;
    color: rgba(255, 255, 255, .5);
    letter-spacing: .3px;
}

.auth-main {
    flex: .94;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
    background: #fff;
}

.auth-box {
    width: 100%;
    max-width: 392px;
}

.auth-box h1 {
    margin: 0 0 9px;
    font-size: 25px;
    font-weight: 650;
    color: var(--ink);
    letter-spacing: -.2px;
}

.auth-sub {
    margin: 0 0 28px;
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.7;
}

.auth-shell .input {
    height: 46px;
    border-radius: 11px;
    font-size: 14px;
    background: #fbfcfe;
}

.auth-shell .input:focus {
    background: #fff;
}

.auth-shell .form-item {
    margin-bottom: 16px;
}

.auth-shell .form-item label {
    font-size: 13px;
    color: var(--text-2);
}

.auth-shell .btn-block {
    height: 46px;
    border-radius: 11px;
    font-size: 14.5px;
    font-weight: 600;
    margin-top: 6px;
}

.auth-hint {
    margin-top: 20px;
    padding: 11px 14px;
    border: 1px dashed #cdd9f7;
    border-radius: 11px;
    background: #f8faff;
    font-size: 12.5px;
    line-height: 1.75;
    color: #4b5776;
}

.auth-hint b {
    color: var(--primary-dark);
}

.auth-foot {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-2);
}

.auth-foot a {
    font-weight: 600;
}

.auth-aside-hide {
    display: none;
}

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
    .top-user-name {
        display: none;
    }
}

@media (max-width: 980px) {
    .auth-aside {
        display: none;
    }

    .auth-main {
        flex: 1;
        padding: 40px 24px;
    }
}

@media (max-width: 860px) {
    :root {
        --side-w: 68px;
    }

    .side-logo {
        justify-content: center;
        padding: 18px 0;
    }

    .side-logo > div:not(.logo-mark) {
        display: none;
    }

    .side-group-title {
        text-align: center;
        padding: 14px 0 6px;
        letter-spacing: 0;
        font-size: 10px;
    }

    .side-item {
        justify-content: center;
        padding: 11px 0;
    }

    .side-item span:not(.side-tag),
    .side-item .side-tag {
        display: none;
    }

    .side-foot .quota-box {
        display: none;
    }

    .page {
        padding: 18px 16px 44px;
    }

    .topbar {
        padding: 0 16px;
    }

    .crumb {
        font-size: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============ 侧边栏联系客服弹窗 ============ */
.contact-modal-mask {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 24, 48, .5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    padding: 16px;
}

.contact-modal {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(15, 24, 48, .32);
    overflow: hidden;
}

.contact-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 20px;
    font-size: 15px;
    font-weight: 650;
    color: var(--ink);
    border-bottom: 1px solid var(--line-soft);
}

.contact-modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    cursor: pointer;
    padding: 0;
}

.contact-modal-close:hover {
    background: #f2f5fb;
    color: var(--text);
}

.contact-modal-close svg {
    width: 18px;
    height: 18px;
}

.contact-modal-body {
    padding: 18px 20px 22px;
}

.contact-modal-item {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
}

.contact-modal-item:last-of-type {
    border-bottom: none;
}

.contact-modal-item span {
    color: var(--text-3);
    white-space: nowrap;
}

.contact-modal-item b {
    color: var(--ink);
    font-weight: 600;
    text-align: left;
    word-break: break-all;
}

.contact-modal-item a {
    color: var(--primary);
}

.contact-modal-qr {
    margin-top: 14px;
    text-align: center;
}

.contact-modal-qr img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px;
    background: #fff;
}

.contact-modal-qr span {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-3);
}

@media (max-width: 860px) {
    .side-contact-btn {
        font-size: 0;
        gap: 0;
        padding: 9px 0;
    }
}
