/* 洋屿 - 友链导航页面（A-洋屿-友链导航页面）
 */

/* 页面整体容器 */
.xy-links-nav-page {
    padding-bottom: 0;
}

/* 右下角浮层/弹窗隐藏由后台 xy_links_hide_selectors 配置控制，不再默认隐藏 .float-right */

.xy-links-nav-row {
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 左侧边栏 */
.xy-links-sidebar {
    padding-right: 10px;
}

.xy-links-sidebar-box {
    padding: 16px;
    position: sticky;
    top: 80px;
}

.xy-links-sidebar-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--main-color, #333);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--muted-border-color, #f0f0f0);
    margin-bottom: 10px;
}

.xy-links-sidebar-head i {
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
}

.xy-links-cat-list {
    margin-bottom: 14px;
}

.xy-links-cat-item,
.xy-links-no-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--main-color, #555);
    font-size: 14px;
    margin-bottom: 6px;
    transition: all .2s;
    text-decoration: none;
}

.xy-links-cat-item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c0c4cc;
    transition: all .2s;
    flex-shrink: 0;
}

.xy-links-cat-item:hover,
.xy-links-cat-item.active {
    background: rgba(74, 144, 226, .08);
    color: var(--theme-color, #4a90e2);
    font-weight: 600;
}

.xy-links-cat-item:hover::before,
.xy-links-cat-item.active::before {
    background: var(--theme-color, #4a90e2);
}

.xy-links-no-cat {
    color: #999;
    font-size: 13px;
    text-align: center;
    background: var(--body-bg-color, #f8f9fa);
}

.xy-links-apply-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 0;
    font-size: 14px;
}

/* 主内容区 */
.xy-links-main {
    padding-left: 10px;
}

/* Hero 横幅 */
.xy-links-hero {
    position: relative;
    border-radius: 16px;
    min-height: 280px;
    width: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 12px;
}

.xy-links-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 1;
}

.xy-links-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 680px;
    padding: 20px 16px;
    color: #fff;
}

.xy-links-hero-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    letter-spacing: 1px;
}

/* Hero 搜索区 */
.xy-links-search-box {
    background: rgba(255, 255, 255, .95);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    max-width: 640px;
    margin: 0 auto;
}

.xy-links-hero-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.xy-links-hero-tags span {
    display: inline-block;
    padding: 5px 16px;
    background: rgba(0, 0, 0, .25);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 20px;
    font-size: 13px;
    color: #fff;
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: all .2s;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

.xy-links-hero-tags span:hover,
.xy-links-hero-tags span.active {
    background: rgba(0, 0, 0, .45);
    border-color: rgba(255, 255, 255, .5);
    font-weight: 600;
}

/* 搜索框 */
.xy-links-search-form {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e4e6eb;
    margin-bottom: 8px;
}

.xy-links-search-input {
    flex: 1;
    border: 0;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    color: #333;
    background: #fff;
}

.xy-links-search-form button {
    border-radius: 0;
    padding: 0 24px;
    font-size: 14px;
}

/* 快捷标签 */
.xy-links-quick-tags-list {
    min-height: 32px;
}

.xy-links-quick-tags {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}

.xy-links-quick-tags.active {
    display: flex;
}

.xy-links-quick-tags span {
    color: #666;
    text-decoration: none;
    padding: 5px 14px;
    background: #f0f2f5;
    border-radius: 16px;
    cursor: pointer;
    transition: all .2s;
}

.xy-links-quick-tags span:hover,
.xy-links-quick-tags span.active {
    background: #4a90e2;
    color: #fff;
}

/* 友链面板 */
.xy-links-panel {
    padding: 20px;
    min-height: 200px;
}

/* 分类分组区 */
.xy-links-section {
    margin-bottom: 28px;
    scroll-margin-top: 90px;
}

.xy-links-section:last-child {
    margin-bottom: 0;
}

.xy-links-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--main-color, #333);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--muted-border-color, #f0f0f0);
}

.xy-links-section-bar {
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--theme-color, #4a90e2);
    flex-shrink: 0;
}

.xy-links-section-name {
    flex-shrink: 0;
}

.xy-links-section-count {
    font-size: 13px;
    font-weight: 400;
    color: #999;
}

.xy-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.xy-links-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    background: var(--body-bg-color, #f5f6f7);
    border: 1px solid transparent;
    text-decoration: none;
    transition: all .25s;
}

