/* 通用样式 */
/* 禁止用户选择文本和图片 */
* {
    -webkit-touch-callout: none; /* 禁止长按链接与图片弹出菜单 */
    -webkit-tap-highlight-color: transparent; /* 去除点击高亮 */
    -webkit-user-select: none; /* 禁止选择文本 */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 允许输入框选择文本 */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 根元素和body样式 */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-text-size-adjust: 100% !important; /* 禁止字体大小调整 */
    text-size-adjust: 100% !important;
}

/* 容器样式调整 */
.container {
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    background-color: #f5f5f5; /* 统一背景色 */
    position: relative;
    display: flex;
    flex-direction: column;
}

.container.loaded {
    opacity: 1;
}

/* 防止页面滚动 */
.no-scroll {
    overflow: hidden;
    height: 100%;
    position: fixed;
    width: 100%;
}

/* 安全区域适配（针对刘海屏手机） */
.safe-area-inset-bottom {
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-inset-top {
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}
/* 加载指示器样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

/* 加载指示器颜色更新 */
.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2a5298; /* 改为蓝色 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    width: 30px; /* 添加宽度 */
    height: 30px; /* 添加高度，保持圆形 */
}

.loading-text {
    margin-top: 20px;
    color: #666;
    font-size: 16px;
    text-align: center;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 加载完成时的隐藏效果 */
.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    position: relative;
}

.header h1 {
    margin: 0;
    font-size: 18px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
/* 用户头像样式更新 */
.user-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.default-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    backdrop-filter: blur(10px);
}

.back-btn {
    color: #00008B;
    text-decoration: none;
    font-size: 14px;
}

.user-icon {
    margin-left: auto;
}

/* 确保main内容区域有适当的边距 */
.main {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* 平滑滚动 */
    background-color: #f5f5f5; /* 添加背景色，让边距更明显 */
}

/* Footer底部导航栏样式 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #eee;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    flex: 1;
    height: 100%;
    justify-content: center;
    transition: color 0.3s ease;
    position: relative;
}

.footer-item.active {
    color: #2a5298; /* 改为蓝色 */
}

.footer-item span {
    margin-top: 4px;
}

.footer-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.footer-item.active .footer-icon {
    color: #2a5298; /* 改为蓝色 */
}

/* 安全区域适配 */
.footer.safe-area-inset-bottom {
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(60px + constant(safe-area-inset-bottom));
    height: calc(60px + env(safe-area-inset-bottom));
}

button {
    border: none;
    outline: none;
    cursor: pointer;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 300px;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 10px;
}

.modal-content button {
    margin: 5px;
    padding: 8px 15px;
    border-radius: 3px;
}
/* Toast 消息提示 */
.toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    max-width: 70%;
    text-align: center;
    line-height: 1.4;
    animation: toastFade 3s ease-in-out;
}

@keyframes toastFade {
    0% { opacity: 0; transform: translate(-50%, -40%); }
    20% { opacity: 1; transform: translate(-50%, -50%); }
    80% { opacity: 1; transform: translate(-50%, -50%); }
    100% { opacity: 0; transform: translate(-50%, -60%); }
}

/* 自定义确认框 */
.custom-confirm {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.custom-confirm-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 280px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.custom-confirm-message {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 20px;
}

.custom-confirm-buttons {
    display: flex;
    gap: 10px;
}

.custom-confirm-button {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.custom-confirm-cancel {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
}

.custom-confirm-cancel:active {
    background: #e9ecef;
}

.custom-confirm-ok {
    background: #007AFF;
    color: white;
}

.custom-confirm-ok:active {
    background: #0056CC;
}