/* WordPress Links Manager - 精简版样式 */

/* ===== CSS 变量和全局样式 ===== */
.wp-lm-container {
    /* 简约色彩系统 - 浅色主题 */
    --wp-lm-simple-primary: #4a6fa5;
    --wp-lm-primary-light: #e8f0fe;
    --wp-lm-simple-primary-dark: #3a5884;

    /* 中性色彩 */
    --wp-lm-simple-text-primary: #374151;
    --wp-lm-simple-text-regular: #6b7280;
    --wp-lm-simple-text-secondary: #9ca3af;
    --wp-lm-simple-text-placeholder: #d1d5db;

    --wp-lm-simple-border: #e5e7eb;
    --wp-lm-simple-border-light: #f3f4f6;
    --wp-lm-simple-border-hover: #d1d5db;

    --wp-lm-simple-bg-page: transparent;
    --wp-lm-simple-bg-light: #ffffff;
    --wp-lm-simple-bg-lighter: #f8fafc;
    --wp-lm-simple-bg-hover: #f3f4f6;

    /* 间距系统 */
    --wp-lm-simple-space-xs: 4px;
    --wp-lm-simple-space-sm: 8px;
    --wp-lm-simple-space-md: 12px;
    --wp-lm-simple-space-lg: 16px;
    --wp-lm-simple-space-xl: 20px;
    --wp-lm-simple-space-2xl: 24px;

    /* 圆角系统 */
    --wp-lm-simple-radius-sm: 4px;
    --wp-lm-simple-radius-base: 6px;
    --wp-lm-simple-radius-lg: 8px;
    --wp-lm-simple-radius-xl: 12px;

    /* 阴影 */
    --wp-lm-simple-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --wp-lm-simple-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.06);
    --wp-lm-simple-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);

    /* 警告和错误颜色 */
    --wp-lm-simple-warning: #e6a23c;
    --wp-lm-simple-error: #f56c6c;
    --wp-lm-simple-success: #67c23a;
    --wp-lm-simple-info: #909399;

    /* 渐变背景 */
    --wp-lm-gradient-light: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===== 链接展示页面样式 ===== */
.wp-lm-links-container {
    /* max-width 改为可配置，通过内联样式设置 */
    margin: 0 auto;
    padding: var(--wp-lm-simple-space-lg);
    background: var(--wp-lm-simple-bg-page);
}

/* 顶部推荐链接 */
.wp-lm-top-links-widget {
    margin-bottom: var(--wp-lm-simple-space-2xl);
    border-radius: var(--wp-lm-simple-radius-xl);
    background: var(--wp-lm-simple-bg-light);
    padding: var(--wp-lm-simple-space-xl);
    box-shadow: var(--wp-lm-simple-shadow-base);
    border: 1px solid var(--wp-lm-simple-border);
    position: relative;
    overflow: hidden;
}

/* 顶部推荐链接渐变装饰 */
.wp-lm-top-links-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--wp-lm-gradient-light);
}

.wp-lm-top-links-widget h5 {
    color: var(--wp-lm-simple-text-primary);
    margin-bottom: var(--wp-lm-simple-space-md);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    padding-bottom: var(--wp-lm-simple-space-sm);
    border-bottom: 1px solid var(--wp-lm-simple-border);
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--wp-lm-simple-space-md);
}

.wp-lm-top-links-widget .wp-lm-refresh-button {
    font-size: 12px;
    font-weight: 600;
    color: var(--wp-lm-simple-primary);
    text-decoration: none;
    background: var(--wp-lm-primary-light);
    padding: 6px 16px;
    border-radius: var(--wp-lm-simple-radius-lg);
    border: 1px solid var(--wp-lm-simple-border);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--wp-lm-simple-space-xs);
}

.wp-lm-top-links-widget .wp-lm-refresh-button:hover {
    background: var(--wp-lm-simple-primary);
    border-color: var(--wp-lm-simple-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
}

.wp-lm-top-links-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--wp-lm-simple-space-md);
    margin-top: var(--wp-lm-simple-space-md);
}

/* 分类和内容布局 */
.wp-lm-category-display-container {
    display: flex;
    gap: var(--wp-lm-simple-space-lg);
    align-items: flex-start;
    position: relative;
}

