/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 全局变量：统一配色+尺寸，匹配设计图 */
:root {
    --main-color: #165DFF; /* 主色调 */
    --tab-active-color: #C9409F; /* 底部导航选中色，匹配设计图紫红色 */
    --tab-normal-color: #8E8E93; /* 底部导航未选中色，匹配设计图灰色 */
    --text-main: #1D1D1F; /* 主文字色 */
    --text-sub: #6E6E73; /* 次要文字色 */
    --text-light: #8E8E93; /* 浅文字色 */
    --bg-color: #F5F5F7; /* 页面背景色，匹配设计图浅灰 */
    --white: #FFFFFF; /* 纯白背景 */
    --border-color: #E5E5EA; /* 边框色 */
    --success: #00B42A; /* 成功色 */
    --danger: #F53F3F; /* 错误/警告色 */
    --max-width: 1200px; /* 页面最大宽度 */
    --radius: 12px; /* 统一圆角 */
    --card-radius: 24px; /* 快捷入口大圆角，匹配设计图 */
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* 统一卡片阴影 */
    --tabbar-height: 56px; /* 底部导航栏高度，匹配设计图 */
    --safe-bottom: env(safe-area-inset-bottom); /* 适配全面屏底部安全区 */
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    /* 给页面底部预留导航栏+安全区高度，避免内容被遮挡 */
    padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 10px);
    /* 禁止页面横向滚动 */
    overflow-x: hidden;
}

/* 页面容器：全局居中 */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* 链接样式重置 */
a {
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s ease;
}

a:hover {
    color: var(--main-color);
}

/* 列表样式重置 */
ul, li {
    list-style: none;
}

/* 图片自适应 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 统一按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.btn-primary {
    background-color: var(--main-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #0E42C1;
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
}

.btn-sub {
    background-color: var(--sub-color);
    color: var(--white);
}

.btn-sub:hover {
    background-color: #E09A00;
    color: var(--white);
}

.btn-default {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-default:hover {
    border-color: var(--main-color);
    color: var(--main-color);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #D03030;
    color: var(--white);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 10px;
}

.btn-xs {
    padding: 3px 6px;
    font-size: 9px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 16px;
}

/* 统一卡片样式 */
.card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: #FAFAFA;
}

/* 统一表单样式 */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-main);
    font-weight: 500;
}

.form-input {
    width: 100%;
    height: 42px;
    padding: 0 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-main);
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--main-color);
}

.form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-main);
    transition: border-color 0.2s;
    outline: none;
    resize: vertical;
    line-height: 1.5;
}

.form-textarea:focus {
    border-color: var(--main-color);
}

/* 网格布局 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -6px;
}

.col-1 {
    width: 8.3333%;
    padding: 0 6px;
    margin-bottom: 12px;
}

.col-2 {
    width: 16.6666%;
    padding: 0 6px;
    margin-bottom: 12px;
}

.col-3 {
    width: 25%;
    padding: 0 6px;
    margin-bottom: 12px;
}

.col-4 {
    width: 33.3333%;
    padding: 0 6px;
    margin-bottom: 12px;
}

.col-6 {
    width: 50%;
    padding: 0 6px;
    margin-bottom: 12px;
}

.col-8 {
    width: 66.6666%;
    padding: 0 6px;
    margin-bottom: 12px;
}

.col-12 {
    width: 100%;
    padding: 0 6px;
    margin-bottom: 12px;
}

/* 超小卡片列宽，适配市场页面 */
.col-mini {
    width: 6.25%;
    padding: 0 4px;
    margin-bottom: 8px;
}

/* flex通用布局 */
.flex {
    display: flex;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.flex-1 {
    flex: 1;
}

/* 文字通用样式 */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-main {
    color: var(--text-main);
}

.text-sub {
    color: var(--text-sub);
}

.text-light {
    color: var(--text-light);
}

.text-primary {
    color: var(--main-color);
}

.text-tab-active {
    color: var(--tab-active-color);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-white {
    color: #fff;
}

.fs-8 {
    font-size: 8px;
}

.fs-9 {
    font-size: 9px;
}

.fs-10 {
    font-size: 10px;
}

.fs-11 {
    font-size: 11px;
}

.fs-12 {
    font-size: 12px;
}

.fs-13 {
    font-size: 13px;
}

.fs-14 {
    font-size: 14px;
}

.fs-16 {
    font-size: 16px;
}

.fs-18 {
    font-size: 18px;
}

.fs-20 {
    font-size: 20px;
}

.fs-22 {
    font-size: 22px;
}

.fs-24 {
    font-size: 24px;
}

.fs-28 {
    font-size: 28px;
}

.fs-32 {
    font-size: 32px;
}

.fs-36 {
    font-size: 36px;
}

.fw-bold {
    font-weight: 600;
}

/* 间距通用样式 */
.mt-5 {
    margin-top: 5px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mt-40 {
    margin-top: 40px;
}

.mb-2 {
    margin-bottom: 2px;
}

.mb-3 {
    margin-bottom: 3px;
}

.mb-5 {
    margin-bottom: 5px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mb-40 {
    margin-bottom: 40px;
}

.p-8 {
    padding: 8px;
}

.p-10 {
    padding: 10px;
}

.p-12 {
    padding: 12px;
}

.p-15 {
    padding: 15px;
}

.p-20 {
    padding: 20px;
}

.p-40 {
    padding: 40px;
}

/* 圆角通用 */
.radius {
    border-radius: var(--radius);
}

.radius-round {
    border-radius: 50%;
}

/* 隐藏滚动条 */
.scroll-hide::-webkit-scrollbar {
    display: none;
}

.scroll-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 提示框样式 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 20px;
    background-color: rgba(0, 0, 0, 0.75);
    color: var(--white);
    border-radius: var(--radius);
    z-index: 9999;
    font-size: 14px;
    max-width: 80%;
    text-align: center;
    display: none;
}

/* 页面头部导航样式 */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 999;
    height: 60px;
}

.header .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--main-color);
}

