/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-x: hidden;
    min-height: 100vh;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 15px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 广告列表 */
.ad-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    overflow: hidden;
}

/* 广告项 */
.ad-item {
    width: 100%;
    flex: 1;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
}

.ad-item:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ad-item a {
    display: flex;
    width: 100%;
    height: 100%;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.ad-item img {
    width: 100%;
    height: 100%;
    display: block;
    /* 图片拉伸填满容器 */
    object-fit: fill;
}

/* 无广告提示 */
.no-ads {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* 响应式优化 */
@media screen and (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .ad-list {
        gap: 5px;
    }
    
    .ad-item {
        border-radius: 10px;
    }
}

/* 超小屏幕 */
@media screen and (max-width: 320px) {
    .container {
        padding: 8px;
    }
    
    .ad-list {
        gap: 5px;
    }
}

/* 平板和桌面端保持移动端大小 */
@media screen and (min-width: 751px) {
    .container {
        padding: 15px;
    }
}

/* 图片加载动画 */
.ad-item img {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 触摸优化 */
.ad-item a {
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
