/* 统一基础样式 - base.css */

/* CSS变量定义 */
:root {
    /* 基础文本颜色 */
    --text-color-primary: #333;
    --text-color-secondary: #666;
    --text-color-dark: #222;
    --text-color-darker: #222426;
    --text-color-muted: #6b7280;
    --text-color-light: #919499;
    --text-color-white: #ffffff;
    
    /* 强调色 */
    --accent-color: #ff6b35;
    --accent-color-orange: #f96432;
    --accent-color-light: #ff7e00;
    
    /* 字体 */
    --font-family-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-family-special: 'HYXiuYingF', sans-serif;
    --font-family-button: 'Alibaba PuHuiTi', sans-serif;
    
    /* 层级 */
    --z-index-base: 1;
    --z-index-overlay: 10;
    --z-index-modal: 9999;
    
    /* 尺寸 */
    --feature-icon-size: 3.04rem;
    --header-h: 3.66rem;
    
    /* 背景色 */
    --white-bg: #fff;
    --main-container-bg:#F7F7F7;
    --card-bg: #ffffff;
    
    /* 边框 */
    --border-color: #e9ebef;
    --border-color-light: #e5e9f0;
    --border-light-orange: rgba(249, 100, 50, 0.12);
    --border-light-gray: rgba(0, 0, 0, 0.06);
    
    /* 阴影 */
    --shadow-soft: 0 0.5rem 1.5rem rgba(30, 36, 50, 0.08);
    --shadow-card: 0 0.66rem 1.83rem rgba(30, 36, 50, 0.06);

    /* game-detail.css中的CSS变量 */
    --text-primary: #222426;
    --text-secondary: #616366;
    --text-tertiary: #919499;
    --text-light: #ffffff;
    --text-accent: #ff7e00;
    --text-dark: #3c3c3c;
    --text-price-strike: rgba(75, 65, 65, 0.6);
    --bg-main: #ffffff;
    --bg-secondary: #f2f4f7;
    --bg-accent: #ff7e00;
    --border-light: #ebebeb;
    --border-medium: #7484a4;
    --border-accent: #ffead5;
    --indicator: #f56434;    
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 通用链接样式 */
a {
    text-decoration: none;
    color: inherit;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 83rem #FAFAFA inset !important; /* 与 .input-group 一致 */
    box-shadow: 0 0 0 83rem #FAFAFA inset !important;
    -webkit-text-fill-color: #111;
    transition: background-color 5000s ease-in-out 0s;
}
html, body {
    /* height: 100%; */
    /* 确保在移动端正确显示 */
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-family-primary);
    overflow-x: hidden;
    /* 防止移动端缩放 */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    /* background: var(--main-container-bg); */
    box-shadow:none
}

/* 主容器 - 统一所有页面的宽、高、左右边距 */
/* 所有页面都使用相同的主容器样式，无需区分页面类型 */
.main-container {
    /* 统一宽度 */
    max-width: 41.5rem;
    width: 100%;
    margin: 0 auto;
    background: var(--main-container-bg);
    /* 统一高度 - 为底部导航预留空间 */
    /* min-height: calc(100vh - 4.65rem - env(safe-area-inset-bottom));
    min-height: calc(100dvh - 4.65rem - env(safe-area-inset-bottom)); */
    min-height: 100vh;
    min-height: 100dvh;
    
    /* 统一边距 */
    /* padding: 0 0.83rem 0; */
    
    /* 统一布局属性 */
    position: relative;
    
    /* 为底部导航栏预留空间 */
    padding-bottom: calc(4.15rem + env(safe-area-inset-bottom));
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: env(safe-area-inset-bottom, 0);
    background: #fff;
    display: flex;
    z-index: var(--z-index-modal);
    width: 100vw;
    max-width: 41.5rem;
    height: 4.15rem;
    box-shadow: 0px -0.083rem 0.66rem 0px rgba(174, 185, 190, 0.5);
    left: 50%;
    transform: translateX(-50%);
    padding: 0 0.533rem;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    justify-content:center;
}

/*
.nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
}
*/

.nav-item.active .nav-label {
    color: #F36F20;
}

