/* ============================================================
   小缘风格模板 (template-xiaoyuan)
   仿「小缘导航」(4.xn--7p0a.top) 前端风格：
   深黑渐变主色 #121212/#333333 + 紫色点缀 #6C5CE7
   新拟态白卡片 + 首页双按钮（彩虹渐变文字）
   仅在 body.template-xiaoyuan 下生效，不影响默认模板
   ============================================================ */

body.template-xiaoyuan {
    background: #eef0f3;
}

/* ---------- 顶部导航 ---------- */
body.template-xiaoyuan .top-nav {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 8px 0;
}

body.template-xiaoyuan .nav-action-button {
    background: #000000 !important;
    color: #ffffff !important;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2), -2px -2px 4px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

body.template-xiaoyuan .nav-action-button:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

/* ---------- 首页双按钮区 ---------- */
body.template-xiaoyuan .dual-btn-section {
    margin: 8px 12px;
    display: flex;
    gap: 8px;
    align-items: stretch;
}

body.template-xiaoyuan .dual-btn {
    flex: 1;
    background-color: #121212;
    border-radius: 18px;
    padding: 22px 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    letter-spacing: 0.5px;
}

body.template-xiaoyuan .dual-btn span {
    background: none;
    background-image: none;
    background-clip: border-box;
    -webkit-background-clip: border-box;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    font-weight: 900;
    font-size: 22px;
    display: inline-block;
}

body.template-xiaoyuan .dual-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background-color: #1a1a1a;
}

body.template-xiaoyuan .dual-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

@keyframes xiaoyuanTextGradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- 滚动公告栏（黑白：黑底白字跑马灯） ---------- */
body.template-xiaoyuan .announcement-bar {
    margin: 8px 12px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    height: auto;
    background: #000000 !important;
    padding: 10px 14px;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.25);
}

body.template-xiaoyuan .announcement-container {
    display: flex;
    align-items: center;
    height: auto;
    padding: 0;
}

body.template-xiaoyuan .announcement-icon {
    color: #ffffff;
    font-size: 16px;
    margin-right: 10px;
    flex-shrink: 0;
    width: auto;
    height: auto;
}

body.template-xiaoyuan .announcement-text {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 24px;
    padding-right: 0;
}

/* 去掉右侧渐变遮罩，避免文字显示不全 */
body.template-xiaoyuan .announcement-text::after {
    display: none !important;
}

body.template-xiaoyuan .announcement-scroll {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    min-width: 100%;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    background: none;
    text-shadow: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    white-space: nowrap;
    display: inline-block;
    animation: xiaoyuanScrollText 18s linear infinite;
}

@keyframes xiaoyuanScrollText {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ---------- 分类 Tab ---------- */
body.template-xiaoyuan .tab-section {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-radius: 14px;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.05), -4px -4px 8px rgba(255, 255, 255, 0.8);
    margin: 0 12px 8px;
    border: none;
    padding: 12px;
}

body.template-xiaoyuan .tab-section .p-2 {
    background: transparent;
    padding: 0;
}

body.template-xiaoyuan .tab-button {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    color: #666666;
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.08), -4px -4px 8px rgba(255, 255, 255, 0.8);
}

body.template-xiaoyuan .tab-button:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.1), -6px -6px 12px rgba(255, 255, 255, 0.9);
}

body.template-xiaoyuan .tab-button.active {
    background: linear-gradient(145deg, #121212, #333333) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 6px 6px 12px rgba(18, 18, 18, 0.15), -2px -2px 6px rgba(255, 255, 255, 0.1), inset 2px 2px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* ---------- 导航卡片：列表式新拟态（2 列） ---------- */
body.template-xiaoyuan .tab-content-container {
    margin: 0 12px 10px;
}

body.template-xiaoyuan .compact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

body.template-xiaoyuan .compact-card {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border-radius: 14px;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.08), -4px -4px 8px rgba(255, 255, 255, 0.7), inset 1px 1px 0 rgba(255, 255, 255, 0.8), inset -1px -1px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    border: none;
    min-height: 0;
    position: relative;
}

body.template-xiaoyuan .compact-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.12), -8px -8px 16px rgba(255, 255, 255, 0.8), inset 2px 2px 0 rgba(255, 255, 255, 0.9), inset -2px -2px 0 rgba(0, 0, 0, 0.07);
}