/* 链接分类区域 */
.wp-lm-link-categories-widget {
    flex: 0 0 180px;
    border-radius: var(--wp-lm-simple-radius-xl);
    padding: var(--wp-lm-simple-space-md);
    background: var(--wp-lm-simple-bg-light);
    box-shadow: var(--wp-lm-simple-shadow-base);
    border: 1px solid var(--wp-lm-simple-border);
    position: sticky;
    top: var(--wp-lm-simple-space-md);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* 当分类菜单处于固定悬浮状态时的样式 */
.wp-lm-link-categories-widget.is-sticky {
    box-shadow: var(--wp-lm-simple-shadow-lg);
    z-index: 100;
    animation: stickyPulse 0.3s ease;
}

@keyframes stickyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* 悬浮切换按钮 */
.wp-lm-sticky-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--wp-lm-gradient-light);
    border-radius: 50%;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.3s ease;
    position: relative;
}

.wp-lm-sticky-toggle::before {
    content: '📌';
    font-size: 12px;
}

.wp-lm-sticky-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* 不同显示风格 */
/* 现代风格（默认） */
.wp-lm-style-modern .wp-lm-category-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: var(--wp-lm-simple-radius-base);
    color: white;
    font-weight: 600;
}

/* 经典风格 */
.wp-lm-style-classic .wp-lm-category-button {
    background: #fff;
    border: 2px solid var(--wp-lm-simple-border);
    border-radius: 4px;
    color: var(--wp-lm-simple-text-primary);
    font-weight: normal;
    transition: all 0.2s ease;
}

.wp-lm-style-classic .wp-lm-category-button:hover,
.wp-lm-style-classic .wp-lm-category-button.active {
    background: var(--wp-lm-gradient-light);
    color: white;
    border-color: transparent;
}

/* 紧凑风格 */
.wp-lm-style-compact .wp-lm-category-button {
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    color: var(--wp-lm-simple-text-primary);
    font-weight: 500;
    padding: var(--wp-lm-simple-space-sm) var(--wp-lm-simple-space-md);
}

.wp-lm-style-compact .wp-lm-category-button:hover,
.wp-lm-style-compact .wp-lm-category-button.active {
    background: var(--wp-lm-simple-bg-hover);
    border-left-color: #667eea;
}

/* 卡片风格 */
.wp-lm-style-card .wp-lm-category-button {
    background: #fff;
    border: 1px solid var(--wp-lm-simple-border);
    border-radius: var(--wp-lm-simple-radius-lg);
    color: var(--wp-lm-simple-text-primary);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--wp-lm-simple-space-md);
}

.wp-lm-style-card .wp-lm-category-button:hover,
.wp-lm-style-card .wp-lm-category-button.active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
    color: #667eea;
}

.wp-lm-style-card .wp-lm-category-button .category-name {
    font-size: 14px;
    margin-bottom: 4px;
}

.wp-lm-style-card .wp-lm-category-button .category-count {
    font-size: 11px;
    color: var(--wp-lm-simple-text-secondary);
    background: var(--wp-lm-simple-bg-light);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 桌面端标题 - 默认显示 */
.wp-lm-link-categories-widget h5 {
    color: var(--wp-lm-simple-text-primary);
    margin-bottom: var(--wp-lm-simple-space-md);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    padding-bottom: var(--wp-lm-simple-space-sm);
    border-bottom: 1px solid var(--wp-lm-simple-border);
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--wp-lm-simple-space-md);
    justify-content: center;
}

/* 标题同一行的申请按钮样式 */
.wp-lm-link-categories-widget h5 .wp-lm-links-form-button-inline {
    margin-left: auto;
    padding: 4px 12px;
    background: var(--wp-lm-gradient-light);
    border: none;
    border-radius: var(--wp-lm-simple-radius-base);
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--wp-lm-simple-shadow-sm);
    white-space: nowrap;
}

.wp-lm-link-categories-widget h5 .wp-lm-links-form-button-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 分类标题装饰线 */
.wp-lm-link-categories-widget h5::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--wp-lm-simple-primary);
    border-radius: 2px;
}



.wp-lm-link-categories-widget .wp-lm-category-button-container {
    display: flex;
    flex-direction: column;
    gap: var(--wp-lm-simple-space-sm);
    margin-bottom: var(--wp-lm-simple-space-lg);
}

.wp-lm-link-categories-widget .wp-lm-category-button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--wp-lm-simple-space-md) var(--wp-lm-simple-space-lg);
    background: var(--wp-lm-simple-bg-lighter);
    border-radius: var(--wp-lm-simple-radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--wp-lm-simple-border);
    color: var(--wp-lm-simple-text-regular);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* 分类按钮悬停效果 */