.xy-links-card:hover {
    background: var(--main-bg-color, #fff);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
    border-color: var(--theme-color, #4a90e2);
    transform: translateY(-2px);
}

.xy-links-card-logo {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #fff;
    border: 1px solid #eee;
}

.xy-links-card-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
    min-width: 0;
    flex: 1;
}

.xy-links-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--main-color, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xy-links-card-desc {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xy-links-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
}

.xy-links-card-stars {
    color: #ffc107;
    letter-spacing: 1px;
}

.xy-links-card-stars .fa-star-o {
    color: #d8d8d8;
}

.xy-links-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 60px;
}

.xy-links-card-actions .but {
    padding: 5px 0;
    font-size: 12px;
    border-radius: 6px;
    text-align: center;
}

.xy-links-detail-btn {
    background: #fff;
    color: var(--theme-color, #4a90e2);
    border: 1px solid var(--theme-color, #4a90e2);
}

.xy-links-detail-btn:hover {
    background: var(--theme-color, #4a90e2);
    color: #fff;
}

.xy-links-go-btn {
    background: var(--theme-color, #4a90e2);
    color: #fff;
    border: 1px solid var(--theme-color, #4a90e2);
}

.xy-links-go-btn:hover {
    background: #357abd;
    border-color: #357abd;
    color: #fff;
}

/* 空状态 */
.xy-links-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: #999;
}

.xy-links-empty i {
    font-size: 56px;
    margin-bottom: 12px;
    color: #d0d3d9;
}

.xy-links-empty p {
    font-size: 15px;
    margin-bottom: 18px;
}

/* 底部波浪 */
.xy-links-waves {
    position: relative;
    height: 80px;
    overflow: hidden;
    margin-top: -20px;
    z-index: 0;
    display: none;
}

.xy-links-wave {
    position: absolute;
    left: 0;
    width: 200%;
    height: 80px;
    background-repeat: repeat-x;
    background-size: 50% 100%;
    animation: xy-links-wave 20s linear infinite;
    opacity: .85;
}

.xy-links-wave-1 {
    bottom: 0;
    animation-duration: 24s;
}

.xy-links-wave-2 {
    bottom: 8px;
    animation-duration: 18s;
    opacity: .6;
}

@keyframes xy-links-wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 申请入驻弹窗 */
.xy-links-modal .modal-dialog {
    max-width: 560px;
}

.xy-links-modal .modal-content {
    border-radius: 14px;
    border: 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}

.xy-links-modal .modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
}

.xy-links-modal .modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--main-color, #333);
    display: flex;
    align-items: center;
    gap: 8px;
}

.xy-links-modal .modal-title i {
    color: #ff6b6b;
}

.xy-links-modal .modal-body {
    padding: 20px;
}

.xy-links-modal-top {
    color: #ff4757;
    font-size: 14px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #fff5f5;
    border-radius: 8px;
}

.xy-links-site-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
}

.xy-links-info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--main-color, #444);
    flex-wrap: wrap;
}

.xy-links-info-row:last-child {
    margin-bottom: 0;
}

.xy-links-info-row i {
    margin-right: 2px;
}

.xy-links-info-row strong {
    font-weight: 500;
    color: #4a90e2;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xy-links-copy {
    color: #4a90e2;
    font-size: 12px;
    margin-left: auto;
}

