/* Tailwind CSS v3 */
/* 自定义样式 */

/* 确保Font Awesome图标正确显示 */
.fa {
    font-family: 'FontAwesome' !important;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: inline-block;
}

/* 刷新按钮图标样式 */
#refresh-btn .fa-refresh {
    font-size: 1rem;
    margin-right: 0.5rem;
}

/* 加载状态图标样式 */
#data-container .fa-spinner {
    font-size: 3rem;
    color: #1e40af;
    margin-bottom: 1rem;
}

/* 联系信息图标样式 */
footer .fa {
    font-size: 1.25rem;
    margin-right: 0.5rem;
    color: #1e40af;
}

/* 品牌标题样式已移除，改用Tailwind CSS类实现 */

/* 品牌选项卡容器 */
#brand-tabs {
    background-color: #f3f4f6;
    padding: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 品牌选项卡基本样式 */
.brand-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #6b7280;
    background-color: #e5e7eb;
    border: 1px solid transparent;
    white-space: nowrap;
}

/* 品牌选项卡悬停效果 */
.brand-tab:hover {
    background-color: #d1d5db;
    color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 品牌选项卡激活状态 */
.brand-tab.active {
    background-color: white;
    color: #1e40af;
    border: 1px solid #1e40af;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
    font-weight: 600;
}

/* 苹果品牌颜色 */
.brand-tab[data-brand="苹果"].active {
    background-color: #ffffff;
    color: #a2aaad;
    border-color: #a2aaad;
}

/* 荣耀品牌颜色 */
.brand-tab[data-brand="荣耀"].active {
    background-color: #ffffff;
    color: #f70000;
    border-color: #f70000;
}

/* 华为品牌颜色 */
.brand-tab[data-brand="华为FD"].active, 
.brand-tab[data-brand="华为ND"].active {
    background-color: #ffffff;
    color: #ff4d4f;
    border-color: #ff4d4f;
}

/* OPPO品牌颜色 */
.brand-tab[data-brand="OPPO"].active {
    background-color: #ffffff;
    color: #00aeff;
    border-color: #00aeff;
}

/* VIVO品牌颜色 */
.brand-tab[data-brand="VIVO"].active {
    background-color: #ffffff;
    color: #00c300;
    border-color: #00c300;
}

/* 一加品牌颜色 */
.brand-tab[data-brand="一加"].active {
    background-color: #ffffff;
    color: #ff5000;
    border-color: #ff5000;
}

/* IQOO品牌颜色 */
.brand-tab[data-brand="IQOO"].active {
    background-color: #ffffff;
    color: #00c300;
    border-color: #00c300;
}

/* Realme品牌颜色 */
.brand-tab[data-brand="Realme"].active {
    background-color: #ffffff;
    color: #ff5000;
    border-color: #ff5000;
}

/* 小米品牌颜色 */
.brand-tab[data-brand="小米"].active {
    background-color: #ffffff;
    color: #ff6700;
    border-color: #ff6700;
}

/* 三星品牌颜色 */
.brand-tab[data-brand="三星"].active {
    background-color: #ffffff;
    color: #1428a0;
    border-color: #1428a0;
}

/* 手机项样式 */
.phone-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    white-space: normal;
    min-height: 50px;
    line-height: 1.5;
}

/* 手机项悬停效果 */
.phone-item:hover {
    background-color: #f3f4f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 手机样式 */
.phone-model {
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
    flex-shrink: 1;
    min-width: 100px;
    max-width: 300px;
    margin-right: 1rem;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

/* 手机颜色和价格容器 */
.phone-item > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    flex-grow: 1;
}

/* 手机颜色样式 */
.phone-color {
    color: #4b5563;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    background-color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
}

/* 手机价格样式 */
.phone-price {
    font-weight: 700;
    color: #f59e0b;
    margin-left: 0.5rem;
    font-size: 1.125rem;
}

/* 刷新按钮样式 */
.refresh-button {
    position: relative;
    display: inline-block;
}

.refresh-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background-color: #ef4444;
    color: white;
    font-size: 0.75rem;
    border-radius: 9999px;
    height: 1rem;
    width: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 密码输入样式 */
.password-input {
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin-right: 0.5rem;
    width: 200px;
}

/* 确认按钮样式 */
.confirm-button {
    background-color: #1e40af;
    color: white;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-button:hover {
    background-color: #1d4ed8;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
}

/* 数据容器样式 - 确保sticky正常工作 */
#data-container {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: visible;
    position: relative;
    z-index: 1;
}

/* 品牌区块样式 */
.brand-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #fafafa;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
    overflow: visible;
}

/* 加载状态样式 */
#data-container .text-center {
    background-color: #f9fafb;
    padding: 3rem;
    border-radius: 0.5rem;
    border: 1px dashed #d1d5db;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #brand-tabs {
        /* 移除横向滚动，改为自动换行 */
        overflow-x: visible;
        padding-bottom: 0.5rem;
    }
    
    .brand-tab {
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* 为移动设备优化手机项布局 */
    .phone-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem;
    }
    
    .phone-model {
        min-width: 100%;
        max-width: 100%;
        font-size: 0.875rem;
        margin-right: 0;
        margin-bottom: 0.5rem;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.4;
    }
    
    .phone-item > div {
        gap: 0.5rem;
        width: 100%;
    }
    
    .phone-color {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

.content-auto {
    content-visibility: auto;
}

/* 品牌标题粘性定位样式 - 优化QQ浏览器兼容性 */
.brand-header {
    /* 核心sticky定位功能 - 提高兼容性 */
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    
    /* 基本样式 */
    background-color: white !important;
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    margin-bottom: 1rem !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 移动端优化 */
@media (max-width: 768px) {
    /* 修复移动端sticky定位问题 */
    .brand-section {
        /* 移除可能干扰sticky的overflow */
        overflow: visible !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* 修复移动端sticky定位 */
    .brand-header {
        /* 确保sticky在移动端正常工作 */
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        
        /* 增强可见性 */
        background-color: #ffffff !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
        border: 1px solid #e5e7eb !important;
        margin-bottom: 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        
        /* 避免transform影响sticky */
        transform: none !important;
        will-change: auto !important;
        
        /* 确保在微信和QQ浏览器中正常显示 */
        -webkit-transform: none !important;
        transform-style: flat !important;
    }
    
    /* 修复微信浏览器兼容性 */
    .brand-header {
        /* 微信浏览器特殊处理 */
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 9999 !important;
        background-color: #ffffff !important;
        padding: 10px 15px !important;
    }
    
    /* 修复QQ浏览器兼容性 */
    .brand-header {
        /* QQ浏览器特殊处理 */
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 9999 !important;
        background-color: #ffffff !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    /* 修复苹果Safari浏览器 */
    .brand-header {
        /* Safari浏览器特殊处理 */
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        background-color: #ffffff !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* 确保数据容器不会干扰sticky */
#data-container {
    /* 移除可能干扰sticky的overflow */
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

/* 浮动滚动按钮样式 */
.scroll-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999; /* 提高z-index确保按钮在最上层 */
}

.scroll-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #1e40af; /* 不透明的主色调 */
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0.9; /* 提高初始透明度 */
    display: block; /* 确保按钮显示 */
}

.scroll-btn:hover {
    background-color: rgba(30, 64, 175, 1);
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.scroll-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .scroll-buttons {
        right: 10px;
        bottom: 10px;
    }
    
    .scroll-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}
