// tab1.page.scss
:root {
    --gold: #FFD700;
    --dark: #f04a4a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "STXingkai", "华文行楷", cursive;
}

body {
    background: 
        linear-gradient(135deg, rgba(60, 60, 60, 0.9) 0%, rgba(30, 30, 30, 0.95) 100%),
        url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjEiLz4KICA8cGF0aCBkPSJNMjAgMjBMODAgODBNODAgMjBMMjAgODAiIHN0cm9rZT0iI2ZmZCIgc3Ryb2tlLXdpZHRoPSIxIi8+Cjwvc3ZnPg==');
    min-height: 100vh;
    color: var(--gold);
}

/* 顶部标题 */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 50px;
    background: rgb(255, 213, 5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    letter-spacing: 4px;
    z-index: 100;
    backdrop-filter: blur(5px);
    border-bottom: 2px solid var(--gold);
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(198, 160, 160, 0.5);
}

.main-content {
    padding: 80px 20px 90px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    background: transparent; // 新增
}

.search-bar {
    display: flex;
    background: rgba(253, 236, 137, 0.884);
    border-radius: 30px;
    padding: 12px 20px;
    border: 2px solid var(--gold);
    backdrop-filter: blur(4px);
}

.city-select {
    border: none;
    background: transparent;
    color: var(--gold);
    padding-right: 20px;
    border-right: 2px solid rgba(255, 217, 0, 0.964);
    font-size: 1rem;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--gold);
    padding: 8px 20px;
    font-size: 1rem;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.tactics-btn {
    aspect-ratio: 1;
    background: rgba(247, 148, 34, 0.7); 
    border: 2px solid var(--gold);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(194, 175, 175, 0.3);
}

.tactics-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 217, 0, 0.995);
}

.tactics-btn:active {
    transform: scale(0.98);
}

.tactics-icon {
    width: 50px;
    height: 50px;
    background-size: contain;
    margin-bottom: 12px;
}

.btn-text {
    text-align: center;
    line-height: 1.3;
}

.btn-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.btn-subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
}

.ad-banner {
    background: linear-gradient(to right, #e99433, #c2aeae);
    border-radius: 20px;
    padding: 15px;
    display: flex;
    align-items: center;
    border: 1px solid rgb(255, 217, 0);
}

.ad-text {
    font-size: 1.8rem;
    writing-mode: vertical-rl;
    letter-spacing: 5px;
    padding: 10px 0;
}

.ad-scroll {
    flex: 1;
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-left: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ad-scroll::-webkit-scrollbar { 
    display: none;
}

.ad-item {
    flex-shrink: 0;
    width: 150px;
    height: 100px;
    background: #c4abab;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.ad-item::after {
    content: "兵法精要";
    position: absolute;
    bottom: 12px;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(193, 153, 153, 0.6);
}

/* 新增选项卡样式 */
.share-tabs {
    display: flex;
    border-bottom: 2px solid rgba(255, 217, 0, 0.919);
    margin-bottom: 20px;
    
    .tab-item {
        flex: 1;
        padding: 15px;
        text-align: center;
        position: relative;
        font-size: 1rem;
        transition: all 0.3s ease;
        cursor: pointer;
        
        &:hover {
            background: rgba(255, 217, 0, 0.2);
        }
        
        &.active {
            font-weight: 600;
            
            &::after {
                content: '';
                position: absolute;
                bottom: -2px;
                left: 50%;
                transform: translateX(-50%);
                width: 70%;
                height: 3px;
                background: var(--gold);
                transition: width 0.3s ease;
            }
        }
    }
    .tab-item {
        cursor: pointer;
        transition: all 0.3s ease;
        
        &.active {
            font-weight: 600;
            &::after {
                /* 下划线动画 */
                content: '';
                position: absolute;
                bottom: -2px;
                left: 50%;
                transform: translateX(-50%);
                width: 70%;
                height: 3px;
                background: var(--gold);
                transition: width 0.3s ease;
            }
        }
    }
}
.share-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    animation: fadeIn 0.3s ease;
  
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
  }


.share-card {
    background: #c5b1b1;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 3/4;
    position: relative;
    transition: transform 0.3s ease;
    
    &:hover {
        transform: translateY(-5px);
    }
    
    &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border: 2px solid var(--gold);
        border-radius: 20px;
        opacity: 0.2;
    }
}

.card-image {
    height: 70%;
    background: linear-gradient(45deg, #e48519 0%, #bea8a8 100%);
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.card-info {
    padding: 15px;
}

// 修改卡片标题样式
.card-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.4;
    
    /* 多行文本截断方案 */
    display: -webkit-box;
    display: -moz-box;
    display: flex;
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
    box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    
    /* 备用方案 */
    max-height: 1.4em; // line-height × 行数
    @supports not (line-clamp: 1) {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
    }
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-tag {
    font-size: 0.8rem;
    opacity: 0.9;
    padding: 4px 10px;
    background: rgb(255, 217, 0);
    border-radius: 5px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #b2adad;
    border: 1px solid var(--gold);
}

/* 其他保持不变的样式... */

/* 覆盖分享卡片的字体 */
.share-card,
.share-card * {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 70px;  /* 加高导航栏 */
    background: rgba(200, 177, 177, 0.97);
    display: flex;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--gold);
    box-shadow: 0 -4px 15px rgba(189, 162, 162, 0.3);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: all 0.3s ease;
    padding: 8px 15px;
    border-radius: 10px;
}
.nav-item:hover {
    background: rgb(255, 217, 0);
    opacity: 1;
}
.nav-item.active {
    opacity: 1;
    transform: scale(1.1);
    background: rgb(255, 217, 0);
}
.nav-icon {
    width: 28px;  /* 放大图标 */
    height: 28px;
    background-size: contain;
}

/* 加载动画 */
@keyframes loadingShimmer {
    100% { left: 200%; }
}
.card-image::after,
.ad-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.667) 0%,
        rgba(255, 255, 255, 0.879) 50%,
        rgba(255, 255, 255, 0.747) 100%
    );
    animation: loadingShimmer 2s infinite;
}
