/* ========================================
   Ferris 导航站 - Apple/iOS 毛玻璃设计系统
   ======================================== */

/* ========================================
   1. 自托管字体
   ======================================== */
@font-face {
    font-family: 'Outfit';
    src: url('../fonts/Outfit-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('../fonts/Outfit-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('../fonts/Outfit-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/PlusJakartaSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/PlusJakartaSans-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/PlusJakartaSans-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ========================================
   2. CSS 变量
   ======================================== */
:root {
    /* 配色 */
    --color-primary: #007aff;
    --color-primary-hover: #0071e3;
    --color-background: #f2f2f7;
    --color-foreground: #1c1c1e;
    --color-muted: #8e8e93;
    --color-subtle: #6c6c70;
    --color-destructive: #ff3b30;
    --color-success: #34c759;
    --color-warning: #ff9500;

    /* 毛玻璃 */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-bg-strong: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-blur: blur(24px) saturate(180%);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --glass-shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06);
    --glass-inset: inset 0 1px rgba(255, 255, 255, 0.95), inset 0 -1px rgba(0, 0, 0, 0.04);

    /* 圆角 */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 980px;

    /* 间距 */
    --spacing-unit: 4px;

    /* 动画 */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);

    /* 字体 */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', sans-serif;
}

/* ========================================
   3. 基础重置
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--color-foreground);
    line-height: 1.6;
    background: var(--color-background);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
}

/* 自定义细滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ========================================
   4. 动画关键帧
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glassReveal {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
        backdrop-filter: blur(0);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        backdrop-filter: var(--glass-blur);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ========================================
   5. 毛玻璃通用样式
   ======================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-inset), var(--glass-shadow);
    transition: transform 0.45s var(--ease-bounce),
        box-shadow 0.45s var(--ease-smooth),
        background 0.3s var(--ease-smooth);
}


/* ========================================
   6. 容器
   ======================================== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

#site-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   7. 导航栏 (Header)
   ======================================== */
#site-header {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1100px;
    z-index: 100;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-inset),
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.5s var(--ease-smooth),
        box-shadow 0.5s var(--ease-smooth),
        background 0.5s var(--ease-smooth);
    animation: fadeIn 0.6s var(--ease-enter);
}

#site-header.scrolled {
    transform: translateX(-50%) translateY(-8px);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: var(--glass-inset),
        0 8px 40px rgba(0, 0, 0, 0.1),
        0 2px 6px rgba(0, 0, 0, 0.06);
}

@supports not (backdrop-filter: blur(1px)) {
    #site-header {
        background: rgba(255, 255, 255, 0.95);
    }
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    transition: padding 0.5s var(--ease-smooth);
}

#site-header.scrolled .header-inner {
    padding: 10px 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo img {
    border-radius: 6px;
    transition: transform 0.5s var(--ease-smooth);
}

#site-header.scrolled .header-logo img {
    transform: scale(0.85);
}

.header-site-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 600;
    color: var(--color-foreground);
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.header-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.header-btn img {
    border-radius: 4px;
}

