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

/* 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: 10px 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: 24px;
}

/* 左侧品牌区域 */
.yxh-topbar-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.yxh-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.yxh-logo-svg {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}
.yxh-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.yxh-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}
.yxh-brand-name {
    font-size: 18px;
    font-weight: 700;
    color: #1677ff;
    letter-spacing: 0.5px;
}
.yxh-brand-slogan {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

/* 顶部栏搜索框 */
.yxh-topbar-search {
    flex: 1;
    max-width: 520px;
    min-width: 280px;
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 50px;
    padding: 3px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    margin: 0 auto;
}
.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: 6px 12px;
    font-size: 14px;
    outline: none;
    color: #333;
    min-width: 0;
    width: auto;
}
.yxh-topbar-search input::placeholder {
    color: #bbb;
}
.yxh-topbar-search button {
    width: 36px;
    height: 36px;
    background: #1677ff;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    color: #fff;
    margin-right: 2px;
}
.yxh-topbar-search button:hover {
    background: #0958d9;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(22,119,255,0.4);
}
.yxh-topbar-search button svg {
    width: 16px;
    height: 16px;
}

/* 引擎下拉菜单 */
.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;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    color: #666;
    white-space: nowrap;
}
.yxh-topbar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}
.yxh-weather-row {
    font-size: 13px;
}
.yxh-date-row {
    font-size: 12px;
    color: #999;
}
.yxh-weather-icon {
    font-size: 18px;
    line-height: 1;
}
.yxh-weather-temp {
    font-size: 13px;
    color: #666;
}
.yxh-weather-city {
    font-size: 13px;
    color: #666;
}
.yxh-divider {
    width: 1px;
    height: 12px;
    background: #e0e0e0;
}
.yxh-date-text,
.yxh-weekday-text {
    display: inline;
    color: #999;
}

/* ========================
   主体内容
   ======================== */
.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: 1024px) and (orientation: landscape) {
    .yxh-topbar-brand {
        display: flex !important;
    }
    .yxh-topbar-right {
        display: none !important;
    }
    .yxh-topbar-inner {
        gap: 16px;
    }
    .yxh-topbar-search {
        flex: 1;
        max-width: none;
        margin: 0;
    }
    .yxh-brand-slogan {
        display: none;
    }
    .yxh-logo-svg, .yxh-logo-img {
        width: 32px;
        height: 32px;
    }
    .yxh-brand-name {
        font-size: 16px;
    }
}


@media (max-width: 480px) {
    .yxh-link-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .yxh-topbar-search input {
        font-size: 13px;
        padding: 5px 8px;
    }
    .yxh-topbar-search button {
        width: 34px;
        height: 34px;
    }
}

/* ========================
   底部收藏提示
   ======================== */
.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 {
        padding: 8px 0;
    }
    .yxh-topbar-inner {
        padding: 0 12px;
        gap: 0;
        flex-wrap: nowrap;
    }
    /* 隐藏品牌区域 */
    .yxh-topbar-brand {
        display: none;
    }
    /* 搜索框独占整行 */
    .yxh-topbar-search {
        flex: 1;
        max-width: none;
        min-width: 0;
        margin: 0;
        padding: 3px;
        border-radius: 40px;
    }
    .yxh-topbar-search input {
        padding: 6px 10px;
        font-size: 14px;
    }
    .yxh-topbar-search button {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    .yxh-search-engine {
        padding: 5px 8px;
    }
    .yxh-search-engine .yxh-engine-icon {
        width: 20px;
        height: 20px;
    }
    .yxh-search-engine > svg {
        width: 10px;
        height: 10px;
    }
    /* 隐藏右侧天气日期 */
    .yxh-topbar-right {
        display: none;
    }
    .yxh-engine-dropdown {
        min-width: 240px;
        left: 0;
        transform: translateY(-10px);
        grid-template-columns: repeat(2, 1fr);
    }
    .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); }


    .yxh-page-title {
        font-size: 22px;
    }
    .yxh-page-body {
        font-size: 14px;
    }
}


    .yxh-page-content {
        padding: 24px 20px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        border-top: 1px solid #f0f0f0;
    }
    .yxh-page-title {
        font-size: 24px;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    .yxh-page-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 16px;
        font-size: 12px;
    }
    .yxh-page-body {
        font-size: 14px;
        line-height: 1.8;
    }
    .yxh-page-body h2 {
        font-size: 18px;
    }
    .yxh-page-body h3 {
        font-size: 16px;
    }
}

/* ========================
   独立页面样式（关于本站等）
   ======================== */
.yxh-page-main {
    padding: 24px 0 50px;
    background: #f0f2f5;
    min-height: calc(100vh - 200px);
}
.yxh-page-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    overflow: hidden;
}
.yxh-page-header {
    padding: 40px 40px 30px;
    background: linear-gradient(135deg, #f6ffed 0%, #ffffff 100%);
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}
.yxh-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2329;
    margin: 0;
    position: relative;
    display: inline-block;
    padding-bottom: 16px;
}
.yxh-page-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #52c41a, #95de64);
    border-radius: 2px;
}
.yxh-page-body {
    padding: 36px 48px 48px;
    font-size: 15px;
    line-height: 2;
    color: #333;
    background: #ffffff;
}
.yxh-page-body p {
    margin-bottom: 16px;
}
.yxh-page-body h2,
.yxh-page-body h3 {
    color: #1f2329;
    margin: 28px 0 14px;
    font-weight: 600;
}
.yxh-page-body h2 {
    font-size: 20px;
    padding-left: 12px;
    border-left: 3px solid #52c41a;
}
.yxh-page-body h3 {
    font-size: 17px;
}
.yxh-page-body ul,
.yxh-page-body ol {
    margin: 14px 0 14px 24px;
}
.yxh-page-body li {
    margin-bottom: 8px;
}
.yxh-page-body a {
    color: #1677ff;
    text-decoration: none;
    transition: color 0.2s;
}
.yxh-page-body a:hover {
    color: #0958d9;
    text-decoration: underline;
}
.yxh-page-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}
.yxh-page-body blockquote {
    margin: 18px 0;
    padding: 14px 18px;
    background: #f6ffed;
    border-left: 3px solid #52c41a;
    border-radius: 0 6px 6px 0;
    color: #333;
}
.yxh-page-body code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    color: #cf1322;
}
.yxh-page-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}
.yxh-page-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

@media (max-width: 768px) {
    .yxh-page-main {
        padding: 0 0 30px;
        background: #f0f2f5;
    }
    .yxh-page-content {
        border-radius: 0;
        box-shadow: none;
    }
    .yxh-page-header {
        padding: 24px 20px 18px;
    }
    .yxh-page-title {
        font-size: 22px;
    }
    .yxh-page-meta {
        font-size: 12px;
        gap: 14px;
    }
    .yxh-page-body {
        padding: 24px 20px 30px;
        font-size: 14px;
        line-height: 1.8;
    }
    .yxh-page-body h2 {
        font-size: 17px;
    }
    .yxh-page-body h3 {
        font-size: 15px;
    }
}