body.template-xiaoyuan .compact-card:active {
    transform: translateY(-1px) scale(1.01);
}

/* 右下角「立即访问」跳动小按钮（整卡可点击跳转，按钮为纯视觉入口） */
body.template-xiaoyuan .compact-card::after {
    content: '立即访问';
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: linear-gradient(145deg, #333333, #121212);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2), -1px -1px 3px rgba(255, 255, 255, 0.1), inset 1px 1px 0 rgba(255, 255, 255, 0.15);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    min-width: 64px;
    height: 26px;
    animation: xiaoyuanBounce 1s infinite;
    z-index: 3;
}

body.template-xiaoyuan .compact-card:hover::after {
    background: linear-gradient(145deg, #121212, #333333);
}

@keyframes xiaoyuanBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

body.template-xiaoyuan .compact-card-img {
    width: 65px;
    height: 65px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.08), -3px -3px 6px rgba(255, 255, 255, 0.8);
}

body.template-xiaoyuan .compact-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

body.template-xiaoyuan .compact-card-content {
    flex: 1;
    text-align: left;
    min-width: 0;
}

body.template-xiaoyuan .compact-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #121212;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

body.template-xiaoyuan .compact-card-desc {
    font-size: 12px;
    color: #666666;
    line-height: 1.4;
    max-height: none;
    height: auto;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 76px;
}

/* ---------- 分享弹窗配色（跟随深黑主色） ---------- */
body.template-xiaoyuan .btn-copy {
    background: linear-gradient(145deg, #121212, #333333) !important;
}

body.template-xiaoyuan .share-platform .fa-qq,
body.template-xiaoyuan .share-platform .fa-weixin,
body.template-xiaoyuan .share-platform .fa-paper-plane {
    color: #121212 !important;
}

/* ---------- 弹窗确认按钮 ---------- */
body.template-xiaoyuan #announcementPopup .bg-primary,
body.template-xiaoyuan #announcementPopup button.bg-primary,
body.template-xiaoyuan .noticeNew .bg-primary {
    background: linear-gradient(145deg, #121212, #333333) !important;
}

/* ---------- 底部导航激活色（黑白） ---------- */
body.template-xiaoyuan .nav-item.active {
    color: #000000 !important;
}

/* ---------- 顶部副标题（黑白） ---------- */
body.template-xiaoyuan .nav-subtitle {
    color: #333333 !important;
}

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
    body.template-xiaoyuan .compact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    body.template-xiaoyuan .compact-card {
        padding: 8px 10px;
        border-radius: 12px;
    }

    body.template-xiaoyuan .compact-card-img {
        width: 55px;
        height: 55px;
        margin-right: 8px;
        border-radius: 10px;
    }

    body.template-xiaoyuan .compact-card-title {
        font-size: 13px;
    }

    body.template-xiaoyuan .compact-card-desc {
        font-size: 11px;
        line-height: 1.4;
        padding-right: 68px;
    }

    body.template-xiaoyuan .compact-card::after {
        right: 8px;
        bottom: 8px;
        padding: 2px 7px;
        font-size: 10px;
        min-width: 58px;
        height: 24px;
        border-radius: 7px;
    }

    body.template-xiaoyuan .tab-button {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 10px;
    }

    body.template-xiaoyuan .tab-section {
        padding: 10px;
        border-radius: 12px;
        margin: 0 10px 8px;
    }

    body.template-xiaoyuan .dual-btn {
        padding: 18px 4px;
        border-radius: 16px;
    }

    body.template-xiaoyuan .dual-btn span {
        font-size: 18px;
    }

    body.template-xiaoyuan .announcement-bar {
        margin: 8px 10px;
        padding: 10px 12px;
    }

    body.template-xiaoyuan .announcement-scroll {
        font-size: 13px;
        line-height: 20px;
    }

    body.template-xiaoyuan .nav-action-button {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 8px;
    }
}

@media (max-width: 320px) {
    body.template-xiaoyuan .compact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
