/* 公共样式 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: #2979ff;
}

input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    outline: none;
}

input:focus, textarea:focus, select:focus {
    outline: none;
}

ul, ol {
    list-style: none;
}

/* 浮动清除 */
.clearfix:after {
    content: "";
    display: block;
    clear: both;
}

/* 常用样式 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: #2979ff;
}

.text-success {
    color: #67c23a;
}

.text-warning {
    color: #e6a23c;
}

.text-danger {
    color: #f56c6c;
}

.text-info {
    color: #909399;
}

/* 加载遮罩（通用） */
.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 底部导航（通用） */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55px;
    background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
    display: flex;
    border-top: 1px solid #e8e8e8;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #999;
    cursor: pointer;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background-color: rgba(41, 121, 255, 0.05);
}

.nav-item.active {
    color: #2979ff;
    font-weight: bold;
}

.nav-item.active::before {
    background-color: #2979ff;
}

/* 导航图标样式 */
.nav-item::before {
    content: '';
    width: 28px;
    height: 28px;
    margin-bottom: 0;
    background-color: #999;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    transition: all 0.3s ease;
}

.nav-item.active::before {
    background-color: #2979ff;
}

/* 各个导航项的图标 */
.nav-item.nav-home::before {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9,22 9,12 15,12 15,22"/></svg>');
}

.nav-item.nav-product::before {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>');
}

.nav-item.nav-invite::before {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="8.5" cy="7" r="4"/><line x1="20" y1="8" x2="20" y2="14"/><line x1="23" y1="11" x2="17" y2="11"/></svg>');
}

.nav-item.nav-team::before {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>');
}

.nav-item.nav-my::before {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>');
}

/* 导航栏动画效果 */
.nav-item:active {
    transform: scale(0.95);
    background-color: rgba(41, 121, 255, 0.1);
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: none; /* 隐藏文字，只显示图标 */
}

.nav-item.active span {
    color: #2979ff;
    text-shadow: 0 1px 2px rgba(41, 121, 255, 0.2);
}

/* 导航栏响应式优化 */
@media (max-width: 375px) {
    .nav-item::before {
        width: 24px;
        height: 24px;
        margin-bottom: 0;
    }
}

@media (min-width: 414px) {
    .nav-item::before {
        width: 30px;
        height: 30px;
        margin-bottom: 0;
    }
}

/* 通用头部 */
.header {
    height: 50px;
    background-color: #2979ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.title {
    font-size: 18px;
    font-weight: bold;
}

.back-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

/* 共享样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f8f8f8;
    padding-bottom: 55px; /* 为导航栏预留空间 */
}

/* 通用样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-size: 16px;
    border: none;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    max-width: 80%;
    padding: 10px 20px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 10000;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast-success {
    background-color: rgba(38, 194, 129, 0.9);
}

.toast-error {
    background-color: rgba(229, 57, 53, 0.9);
}

/* 空状态 */
.empty-data {
    text-align: center;
    padding: 40px 0;
    color: #999;
    font-size: 14px;
}

/* 加载中状态 */
.loading {
    text-align: center;
    padding: 20px 0;
    color: #999;
    font-size: 14px;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-weight: bold;
    font-size: 16px;
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

/* 列表样式 */
.list {
    background: white;
}

.list-item {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.list-item:last-child {
    border-bottom: none;
}

/* 表单样式共享 */
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="email"],
textarea,
select {
    font-size: 16px;
    font-family: inherit;
}

/* 禁用状态 */
.disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

/* 修复iOS中input样式问题 */
input,
textarea,
select {
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
}

/* 响应式工具类 */
.hidden-xs {
    display: none;
}

@media (min-width: 768px) {
    .hidden-xs {
        display: initial;
    }
    
    .visible-xs {
        display: none;
    }
}

.form-button {
    height: 42px;
    line-height: 42px;
    padding: 0 15px;
    border-radius: 5px;
    color: white;
    background-color: #0a53be;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.form-button:hover {
    background-color: #094aa8;
}

.form-button:active {
    background-color: #08419a;
}