/* =========================================
   内容卡片样式 - 参考站风格复刻版
   解决：头像偏上、边框遮挡、排版混乱
   ========================================= */

/* --- 容器布局 --- */
.em-card-container {
    display: grid;
    /* 自动适应宽度，最小300px，最大1fr */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
    padding: 10px 0; /* 增加上下内边距 */
}

/* --- 卡片主体 --- */
.em-card-item {
    display: flex;
    align-items: center; /* 强制垂直居中 */
    position: relative;
    background-color: #fff; /* 卡片背景白 */
    border: 1px solid #eaeaea; /* 细边框 */
    border-radius: 12px; /* 圆角 */
    padding: 15px;
    text-decoration: none !important; /* 去除下划线 */
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02); /* 轻微阴影 */
    height: 100%; /* 高度占满 */
}

/* 鼠标悬停效果：上浮 + 阴影加深 */
.em-card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #f1c40f; /* 悬停时边框变色（参考站风格） */
    text-decoration: none !important;
}

/* --- 头像区域 --- */
.em-card-icon {
    flex-shrink: 0; /* 防止头像被压缩 */
    width: 50px;
    height: 50px;
    margin-right: 15px;
    position: relative;
    z-index: 2; /* 确保头像层级高于卡片背景 */
}

/* 头像图片本身 */
.em-card-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%; /* 强制圆形 */
    border: 3px solid #fff; /* 关键：白色边框，像戒指一样套住头像 */
    box-shadow: 0 2px 6px rgba(0,0,0,0.15); /* 头像自带阴影，增加立体感 */
    object-fit: cover; /* 防止图片变形 */
    display: block; /* 修复图片底部空隙 */
    background-color: #f8f9fa; /* 图片加载前的背景色 */
}

/* --- 文字信息区域 --- */
.em-card-info {
    flex: 1;
    overflow: hidden; /* 防止文字溢出 */
    padding-right: 5px;
}

/* 网站标题 */
.em-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
    white-space: nowrap; /* 标题不换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 超出显示省略号 */
}

/* 网站描述 */
.em-card-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
    /* 限制描述最多显示2行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

/* --- 暗黑模式适配 (可选) --- */
html[data-theme='dark'] .em-card-item,
body[data-theme='dark'] .em-card-item {
    background-color: #2c2c2c;
    border-color: #444;
}

html[data-theme='dark'] .em-card-title {
    color: #eee;
}

html[data-theme='dark'] .em-card-desc {
    color: #aaa;
}

html[data-theme='dark'] .em-card-icon img {
    border-color: #2c2c2c; /* 暗黑模式下，头像边框变成背景色 */
}