/* =============================================================
   蓝果吧 · 首页样式（含手机/PC 响应式）
   ============================================================= */

/* ---------------- 页面容器 ---------------- */
#app {
    max-width: 3500px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    padding-bottom: 40px;
    position: relative;
    z-index: 2;
}

/* ---------------- 顶部 Banner + 轮播 ---------------- */
.header-banner {
    position: relative;
    height: 260px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
}
.carousel-container, .carousel-slides {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}
.carousel-slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 1.2s ease;
    background-size: cover;
    background-position: center;
}
.carousel-slide.active { opacity: 1; }
.carousel-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 100%);
    z-index: 2;
}
.header {
    position: relative;
    z-index: 3;
    padding: 30px 0 20px;
    text-align: center;
    color: #fff;
}
.banner { margin-bottom: 6px; }
.logo {
    width: 90px; height: 90px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: transparent;
    cursor: pointer;
    animation: float 4s ease-in-out infinite;
    margin: 0 auto;
}
@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}
.logo img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.author-name {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff, #dbeafe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.desc {
    font-size: 18px;
    max-width: 500px;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}
.carousel-indicators {
    position: absolute;
    bottom: 12px; left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 3;
}
.carousel-indicators .indicator {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}
.carousel-indicators .indicator.active { background: #fff; width: 20px; border-radius: 4px; }

/* ---------------- 搜索框 ---------------- */
.search-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto 30px;
    display: flex;
    background: #fff;
    border-radius: 60px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: visible;
    transition: var(--transition);
    height: 48px;
    z-index: 100;
}
.search-engine-selector {
    position: relative;
    width: 140px; min-width: 140px;
    cursor: pointer;
    border-right: 1px solid var(--border);
    background: var(--primary-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 60px 0 0 60px;
    user-select: none;
}
.search-engine-selector:hover { background: var(--primary-light-2); }
.selected-engine {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.selected-engine img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; }
.selected-engine span {
    font-weight: 600; font-size: 14px;
    color: var(--primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.engine-arrow { margin-left: auto; transition: var(--transition); font-size: 11px; color: var(--primary); }
.engine-arrow.open { transform: rotate(180deg); }
.engine-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0; width: 100%;
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    overflow-y: auto;
    max-height: 400px;
    border: 1px solid var(--border);
}
.engine-options.active { display: block; animation: fadeInDown 0.3s ease; }
.engine-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.engine-option:last-child { border-bottom: none; }
.engine-option:hover { background: var(--primary-light); }
.engine-option img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.engine-option span { font-weight: 500; font-size: 14px; color: var(--text-primary); }
.search-input-container { flex: 1; display: flex; align-items: center; }
.search-input {
    width: 100%; height: 100%;
    border: none; outline: none;
    padding: 0 15px;
    font-size: 15px;
    color: var(--text-primary);
    background: transparent;
}
.search-input::placeholder { color: #a0aec0; font-size: 14px; }
.search-button {
    width: 50px; min-width: 50px;
    background: var(--primary);
    border: none; outline: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    border-radius: 0 60px 60px 0;
}
.search-button:hover { background: var(--primary-dark); }
.search-button svg { width: 20px; height: 20px; stroke: #fff !important; }

/* PC 端搜索栏引擎选项（横向滚动） */
.engine-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    max-width: 900px;
    margin: -14px auto 18px;
}
.engine-pills::-webkit-scrollbar { display: none; }
.engine-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}
.engine-pill img { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; }
.engine-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---------------- 标签栏 ---------------- */
.tab-list {
    display: flex;
    /* 手机默认风格：四个标签均分一行，完整铺满 */
    gap: 8px;
    justify-content: space-between;
    max-width: 900px;
    margin: 0 auto 24px;
    padding: 0 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 3;
}
.tab-list::-webkit-scrollbar { display: none; }
.tab-item {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 10px 6px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
    box-shadow: var(--shadow);
    color: var(--text-primary);
    font-size: 15px;
    backdrop-filter: blur(5px);
    flex-shrink: 0;
    white-space: nowrap;
}
.tab-item:hover { background-color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); }
.tab-item.active {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(74, 108, 247, 0.3);
}

/* ---------------- 分类侧边栏 ---------------- */
.category-sidebar {
    position: absolute;
    left: 10px;
    width: 52px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 16px 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.7);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: none;
    transition: opacity 0.3s ease, transform 0.3s ease, top 0.1s ease;
    opacity: 1;
    transform: translateX(0);
}
.category-sidebar.hidden { opacity: 0; transform: translateX(-20px); pointer-events: none; }
.category-sidebar.fixed-center { position: fixed; top: 50%; transform: translateY(-50%); }
.category-sidebar::-webkit-scrollbar { display: none; }
.side-cat {
    width: 38px; height: 38px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.6);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    text-align: center; line-height: 1.2;
    word-break: break-word;
    padding: 0 2px;
}
.side-cat:hover { border-color: var(--primary); }
.side-cat.active {
    background: var(--primary);
    color: #fff;
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(74, 108, 247, 0.4);
}

