* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 字体大小归一化，使1rem = 10px */
html {
    font-size: 62.5%; /* 16px * 0.625 = 10px */
}

body {
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    font-size: 1.4rem; /* 14px */
}

.container {
    max-width: 120rem; /* 1200px */
    margin: 0 auto;
    padding: 2rem; /* 20px */
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* 左侧区域：Logo + 标题 */
.header-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.logo {
    width: 18rem;
    height: 6rem;
    border-radius: 0.8rem;
    overflow: hidden;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

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

/* 标题区域 */
.header-titles {
    text-align: left;
}

.main-title {
    font-size: 2.4rem;
    color: white;
    margin: 0 0 0.3rem 0;
    font-weight: bold;
    text-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.3);
}

.sub-title {
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: normal;
    text-shadow: 0 0.1rem 0.2rem rgba(0, 0, 0, 0.3);
}

/* Telegram 联系方式 */
.header-right {
    flex: 0 0 auto;
}

.telegram-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 0.1rem solid rgba(255, 255, 255, 0.2);
}

.telegram-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-0.2rem);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

.telegram-icon {
    width: 2rem;
    height: 2rem;
}

.telegram-text {
    font-size: 1.4rem;
    font-weight: 500;
}

/* 应用卡片链接样式 */
.app-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    width: calc((100% - 4 * 1.5rem) / 5);
    min-width: 18rem;
    flex: 0 0 auto;
}

.app-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.app-card-link:visited {
    color: inherit;
}

.app-card-link:focus {
    outline: none;
}

/* Flex布局替代Grid布局 */
.apps-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: flex-start;
    width: 100%; /* 填满整个container宽度 */
    align-items: stretch;
}

.app-card {
    background: white;
    border-radius: 1.2rem; /* 12px */
    padding: 1.5rem; /* 15px */
    box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: box-shadow 0.3s ease;
    width: 100%; /* 填满父容器 */
    min-height: 20rem; /* 200px */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 0 0 auto;
    height: 100%;
}

.app-card:hover {
    box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.15);
}

.app-icon {
    position: relative;
    width: 12rem; /* 120px，正方形 - 增大 */
    height: 12rem; /* 120px，与宽度一致 - 增大 */
    margin: 0 auto 1rem; /* 10px */
    border-radius: 1.2rem; /* 12px */
    padding: 0;
    font-size: 1.2rem; /* 12px */
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden; /* 确保圆角效果 */
}

/* 图片图标样式 */
.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1.2rem; /* 与容器圆角一致 */
}

.app-icon .label {
    position: absolute;
    top: -0.5rem; /* -5px */
    left: -0.5rem; /* -5px */
    font-size: 1rem; /* 10px */
    padding: 0.2rem 0.6rem; /* 2px 6px */
    border-radius: 0.4rem; /* 4px */
    font-weight: bold;
}

.label.official {
    background-color: #e74c3c;
    color: white;
}

.icon-content {
    text-align: center;
    line-height: 1.2;
}

.app-title {
    font-weight: bold;
    font-size: 1.6rem; /* 16px - 增大 */
    color: #333;
    margin-bottom: 0.5rem; /* 5px */
}

.app-size {
    font-size: 1.2rem; /* 12px */
    color: #666;
    margin-bottom: 0.8rem; /* 8px */
}

.app-description {
    font-size: 1.5rem; /* 15px - 增大字体 */
    color: #777;
    line-height: 1.4;
    flex-grow: 1;
}

