/* 全局样式 */
* {
    box-sizing: border-box;
}

body {
    --wp-lm-theme-color: #409eff;
    /* font-family: Arial, sans-serif; */
    margin: 0;
    padding: 0;
}

/* 主容器样式 */
.wp-lm-links-container {
    max-width: 1440px; /* calc(100% - 25%); */
    margin: 0 auto;
    padding: 0px;
    background-color: transparent;
}

/* 优秀链接展示区域样式 */
.wp-lm-top-links-widget {
    margin-bottom: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.133), rgba(255, 255, 255, 0.133));
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border: 0px solid var(--wp-lm-theme-color);
}

.wp-lm-top-links-widget .wp-lm-show-more-top-links {
    text-decoration: none;
    color: var(--wp-lm-theme-color);
}

/* 优秀链接展示区域内容样式，使用 Grid 布局 */
.wp-lm-top-links-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(131px, 1fr));
    gap: 25px;
}

/* 链接分类和链接展示容器样式 */
.wp-lm-category-display-container {
    display: flex;
    gap: 20px;
    height: auto;
}

/* 链接分类区域样式 */
.wp-lm-link-categories-widget {
    width: 12.5%;
    border-radius: 12px;
    /* background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6)); */
    padding: 15px;
    /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); */
    /* border: 2px solid var(--wp-lm-theme-color); */
}

.wp-lm-link-categories-widget .wp-lm-category-button {
    display: block;
    width: 100%;
    max-width:110px;
    margin-bottom: 10px;
    padding: 10px 10px;
    background-color: transparent;
    /* border: none; */
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: 2px solid var(--wp-lm-theme-color);
    text-align: center;
    color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
    font-size: 14px;
}

.wp-lm-links-form-button {
    display: block;
    width: 100%;
    max-width:110px;
    margin-bottom: 10px;
    padding: 10px 10px;
    background-color: transparent;
    /* border: none; */
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: 2px solid rgba(255, 128, 0, 0.765);
    text-align: center;
    color: var(--wp-lm-theme-color);
    font-size: 14px;
}

.wp-lm-link-categories-widget .wp-lm-category-button.active {
    background-color: var(--wp-lm-theme-color);
    color: var(--bs-white);
}

.wp-lm-links-form-button:hover,
.wp-lm-link-categories-widget .wp-lm-category-button:hover {
    transform: translateY(-2px);
    box-shadow: 0px 5px 10px rgba(54, 158, 255, 0.666);
    border: 2px solid rgba(64, 158, 255, 0.84);
    transition: all 0.3s ease;
}

.wp-lm-links-form-button.active {
    background-color: rgba(255, 128, 0, 0.765);
    color: white;
}

/* 友链展示区域样式 */
.wp-lm-link-display-widget {
    width: 87.50%;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.133), rgba(255, 255, 255, 0.133));
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 0px solid var(--wp-lm-theme-color);
}

/* 友链展示区域内容样式，使用 Grid 布局 */
.wp-lm-link-display-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(131px, 1fr));
    gap: 20px;
}

/* 链接卡片通用样式 */
.wp-lm-link-card-common {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.7));
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 10px;
}

.wp-lm-link-card-common:hover {
    transform: translateY(0px);
    box-shadow: 0px 5px 10px rgba(233, 127, 28, 0.666);
    border: 0px solid rgba(236, 66, 10, 0.84);
}

/* 大卡片样式 */
.links-big-card {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.links-big-card .wp-lm-link-icon-container {
    width: 60%;
    padding-bottom: 60%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    background-color: white;
    position: relative;
}

.links-big-card .wp-lm-link-icon-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.links-big-card .wp-lm-link-name {
    font-size: 14px;
    margin-bottom: 8px;
    color: #2c3e50;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.links-big-card .wp-lm-link-description {
    font-size: 14px;
    color: #777;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* 小卡片样式 */
.links-small-card {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.links-small-card .wp-lm-link-icon-container {
    width: 60%;
    padding-bottom: 60%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(233, 127, 28, 0.666);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    background-color: white;
    position: relative;
}

.wp-lm-link-icon-container:hover 
.wp-lm-link-icon-container img:hover {
    transform: translateY(-2px);
    box-shadow: 0px 5px 10px rgba(233, 127, 28, 0.666);
}

.links-small-card .wp-lm-link-icon-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.links-small-card .wp-lm-link-name {
    font-size: 14px;
    margin-bottom: 4px;
    color: #2c3e50;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.links-small-card .wp-lm-link-description {
    font-size: 14px;
    color: #777;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* 去除链接下划线 */
.wp-lm-link-name a,
.wp-lm-link-icon-container a {
    text-decoration: none;
    color: inherit;
}

.wp-lm-modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.wp-lm-modal-content {
    background-color: var(--bs-light-text);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.wp-lm-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.wp-lm-close:hover,
.wp-lm-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* 媒体查询，竖屏时调整布局 */
@media (max-width: 768px) {
    .wp-lm-category-display-container {
        flex-direction: column;
    }

    .wp-lm-link-categories-widget,
    .wp-lm-link-display-widget {
        width: 100%;
        flex: 1 1 100%;
        min-width: 0;
    }

    .links-big-card .wp-lm-link-name,
    .links-small-card .wp-lm-link-name {
        font-size: 12px;
    }

    .links-big-card .wp-lm-link-description,
    .links-small-card .wp-lm-link-description {
        font-size: 10px;
    }
}

/* 中等屏幕设备（如平板） */
@media (min-width: 769px) and (max-width: 1024px) {
    .links-big-card .wp-lm-link-name,
    .links-small-card .wp-lm-link-name {
        font-size: 13px;
    }

    .links-big-card .wp-lm-link-description,
    .links-small-card .wp-lm-link-description {
        font-size: 11px;
    }
}