:root {
    --primary-color: #26b170; /* 仿联想管理绿 */
    --hover-color: #f5f6f8;
    --text-main: #333;
    --text-sub: #888;
    --border-color: #eee;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --titlebar-height: 90px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #fff;
    overflow: hidden; /* 防止原生滚动条 */
    color: var(--text-main);
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-radius: 12px;
    overflow: hidden;
    background-color: #fff;
}

/* 顶部标题栏 & 导航 */
#title-bar {
    height: var(--titlebar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    -webkit-app-region: drag; /* 允许拖动窗口 */
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 240px;
}

.app-logo {
    width: 32px;
    height: 32px;
}

.app-name {
    font-weight: bold;
    font-size: 18px;
    color: #444;
}

.navigation-tabs {
    display: flex;
    gap: 30px;
    margin-left: 0;
    padding-top: 12px;
    padding-bottom: 4px;
    -webkit-app-region: no-drag;
}

.tab-item {
    background: none;
    border: none;
    font-size: 20px;
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-sub);
    position: relative;
    transition: color 0.3s;
}

.tab-item.active {
    color: var(--text-main);
    font-weight: bold;
}

.tab-item.active::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    -webkit-app-region: no-drag;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: #f1f3f5;
    padding: 6px 14px;
    border-radius: 20px;
    width: 240px;
}

.search-icon {
    width: 16px;
    color: #888;
    margin-right: 8px;
}

#search-input {
    background: none;
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
}

.window-controls {
    display: flex;
}

.win-btn {
    background: none;
    border: none;
    width: 44px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #666;
    transition: background 0.2s;
    border-radius: 4px;
    margin: 4px 2px;
}

.win-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.win-btn.close:hover {
    background-color: #ff4d4f;
    color: #fff;
}

.win-btn i {
    width: 16px;
    height: 16px;
}

/* 下拉设置菜单 */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
    -webkit-app-region: no-drag;
}

.settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 150px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 8px 0;
    margin-top: 4px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.dropdown-wrapper:hover .settings-dropdown,
.settings-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-item {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-item i {
    width: 14px;
    height: 14px;
    color: var(--text-sub);
}

.settings-item:hover {
    background-color: #f1f3f5;
    color: var(--primary-color);
}

.settings-item:hover i {
    color: var(--primary-color);
}

.settings-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

/* 固定的导航及筛选区 */
#fixed-nav-area {
    background-color: #fff;
    padding: 0 50px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    z-index: 10;
}

/* 主内容区 */
#main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 50px 40px 50px; /* 增加底部间距防版本号重合 */
    overflow-y: auto;
    background-color: #f8f9fa; /* 与顶部栏拉开视觉层次 */
}

/* 过滤栏 */
.filter-bar {
    margin-top: 15px;
    margin-bottom: 15px;
}

.filter-tags {
    display: flex;
    gap: 12px;
}

.tag {
    padding: 6px 16px;
    border-radius: 16px;
    background-color: #f1f3f5;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag:hover {
    background-color: #e9ecef;
}

.tag.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* 应用网格 */
.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding-bottom: 20px;
}

/* 微信全屏认证重构层 */
#login-overlay {
    position: absolute;
    top: var(--titlebar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #f6f8fb;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.login-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 35px 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    text-align: center;
    width: 380px;
    border: 1px solid rgba(0,0,0,0.04);
}
.login-logo {
    margin-bottom: 15px;
}
.login-box h2 {
    color: var(--text-main);
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: bold;
}
.login-box p {
    color: var(--text-sub);
    font-size: 13px;
    margin-bottom: 25px;
}
.wx-container {
    width: 300px;
    height: 400px;
    margin: 0 auto;
}

.app-card {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
    background-color: #fff; /* 卡片白底 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.app-card:hover {
    background-color: #f8f9fa;
}

.app-card.selected {
    background-color: #f2faf6;
    border: 1px solid rgba(38, 177, 112, 0.2);
}

/* 选中小勾 */
.app-card.selected::before {
    content: "\2713"; /* Checkmark */
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 18px;
    height: 18px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    font-weight: bold;
    z-index: 5;
}

.app-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    margin-right: 12px;
}

.app-info {
    flex-grow: 1;
    min-width: 0; /* 允许 flex 子项缩小以触发行内省略 */
}

.app-title {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-status {
    position: relative;
    height: 22px;
    display: flex;
    align-items: center;
}

.app-install-count {
    font-size: 11px;
    color: var(--text-sub);
    transition: opacity 0.2s;
}

.install-btn {
    position: absolute;
    left: 0;
    top: 0;
    padding: 2px 12px;
    border-radius: 12px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.app-card:hover .app-install-count {
    opacity: 0;
}

.app-card:hover .install-btn {
    opacity: 1;
    pointer-events: auto;
}

.install-btn:hover {
    opacity: 0.9;
}

/* 隐藏滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 3px;
}
/* 加载转场动画样式 */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease-out, visibility 0.6s;
    border-radius: 12px;
}

#loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 0, 0, 0.05);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    margin-bottom: 20px;
    display: inline-block;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader-text {
    color: #666;
    font-size: 14px;
    letter-spacing: 1px;
    font-weight: 400;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 底部加载指示 */
#load-more-indicator {
    text-align: center;
    padding: 30px 0 10px 0;
    color: var(--text-sub);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
#load-more-indicator.hidden {
    display: none;
}
.mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 下拉菜单样式 */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.settings-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 8px 0;
    min-width: 150px;
    z-index: 100;
}

.settings-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.settings-item:hover {
    background: #f8f9fa;
}

/* 底部固定动作栏 */
#footer-bar {
    position: relative;
    height: 70px;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 50px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
    z-index: 20;
}

#footer-bar.hidden {
    display: none;
}

.footer-left {
    font-size: 15px;
    color: var(--text-sub);
    display: flex;
    align-items: baseline;
}

.highlight-count {
    color: var(--primary-color);
    font-size: 22px;
    font-weight: bold;
    margin: 0 6px;
}

#btn-install-all {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 36px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

#btn-install-all:hover {
    background-color: #219a62;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 177, 112, 0.3);
}

#btn-install-all:active {
    transform: translateY(0);
}
