/* ========================
   游戏狐导航主题 - 样式表
   专为游戏玩家打造的导航网站
   ======================== */

/* CSS变量 */
:root {
    --primary: #1677ff;
    --primary-dark: #0958d9;
    --danger: #ff4d4f;
    --success: #52c41a;
    --warning: #faad14;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #1f2329;
    --text-secondary: #646a73;
    --border: #e5e7eb;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 重置 */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }

/* ========================
   顶部栏
   ======================== */
.yxh-topbar {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
    position: relative;
    z-index: 100;
}
.yxh-topbar-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.yxh-topbar-left {
    flex-shrink: 0;
    min-width: 0;
    max-width: 200px;
}
.yxh-topbar-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 顶部栏搜索框 */
.yxh-topbar-search {
    flex: 0 1 auto;
    max-width: 380px;
    min-width: 200px;
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 50px;
    padding: 2px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}
.yxh-topbar-search:focus-within {
    background: #fff;
    border-color: #1677ff;
    box-shadow: 0 0 0 4px rgba(22,119,255,0.1);
}

/* 引擎切换按钮 */
.yxh-search-engine {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: #fff;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    border: 1px solid #e8e8e8;
    user-select: none;
}
.yxh-search-engine:hover {
    background: #f0f7ff;
    border-color: #1677ff;
}
.yxh-search-engine.active {
    background: #f0f7ff;
}
.yxh-search-engine .yxh-engine-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.yxh-search-engine .yxh-engine-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.yxh-search-engine > svg {
    width: 10px;
    height: 10px;
    color: #999;
    transition: transform 0.3s;
}
.yxh-search-engine.active > svg {
    transform: rotate(180deg);
}

/* 搜索表单 */
.yxh-topbar-search form {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}
.yxh-topbar-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 4px 8px;
    font-size: 13px;
    outline: none;
    color: #333;
    min-width: 0;
    width: 140px;
}
.yxh-topbar-search input::placeholder {
    color: #bbb;
}
.yxh-topbar-search button {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #1677ff, #0958d9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    color: #fff;
}
.yxh-topbar-search button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(22,119,255,0.4);
}
.yxh-topbar-search button svg {
    width: 14px;
    height: 14px;
}

/* 引擎下拉菜单 */
.yxh-engine-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 200;
    min-width: 260px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
}
.yxh-engine-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.yxh-engine-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: #333;
}
.yxh-engine-item:hover {
    background: #f0f7ff;
}
.yxh-engine-item.active {
    background: #e6f7ff;
    color: #1677ff;
    font-weight: 500;
}
.yxh-engine-item .yxh-engine-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.yxh-engine-item .yxh-engine-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.yxh-engine-item span {
    white-space: nowrap;
}

/* 右上角时间日期 */
.yxh-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    color: #999;
    font-size: 12px;
    white-space: nowrap;
}
.yxh-divider {
    width: 1px;
    height: 12px;
    background: #e0e0e0;
}
.yxh-date-text,
.yxh-weekday-text {
    display: inline;
}

/* ========================
   主体内容
   ======================== */
