/* 装机必备 - 应用商店样式 */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f7;
    color: #1d1d1f;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* 侧边导航 */
.side-nav {
    width: 220px;
    background-color: rgba(255, 255, 255, .9);
    box-shadow: 0 1px 10px rgba(0, 0, 0, .05);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1000;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all .3s ease;
}

.side-nav::-webkit-scrollbar {
    width: 6px;
}

.side-nav::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, .2);
    border-radius: 3px;
}

.app-logo {
    display: none;
}

.nav-items {
    padding: 15px 0;
    padding-top: 20px;
}

.nav-item {
    padding: 12px 15px;
    font-size: 16px;
    font-weight: 500;
    color: #1d1d1f;
    cursor: pointer;
    display: block;
    text-decoration: none;
    margin: 2px 10px;
    border-radius: 10px;
    transition: all .2s ease;
}

.nav-item:hover {
    background-color: rgba(0, 122, 255, .1);
    color: #007aff;
}

.nav-item.active {
    background-color: #0057b3;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 87, 179, .3);
}

.nav-item:focus {
    outline: none;
    background-color: rgba(0, 122, 255, .15) !important;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, .2);
    color: #007aff;
}

.nav-item.active:focus {
    background-color: #0057b3 !important;
    box-shadow: 0 0 0 2px rgba(0, 57, 153, .3);
    color: #fff;
}

.clear-cache {
    padding: 15px;
    text-align: center;
    margin-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, .05);
}

.clear-cache-btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background-color: rgba(0, 122, 255, .1);
    color: #007aff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
}

.clear-cache-btn:hover {
    background-color: rgba(0, 122, 255, .2);
}

.clear-cache-btn:focus {
    outline: none;
    background-color: rgba(0, 122, 255, .3);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, .2);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 20px;
    transition: all .3s ease;
    max-width: 1000px;
}

/* 公告栏 */
.announcement {
    background-color: #fff;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .05);
    overflow: hidden;
    height: 50px;
    position: relative;
    display: flex;
    align-items: center;
}

.announcement-text {
    text-decoration: none;
    display: block;
    height: 40px;
    line-height: 40px;
    color: #1d1d1f;
    font-size: 16px;
    position: absolute;
    width: 100%;
    left: 0;
    padding: 0 15px;
    text-align: center;
    transition: transform .5s ease-in-out;
    opacity: 0;
}

.announcement-text.active {
    opacity: 1;
    transform: translateY(0);
}

.announcement-text.highlight {
    color: #ff453a;
}

/* 标签页 */
.tab-pane {
    display: none;
    padding: 10px 0;
}

.tab-pane.active {
    display: block;
}

/* 应用列表 */
.app-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
    max-width: 100%;
}

.app-list li {
    border-radius: 16px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    transition: all .3s ease;
    border: 1px solid rgba(0, 0, 0, .04);
    position: relative;
    margin-bottom: 5px;
    padding: 3px;
}

.app-list li:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 122, 255, .15);
    border-color: rgba(0, 122, 255, .2);
}

.app-list li.selected,
.app-list li:focus-within {
    background-color: rgba(0, 122, 255, .05);
    border: 1px solid rgba(0, 122, 255, .5);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, .2);
}

.app-list li:focus,
.app-list li a:focus {
    outline: none;
    background-color: rgba(0, 122, 255, .05);
    border: 1px solid rgba(0, 122, 255, .5);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, .2);
    transform: translateY(-3px);
}

.app-list li a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.app-card {
    display: flex;
    padding: 12px 18px;
    align-items: center;
    width: 100%;
    border-radius: 14px;
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-info {
    flex: 1;
    margin-left: 20px;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    text-decoration: none;
}

.app-explain {
    font-size: 15px;
    color: #6e6e73;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.xiazai {
    margin-left: 20px;
}

/* 下载按钮 */
.btn-download {
    background-color: #007aff;
    color: #fff;
    border: none;
    border-radius: 22px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all .3s ease;
    min-width: 100px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 122, 255, .2);
}

.btn-download:hover {
    background-color: #0062cc;
    box-shadow: 0 4px 12px rgba(0, 122, 255, .3);
    transform: translateY(-1px);
}

/* 安装按钮（可点击状态）- 蓝色底白色字 */
.btn-download:not(:disabled):not(.downloading):not(.verifying):not(.installing):not(.error):not(.queued) {
    background-color: #007aff !important;
    color: #fff !important;
}

.btn-download.queued {
    background-color: #5856d6;
}

.btn-download.downloading {
    background-color: #34c759;
}

.btn-download.verifying {
    background-color: #ff9f0a;
}

.btn-download.installing {
    background-color: #34c759;
}

.btn-download.error {
    background-color: #ff3b30;
}

.btn-download:disabled {
    background-color: #8e8e93;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 网络错误提示 */
#networkError {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .85);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    padding: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#networkError h2 {
    color: #ff453a;
    margin-bottom: 20px;
    font-weight: 600;
}

#networkError p {
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.5;
    max-width: 500px;
}

#retryButton {
    background: #007aff;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all .2s ease;
}

#retryButton:hover {
    background: #0062cc;
}

#retryCount {
    color: #ff9f0a;
    font-weight: bold;
    margin-top: 15px;
}

/* 加载动画 */
#loadingSpinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top: 4px solid #fff;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* 应用加载动画 */
#appLoading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, .95);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: opacity .5s ease;
}

#appLoading h2 {
    color: #007aff;
    margin-bottom: 20px;
    font-weight: 600;
}

#appLoadingSpinner {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 5px solid rgba(0, 122, 255, .2);
    border-radius: 50%;
    border-top: 5px solid #007aff;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

#appLoading p {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .side-nav {
        width: 180px;
    }
    
    .main-content {
        margin-left: 180px;
        max-width: calc(100% - 180px);
    }
    
    .app-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 576px) {
    .side-nav {
        width: 60px;
    }
    
    .side-nav .app-logo h1,
    .side-nav .nav-item span {
        display: none;
    }
    
    .side-nav .nav-item {
        text-align: center;
        padding: 12px 0;
    }
    
    .side-nav .clear-cache-btn {
        font-size: 0;
    }
    
    .side-nav .clear-cache-btn:before {
        content: "🧹";
        font-size: 18px;
    }
    
    .main-content {
        margin-left: 60px;
        max-width: calc(100% - 60px);
    }
    
    .app-icon {
        width: 60px;
        height: 60px;
    }
    
    .app-title {
        font-size: 18px;
    }
    
    .app-explain {
        font-size: 14px;
    }
    
    .btn-download {
        min-width: 90px;
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* 自定义提示弹窗 */
#customAlert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#customAlert.show {
    display: flex;
}

.custom-alert-box {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.custom-alert-title {
    font-size: 20px;
    font-weight: 600;
    color: #007aff;
    margin-bottom: 15px;
    text-align: center;
}

.custom-alert-message {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: center;
    white-space: pre-line;
}

.custom-alert-button {
    width: 100%;
    padding: 12px;
    background: #007aff;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-alert-button:hover {
    background: #0062cc;
}

.custom-alert-button:active {
    transform: scale(0.98);
}

/* 链接样式重置 */
a.nav-item {
    text-decoration: none;
}

a[data-filename] {
    text-decoration: none;
}

.app-list a,
.app-list a:hover,
.app-list a:visited,
.app-list a:active,
.app-title a,
.app-title a:hover,
.app-title a:visited,
.app-title a:active,
.app-explain a,
.app-explain a:hover,
.app-explain a:visited,
.app-explain a:active,
a[data-filename],
a[href^="javascript"] {
    text-decoration: none !important;
    color: inherit;
}
