/* --- 应用详情页 CSS --- */
.app-detail-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-bg);
    z-index: 2000;
    overflow-y: auto; /* 允许详情页滚动 */
    color: var(--text-color);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.app-detail-page.show {
    opacity: 1;
    pointer-events: auto;
}

.app-detail-header {
    padding: 15px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--primary-bg);
    z-index: 2001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.back-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    flex-shrink: 0;
}

#appDetailErrorContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    height: calc(100% - 70px);
    text-align: center;
}

/* ★★★ 核心修改：让错误图片更大、更具响应性 ★★★ */
#errorImage {
    width: 60%; /* 相对于容器宽度缩放 */
    max-width: 250px; /* 显著增大最大宽度 */
    margin-bottom: 25px;
    opacity: 0.7;
}

#errorText {
    font-size: 1.1rem;
    color: var(--light-text-color);
    margin-bottom: 30px;
}

#errorHomeButton {
    background-color: var(--accent-color);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}
#errorHomeButton:hover {
    background-color: #ffac33;
    transform: scale(1.05);
}

.app-detail-top-wrapper {
    padding: 0 25px 25px 25px;
}

.app-detail-top-info {
    display: flex;
    align-items: center;
}

.app-detail-icon-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    flex-shrink: 0;
    margin-right: 20px;
    visibility: hidden; 
}

.app-detail-icon-placeholder.shimmer-placeholder {
    background-color: var(--placeholder-bg);
    animation: placeholder-shimmer 1.5s infinite linear;
    background-image: linear-gradient(90deg, var(--placeholder-bg) 0px, #4e4e4e 40px, var(--placeholder-bg) 80px);
    background-size: 600px;
}

.app-detail-icon-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.app-detail-icon-placeholder img.loaded {
    opacity: 1;
}


.app-detail-icon-placeholder.visible {
    visibility: visible;
}

.app-detail-text-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-detail-name {
    font-size: 28px;
    margin: 0 0 5px 0;
    font-weight: bold;
    min-height: 34px; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-detail-meta {
    font-size: 16px;
    color: var(--light-text-color);
    margin: 0;
    min-height: 20px; 
}

.placeholder-text {
    background-color: var(--placeholder-bg);
    border-radius: 6px;
    animation: placeholder-shimmer 1.5s infinite linear;
    background-image: linear-gradient(90deg, var(--placeholder-bg) 0px, #4e4e4e 40px, var(--placeholder-bg) 80px);
    background-size: 600px;
}
.placeholder-text-name {
    width: 200px;
    height: 28px;
    display: block;
}
.placeholder-text-meta {
    width: 150px;
    height: 16px;
    margin-top: 5px;
    display: block;
}
@keyframes placeholder-shimmer {
    0% { background-position: -300px; }
    100% { background-position: 300px; }
}

.button-group {
    display: flex;
    gap: 15px; 
    margin-top: 25px; 
    margin-bottom: 5px; 
    align-items: center; 
}

.download-button {
    flex-grow: 1; 
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    background-color: var(--accent-color);
    border: none;
    border-radius: 25px; 
    cursor: pointer;
    transition: background-color 0.3s;
}
.download-button:hover {
    background-color: #ffac33;
}

.report-button {
    width: 50px; 
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--secondary-bg); 
    color: var(--light-text-color); 
    border: 1px solid var(--border-color); 
    border-radius: 50%; 
    font-size: 22px; 
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, transform 0.2s;
    flex-shrink: 0; 
}
.report-button:hover {
    background-color: rgba(255, 140, 0, 0.2);
    color: var(--accent-color);
    transform: scale(1.05);
}

.separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 30px 0;
}

.app-detail-content {
    padding: 0 25px 25px 25px;
}

.app-detail-content h2 {
    font-size: 22px;
    margin-bottom: 15px;
}

.screenshots {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
}

.screenshots img {
    height: 250px;
    border-radius: 10px;
}

.app-detail-description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--light-text-color);
}