.nav-icon {
    width: 2.33rem;
    height: 2.33rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon img {
    width: 1.66rem;
    height: 1.66rem;
}

.nav-label {
    font-size: 14px;
    color: #adaeb6;
    font-weight: 500;
}

/* 响应式设计 - 横屏适配 */
@media screen and (orientation: landscape) {
    .main-container {
        padding: 0 0.66rem 0.83rem;
    }
}

/* 响应式设计 - 大屏设备 */
@media screen and (min-width: 768px) {
    .main-container {
        max-width: 41.5rem;
        margin: 0 auto;
    }
    .bottom-nav {
        height: 4.15rem;
    }
}

/* 响应式设计 - 小屏设备 */
@media screen and (max-width: 375px) {
    .main-container {
        padding: 1.33rem 1.33rem 0;
        /* 确保在小屏设备上正确显示 */
        /* min-height: calc(100vh - 4.65rem);
        min-height: calc(100dvh - 4.65rem); */
        min-height: 100vh;
        min-height: 100dvh;
        padding-bottom: calc(4.15rem + env(safe-area-inset-bottom));
    }
}

/* 超小屏幕优化 */
@media screen and (max-height: 568px) {
    .main-container {
        padding: 0.66rem 1.33rem 0;
        padding-bottom: calc(5.32rem + env(safe-area-inset-bottom));
    }
}

/* 通用导航栏样式 */
.nav-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    padding: 0;
    position: relative;
}

.back-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    left: 0rem;
}

.back-button img{
    width: 12px;
    height: 24px;
    margin-left: 18px;
}

.page-title {
    margin: 0;
    font-size: 1.41rem;
    line-height: 1.99rem;
    color: #FFF;
    font-size: 1.5rem;
}

/* 通用主内容区域样式 */
.main-content {
    flex-grow: 1;
    padding: 20px 15px 0;
    height: calc(90dvh - var(--header-h, 3.66rem));
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

/* 通用页面底部操作区样式 */
.page-footer {
    margin-top: auto;
}

.primary-button {
    width: 100%;
    height: 3.99rem;
    border: none;
    border-radius: 1.5rem;
    background: linear-gradient(147.02deg, #FFA13C 0%, #FF6B16 107.38%);
    color: #FFFFFF;
    font-size: 1.33rem;
    line-height: 1.83rem;
    cursor: pointer;
}

.primary-button:active {
    transform: scale(.98);
}

.primary-button.disabled {
    opacity: .5;            /* 视觉变灰 */
    cursor: not-allowed;    /* 禁用指针 */
    pointer-events: none;   /* 阻止点击 */
}

.primary-button:active:not(.disabled) {
    opacity: 0.9;
}

html{
    /* background-image: url('/static/images/body_bg.png');
    background-repeat: repeat;
    background-size: 60px 60px;
    background-position: top left; */
    background: linear-gradient(to bottom, #faa557 0px, #ffe4c1 375px, #ffe4c1 100%);
}

/* 滚动优化 */
body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;

    font-family: "PingFang SC" !important;
}

/* 安全区域适配 */
@supports (padding: max(0rem)) {
    .main-container {
        padding-bottom: max(calc(4.15rem), calc(4.15rem + env(safe-area-inset-bottom)));
    }
}

.chat-button{
    display: block;
    width: 64px;
    height: 32px;
    margin-right: 18px;
    user-select: none;
}


/* 系统提示窗样式 - 基于alert页面设计 */
.alert-modal-container {
    display: none;
    position: relative;
    width: 100%;
    max-width: 500px;
    background-color: #ffffff;
    border-radius: 20px;
    padding: 36px 24px;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}
/* 关闭按钮 */
.alert-modal-close-btn {
    position: absolute;
    top: 12px;
    right: 17px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.alert-modal-close-btn:hover {
    opacity: 0.7;
}

.alert-modal-close-btn img {
    width: 100%;
    height: 100%;
}

/* 内容区域 */
.alert-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

/* 标题 */
.alert-modal-title {
    margin: 0;
    color: #4d4d4d;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.7; /* Approx 30.6px */
    text-align: center;
}

/* 消息区域 */
.alert-modal-message {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
}

/* 警告图标 */
.alert-modal-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 4px; /* Visually align with the first line of text */
}

/* 提示文本 */
.alert-modal-text {
    margin: 0;
    color: #4d4d4d;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7; /* Approx 23.8px */
    text-align: left;
}

/* 按钮区域 */
.alert-modal-actions {
    display: flex;
    flex-direction: row;
    gap: 24px;
    width: 100%;
}

/* 按钮基础样式 */
.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    border-radius: 35px;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border: 1px solid transparent;
    flex: 1;
    box-sizing: border-box;
    padding: 9px 15px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* 主要按钮 */
.btn-primary {
    background: linear-gradient(147deg, #ffa13c 0%, #ff6b16 107.38%);
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(147deg, #ff8f2a 0%, #ff5a0a 107.38%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 22, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 次要按钮 */
.btn-secondary {
    background-color: #ffffff;
    color: #ff7e00;
    border-color: #ff7e00;
}

.btn-secondary:hover {
    background-color: #fff8f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 126, 0, 0.15);
}

.btn-secondary:active {
    transform: translateY(0);
}