.wp-lm-link-categories-widget .wp-lm-category-button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--wp-lm-simple-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.wp-lm-link-categories-widget .wp-lm-category-button:hover {
    border-color: var(--wp-lm-simple-primary);
    color: var(--wp-lm-simple-text-primary);
    background: var(--wp-lm-primary-light);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wp-lm-link-categories-widget .wp-lm-category-button:hover::before {
    transform: scaleY(1);
}

/* 活跃状态的分类按钮 */
.wp-lm-link-categories-widget .wp-lm-category-button.active {
    background: var(--wp-lm-simple-primary);
    color: white;
    border-color: var(--wp-lm-simple-primary);
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
    transform: translateX(4px);
}

.wp-lm-link-categories-widget .wp-lm-category-button.active::before {
    transform: scaleY(1);
    background: white;
}

.wp-lm-link-categories-widget .wp-lm-category-button .category-count {
    margin-left: auto;
    background: var(--wp-lm-simple-bg-lighter);
    color: var(--wp-lm-simple-text-secondary);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.wp-lm-link-categories-widget .wp-lm-category-button.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 申请入驻按钮 */
.wp-lm-link-categories-widget .wp-lm-apply-subwidget {
    margin-top: var(--wp-lm-simple-space-xl);
    padding-top: var(--wp-lm-simple-space-xl);
    border-top: 2px solid var(--wp-lm-simple-border);
    display: flex;
    justify-content: center;
    position: relative;
}

/* 申请按钮装饰线 */
.wp-lm-link-categories-widget .wp-lm-apply-subwidget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--wp-lm-simple-primary);
    border-radius: 2px;
}

.wp-lm-link-categories-widget .wp-lm-apply-subwidget .wp-lm-links-form-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--wp-lm-simple-space-lg);
    background: var(--wp-lm-gradient-light);
    border-radius: var(--wp-lm-simple-radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
    color: white;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--wp-lm-simple-shadow-base);
}

.wp-lm-link-categories-widget .wp-lm-apply-subwidget .wp-lm-links-form-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

/* 所有分类链接展示区域 */
.wp-lm-all-categories-display {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--wp-lm-simple-space-lg);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 分类区域内链接卡片的网格布局 */
.wp-lm-category-section .wp-lm-link-display-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--wp-lm-simple-space-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: start;
}

/* 单个分类区域 */
.wp-lm-category-section {
    border-radius: var(--wp-lm-simple-radius-xl);
    background: var(--wp-lm-simple-bg-light);
    padding: var(--wp-lm-simple-space-md);
    box-shadow: var(--wp-lm-simple-shadow-base);
    border: 1px solid var(--wp-lm-simple-border);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 分类区域顶部装饰 */
.wp-lm-category-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--wp-lm-gradient-light);
}

.wp-lm-category-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--wp-lm-simple-shadow-lg);
}

.wp-lm-category-section h5 {
    color: var(--wp-lm-simple-text-primary);
    margin-bottom: var(--wp-lm-simple-space-md);
    font-size: 14px;
    font-weight: 700;
    padding-bottom: var(--wp-lm-simple-space-sm);
    border-bottom: 1px solid var(--wp-lm-simple-border);
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--wp-lm-simple-space-md);
}

/* 分类标题装饰线 */
.wp-lm-category-section h5::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--wp-lm-simple-primary);
    border-radius: 2px;
}

.wp-lm-link-display-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: var(--wp-lm-simple-space-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: start;
}

/* 通用链接卡片样式 */
.wp-lm-link-card-common {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: var(--wp-lm-simple-radius-lg);
    background: var(--wp-lm-simple-bg-lighter);
    box-shadow: var(--wp-lm-simple-shadow-sm);
    text-align: center;
    padding: var(--wp-lm-simple-space-md);
    border: 1px solid var(--wp-lm-simple-border);
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1;
    justify-content: center;
    min-height: 75px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wp-lm-link-card-common:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--wp-lm-simple-shadow-lg);
    border-color: var(--wp-lm-simple-primary);
}

/* 统一卡片样式 */
.wp-lm-link-card-common .wp-lm-link-icon-container {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    max-width: 56px;
    max-height: 56px;
    padding: 3px;
    box-sizing: border-box;
    border-radius: var(--wp-lm-simple-radius-lg);
    overflow: hidden;
    box-shadow: var(--wp-lm-simple-shadow-base);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--wp-lm-simple-space-sm);
    background: var(--wp-lm-simple-bg-light);
    border: 2px solid var(--wp-lm-simple-border);
    position: relative;
    z-index: 1;
}

