/* ============================================================
   首页样式 —— 毛玻璃 / 视频背景 / 渐变流光标题 / 可折叠分类卡片
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body.home-glass {
    color: #fff;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background: #1a1a2e;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* ---------- 背景：动态渐变（始终存在，视频可选叠加） ---------- */
.bg-gradient {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -3;
    background: linear-gradient(125deg, #1a1a2e, #16213e, #0f3460, #533483, #1a1a2e);
    background-size: 400% 400%;
    animation: bg-flow 24s ease infinite;
}
@keyframes bg-flow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.video-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -2;
    overflow: hidden;
}
#video-bg {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.8s ease;
}

.dark-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}
.blur-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: -1;
    transition: backdrop-filter 0.5s ease;
}
body.scrolled .blur-overlay { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
body.scrolled #video-bg { opacity: 0.5; }

/* ---------- 顶部跑马灯公告 ---------- */
.marquee-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}
.marquee {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
    padding-left: 100%;
}
.marquee-content {
    display: inline-block;
    margin-right: 40px;
    color: #f5f5f5;
    font-weight: bold;
    font-size: 14px;
}
@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ---------- 主容器 ---------- */
.home-main {
    max-width: min(1200px, 90vw);
    margin: 0 auto;
    position: relative;
    padding: 20px;
    padding-top: 70px;
}

/* ---------- 头部 ---------- */
.home-header {
    text-align: center;
    margin-bottom: 35px;
    padding: 30px 0 10px;
}
.grad-title {
    display: inline-block;
    margin-bottom: 12px;
    font-size: clamp(2em, 6vw, 3em);
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(90deg, #ff6b6b, #ffa726, #66bb6a, #42a5f5, #ab47bc);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 8s ease infinite;
}
@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.home-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(14px, 3.5vw, 18px);
    max-width: 640px;
    margin: 8px auto 0;
}
.hero-stat {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    margin-top: 12px;
}
.hero-stat b { color: #a3d9ff; }

/* ---------- 搜索框（毛玻璃） ---------- */
.hero-search {
    max-width: 560px;
    margin: 20px auto 0;
    position: relative;
}
#toolSearch {
    width: 100%;
    padding: 13px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}
#toolSearch::placeholder { color: rgba(255, 255, 255, 0.55); }
#toolSearch:focus {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(163, 217, 255, 0.7);
    box-shadow: 0 0 18px rgba(163, 217, 255, 0.25);
}

/* ---------- 分类卡片（毛玻璃，可折叠） ---------- */
.bookmarks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 28px;
    margin-top: 20px;
}
.bookmark {
    background: rgba(255, 255, 255, 0.13);
    border-radius: 28px;
    padding: 22px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.bookmark:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}
.bookmark-header {
    cursor: pointer;
    margin-bottom: 15px;
    text-align: center;
    user-select: none;
}
.bookmark-title {
    color: #ffffff;
    font-size: 19px;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    padding: 0 10px;
}
.bookmark-title .cat-ico { margin-right: 6px; }
.bookmark-title .cat-count {
    font-size: 12px;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 1px 9px;
    margin-left: 8px;
    vertical-align: 2px;
}
.bookmark-header:hover .bookmark-title { color: #a3d9ff; text-shadow: 0 0 15px rgba(163, 217, 255, 0.4); }
.bookmark-header.collapsed .bookmark-title { color: #a3d9ff; text-shadow: 0 0 15px rgba(163, 217, 255, 0.6); }

/* 流光折叠指示条 */
.fold-indicator {
    position: relative;
    width: 80%;
    height: 2px;
    margin: 10px auto 0;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%);
    border-radius: 2px;
    overflow: hidden;
    transition: all 0.4s ease;
}
.fold-indicator::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 255, 255, 0) 100%);
    animation: shimmer 2.5s infinite;
}
.bookmark-header:hover .fold-indicator {
    background: linear-gradient(90deg,
        rgba(163, 217, 255, 0) 0%,
        rgba(163, 217, 255, 0.7) 50%,
        rgba(163, 217, 255, 0) 100%);
    height: 3px;
    box-shadow: 0 0 8px rgba(163, 217, 255, 0.3);
}
.bookmark-header.collapsed .fold-indicator {
    background: linear-gradient(90deg,
        rgba(163, 217, 255, 0) 0%,
        rgba(163, 217, 255, 0.9) 50%,
        rgba(163, 217, 255, 0) 100%);
    height: 3px;
    box-shadow: 0 0 12px rgba(163, 217, 255, 0.5);
}
.bookmark-header.collapsed .fold-indicator::before { animation: shimmer 1.5s infinite; }
@keyframes shimmer {
    0%   { left: -100%; }
    100% { left: 100%; }
}

/* ---------- 工具链接 pill（双列网格） ---------- */
.bookmark-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 9px;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.bookmark-links.collapsed { display: none; }
.tool-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 8px;
    min-height: 42px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 13.5px;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    line-height: 1.2;
}
.tool-pill:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border-color: rgba(163, 217, 255, 0.5);
    color: #a3d9ff;
    text-decoration: none;
}

/* ---------- 其他 ---------- */
.search-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 0;
    font-size: 15px;
}
.home-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    padding: 30px 0 20px;
}
.home-footer a { color: rgba(163, 217, 255, 0.8); text-decoration: none; }

/* 首页广告容器在暗色下留白即可 */
.home-main .ad-box { min-height: 0; }
.home-main .ad-box:empty { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .home-main { padding: 10px; padding-top: 55px; }
    .bookmarks { gap: 18px; }
    .bookmark { padding: 18px; border-radius: 22px; }
    .bookmark-title { font-size: 17px; }
    .tool-pill { font-size: 12.5px; padding: 9px 6px; min-height: 38px; }
    .marquee-content { font-size: 12px; }
}
@media (max-width: 480px) {
    .bookmarks { grid-template-columns: 1fr; }
    .bookmark-links { grid-template-columns: repeat(2, 1fr); }
    .fold-indicator { width: 70%; }
}
