/* 链接面板样式 */
.link-panel {
    position: fixed;
    top: 0;
    left: -350px; /* 初始隐藏在左侧 */
    width: 350px;
    height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.link-panel.show {
    left: 0;
}

/* 链接面板头部 */
.link-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
}

.link-header img {
    max-width: 200px;
    height: auto;
    transition: transform 0.3s ease;
}

.link-header img:hover {
    transform: scale(1.05);
}

/* 头部按钮容器 */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 管理按钮样式 */
.manage-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    transition: all 0.3s ease;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.manage-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.manage-button:active {
    transform: scale(0.95);
}

/* 关闭按钮 */
.close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 链接内容区域 */
.link-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 链接项目 */
.link-item {
    margin-bottom: 8px;
    opacity: 0;
    transform: translateX(-20px);
    animation: linkSlideIn 0.5s ease forwards;
}

.link-item:nth-child(1) { animation-delay: 0.1s; }
.link-item:nth-child(2) { animation-delay: 0.15s; }
.link-item:nth-child(3) { animation-delay: 0.2s; }
.link-item:nth-child(4) { animation-delay: 0.25s; }
.link-item:nth-child(5) { animation-delay: 0.3s; }
.link-item:nth-child(6) { animation-delay: 0.35s; }
.link-item:nth-child(7) { animation-delay: 0.4s; }
.link-item:nth-child(8) { animation-delay: 0.45s; }
.link-item:nth-child(9) { animation-delay: 0.5s; }
.link-item:nth-child(10) { animation-delay: 0.55s; }
.link-item:nth-child(11) { animation-delay: 0.6s; }
.link-item:nth-child(12) { animation-delay: 0.65s; }

@keyframes linkSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 链接按钮 */
.link-button-large {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(37, 117, 252, 0.85);
    border: 1px solid rgba(37, 117, 252, 0.9);
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.link-button-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.link-button-large:hover::before {
    left: 100%;
}

.link-button-large:hover {
    background: rgba(37, 117, 252, 0.95);
    border-color: rgba(37, 117, 252, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(37, 117, 252, 0.5);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.link-button-large:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.link-button-large i {
    font-size: 16px;
    min-width: 16px;
    text-align: center;
}

.link-button-large span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 切换按钮样式 - 已删除，使用linkPanelButton代替 */

/* 移动端适配 */
@media (max-width: 768px) {
    .link-panel {
        width: 280px;
        left: -280px;
    }
    
    .link-header {
        padding: 15px;
    }
    
    .link-header img {
        max-width: 120px;
    }
    
    .link-content {
        padding: 15px;
        gap: 10px;
    }
    
    .link-button-large {
        padding: 10px 12px;
        font-size: 13px;
        gap: 10px;
    }
    
    .link-button-large i {
        font-size: 14px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .link-panel {
        width: 250px;
        left: -250px;
    }
    
    .link-header {
        padding: 12px;
    }
    
    .link-header img {
        max-width: 100px;
    }
    
    .link-content {
        padding: 12px;
        gap: 8px;
    }
    
    .link-button-large {
        padding: 8px 10px;
        font-size: 12px;
        gap: 8px;
    }
    
    .close-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* 面板遮罩层（移动端） */
@media (max-width: 768px) {
    .link-panel-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .link-panel.show + .link-panel-overlay,
    .link-panel-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* 滚动条样式 */
.link-panel::-webkit-scrollbar {
    width: 6px;
}

.link-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.link-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.link-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 无障碍访问支持 */
.link-button-large:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.close-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .link-panel {
        background: #000;
        border-right: 2px solid #fff;
    }
    
    .link-button-large {
        background: #333;
        border-color: #fff;
        color: #fff;
    }
    
    .link-button-large:hover {
        background: #555;
    }
}

/* 动画禁用模式支持 */
@media (prefers-reduced-motion: reduce) {
    .link-panel,
    .link-button-large,
    .close-button,
    .link-item {
        transition: none;
        animation: none;
    }
    
    .link-item {
        opacity: 1;
        transform: none;
    }
}

/* 安卓浏览器兼容性修复 */
@supports not (backdrop-filter: blur(8px)) {
    .link-button-large {
        background: #2575fc !important;
        border: 1px solid #1a5ef0 !important;
        color: #ffffff !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 1) !important;
    }
    
    .link-button-large:hover {
        background: #1a5ef0 !important;
        border-color: #0f47d4 !important;
        color: #ffffff !important;
    }
}

/* 对于不支持 backdrop-filter 的浏览器（如部分安卓浏览器） */
.link-button-large {
    /* 优先使用实色背景作为备用 */
    background-color: #2575fc;
    background-image: linear-gradient(135deg, #2575fc 0%, #1a5ef0 100%);
}

.link-button-large:hover {
    background-color: #1a5ef0;
    background-image: linear-gradient(135deg, #1a5ef0 0%, #0f47d4 100%);
}

/* 强制文字颗色为白色，确保在任何情况下都清晰可见 */
.link-button-large,
.link-button-large:hover,
.link-button-large:active,
.link-button-large:focus {
    color: #ffffff !important;
}

.link-button-large i,
.link-button-large span {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
}