.wp-lm-link-card-common .wp-lm-link-icon-container img {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
    display: block;
}

.wp-lm-link-card-common:hover .wp-lm-link-icon-container img {
    transform: scale(1.1);
}

.wp-lm-link-card-common .wp-lm-link-name {
    font-size: 12px;
    margin-bottom: var(--wp-lm-simple-space-sm);
    color: var(--wp-lm-simple-text-primary);
    line-height: 1.4;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
}

.wp-lm-link-card-common:hover .wp-lm-link-name {
    color: var(--wp-lm-simple-primary);
}

.wp-lm-link-card-common .wp-lm-link-description {
    font-size: 11px;
    color: var(--wp-lm-simple-text-secondary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* 猜你喜欢区域的描述样式 - 显示两行 */
.wp-lm-top-links-content .wp-lm-link-card-common .wp-lm-link-description {
    white-space: normal;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    word-break: break-word;
    max-height: calc(1.4em * 2);
    overflow: hidden;
}

/* 分类链接展示区域 - 横向卡片布局 */
.wp-lm-all-categories-display .wp-lm-link-card-common {
    width: 220px;
    height: 75px;
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    aspect-ratio: auto;
}

.wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-icon-container {
    width: 65px;
    height: 65px;
    min-width: 65px;
    min-height: 65px;
    max-width: 65px;
    max-height: 65px;
    padding: 3px;
    box-sizing: border-box;
    margin-bottom: 0;
    flex-shrink: 0;
}

.wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-icon-container img {
    width: 59px;
    height: 59px;
    min-width: 59px;
    min-height: 59px;
    max-width: 59px;
    max-height: 59px;
    object-fit: contain;
}

.wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    align-items: flex-start;
    text-align: left;
}

.wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-name {
    font-size: 15px;
    margin-bottom: 0;
    line-height: 1.2;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    color: var(--wp-lm-simple-text-primary);
}

.wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-description {
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    color: var(--wp-lm-simple-text-regular);
    text-align: left;
    width: 100%;
}

/* 默认纵向卡片 - 保持原有布局 */
.wp-lm-link-card-common:not(.wp-lm-all-categories-display .wp-lm-link-card-common) .wp-lm-link-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 链接文本样式 */
.wp-lm-link-name a,
.wp-lm-link-icon-container a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.wp-lm-link-name a:hover,
.wp-lm-link-icon-container a:hover {
    color: var(--wp-lm-simple-primary);
}

/* ===== 申请入驻模态框样式 ===== */
.wp-lm-apply-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    animation: fadeIn 0.3s ease;
}

.wp-lm-apply-modal.wp-lm-modal-active {
    display: block;
}

.wp-lm-apply-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.wp-lm-apply-modal-content {
    position: relative;
    background-color: var(--wp-lm-simple-bg-light);
    margin: 5vh auto;
    border-radius: var(--wp-lm-simple-radius-xl);
    width: 90%;
    max-width: 950px;
    max-height: 90vh;
    box-shadow: var(--wp-lm-simple-shadow-lg);
    border: 1px solid var(--wp-lm-simple-border);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.4s ease;
    overflow: hidden;
}

/* 模态框头部 */
.wp-lm-apply-modal-header {
    padding: var(--wp-lm-simple-space-lg) var(--wp-lm-simple-space-xl);
    border-bottom: 2px solid var(--wp-lm-simple-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--wp-lm-primary-light);
}

.wp-lm-modal-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--wp-lm-simple-space-sm);
}