/* 导航链接 */
.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    color: #3a3a3c;
    letter-spacing: -0.01em;
    transition: all 0.25s var(--ease-smooth);
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-link.active {
    color: var(--color-foreground);
    background: rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

/* ========================================
   8. 主内容区
   ======================================== */
.content-wrapper {
    padding-top: 80px;
    /* padding-bottom: 40px; */
}

/* 页面背景浮动光球 */
@keyframes floatOrb {

    0%,
    100% {
        transform: translate(0) scale(1);
    }

    33% {
        transform: translate(20px, -15px) scale(1.04);
    }

    66% {
        transform: translate(-10px, 10px) scale(0.97);
    }
}

.page-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.animate-float-orb {
    position: absolute;
    border-radius: 50%;
    animation: 8s ease-in-out infinite floatOrb;
}

.page-orb-blue {
    top: -5%;
    left: -6%;
    width: clamp(340px, 50vw, 660px);
    height: clamp(340px, 50vw, 660px);
    background: radial-gradient(circle, rgba(0, 122, 255, 0.15) 0%, rgba(90, 200, 250, 0.06) 50%, transparent 70%);
    animation-delay: 0s;
}

.page-orb-purple {
    top: -8%;
    right: -6%;
    width: clamp(260px, 42vw, 540px);
    height: clamp(260px, 42vw, 540px);
    background: radial-gradient(circle, rgba(175, 82, 222, 0.12) 0%, rgba(0, 122, 255, 0.05) 50%, transparent 70%);
    animation-delay: -3s;
}

.page-orb-green {
    top: 40%;
    left: 30%;
    width: clamp(200px, 32vw, 420px);
    height: clamp(200px, 32vw, 420px);
    background: radial-gradient(circle, rgba(52, 199, 89, 0.09) 0%, transparent 70%);
    animation-delay: -5.5s;
}

.page-orb-orange {
    top: 20%;
    right: 5%;
    width: clamp(140px, 18vw, 260px);
    height: clamp(140px, 18vw, 260px);
    background: radial-gradient(circle, rgba(255, 149, 0, 0.08) 0%, transparent 70%);
    animation-delay: -8s;
}

/* ========================================
   9. Slogan + 搜索栏
   ======================================== */
.slogan-section {
    position: relative;
    text-align: center;
    margin-top: 75px;
    margin-bottom: 60px;
}

.slogan-title {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 800;
    background: linear-gradient(135deg, #1a1a2e 0%, #6366f1 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 14px;
    font-family: var(--font-heading);
}

.slogan-desc {
    font-size: 17px;
    color: var(--color-subtle);
}

.search-section {
    max-width: 900px;
    margin: 0 auto 30px;
    animation: glassReveal 0.6s var(--ease-enter) 0.1s both;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 搜索输入框容器（内嵌下拉） */
.search-input-wrapper {
    position: relative;
    flex: 1 1 0%;
    min-width: 200px;
    display: flex;
    align-items: center;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s var(--ease-smooth);
}

.search-input-wrapper:focus-within {
    transform: scale(1.005);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 122, 255, 0.3);
}

/* 内嵌引擎选择器 */
.search-engine-inline {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.search-engine-select {
    height: 100%;
    padding: 0 24px 0 14px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-foreground);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    letter-spacing: -0.01em;
}

.search-select-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(174, 174, 178);
    pointer-events: none;
}

.search-input {
    flex: 1;
    height: 100%;
    padding: 0 16px 0 14px;
    background: transparent;
    border: none;
    color: var(--color-foreground);
    font-size: 14px;
    outline: none;
    letter-spacing: -0.01em;
    transition: opacity 0.2s;
}

.search-input:focus {
    box-shadow: none;
}

.search-input::placeholder {
    color: var(--color-muted);
}

/* 搜索清除按钮 */
.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 0;
    bottom: 0;
    margin: auto;
    /* 绝对定位配合 top/bottom 0 和 margin auto 是最稳妥的垂直居中方案 */
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: #666;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}

.search-clear-btn.visible {
    display: flex;
    /* 使用类切换保证 flex 布局不被覆盖 */
}

.search-clear-btn:hover {
    background: rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

.search-clear-btn:active {
    transform: scale(0.9);
}

.search-clear-btn svg {
    width: 10px;
    height: 10px;
    display: block;
}

.search-btn {
    height: 44px;
    padding: 0 26px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 2px 8px rgba(0, 0, 0, 0.05);
    color: var(--color-foreground);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: -0.01em;
    transition: all 0.3s var(--ease-smooth);
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.search-btn:active {
    transform: scale(0.97);
}

/* ========================================
   10. 胶囊标签 (Pill)
   ======================================== */
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-subtle);
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.85);
    transition: all 0.3s var(--ease-bounce);
    user-select: none;
}

.pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pill.active {
    color: #fff;
    background: var(--color-foreground);
    border-color: rgba(0, 0, 0, 0.15);
}

.pill-icon {
    padding: 8px 12px;
}

/* ========================================
   11. 分类标签栏
   ======================================== */
.category-section {
    margin-bottom: 30px;
    animation: fadeUp 0.5s var(--ease-enter) 0.2s both;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: center;
    padding: 3px 0;
}

.category-pills::-webkit-scrollbar {
    display: none;
}

/* ========================================
   12. 链接卡片网格
   ======================================== */
.links-section {
    margin-bottom: 24px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 12px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    position: relative;
    cursor: pointer;
    animation: fadeUp 0.5s var(--ease-enter) backwards;
    transition: transform 0.3s var(--ease-smooth),
        box-shadow 0.45s var(--ease-smooth),
        background-color 0.3s var(--ease-smooth),
        border-color 0.3s var(--ease-smooth);
}

.link-card.glass-card {
    background: rgba(255, 255, 255, 0.8);
}

.link-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(255, 255, 255, 0.98);
    box-shadow: var(--glass-inset),
        0 10px 24px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 122, 255, 0.04);
}

.link-card:active {
    transform: translateY(-1px) scale(0.98);
}

.link-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.link-icon img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
    transition: transform 0.35s var(--ease-smooth);
}

.link-card:hover .link-icon img {
    transform: scale(1.03);
}

.link-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 骨架屏加载状态 */
.link-skeleton {
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.4) 25%,
            rgba(255, 255, 255, 0.7) 50%,
            rgba(255, 255, 255, 0.4) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ========================================
   13. 设置工具栏
   ======================================== */
.tool-panel {
    padding: 24px;
    /* max-width: 480px; */
}

.tool-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-foreground);
}

.tool-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    background: rgba(118, 118, 128, 0.08);
    color: var(--color-foreground);
    font-size: 14px;
    transition: box-shadow 0.3s, background 0.3s;
}

.form-input:focus {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}

.form-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238e8e93' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.937 10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.btn-primary {
    height: 44px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s var(--ease-bounce);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-primary:active {
    transform: scale(0.96);
}