.xy-links-modal-bottom {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

/* 表单 */
.xy-links-form-group {
    margin-bottom: 14px;
}

.xy-links-form-group label {
    display: block;
    font-size: 13px;
    color: var(--main-color, #555);
    margin-bottom: 6px;
    font-weight: 500;
}

.xy-links-form-group .form-control {
    border-radius: 8px;
    border: 1px solid #e0e2e8;
    padding: 10px 12px;
    font-size: 13px;
    transition: border-color .2s;
}

.xy-links-form-group .form-control:focus {
    border-color: var(--theme-color, #4a90e2);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, .1);
}

.xy-links-input-group {
    display: flex;
    gap: 8px;
}

.xy-links-input-group .form-control {
    flex: 1;
}

.xy-links-input-group .xy-links-auto-fill {
    white-space: nowrap;
    padding: 0 14px;
    font-size: 13px;
}

.xy-links-logo-preview {
    margin-top: 8px;
    min-height: 0;
}

.xy-links-logo-preview img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.xy-links-form-submit {
    text-align: right;
    margin-top: 20px;
}

.xy-links-form-submit button {
    padding: 10px 24px;
    font-size: 14px;
}

.xy-links-form-message {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.xy-links-form-message.success {
    display: block;
    background: #f0f9eb;
    color: #67c23a;
    border: 1px solid #e1f3d8;
}

.xy-links-form-message.error {
    display: block;
    background: #fef0f0;
    color: #f56c6c;
    border: 1px solid #fde2e2;
}

/* 链接详情页 */
.xy-links-detail-page {
    padding: 24px;
    display: none;
}

.xy-links-detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.xy-links-detail-breadcrumb a {
    color: #666;
    text-decoration: none;
}

.xy-links-detail-breadcrumb a:hover {
    color: var(--theme-color, #4a90e2);
}

.xy-links-detail-breadcrumb span:last-child {
    color: var(--main-color, #333);
    font-weight: 500;
}

.xy-links-detail-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--body-bg-color, #f8f9fa);
    border-radius: 14px;
    margin-bottom: 24px;
}

.xy-links-detail-hero-logo {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #fff;
    border: 1px solid #eee;
}

.xy-links-detail-hero-info {
    flex: 1;
    min-width: 0;
}

.xy-links-detail-hero-info h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--main-color, #333);
    margin: 0 0 8px;
}

.xy-links-detail-hero-url {
    display: inline-block;
    font-size: 13px;
    color: #4a90e2;
    margin-bottom: 10px;
    word-break: break-all;
    text-decoration: none;
}

.xy-links-detail-hero-url:hover {
    text-decoration: underline;
}

.xy-links-detail-hero-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: #999;
    flex-wrap: wrap;
}

.xy-links-detail-hero-meta strong {
    color: var(--theme-color, #4a90e2);
}

.xy-links-detail-stars {
    color: #ffc107;
    letter-spacing: 1px;
}

.xy-links-detail-stars .fa-star-o {
    color: #d8d8d8;
}

.xy-links-detail-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 110px;
}

.xy-links-detail-hero-actions .but {
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
}

.xy-links-detail-hero-actions .xy-links-back-btn {
    background: #fff;
    color: var(--main-color, #555);
    border: 1px solid #ddd;
}

.xy-links-detail-hero-actions .xy-links-back-btn:hover {
    background: var(--body-bg-color, #f5f6f7);
    border-color: #ccc;
}

.xy-links-detail-blocks {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.xy-links-detail-block {
    padding: 20px;
    background: var(--body-bg-color, #f8f9fa);
    border-radius: 12px;
}

.xy-links-detail-block h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--main-color, #333);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.xy-links-detail-block h4 i {
    color: var(--theme-color, #4a90e2);
}

.xy-links-detail-block p {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    margin: 0;
}

.xy-links-detail-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.xy-links-detail-info-grid > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.xy-links-detail-info-grid > div span {
    font-size: 12px;
    color: #999;
}

.xy-links-detail-info-grid > div strong {
    font-size: 14px;
    color: var(--main-color, #333);
    font-weight: 600;
}

/* 夜间模式 */
body.dark-theme .xy-links-search-box {
    background: rgba(40, 40, 45, .95);
}

body.dark-theme .xy-links-quick-tags span {
    background: #3a3a40;
    color: #bbb;
}

body.dark-theme .xy-links-quick-tags span:hover,
body.dark-theme .xy-links-quick-tags span.active {
    background: #4a90e2;
    color: #fff;
}

body.dark-theme .xy-links-search-input {
    background: #2a2a30;
    color: #e0e0e0;
}

body.dark-theme .xy-links-search-form {
    border-color: #444;
}

body.dark-theme .xy-links-card {
    background: #26262c;
    border-color: transparent;
}

body.dark-theme .xy-links-card:hover {
    background: #2e2e36;
    border-color: var(--theme-color, #4a90e2);
}

body.dark-theme .xy-links-card-name {
    color: #e0e0e0;
}

body.dark-theme .xy-links-card-desc,
body.dark-theme .xy-links-card-meta {
    color: #9a9a9a;
}

body.dark-theme .xy-links-card-logo {
    background-color: #1e1e1e;
    border-color: #3a3a40;
}

body.dark-theme .xy-links-detail-btn {
    background: transparent;
    color: var(--theme-color, #4a90e2);
    border-color: var(--theme-color, #4a90e2);
}

body.dark-theme .xy-links-card-stars .fa-star-o,
body.dark-theme .xy-links-detail-stars .fa-star-o {
    color: #555;
}

body.dark-theme .xy-links-section-title {
    border-color: #333;
}

body.dark-theme .xy-links-section-name {
    color: #e0e0e0;
}

body.dark-theme .xy-links-detail-hero,
body.dark-theme .xy-links-detail-block {
    background: #26262c;
}

body.dark-theme .xy-links-detail-hero-logo {
    background-color: #1e1e1e;
    border-color: #3a3a40;
}

body.dark-theme .xy-links-detail-hero-info h2,
body.dark-theme .xy-links-detail-info-grid > div strong {
    color: #e0e0e0;
}

body.dark-theme .xy-links-detail-block p {
    color: #aaa;
}

body.dark-theme .xy-links-detail-breadcrumb a {
    color: #999;
}

body.dark-theme .xy-links-detail-breadcrumb a:hover {
    color: var(--theme-color, #4a90e2);
}

body.dark-theme .xy-links-detail-hero-actions .xy-links-back-btn {
    background: #2a2a30;
    color: #bbb;
    border-color: #444;
}

body.dark-theme .xy-links-detail-hero-actions .xy-links-back-btn:hover {
    background: #333;
    border-color: #555;
}

body.dark-theme .xy-links-site-info {
    background: #2a2a30;
}

body.dark-theme .xy-links-form-group .form-control {
    background: #2a2a30;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-theme .xy-links-form-group .form-control:focus {
    border-color: var(--theme-color, #4a90e2);
}

body.dark-theme .xy-links-modal .modal-content {
    background: var(--main-bg-color, #1e1e1e);
}

body.dark-theme .xy-links-modal .modal-header {
    border-color: #333;
}

body.dark-theme .xy-links-info-row {
    color: #bbb;
}

/* 响应式 */
@media (max-width: 768px) {
    /* 手机端页面容器无 padding */
    .xy-links-nav-page {
        padding: 0 !important;
    }

    /* 手机端隐藏页面标题/面包屑（zib_get_page_header 输出） */
    .xy-links-nav-page .content-layout > .page-header,
    .xy-links-nav-page .content-layout > .breadcrumb,
    .xy-links-nav-page .box-body > .page-header:first-child,
    .xy-links-nav-page .box-body > .breadcrumb:first-child {
        display: none !important;
    }

    /* 手机端外层盒子去掉 padding，让图片贴顶 */
    .xy-links-nav-page .box-body {
        padding: 0 !important;
        border-radius: 12px !important;
        overflow: hidden;
    }

    .xy-links-nav-row {
        margin-top: 0;
        margin-bottom: 0;
    }

    .xy-links-sidebar {
        display: none !important;
        padding-right: 0;
        margin-bottom: 0;
    }

    .xy-links-sidebar-box {
        position: static;
    }

    .xy-links-main {
        padding-left: 0;
        padding-right: 0;
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .xy-links-hero {
        min-height: 260px;
        border-radius: 12px;
        margin-bottom: 10px;
    }

    .xy-links-hero-title {
        font-size: 24px;
    }

    .xy-links-search-tabs span {
        padding: 4px 10px;
        font-size: 12px;
    }

    .xy-links-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .xy-links-card {
        padding: 10px;
    }

    .xy-links-card-logo {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .xy-links-card-name {
        font-size: 13px;
    }

    .xy-links-detail-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .xy-links-detail-hero-actions {
        flex-direction: row;
        width: 100%;
    }

    .xy-links-detail-info-grid {
        grid-template-columns: 1fr;
    }

    .xy-links-waves {
        height: 50px;
    }

    .xy-links-wave {
        height: 50px;
    }
}

/* 手机端固定入驻按钮（圆形蓝色+号） */
.xy-links-mobile-apply {
    display: none;
    position: fixed;
    right: 58px;
    bottom: 65px;
    z-index: 99;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #4a90e2;
    color: #fff;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(74, 144, 226, .4);
    font-size: 24px;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}

.xy-links-mobile-apply.left {
    right: auto;
    left: 20px;
}

.xy-links-mobile-apply:active {
    transform: scale(.92);
}

@media (max-width: 768px) {
    /* 手机端隐藏侧边栏内联申请按钮 */
    .xy-links-apply-btn {
        display: none !important;
    }

    /* 手机端隐藏整个侧边栏（标题+分类列表） */
    .xy-links-sidebar {
        display: none !important;
    }

    /* 手机端隐藏"网址导航"标题 */
    .xy-links-sidebar-head {
        display: none !important;
    }

    /* 手机端始终显示浮动+按钮 */
    .xy-links-mobile-apply {
        display: flex;
    }
}

/* 关闭「显示提交链接模块」时隐藏所有申请入口 */
.xy-links-no-submit .xy-links-apply-btn,
.xy-links-no-submit .xy-links-mobile-apply,
.xy-links-no-submit #xy-links-apply-modal {
    display: none !important;
}