.yxh-main { padding: 24px 0 40px; }
.yxh-main-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 分类区块 */
.yxh-section { margin-bottom: 28px; }
.yxh-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.yxh-section-head h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    position: relative;
    padding-left: 12px;
}
.yxh-section-head h2::before {
    content: '';
    position: absolute;
    left: 0; top: 3px; bottom: 3px;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), #722ed1);
    border-radius: 2px;
}
.yxh-section-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 链接卡片网格 */
.yxh-link-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.yxh-link-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.yxh-link-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(22,119,255,0.1);
    transform: translateY(-1px);
}
.yxh-link-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}
.yxh-link-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.yxh-link-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.yxh-link-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 4px;
}
.yxh-link-title .yxh-link-badge {
    display: inline-block;
    padding: 1px 5px;
    font-size: 10px;
    border-radius: 3px;
    font-weight: 600;
    flex-shrink: 0;
}
.yxh-link-badge-tj {
    background: #fff1f0;
    color: #cf1322;
    border: 1px solid #ffa39e;
}
.yxh-link-badge-new {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}
.yxh-link-desc {
    font-size: 11px;
    color: #999;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.yxh-link-card.is-title-red .yxh-link-title { color: var(--danger); font-weight: 600; }

@media (max-width: 1200px) {
    .yxh-link-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 768px) {
    .yxh-link-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .yxh-link-card { padding: 6px 8px; }
    .yxh-link-icon { width: 28px; height: 28px; }
    .yxh-link-title { font-size: 12px; }
}

@media (max-width: 480px) {
    .yxh-link-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}

/* ========================
   底部收藏提示
   ======================== */
.yxh-bookmark-tip {
    max-width: 1300px;
    margin: 0 auto 30px;
    padding: 20px 24px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    font-size: 15px;
    color: var(--text);
}
.yxh-key {
    display: inline-block;
    background: #e6f7ff;
    border: 2px solid #91d5ff;
    border-radius: 6px;
    padding: 4px 14px;
    margin: 0 4px;
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
    font-size: 14px;
}
.yxh-green-url {
    color: var(--success);
    font-weight: 700;
}

/* ========================
   友情链接
   ======================== */
.yxh-friendlink-wrap {
    padding: 0 0 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.yxh-friendlink-head {
    display: inline;
    margin-right: 10px;
}
.yxh-friendlink-title {
    font-size: 13px;
    color: #999;
    font-weight: normal;
}
.yxh-friendlink-list {
    display: inline;
}
.yxh-friendlink-item {
    display: inline;
    padding: 0;
    background: none;
    border-radius: 0;
    font-size: 13px;
    color: #666;
    transition: color 0.2s;
    border: none;
    margin-right: 16px;
    text-decoration: none;
}
.yxh-friendlink-item:hover {
    background: none;
    color: var(--primary);
    transform: none;
    box-shadow: none;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .yxh-friendlink-wrap { padding: 0 0 10px; margin-bottom: 10px; }
    .yxh-friendlink-item { margin-right: 12px; font-size: 12px; }
}

/* ========================
   页脚
   ======================== */
.yxh-footer {
    background: #fff;
    color: #999;
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #f0f0f0;
}
.yxh-footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}
.yxh-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
}
.yxh-footer-left { display: flex; align-items: center; gap: 8px; }
.yxh-footer-left a { color: #999; transition: var(--transition); }
.yxh-footer-left a:hover { color: var(--primary); }
.yxh-footer-left span { color: #ddd; }
.yxh-footer-right { color: #999; }

/* ========================
   悬浮按钮
   ======================== */
.yxh-float-toolbar {
    position: fixed;
    right: 16px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}
.yxh-float-btn {
    width: 48px;
    height: 48px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    color: var(--text-secondary);
}
.yxh-float-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(22,119,255,0.3);
}
.yxh-float-btn svg { width: 20px; height: 20px; }
#yxh-backtop { opacity: 0; visibility: hidden; transform: translateY(20px); transition: var(--transition); }
#yxh-backtop.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* 分享成功提示 */
.yxh-share-toast {
    display: none;
    position: fixed;
    right: 76px;
    bottom: 24px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 10000;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.yxh-share-toast::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(0,0,0,0.8);
}

@media (max-width: 768px) {
    .yxh-share-toast {
        right: 62px;
        bottom: 20px;
        font-size: 12px;
        padding: 8px 14px;
    }
    .yxh-share-toast::after {
        right: -5px;
        border-width: 5px 0 5px 5px;
    }
}

/* ========================
   响应式适配
   ======================== */
@media (max-width: 768px) {
    .yxh-topbar-inner {
        padding: 0 12px;
        gap: 10px;
    }
    .yxh-topbar-hint {
        display: none;
    }
    .yxh-topbar-search {
        max-width: none;
        order: -1;
        width: 100%;
    }
    .yxh-topbar-right {
        gap: 6px;
    }
    .yxh-date-text {
        display: none;
    }
    .yxh-engine-dropdown {
        min-width: 240px;
        left: 0;
        transform: translateY(-10px);
    }
    .yxh-engine-dropdown.is-open {
        transform: translateY(0);
    }

    .yxh-main { padding: 16px 0 30px; }
    .yxh-main-inner { padding: 0 12px; }

    .yxh-section-head h2 { font-size: 17px; }
    .yxh-section-head span { font-size: 12px; display: none; }

    .yxh-bookmark-tip { display: none !important; }

    .yxh-footer { padding: 30px 0 16px; }
    .yxh-footer-inner { padding: 0 16px; }
    .yxh-footer-bottom { flex-direction: column; text-align: center; gap: 8px; }

    .yxh-float-toolbar { right: 10px; bottom: 16px; }
    .yxh-float-btn { width: 42px; height: 42px; }
}

@media (max-width: 480px) {
    .yxh-grid { grid-template-columns: repeat(3, 1fr); }
    .yxh-engine-dropdown {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c0c4cc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #909399; }

/* 选中文字颜色 */
::selection { background: rgba(22,119,255,0.2); color: var(--text); }