/* ========================================
   14. 关于 (About)
   ======================================== */
.about-section {
    text-align: center;
    padding-top: 60px;
    padding-bottom: 30px;
}

.about-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #aeaeb2;
    margin-bottom: 20px;
    animation: fadeUp 0.75s var(--ease-enter) both;
}

.about-title {
    font-family: var(--font-heading);
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 800;
    color: var(--color-foreground);
    letter-spacing: -0.03em;
    line-height: 1.25;
    margin-bottom: 20px;
    animation: fadeUp 0.75s var(--ease-enter) 0.08s both;
}

.about-desc {
    font-size: clamp(15px, 2vw, 17px);
    color: var(--color-subtle);
    line-height: 1.8;
    animation: fadeUp 0.75s var(--ease-enter) 0.16s both;
}

/* ========================================
   15. 画廊区
   ======================================== */
.gallery-section {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    animation: fadeUp 0.5s var(--ease-enter) 0.4s both;
}

.gallery-card {
    flex: 1;
    position: relative;
    height: 200px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-inset), var(--glass-shadow);
    transition: transform 0.45s var(--ease-bounce),
        box-shadow 0.45s var(--ease-smooth);
}

.gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--glass-inset), var(--glass-shadow-hover);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-smooth);
}

.gallery-card:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.85);
}

.gallery-overlay span {
    color: var(--color-foreground);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ========================================
   16. 页脚
   ======================================== */
#site-footer {
    padding: 32px 0 24px;
}

.footer-divider {
    height: 1px;
    margin-bottom: 20px;
    background: linear-gradient(to right, transparent, rgba(60, 60, 67, 0.13), transparent);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.footer-copy {
    font-size: 12px;
    color: var(--color-muted);
}

.footer-beian {
    font-size: 12px;
    color: var(--color-muted);
    transition: color 0.2s;
}

.footer-beian:hover {
    color: var(--color-primary);
}

/* ========================================
   17. 聊天面板 (Chat Panel)
   ======================================== */
#site-nav {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 500px;
    height: 760px;
    max-width: calc(100vw - 60px);
    max-height: calc(100vh - 120px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s var(--ease-bounce);
    pointer-events: none;
}

#site-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chat-panel .nav-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow-hover);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid var(--glass-border);
    cursor: default;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-status-dot {
    width: 10px;
    height: 10px;
    background: var(--color-success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-success);
    position: relative;
}

.chat-status-dot::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid var(--color-success);
    opacity: 0.4;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.chat-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    color: var(--color-foreground);
    letter-spacing: -0.01em;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-subtle);
    transition: all 0.2s;
    cursor: pointer;
}

.chat-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-foreground);
    transform: translateY(-1px);
}

.chat-body {
    flex: 1;
    position: relative;
    background: transparent;
}

.chat-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 遮罩层 */
#main-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

#main-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media screen and (max-width: 768px) {
    #site-nav {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        transform: translateY(100%) scale(1);
        transition: transform 0.4s var(--ease-enter), opacity 0.3s;
    }

    #site-nav.open {
        transform: translateY(0);
        opacity: 1;
    }

    .chat-panel .nav-inner {
        border-radius: 0;
        border: none;
    }

    #main-overlay {
        display: none;
    }
}

/* ========================================
   18. fontello 图标字体
   ======================================== */
@font-face {
    font-family: 'fontello';
    src: url('/statics/link/font/fontello.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

[class^="icon-"]::before,
[class*=" icon-"]::before {
    font-family: 'fontello';
    font-style: normal;
    font-weight: normal;
    speak: never;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-cog::before {
    content: "\e801";
}

/* ========================================
   19. 响应式
   ======================================== */
@media screen and (max-width: 1024px) {
    #site-main {
        padding: 0 16px;
    }

    #site-header {
        width: calc(100% - 32px);
    }
}

@media screen and (max-width: 768px) {
    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .gallery-section {
        flex-direction: column;
    }

    .gallery-card {
        height: 160px;
    }

}

@media screen and (max-width: 480px) {
    .content-wrapper {
        padding-top: 72px;
    }

    .header-inner {
        padding: 8px 14px;
    }

    .header-nav {
        display: none;
    }

    #site-header {
        top: 8px;
        width: calc(100% - 24px);
    }

    /* 搜索栏：三部分并排显示 */
    .search-form {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .search-engine-select {
        padding: 0 20px 0 10px;
        font-size: 13px;
    }

    .search-select-arrow {
        right: 6px;
    }

    .search-input {
        padding-left: 10px;
        font-size: 13px;
    }

    .search-btn {
        padding: 0 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* 分类标签：横向滚动 */
    .category-pills {
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 4px;
    }

    .pill {
        flex-shrink: 0;
        padding: 6px 12px;
        font-size: 12px;
    }

    .links-grid {
        grid-template-columns: repeat(3, 1fr);
        /* gap: 8px; */
    }

    .link-card {
        padding: 10px;
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }
}