:root {
    /* GitHub Dark Theme Palette */
    --bg-body: #0d1117;
    --bg-card: #161b22;
    --border-color: #30363d;
    --text-main: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --btn-primary-bg: #238636;
    --btn-primary-hover: #2ea043;
    --btn-text: #ffffff;
    --card-radius: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

body {
    min-height: 100vh;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Layout */
.main-container {
    max-width: 1012px; /* GitHub container width */
    margin: 0 auto;
    padding: 40px 16px;
    width: 100%;
    flex: 1;
}

.page-header {
    text-align: left;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.page-header h1 {
    font-size: 24px; /* 更克制的字号 */
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 i {
    color: var(--text-secondary);
    font-size: 20px;
}

.page-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px; /* 更紧凑的间距 */
    padding-bottom: 40px;
}

/* Card Styles */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 1px var(--text-secondary); /* GitHub 风格的高亮 */
    transform: none; /* 移除位移 */
    background: var(--bg-card); /* 保持背景不变 */
}

.card-header {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    background: #21262d; /* 深色背景 */
    border: 1px solid var(--border-color);
    border-radius: 50%; /* 圆形图标背景 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 20px;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color); /* 链接色作为标题色 */
    margin-bottom: 8px;
    cursor: pointer;
}

.app-name:hover {
    text-decoration: underline;
}

.meta-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.divider {
    color: var(--border-color);
}

.description {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.5;
    margin-bottom: 24px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.action-area {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--btn-primary-bg);
    color: var(--btn-text);
    text-decoration: none;
    padding: 5px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    border: 1px solid rgba(240, 246, 252, 0.1);
    transition: background-color 0.2s;
}

.download-btn:hover {
    background-color: var(--btn-primary-hover);
    text-decoration: none;
    box-shadow: none;
    transform: none;
}

.download-btn:active {
    background-color: #268033;
}

.update-date {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Footer */
.page-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Skeleton Loading */
.skeleton-card .skeleton-icon {
    width: 48px;
    height: 48px;
    background: #21262d;
    border-radius: 50%;
    margin-bottom: 16px;
}

.skeleton-text {
    background: #21262d;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.title-skeleton { width: 40%; height: 20px; }
.meta-skeleton { width: 30%; height: 14px; margin-bottom: 16px; }
.desc-skeleton { width: 90%; height: 16px; margin-bottom: 8px; }
.skeleton-btn { width: 80px; height: 32px; background: #21262d; border-radius: 6px; margin-top: 16px; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Responsive */
@media (max-width: 640px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
    .page-header {
        text-align: center;
    }
    .page-header h1 {
        justify-content: center;
    }
}