.app-detail-changelog {
    background-color: var(--secondary-bg);
    border-radius: 8px;
    padding: 15px 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: var(--light-text-color);
    white-space: pre-wrap; 
    word-break: break-word;
    border: 1px solid var(--border-color);
}

.user-info-card {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px; 
    border: 1px solid var(--border-color);
    min-height: 75px;
}

.user-info-card .user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info-card .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info-card .user-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
}

.user-info-card .user-account {
    font-size: 14px;
    color: var(--light-text-color);
    margin-top: 2px;
}

.user-info-card .loading-spinner.small {
    width: 25px;
    height: 25px;
    border-width: 3px;
    margin: 0;
}

.app-detail-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px; 
}

.app-detail-info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}
.app-detail-info-list li:last-child {
    border-bottom: none;
}

.app-detail-info-list .info-label {
    font-size: 16px;
    color: var(--light-text-color);
}

.app-detail-info-list .info-value {
    font-size: 16px;
    color: var(--text-color);
    font-weight: 500;
    text-align: right;
}

.app-detail-header-name {
    margin-left: 20px;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 100px); 
}
/* --- START: 在此处添加新代码 --- */

.loading-section {
    min-height: 150px; 
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.3s ease-in-out, height 0.3s ease-in-out, transform 0.3s ease-in-out; 
}

/* 核心修复：这个 .hidden 规则将彻底隐藏加载动画 */
.loading-section.hidden {
    display: none;
    opacity: 0;
    pointer-events: none; 
    height: 0; 
    overflow: hidden; 
    transform: translateY(-20px); 
    min-height: 0; 
}

.loading-message {
    color: var(--light-text-color);
    font-size: 16px;
}

/* 再次缩小详情页 Lottie 动画的尺寸 */
#lottie-detail-loader {
    width: 80px;  /* 从 100px 缩小到 80px */
    height: 80px; /* 从 100px 缩小到 80px */
    margin-bottom: 15px;
}

/* --- END: 新代码结束 --- */

.content-area {
    opacity: 0;
    transition: opacity 0.3s ease-in-out, height 0.3s ease-in-out, transform 0.3s ease-in-out; 
    pointer-events: none;
    height: 0; 
    overflow: hidden; 
}

.content-area.show {
    opacity: 1;
    pointer-events: auto;
    height: auto; 
    overflow: visible; 
    transform: translateY(0); 
}

.app-item.hide-original-icon .app-icon {
    opacity: 0;
    transition: opacity 0.3s ease-out; 
}

.app-icon-clone {
    position: absolute;
    z-index: 2002; 
    transition: all 0.3s ease-in-out; 
}
.app-icon-clone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit; 
}

@media (max-width: 768px) {
    .app-detail-icon-placeholder { width: 70px; height: 70px; }
    .app-detail-name { font-size: 24px; min-height: 29px; }
    .placeholder-text-name { width: 180px; height: 24px; }
    .app-detail-meta { font-size: 14px; min-height: 18px; }
    .placeholder-text-meta { width: 130px; height: 14px; }
    .app-detail-header-name { font-size: 18px; }
    .download-button { padding: 12px; font-size: 16px; }
    .report-button { width: 45px; height: 45px; font-size: 20px; }
}

@media (min-width: 992px) {
    .app-detail-top-wrapper { display: flex; justify-content: space-between; align-items: center; }
    .button-group { margin-top: 0; margin-bottom: 0; flex-shrink: 0; flex-direction: row; width: auto; }
    .download-button { flex-grow: 0; width: 180px; }
    .app-detail-content { padding-top: 25px; }
}

.app-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 30px;
}

/* ★★★ 核心修改：更新标签样式 ★★★ */
.app-detail-tag-item {
    background-color: rgba(255, 140, 0, 0.2); /* 半透明橙色背景 */
    color: var(--text-color); /* 白色文字 */
    padding: 8px 16px; /* 调整内边距 */
    border-radius: 8px; /* 圆角矩形 */
    font-size: 14px;
    border: none; /* 移除描边 */
    font-weight: 500;
}