.header-nav {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-nav li {
    margin: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.header-nav li a {
    font-size: 15px;
    font-weight: 500;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
}

.header-nav li a:hover,
.header-nav li a.active {
    color: var(--main-color);
    border-bottom-color: var(--main-color);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-user .btn {
    height: 36px;
    line-height: 36px;
    padding: 0 18px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--main-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 180px;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 999;
    display: none;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 15px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background-color: var(--bg-color);
    color: var(--main-color);
}

/* 表单页面容器 */
.form-page {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.form-box {
    width: 100%;
    max-width: 400px;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
}

.form-box .form-title {
    text-align: center;
    margin-bottom: 25px;
}

.form-box .form-title h2 {
    font-size: 22px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-box .form-title p {
    color: var(--text-light);
    font-size: 13px;
}

.form-tip {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-light);
}

.form-tip a {
    color: var(--main-color);
}

/* ========== 优化后：底部导航栏（完全匹配设计图1，固定不滑动） ========== */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--tabbar-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background-color: var(--white);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    z-index: 9999;
    border-top: 1px solid #F2F2F7;
    /* 核心：固定定位，不随屏幕滑动 */
    transform: translateZ(0);
    will-change: transform;
}

.tabbar-item {
    /* 四个tab均匀分布，严格从左到右 */
    flex: 1;
    height: var(--tabbar-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--tab-normal-color);
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 2px;
}

/* 选中态：完全匹配设计图紫红色 */
.tabbar-item.active {
    color: var(--tab-active-color);
}

/* 图标样式：匹配设计图 */
.tabbar-item .tabbar-icon {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

/* 选中态图标轻微放大 */
.tabbar-item.active .tabbar-icon {
    transform: scale(1.05);
}

/* 文字样式：匹配设计图 */
.tabbar-item .tabbar-text {
    font-size: 11px;
    line-height: 1;
    font-weight: 500;
}

/* ========== 优化后：快捷入口样式（完全匹配设计图2） ========== */
.quick-entry {
    display: flex;
    gap: 16px;
    margin: 20px 0;
}

.quick-entry-item {
    flex: 1;
    background-color: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.25s ease;
}

/* hover效果 */
.quick-entry-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* 入口图标：匹配设计图 */
.quick-entry-item .entry-icon {
    font-size: 48px;
    line-height: 1;
}

/* 入口文字：匹配设计图 */
.quick-entry-item .entry-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1;
}

/* 表格通用样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    border-color: var(--border-color);
}
.table th {
    font-weight: 600;
    color: var(--text-main);
    padding: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    text-align: center;
}
.table td {
    padding: 12px;
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    text-align: center;
}

/* 响应式适配：移动端完美适配 */
@media (max-width: 768px) {
    :root {
        --max-width: 100%;
        --tabbar-height: 54px;
        --card-radius: 20px;
    }
    .col-1, .col-2, .col-3, .col-4, .col-6, .col-8 {
        width: 50%;
    }
    .col-mini {
        width: 12.5%;
    }
    .header-nav {
        display: none;
    }
    .header-logo {
        font-size: 18px;
    }
    .form-box {
        padding: 25px 20px;
    }
    .header-user {
        display: none;
    }
    /* 移动端快捷入口适配 */
    .quick-entry {
        gap: 12px;
    }
    .quick-entry-item {
        padding: 25px 10px;
    }
    .quick-entry-item .entry-icon {
        font-size: 40px;
    }
    .quick-entry-item .entry-text {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .col-1, .col-2, .col-3, .col-4, .col-6, .col-8 {
        width: 50%;
    }
    .col-mini {
        width: 25%;
    }
    .header-user .btn {
        height: 32px;
        line-height: 32px;
        padding: 0 12px;
        font-size: 13px;
    }
    /* 超小屏快捷入口适配 */
    .quick-entry-item .entry-icon {
        font-size: 36px;
    }
    .quick-entry-item .entry-text {
        font-size: 16px;
    }
}