.wp-lm-apply-modal-header h3 {
    color: var(--wp-lm-simple-text-primary);
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.wp-lm-modal-subtitle {
    font-size: 13px;
    color: var(--wp-lm-simple-text-secondary);
    font-weight: 400;
    line-height: 1.4;
}

/* 精美的关闭按钮 */
.wp-lm-apply-close {
    color: var(--wp-lm-simple-text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--wp-lm-simple-bg-lighter);
    border: 2px solid var(--wp-lm-simple-border);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.wp-lm-apply-close:hover {
    color: var(--wp-lm-simple-error);
    background: #fff0f0;
    border-color: var(--wp-lm-simple-error);
    transform: rotate(90deg);
}

/* 模态框主体内容 */
.wp-lm-apply-modal-body {
    padding: var(--wp-lm-simple-space-lg) var(--wp-lm-simple-space-xl);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* 模态框内的表单样式 */
.wp-lm-modal-form-container {
    width: 100%;
    height: 100%;
}

/* 登录提示区域 - 居中显示 */
.wp-lm-modal-login-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--wp-lm-simple-space-2xl);
    background: var(--wp-lm-simple-bg-lighter);
    border-radius: var(--wp-lm-simple-radius-lg);
    border: 1px solid var(--wp-lm-simple-border);
    min-height: 200px;
}

.wp-lm-modal-login-hint .wp-lm-modal-login-icon {
    font-size: 48px;
    margin-bottom: var(--wp-lm-simple-space-lg);
}

.wp-lm-modal-login-hint p {
    font-size: 16px;
    color: var(--wp-lm-simple-text-primary);
    margin-bottom: var(--wp-lm-simple-space-xl);
    font-weight: 600;
    line-height: 1.5;
}

.wp-lm-modal-login-hint .wp-lm-btn {
    min-width: 140px;
}

/* 模态框布局：表单和须知并排 */
.wp-lm-modal-layout {
    display: flex;
    gap: var(--wp-lm-simple-space-xl);
    height: 100%;
}

/* 左侧表单区域 */
.wp-lm-modal-form-wrapper {
    flex: 1;
    max-width: 600px;
    padding-right: var(--wp-lm-simple-space-lg);
}

/* 右侧须知信息区域 */
.wp-lm-modal-info-wrapper {
    flex: 0 0 350px;
    /* 增加30px宽度 */
    background: var(--wp-lm-simple-bg-lighter);
    border-radius: var(--wp-lm-simple-radius-lg);
    padding: var(--wp-lm-simple-space-lg);
    overflow-y: auto;
    border: 1px solid var(--wp-lm-simple-border);
    font-size: 12px;
    line-height: 1.6;
}

.wp-lm-modal-info-wrapper h4 {
    margin: 0 0 var(--wp-lm-simple-space-md) 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--wp-lm-simple-primary);
    border-bottom: 2px solid var(--wp-lm-simple-border);
    padding-bottom: var(--wp-lm-simple-space-sm);
}

/* 须知部分样式 */
.wp-lm-modal-info-section {
    margin-bottom: var(--wp-lm-simple-space-lg);
}

.wp-lm-modal-info-section h5 {
    font-size: 12px;
    font-weight: 600;
    color: var(--wp-lm-simple-text-primary);
    margin: 0 0 var(--wp-lm-simple-space-sm) 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.wp-lm-modal-info-section h5::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--wp-lm-simple-primary);
    border-radius: 50%;
}

.wp-lm-modal-info-section p {
    margin: 0 0 6px 0;
    color: var(--wp-lm-simple-text-secondary);
    font-size: 11px;
    line-height: 1.5;
    padding-left: 16px;
}

.wp-lm-modal-info-section p:last-child {
    margin-bottom: 0;
}

.wp-lm-modal-info-section a {
    color: var(--wp-lm-simple-primary);
    text-decoration: none;
    font-weight: 500;
}

.wp-lm-modal-info-section a:hover {
    text-decoration: underline;
}

/* 本站信息区域 */
.wp-lm-modal-site-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 4px 0;
}

.wp-lm-modal-site-info-label {
    font-size: 11px;
    color: var(--wp-lm-simple-text-primary);
    font-weight: 500;
    min-width: 36px;
}

