/**
 * 神奇AI百宝箱 Web端全局样式
 * 参考微信小程序风格设计
 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, '微软雅黑', sans-serif;
    background-color: #eeeeee;
    overflow-x: hidden;
}

/* 页面容器 */
.page-container {
    min-height: 100vh;
    background-color: #eeeeee;
}

/* 移动端容器 */
.mobile-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: #fff;
    position: relative;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 88rpx;
    background: linear-gradient(135deg, #ffb8c0 0%, #ff8fa3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.08);
}

.navbar-title {
    font-size: 36rpx;
    font-weight: 600;
    color: #fff;
}

.navbar-left {
    position: absolute;
    left: 20rpx;
    width: 80rpx;
    height: 80rpx;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-right {
    position: absolute;
    right: 20rpx;
    width: 80rpx;
    height: 80rpx;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-icon {
    font-size: 40rpx;
    color: #fff;
    cursor: pointer;
}

/* 页面内容区域 */
.page-content {
    padding-top: 88rpx;
    min-height: 100vh;
    background: #eeeeee;
}

/* 按钮样式 */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20rpx;
    font-size: 30rpx;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #ff8904 0%, #ff9500 100%);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: #666;
    border: 2rpx solid #ddd;
}

.btn-danger {
    background: linear-gradient(135deg, #FF7373 0%, #ff6b6b 100%);
    color: #fff;
}

.btn-lg {
    height: 88rpx;
    font-size: 32rpx;
}

.btn-sm {
    height: 60rpx;
    font-size: 26rpx;
    padding: 0 30rpx;
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 20rpx;
    margin: 20rpx;
    box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
}

.card-header {
    padding: 24rpx 30rpx;
    border-bottom: 2rpx solid #f5f5f5;
    font-size: 32rpx;
    font-weight: 600;
    color: #333;
}

.card-body {
    padding: 24rpx 30rpx;
    font-size: 28rpx;
    color: #666;
    line-height: 1.6;
}

/* 图标按钮 */
.icon-btn {
    width: 80rpx;
    height: 80rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:active {
    transform: scale(0.95);
    background: #e0e0e0;
}

/* Toast提示 */
.wx-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 16rpx;
    padding: 30rpx 40rpx;
    display: flex;
    align-items: center;
    gap: 16rpx;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.3s ease;
}

.wx-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.wx-toast-icon {
    color: #fff;
    font-size: 40rpx;
}

.wx-toast-content {
    color: #fff;
    font-size: 28rpx;
}

/* Modal对话框 */
.wx-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 9998;
    transition: opacity 0.3s ease;
}

.wx-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.wx-modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.wx-modal-content {
    position: relative;
    width: 600rpx;
    max-width: 90%;
    background: #fff;
    border-radius: 20rpx;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.wx-modal.show .wx-modal-content {
    transform: scale(1);
}

.wx-modal-title {
    font-size: 34rpx;
    font-weight: 600;
    color: #333;
    padding: 40rpx 30rpx 20rpx;
    text-align: center;
}

.wx-modal-body {
    font-size: 28rpx;
    color: #666;
    padding: 20rpx 30rpx 40rpx;
    text-align: center;
    line-height: 1.6;
}

.wx-modal-footer {
    display: flex;
    border-top: 2rpx solid #eee;
}

.wx-modal-btn {
    flex: 1;
    height: 88rpx;
    font-size: 32rpx;
    border: none;
    outline: none;
    cursor: pointer;
    background: transparent;
}

.wx-modal-btn.cancel {
    color: #666;
    border-right: 2rpx solid #eee;
}

.wx-modal-btn.confirm {
    color: #ff8fa3;
    font-weight: 500;
}

/* Loading加载 */
.wx-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 9997;
    transition: opacity 0.3s ease;
}

.wx-loading.show {
    opacity: 1;
    pointer-events: auto;
}

.wx-loading-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.wx-loading-content {
    position: relative;
    background: #fff;
    border-radius: 20rpx;
    padding: 40rpx 60rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20rpx;
}

.wx-loading-spinner {
    width: 48rpx;
    height: 48rpx;
    border: 4rpx solid #ffb8c0;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.wx-loading-text {
    font-size: 28rpx;
    color: #666;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 表单样式 */
.form-group {
    margin-bottom: 24rpx;
}

.form-label {
    font-size: 28rpx;
    color: #333;
    margin-bottom: 12rpx;
    display: block;
}

.form-input {
    width: 100%;
    height: 80rpx;
    border: 2rpx solid #eee;
    border-radius: 12rpx;
    padding: 0 24rpx;
    font-size: 30rpx;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: #ffb8c0;
}

.form-input::placeholder {
    color: #999;
}

/* 列表样式 */
.list {
    background: #fff;
    margin: 20rpx;
    border-radius: 20rpx;
    overflow: hidden;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 28rpx 30rpx;
    border-bottom: 2rpx solid #f5f5f5;
    cursor: pointer;
    transition: background 0.3s ease;
}

.list-item:active {
    background: #f9f9f9;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-icon {
    width: 80rpx;
    height: 80rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40rpx;
    margin-right: 20rpx;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 30rpx;
    color: #333;
    margin-bottom: 8rpx;
}

.list-item-desc {
    font-size: 24rpx;
    color: #999;
}

.list-item-arrow {
    font-size: 28rpx;
    color: #ccc;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 120rpx 40rpx;
}

.empty-icon {
    font-size: 120rpx;
    margin-bottom: 30rpx;
    opacity: 0.5;
}

.empty-text {
    font-size: 28rpx;
    color: #999;
}

/* 安全区域适配 */
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* 移动端底部导航栏 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100rpx;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.06);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10rpx 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-bar-icon {
    font-size: 44rpx;
    margin-bottom: 6rpx;
    transition: transform 0.3s ease;
}

.tab-bar-text {
    font-size: 22rpx;
    color: #999;
    transition: color 0.3s ease;
}

.tab-bar-item.active .tab-bar-icon {
    transform: scale(1.1);
}

.tab-bar-item.active .tab-bar-text {
    color: #ff8fa3;
}

/* 响应式设计 */

/* 移动端样式（默认） */
@media screen and (max-width: 768px) {
    :root {
        font-size: 16px;
    }
    
    .page-container {
        max-width: 480px;
        margin: 0 auto;
        background-color: #fff;
    }
    
    /* 移动端显示底部导航 */
    .tab-bar {
        display: flex;
    }
    
    /* 移动端隐藏顶部导航 */
    .top-nav {
        display: none;
    }
}

/* PC端样式 */
@media screen and (min-width: 769px) {
    :root {
        font-size: 18px;
    }
    
    .page-container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    /* PC端隐藏底部导航栏 */
    .tab-bar {
        display: none;
    }
    
    .navbar {
        max-width: none;
        margin: 0;
        left: 0;
        right: 0;
        border-radius: 0;
    }
    
    .page-content {
        padding-top: 100px;
    }
    
    .card {
        margin: 15px;
        padding: 20px;
        border-radius: 16px;
    }
    
    .btn {
        border-radius: 12px;
    }
    
    .btn-lg {
        height: 44px;
        font-size: 16px;
        padding: 0 40px;
    }
    
    .btn-sm {
        height: 32px;
        font-size: 14px;
        padding: 0 20px;
    }
    
    .form-input {
        height: 40px;
        border-radius: 8px;
        padding: 0 16px;
        font-size: 14px;
    }
    
    .wx-modal-content {
        width: 400px;
        border-radius: 16px;
    }
    
    .list {
        margin: 15px;
    }
}

/* 大屏幕优化 */
@media screen and (min-width: 1200px) {
    .page-container {
        max-width: none;
    }
    
    .navbar {
        max-width: none;
    }
}

/* 高分辨率屏幕 */
@media screen and (min-resolution: 2dppx) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* 微信登录弹窗 */
.wx-login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.wx-login-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.wx-login-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.wx-login-content {
    position: relative;
    width: 600rpx;
    max-width: 90%;
    background: #fff;
    border-radius: 24rpx;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.wx-login-modal.show .wx-login-content {
    transform: scale(1);
}

.wx-login-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30rpx;
    border-bottom: 2rpx solid #f5f5f5;
}

.wx-login-title {
    font-size: 34rpx;
    font-weight: 600;
    color: #333;
}

.wx-login-close {
    width: 60rpx;
    height: 60rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40rpx;
    color: #999;
    cursor: pointer;
}

.wx-login-body {
    padding: 40rpx 30rpx;
}

.wx-login-qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: 30rpx;
}

.wx-login-qrcode img {
    width: 280rpx;
    height: 280rpx;
    border-radius: 16rpx;
}

.wx-login-tips {
    text-align: center;
}

.wx-login-tips p {
    font-size: 26rpx;
    color: #666;
    margin-bottom: 10rpx;
}

.wx-login-status {
    font-size: 24rpx !important;
    color: #ff8fa3 !important;
}

.wx-login-footer {
    padding: 20rpx 30rpx 40rpx;
}

.wx-login-cancel {
    width: 100%;
    height: 80rpx;
    background: #f5f5f5;
    border: none;
    border-radius: 40rpx;
    font-size: 30rpx;
    color: #666;
    cursor: pointer;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}