/* 平板设备 */
@media (max-width: 76.8rem) { /* 768px */
    .container {
        padding: 1.5rem; /* 15px */
    }
    
    .header {
        padding: 1.5rem;
    }
    
    .header-content {
        gap: 1.5rem;
    }
    
    .header-left {
        gap: 0.8rem;
    }
    
    .logo {
        width: 12rem;
        height: 4rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .sub-title {
        font-size: 1.4rem;
    }
    
    .telegram-link {
        padding: 0.8rem 1.2rem;
        gap: 0.6rem;
    }
    
    .telegram-text {
        font-size: 1.2rem;
    }
    
    .apps-flex {
        gap: 1.2rem; /* 12px */
    }
    
    .app-card-link {
        width: calc((100% - 3 * 1.2rem) / 4); /* 平板端每行4个，考虑3个gap */
        min-width: 16rem; /* 最小宽度 */
    }
    
    .app-card {
        padding: 1.2rem; /* 12px */
        min-height: 18rem; /* 180px */
    }
    
    .app-icon {
        width: 10rem; /* 100px，正方形 - 增大 */
        height: 10rem; /* 100px，与宽度一致 - 增大 */
        font-size: 1rem; /* 10px */
    }
    
    .app-title {
        font-size: 1.5rem; /* 15px - 增大 */
    }
    
    .app-size {
        font-size: 1.1rem; /* 11px */
    }
    
    .app-description {
        font-size: 1.4rem; /* 14px - 增大字体 */
    }
}

/* 手机设备 */
@media (max-width: 48rem) { /* 480px */
    .container {
        padding: 1rem; /* 10px */
    }
    
    .header {
        margin-bottom: 2rem; /* 20px */
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: row;
        gap: 1rem;
        text-align: left;
    }
    
    .header-left {
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .logo {
        width: 10rem;
        height: 3.5rem;
    }
    
    .header-titles {
        text-align: left;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .sub-title {
        font-size: 1.2rem;
    }
    
    .telegram-link {
        padding: 0.8rem 1.2rem;
        gap: 0.5rem;
        justify-content: flex-start;
        margin: 0;
        max-width: none;
    }
    
    .telegram-text {
        font-size: 1.1rem;
    }
    
    .apps-flex {
        gap: 1rem; /* 10px */
    }
    
    .app-card-link {
        width: calc((100% - 1rem) / 2); /* 手机端每行2个，考虑1个gap */
        flex: 0 0 calc((100% - 1rem) / 2); /* 确保精确的宽度控制 */
    }
    
    .app-card {
        padding: 1.2rem; /* 12px - 增加内边距 */
        min-height: 20rem; /* 200px - 进一步增加高度 */
    }
    
    .app-icon {
        width: 9rem; /* 90px，正方形 - 进一步增大 */
        height: 9rem; /* 90px，与宽度一致 - 进一步增大 */
        font-size: 1.1rem; /* 11px - 增大 */
    }
    
    .app-title {
        font-size: 1.6rem; /* 16px - 增大 */
        margin-bottom: 0.4rem; /* 4px */
    }
    
    .app-size {
        font-size: 1.2rem; /* 12px - 增大 */
        margin-bottom: 0.8rem; /* 8px */
    }
    
    .app-description {
        font-size: 1.5rem; /* 15px - 增大字体 */
        line-height: 1.4;
    }
}

/* 更小屏幕的优化 */
@media (max-width: 36rem) { /* 360px */
    .container {
        padding: 0.8rem; /* 8px */
    }
    
    .apps-flex {
        gap: 0.8rem; /* 8px */
    }
    
    .app-card-link {
        width: calc((100% - 0.8rem) / 2); /* 调整宽度以适应更小的gap */
        flex: 0 0 calc((100% - 0.8rem) / 2); /* 确保精确的宽度控制 */
    }
    
    .app-card {
        padding: 1rem; /* 10px - 增加内边距 */
        min-height: 19rem; /* 190px - 进一步增加高度 */
    }
    
    .app-icon {
        width: 10rem; /* 80px，正方形 - 进一步增大 */
        height: 10rem; /* 80px，与宽度一致 - 进一步增大 */
    }
    
    .app-title {
        font-size: 1.5rem; /* 15px - 增大 */
    }
    
    .app-size {
        font-size: 1.1rem; /* 11px - 增大 */
    }
    
    .app-description {
        font-size: 1.4rem; /* 14px - 增大 */
    }
}