/* ---------------- 网络导航主体 ---------------- */
.app-lists-container { display: block; margin-bottom: 40px; margin-left: 70px; transition: margin-left 0.25s ease; }
/* 非"网址导航"标签（实时动态/网址收录/联系方式）时内容占满全宽，消除侧边栏留白 */
.app-lists-container.full-width { margin-left: 0; }
.category-section { margin-bottom: 16px; }
.section-title {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 40px;
    padding: 5px 18px;
    margin: 20px 0 10px 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    display: inline-block;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
}
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 10px 6px;
    padding: 5px;
}
.item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: var(--bg-white-transparent);
    backdrop-filter: blur(4px);
    border-radius: 16px;
    padding: 10px 2px 6px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.5);
    height: 100%;
    min-height: 92px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    position: relative;
    cursor: pointer;
}
.item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
/* 点击进入动画 */
.item.nav-opening {
    animation: navEnter 0.4s ease forwards;
}
@keyframes navEnter {
    0% { transform: scale(1); opacity: 1; }
    40% { transform: scale(0.86); opacity: 0.65; }
    100% { transform: scale(0.96); opacity: 0.9; }
}
.item .img-wrap {
    width: 36px; height: 36px; min-width: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.item .img-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.item .app-name-wrap { width: 100%; text-align: center; }
.item .app-name {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

/* 最近访问 */
.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.recent-actions { display: flex; gap: 8px; }
.recent-actions button {
    padding: 5px 16px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.8);
    color: var(--text-primary);
    transition: var(--transition);
}
.recent-actions button:hover { background: var(--primary-light); }
.recent-actions button.done { background: var(--success); color: #fff; border-color: var(--success); }
.recent-item .recent-delete-btn {
    position: absolute;
    top: 4px; right: 4px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    display: none;
    z-index: 5;
}
#recent-section.edit-mode .recent-item .recent-delete-btn { display: block; }

/* ---------------- 嵌入式面板（实时动态 / 网址收录 改 AJAX） ---------------- */
.embedded-container {
    display: none;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}
.embedded-container.active { display: block; }
.embedded-inner {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    min-height: 300px;
    width: 100%;
}

/* ---------------- 消息流（轻语） ---------------- */
.show-panel { display: none; }
.show-panel.active { display: block; }

/* ---------------- 联系方式 ---------------- */
.floating-icons {
    position: relative;
    width: 100%;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.floating-icon {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: transform 0.2s;
    position: absolute;
    overflow: hidden;
    animation: floatRandom 12s infinite ease-in-out;
}
.floating-icon:nth-child(1) { animation-delay: -2s; left: 30%; top: 40%; }
.floating-icon:nth-child(2) { animation-delay: -5s; left: 60%; top: 50%; }
.floating-icon img { width: 60%; height: 60%; object-fit: contain; }
@keyframes floatRandom {
    0% { transform: translate(0, 0); }
    25% { transform: translate(20px, -25px); }
    50% { transform: translate(-15px, 20px); }
    75% { transform: translate(25px, 15px); }
    100% { transform: translate(0, 0); }
}

/* ---------------- 页脚 ---------------- */
.footer {
    text-align: center;
    color: rgba(0, 0, 0, 0.55);
    font-size: 14px;
    padding: 30px 0 12px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

/* ---------------- 站内搜索结果弹窗 ---------------- */
.search-result-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.search-result-modal.show { display: flex; }
.search-result-content {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.search-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.search-result-header h3 { font-size: 16px; }
.close-search-result {
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.search-result-grid {
    padding: 12px;
    overflow-y: auto;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: var(--transition);
    cursor: pointer;
}
.search-result-item:hover { background: var(--primary-light); }
.search-result-item img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.search-letter-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.search-result-item span { font-size: 15px; color: var(--text-primary); }

/* =============================================================
   PC 端（宽度 > 768px）
   ============================================================= */
@media (min-width: 768px) {
    body { padding: 30px 40px 20px; }

    .header-banner { height: 320px; }

    /* PC：搜索栏引擎改为横向药丸选择 */
    .search-container { max-width: 700px; }

    .app-lists-container { margin-left: 0; padding-left: 80px; }
    .embedded-inner { margin-left: 0; padding-left: 80px; }
    .floating-icons { margin-left: 0; }

    .app-grid { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 14px 10px; }
    .item { min-height: 100px; border-radius: 18px; }
    .item .app-name { font-size: 13px; }

    .footer { font-size: 15px; }
}