.wp-lm-modal-site-info-value {
    flex: 1;
    font-size: 11px;
    color: var(--wp-lm-simple-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 复制按钮样式 */
.wp-lm-modal-site-info-copy {
    background: var(--wp-lm-simple-bg-lighter);
    border: 1px solid var(--wp-lm-simple-border);
    border-radius: var(--wp-lm-simple-radius-sm);
    padding: 2px 8px;
    font-size: 10px;
    color: var(--wp-lm-simple-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    line-height: 1;
    font-weight: 500;
}

.wp-lm-modal-site-info-copy:hover {
    background: var(--wp-lm-simple-primary);
    color: white;
    border-color: var(--wp-lm-simple-primary);
}

.wp-lm-modal-site-info-copy:active {
    transform: scale(0.95);
}

/* 表单样式 */
.form-row {
    margin-bottom: var(--wp-lm-simple-space-md);
    position: relative;
}

/* 并列显示的form-row容器 */
.form-row-inline {
    display: flex;
    gap: var(--wp-lm-simple-space-md);
    margin-bottom: var(--wp-lm-simple-space-md);
}

.form-row-inline .form-row {
    flex: 1;
    margin-bottom: 0;
}

.form-row label {
    display: block;
    margin-bottom: 4px;
    color: var(--wp-lm-simple-text-primary);
    font-weight: 500;
    font-size: 12px;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--wp-lm-simple-border);
    border-radius: var(--wp-lm-simple-radius-base);
    background: var(--wp-lm-simple-bg-lighter);
    color: var(--wp-lm-simple-text-primary);
    font-size: 13px;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.form-row select {
    padding: 6px 12px;
    height: 36px;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--wp-lm-simple-primary);
    background: var(--wp-lm-simple-bg-light);
    box-shadow: 0 0 0 4px var(--wp-lm-primary-light);
}

.form-hint {
    font-size: 13px;
    color: var(--wp-lm-simple-text-secondary);
    margin-top: var(--wp-lm-simple-space-sm);
    padding: var(--wp-lm-simple-space-sm);
    background: var(--wp-lm-primary-light);
    border-left: 3px solid var(--wp-lm-simple-primary);
    border-radius: 0 var(--wp-lm-simple-radius-base) var(--wp-lm-simple-radius-base) 0;
}

.form-error {
    font-size: 13px;
    color: var(--wp-lm-simple-error);
    margin-top: var(--wp-lm-simple-space-sm);
    padding: var(--wp-lm-simple-space-sm);
    background: rgba(245, 108, 108, 0.1);
    border-left: 3px solid var(--wp-lm-simple-error);
    border-radius: 0 var(--wp-lm-simple-radius-base) var(--wp-lm-simple-radius-base) 0;
}

.form-buttons {
    display: flex;
    justify-content: center;
    gap: var(--wp-lm-simple-space-md);
    margin-top: var(--wp-lm-simple-space-lg);
    padding-top: var(--wp-lm-simple-space-lg);
    border-top: 1px solid var(--wp-lm-simple-border);
}

/* 按钮样式 */
.wp-lm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--wp-lm-simple-radius-base);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    line-height: 1.4;
}

.wp-lm-btn-sm {
    padding: 6px 12px;
    font-size: 11px;
    min-width: 80px;
}

