/* ====== 全局变量与基础设置 ====== */
:root {
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ====== 布局容器 ====== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

@media (min-width: 768px) {
    .container { padding: 40px 24px; }
}

/* ====== 通用卡片样式 ====== */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 32px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 20px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* ====== 1. 广告位样式 (响应式Grid) ====== */
.ad-grid {
    display: grid;
    /* 响应式网格：最小90px，最大1fr可用空间 */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

/* ====== 1. 广告位样式修改 ====== */
.ad-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    /* 移除原来的 padding-bottom: 100%，改为 flex 布局 */
    display: flex;
    flex-direction: column;
}

.ad-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    z-index: 1;
}


/* 新增：接管图片1:1比例的容器 */
.ad-img-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 保证图片区域依然 1:1 */
}

.ad-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保证图片不变形，裁剪填充 */
    transition: transform 0.3s ease;
}

.ad-item:hover .ad-img-wrapper img {
    transform: scale(0.98);
}
.ad-item:hover .ad-name {
    color: red;
    font-size: 0.85rem;
}
.erweima {
    text-decoration: none;
}
/* 新增：图片名称样式 */
.ad-name {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 4px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 文件名过长时显示省略号 */
}


/* ====== 2. URL列表样式 (列表动画) ====== */
.url-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) {
    .url-list { grid-template-columns: 1fr 1fr; } /* 平板以上两列 */
}

.url-item {
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    display: flex;
    gap: 8px;
}

.url-item:hover {
    background: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.url-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    word-break: break-all; /* 防止长URL撑破布局 */
}

.url-link::before {
    content: '🔗';
    font-size: 0.8rem;
    flex-shrink: 0;
}

.url-link:hover {
    color: var(--accent-color);
}

.ad-link {
    color:#1677ff;
    text-decoration:none;
    margin:0 6px;
    font-weight:600;
}
.ad-link:hover {
    color:#ff4d4f;
}
/* ====== 3. 关键词样式 (标签云/胶囊) ====== */
.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.keyword-pill {
    display: inline-flex;
    align-items: center;
    background-color: #eff6ff;
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #bfdbfe;
    transition: all 0.2s ease;
}

.keyword-pill:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
}

.keyword-pill::after {
    content: '↗';
    margin-left: 6px;
    font-size: 0.8rem;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
}

.keyword-pill:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* ====== 空数据提示 ====== */
.empty-notice {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    padding: 16px;
    text-align: center;
    background: #f9fafb;
    border-radius: 8px;
}

/* ====== 粒子背景 ====== */
#particleCanvas {
    position: fixed; 
    top: 0;
    left: 0;
    z-index: 0; 
    pointer-events: none;
    width: 100vw; 
    height: 100vh; 
}