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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 主容器 */
.container {
    height: 100vh;
    background: #F7F8FA;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: 100vh;
}

/* 左侧侧边栏 */
.left-sidebar {
    width: 224px;
    background: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
    transition: width 0.3s ease;
}

/* 侧边栏折叠状态样式 */
.left-sidebar.collapsed {
    width: 88px;
}

.left-sidebar.collapsed .logo-area {
    padding: 0;
}

.left-sidebar.collapsed .logo-full {
    opacity: 0;
}

.left-sidebar.collapsed .logo-mini {
    opacity: 1;
}

.left-sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.left-sidebar.collapsed .menu-item {
    padding-left: 16px;
    justify-content: center;
}

.left-sidebar.collapsed .menu-text {
    opacity: 0;
    width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.left-sidebar.collapsed .menu-image-placeholder {
    display: none;
}

.left-sidebar.collapsed .bottom-area {
    padding: 16px 0;
}

.left-sidebar.collapsed .home-button,
.left-sidebar.collapsed .community-link,
.left-sidebar.collapsed .community-button {
    width: 56px;
    font-size: 12px;
}

.left-sidebar.collapsed .user-info-left {
    gap: 0;
    justify-content: center;
    flex: 1;
}

.left-sidebar.collapsed .user-name {
    opacity: 0;
    width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.left-sidebar.collapsed .user-icon-right {
    display: none;
}

.logo-area {
    height: 80px;
    border-bottom: 1px solid #f2f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.logo-full, .logo-mini {
    position: absolute;
    opacity: 1;
    transition: opacity 0.3s ease;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-mini {
    opacity: 0;
}
.logo-text {
    font-weight: bold;
    font-size: 18px;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.content-inner {
    min-height: 710px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 细滚动条样式 */
.content-wrapper::-webkit-scrollbar {
    width: 4px;
}

.content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.content-wrapper::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}

.content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.menu-area {
    padding: 16px;
    flex: 1;
}

.menu-link {
    display: block;
}

.menu-item {
    height: 56px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding-left: 24px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 8px;
}

.menu-item:hover {
    background: #f2f3f5;
}

.menu-item.active {
    background: #f2f3f5;
}

.menu-icon {
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    margin-right: 16px;
    margin-top: 3px;
}

.menu-icon.icon-jxtj {
    background-image: url('../img/jxtj.svg');
}

.menu-item.active .menu-icon.icon-jxtj {
    background-image: url('../img/jxtj2.svg');
}

.menu-icon.icon-lmfx {
    background-image: url('../img/lmfx.svg');
}

.menu-item.active .menu-icon.icon-lmfx {
    background-image: url('../img/lmfx2.svg');
}

.menu-icon.icon-sjtj {
    background-image: url('../img/sjtj.svg');
}

.menu-item.active .menu-icon.icon-sjtj {
    background-image: url('../img/sjtj2.svg');
}

.menu-icon.icon-zjgx {
    background-image: url('../img/zjgx.svg');
}

.menu-item.active .menu-icon.icon-zjgx {
    background-image: url('../img/zjgx2.svg');
}

.menu-icon.icon-nrsq {
    background-image: url('../img/lrsq.svg');
}


.menu-icon.icon-xmpt {
    background-image: url('../img/xmpt.svg');
}


.menu-text {
    color: #4E5969;
    font-size: 16px;
    opacity: 1;
    transition: opacity 0.3s ease, width 0.3s ease;
    width: auto;
    overflow: hidden;
    white-space: nowrap;
}

.menu-item.active .menu-text {
    color: #1D2129;
}

.divider {
    height: 1px;
    background: #d0d0d0;
    margin: 8px 0;
}

.menu-image-placeholder {
    width: 192px;
    height: 68px;
    margin: 16px auto 0;
}

.menu-image-placeholder img {
    width: 100%;
    height: 100%;
    display: block;
}

.left-sidebar.collapsed .menu-image-placeholder {
    display: none;
}

.bottom-wrapper {
    margin-top: auto;
}

.bottom-area {
    padding: 16px;
}

.home-button {
    width: 192px;
    height: 36px;
    border: 1px solid #e4e1ef;
    border-radius: 8px;
    background: white;
    color: #1D2129;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto;
}

.community-link {
    display: block;
    width: 192px;
    margin: 0 auto;
}

.community-button {
    width: 192px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #F7F8FA;
    color: #86909C;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 8px;
}

.user-info-area {
    height: 64px;
    border-top: 1px solid #f2f3f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.user-info-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #ccc;
    border-radius: 50%;
    background: url('../img/tx.png') no-repeat;
    background-size: 100% 100%;
}

.user-name {
    font-size: 14px;
    color: #1D2129;
}


.user-icon-right {
    width: 20px;
    height: 20px;
    background: url('../img/folding.svg') no-repeat;
    cursor: pointer;
    &.user-icon-right2 {
        background: url('../img/folding2.svg') no-repeat;
        margin-left: 6px;
        display: none;
    }
    background-size: 100% 100%;
}

/* 主内容区域 */
.main-area-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #F7F8FA;
}

.main-area {
    min-height: 100%;
}

/* 顶部通栏图片 */
.banner-area {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    background: #e0e0e0;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 内容区域 */
.content-area {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

/* 搜索区域 */
.search-section {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 48px;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 886px;
    height: 64px;
    background: white;
    border-radius: 32px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #1D2129;
    background: transparent;
}

.search-input::placeholder {
    color: #86909C;
}

.search-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FF7E00;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.search-icon {
    width: 20px;
    height: 20px;
}

/* Tab 区域 */
.tab-section {
    display: flex;
    gap: 12px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.tab-button {
    height: 40px;
    background: #F2F3F5;
    border-radius: 8px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button:hover {
    background: #E8E9EB;
}

.tab-button.active {
    background: white;
}

.tab-text {
    font-size: 14px;
    color: #1D2129;
    white-space: nowrap;
}

.tab-button.active .tab-text {
    color: #FF7D00;
}

/* 卡片网格 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
    gap: 16px;
    margin-top: 32px;
    padding-bottom: 48px;
}

/* 移动端卡片居中 */
@media (max-width: 768px) {
    .cards-grid {
        justify-items: center;
    }
}

.book-card {
    max-width: 226px;
    height: 287px;
    background: white;
    border-radius: 10px;
    border: 1px solid #E5E6EB;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.book-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.book-image {
    width: 100%;
    height: 175px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
}

.book-content {
    padding: 14px;
}

.book-type {
    font-size: 12px;
    color: #C9CDD4;
    line-height: 20px;
}

.book-title {
    font-size: 16px;
    color: #1D2129;
    line-height: 26px;
    margin-top: 12px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-description {
    font-size: 14px;
    color: #86909C;
    line-height: 24px;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 滚动条样式 */
.main-area-wrapper::-webkit-scrollbar {
    width: 6px;
}

.main-area-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.main-area-wrapper::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.main-area-wrapper::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.book-cover {
    width: 168px;
    height: 241px;
    box-shadow: 0px 0px 10px 0px rgba(105,120,142,0.3);
    position: relative;
    top: 16px;
}
.clear-button {
    cursor: pointer;
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    border: none;
    width: 20px;
    height: 20px;
    img {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 750px) {
    .user-icon-right2 {
        display: none !important;
    }
    .banner-area {
        height: 5rem;
    }
    .search-section {
        margin-top: 1rem;
    }
    .content-area {
        padding: 0 1rem;
    }
    .search-wrapper {
        height: 3rem;
        padding-right: 4px;
    }
    .cards-grid {
        margin-top: 1rem;
    }
    

    .left-sidebar.collapsed {
        width: 58px !important;
    }
    .menu-area {
        padding: 4px;
    }
    .menu-item {
        height: 46px;
        padding-left: 0 !important;
    }
    .menu-icon {
        margin-right: 0;
    }
    .logo-area img {
        width: 80%;        
    }
    .content-inner {
        min-height: auto;
    }
    .user-info-area {
        padding: 1rem 0;
        height: auto;
    }
    .left-sidebar.collapsed .home-button, .left-sidebar.collapsed .community-link, .left-sidebar.collapsed .community-button {
        width: auto;
    }
    .left-sidebar.collapsed .bottom-area {
        width: 80%;
        margin: auto;
    }
    .recent-cards-list {
        margin-top: 1rem;
    }
    .scroll-button.scroll-left {
        left: -.4rem;
    }
    .scroll-button.scroll-right {
        right: -.4rem;
    }
}