/* 主要按钮 */
.wp-lm-btn-primary {
    background: var(--wp-lm-simple-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
}

.wp-lm-btn-primary:hover {
    background: var(--wp-lm-simple-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 111, 165, 0.4);
}

/* 次要按钮 */
.wp-lm-btn-secondary {
    background: var(--wp-lm-simple-bg-lighter);
    color: var(--wp-lm-simple-text-regular);
    border: 2px solid var(--wp-lm-simple-border);
}

.wp-lm-btn-secondary:hover {
    background: var(--wp-lm-simple-bg-light);
    border-color: var(--wp-lm-simple-primary);
    color: var(--wp-lm-simple-primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 精美的消息提示样式 */
.success-message,
.error-message {
    max-width: 900px;
    margin: 0 auto var(--wp-lm-simple-space-xl) auto;
    padding: var(--wp-lm-simple-space-xl);
    border-radius: var(--wp-lm-simple-radius-xl);
    text-align: center;
    font-size: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--wp-lm-simple-shadow-base);
}

/* 成功消息 */
.success-message {
    background: linear-gradient(145deg, #f0f9ff 0%, #e6f7ff 100%);
    color: #0066cc;
    border: 2px solid #91d5ff;
}

/* 错误消息 */
.error-message {
    background: linear-gradient(145deg, #fef0f0 0%, #ffe6e6 100%);
    color: #cf1322;
    border: 2px solid #fbc4c4;
}

/* 动画定义 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== 响应式设计 ===== */
/* 平板屏幕优化 (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .wp-lm-links-container {
        padding: var(--wp-lm-simple-space-lg);
    }

    /* 平板端分类菜单优化 */
    .wp-lm-link-categories-widget {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    /* 平板端分类按钮样式调整 */
    .wp-lm-link-categories-widget .wp-lm-category-button {
        padding: var(--wp-lm-simple-space-sm) var(--wp-lm-simple-space-md);
        font-size: 13px;
        min-height: 40px;
    }

    /* 平板端链接卡片布局优化 */
    .wp-lm-link-display-content {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .wp-lm-top-links-content {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* 移动端屏幕 (≤ 768px) */
@media (max-width: 768px) {
    .wp-lm-links-container {
        padding: var(--wp-lm-simple-space-md);
    }

    .wp-lm-category-display-container {
        flex-direction: column;
        gap: var(--wp-lm-simple-space-md);
    }

    /* 移动端将链接分类菜单改为可折叠的抽屉式菜单 */
    .wp-lm-link-categories-widget {
        flex: 0 0 auto;
        width: 100%;
        position: sticky !important;
        top: 0 !important;
        max-height: none;
        overflow: visible;
        background: var(--wp-lm-simple-bg-light);
        border-radius: var(--wp-lm-simple-radius-lg);
        box-shadow: var(--wp-lm-simple-shadow-sm);
        border: 1px solid var(--wp-lm-simple-border);
        padding: 0; /* 移除padding，由标题栏控制 */
        display: block !important;
        visibility: visible !important;
        z-index: 999;
        transition: all 0.3s ease;
    }

    /* 移动端标题栏样式 */
    .wp-lm-link-categories-widget h5 {
        justify-content: space-between;
        padding: var(--wp-lm-simple-space-sm) var(--wp-lm-simple-space-md);
        margin: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: var(--wp-lm-simple-radius-base) var(--wp-lm-simple-radius-base) 0 0;
        position: relative; /* 改为relative，不使用sticky */
        z-index: 10;
        border-bottom: none;
        min-height: 44px;
        cursor: pointer;
    }

    /* 移动端标题显示申请按钮（内联模式） */
    .wp-lm-link-categories-widget h5 {
        justify-content: space-between;
        padding: var(--wp-lm-simple-space-sm);
        margin-bottom: var(--wp-lm-simple-space-sm);
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: var(--wp-lm-simple-radius-base);
        margin: calc(-1 * var(--wp-lm-simple-space-md)) calc(-1 * var(--wp-lm-simple-space-md)) var(--wp-lm-simple-space-md) calc(-1 * var(--wp-lm-simple-space-md));
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .wp-lm-link-categories-widget h5 .wp-lm-sticky-toggle::before {
        color: white;
    }

    /* 移动端标题栏箭头指示 */
    .wp-lm-link-categories-widget h5::after {
        content: '▼';
        position: absolute;
        right: var(--wp-lm-simple-space-md);
        color: white;
        font-size: 10px;
        transition: transform 0.3s ease;
        opacity: 0.8;
    }

    .wp-lm-link-categories-widget.is-collapsed h5::after {
        transform: rotate(-90deg);
    }

    /* 分类菜单内容区 - 默认展开，无滚动条 */
    .wp-lm-link-categories-widget > .wp-lm-category-button-container {
        max-height: none;
        overflow: visible;
        display: grid !important;
        visibility: visible !important;
        grid-template-columns: repeat(var(--wp-lm-mobile-columns, 3), 1fr);
        gap: var(--wp-lm-simple-space-sm);
        padding: var(--wp-lm-simple-space-md);
        transition: all 0.3s ease;
    }

    /* 移动端分类按钮样式调整 */
    .wp-lm-link-categories-widget .wp-lm-category-button {
        text-align: center;
        justify-content: center;
        padding: var(--wp-lm-simple-space-sm);
        min-height: 48px;
        font-size: 13px;
    }

    .wp-lm-link-categories-widget .wp-lm-category-button .category-count {
        margin-left: 0;
        margin-top: 4px;
        display: block;
    }

    /* 移动端申请按钮样式优化 */
    .wp-lm-link-categories-widget .wp-lm-links-form-button-inline {
        padding: 6px 14px;
        font-size: 12px;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    /* 移动端折叠按钮 - 隐藏内容区 */
    .wp-lm-link-categories-widget.is-collapsed > .wp-lm-category-button-container {
        display: none !important;
    }

    /* 移动端折叠按钮 - 隐藏申请按钮 */
    .wp-lm-link-categories-widget.is-collapsed > .wp-lm-apply-subwidget {
        display: none !important;
    }

    /* 移动端折叠状态的圆角调整 */
    .wp-lm-link-categories-widget.is-collapsed h5 {
        border-radius: var(--wp-lm-simple-radius-base);
    }

    .wp-lm-apply-subwidget {
        display: block !important;
        width: 100%;
        margin: var(--wp-lm-simple-space-lg) 0 0 0;
        padding: var(--wp-lm-simple-space-lg);
        background: var(--wp-lm-simple-bg-light);
        border-radius: var(--wp-lm-simple-radius-lg);
        box-shadow: var(--wp-lm-simple-shadow-sm);
        border: 1px solid var(--wp-lm-simple-border);
    }

    .wp-lm-apply-subwidget .wp-lm-links-form-button {
        width: 100%;
        padding: var(--wp-lm-simple-space-md);
    }

    /* 移动端猜你喜欢区域优化 */
    .wp-lm-top-links-widget {
        margin-bottom: var(--wp-lm-simple-space-lg);
    }

    .wp-lm-top-links-content {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: var(--wp-lm-simple-space-sm);
    }

    /* 移动端分类链接保持网格布局 */
    .wp-lm-link-display-content {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: var(--wp-lm-simple-space-sm);
    }

    /* 移动端分类区域内链接卡片的网格布局 */
    .wp-lm-category-section .wp-lm-link-display-content {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--wp-lm-simple-space-sm);
    }

    /* 移动端卡片样式优化 */
    .wp-lm-link-card-common {
        padding: var(--wp-lm-simple-space-sm);
        min-height: 90px;
        justify-content: center;
    }

    /* 移动端猜你喜欢区域的描述样式 - 显示两行 */
    .wp-lm-top-links-content .wp-lm-link-card-common .wp-lm-link-description {
        -webkit-line-clamp: 2;
        line-clamp: 2;
        max-height: calc(1.4em * 2);
    }

    .wp-lm-link-card-common .wp-lm-link-icon-container {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        max-height: 40px;
        padding: 2px;
        box-sizing: border-box;
        margin-bottom: var(--wp-lm-simple-space-sm);
    }

    .wp-lm-link-card-common .wp-lm-link-icon-container img {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        max-width: 36px;
        max-height: 36px;
    }

    /* 分类链接展示区域 - 移动端横向卡片 */
    .wp-lm-all-categories-display .wp-lm-link-card-common {
        width: auto;
        height: 70px;
        padding: 8px 10px;
        gap: 10px;
    }

    .wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-icon-container {
        width: 55px;
        height: 55px;
        min-width: 55px;
        min-height: 55px;
        max-width: 55px;
        max-height: 55px;
        padding: 2px;
    }

    .wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-icon-container img {
        width: 51px;
        height: 51px;
        min-width: 51px;
        min-height: 51px;
        max-width: 51px;
        max-height: 51px;
    }

    .wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-name {
        font-size: 14px;
        font-weight: 700;
    }

    .wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-description {
        font-size: 12px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .wp-lm-link-card-common .wp-lm-link-name {
        font-size: 11px;
    }

    /* 模态框响应式 */
    .wp-lm-modal-layout {
        flex-direction: column;
        gap: var(--wp-lm-simple-space-lg);
    }

    .form-buttons {
        flex-direction: column;
        gap: var(--wp-lm-simple-space-md);
    }

    .wp-lm-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {

    .wp-lm-top-links-content,
    .wp-lm-link-display-content {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: var(--wp-lm-simple-space-sm);
    }





    /* 超小屏幕卡片优化 */
    .wp-lm-link-card-common {
        padding: var(--wp-lm-simple-space-sm);
        min-height: 85px;
    }

    /* 超小屏幕猜你喜欢区域的描述样式 - 显示两行 */
    .wp-lm-top-links-content .wp-lm-link-card-common .wp-lm-link-description {
        -webkit-line-clamp: 2;
        line-clamp: 2;
        max-height: calc(1.4em * 2);
    }

    .wp-lm-link-card-common .wp-lm-link-icon-container {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        max-width: 36px;
        max-height: 36px;
        padding: 2px;
        box-sizing: border-box;
    }

    .wp-lm-link-card-common .wp-lm-link-icon-container img {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        max-width: 32px;
        max-height: 32px;
    }

    /* 超小屏幕分类区域内链接卡片的网格布局 */
    .wp-lm-category-section .wp-lm-link-display-content {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--wp-lm-simple-space-sm);
    }

    /* 分类链接展示区域 - 超小屏幕横向卡片 */
    .wp-lm-all-categories-display .wp-lm-link-card-common {
        width: auto;
        height: 65px;
        padding: 6px 8px;
        gap: 8px;
    }

    .wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-icon-container {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
        max-width: 50px;
        max-height: 50px;
        padding: 2px;
    }

    .wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-icon-container img {
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
        max-width: 46px;
        max-height: 46px;
    }

    .wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-name {
        font-size: 12px;
        font-weight: 700;
    }

    .wp-lm-all-categories-display .wp-lm-link-card-common .wp-lm-link-description {
        font-size: 10px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .wp-lm-link-card-common .wp-lm-link-name {
        font-size: 10px;
    }
}