/**
Theme Name: 导航站主题
Author: wptest
Description: 轻量综合类导航站主题，内置「网站」内容类型、分类导航、搜索与点击统计排行。
Version: 2.18.10
Requires at least: 6.0
Requires PHP: 7.2
License: GNU General Public License v2 or later
Text Domain: daohang
*/

:root {
    --dh-card: #ffffff;
    --dh-text: #17181a;
    --dh-muted: #6b7280;
    --dh-border: #e6e7ea;
    --dh-primary: #da634b;
    --dh-primary-2: #c04a30;
    --dh-radius: 0;
    --dh-shadow: 0 1px 2px rgba(23, 24, 26, .04), 0 6px 18px rgba(23, 24, 26, .05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--dh-primary);  
    color: var(--dh-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
}

 
html.dh-hant body { visibility: hidden; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--dh-primary); }

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

.dh-container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0; }

 
.dh-catbar { width: 100%; max-width: 1280px; margin: 0 auto; }

 
.dh-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; padding: 0 18px; border-radius: 0; border: 0; cursor: pointer;
    font-size: 14px; font-weight: 600; white-space: nowrap;
    background: linear-gradient(135deg, var(--dh-primary), var(--dh-primary-2)); color: #fff;
    transition: opacity .18s, transform .18s;
}
.dh-btn:hover { color: #fff; opacity: .92; }

 
 
.dh-catbox {
    display: flex; flex-wrap: nowrap; gap: 4px;
    border: 1px solid rgba(255, 255, 255, .55); border-radius: 0;
    background: var(--dh-primary);
    padding: 6px; margin: 14px 0 4px;
}
.dh-catbox-item {
    flex: 1 1 0; min-width: 0;
    padding: 6px; border-radius: 0; color: #fff;
    font-size: 15px; font-weight: 700; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background .15s, color .15s;
}
.dh-catbox-item:hover { background: rgba(255, 255, 255, .22); color: #fff; }
 
.dh-catbox-pub {
    flex: 1 1 0; min-width: 0;    
    padding: 6px 12px; color: #fff;
    font-size: 15px; font-weight: 700; text-align: center; white-space: nowrap;
    background: rgba(255, 255, 255, .2);
    transition: background .15s, color .15s;
}
.dh-catbox-pub:hover { background: #fff; color: var(--dh-primary); }

 
.dh-catbox-icon { width: 1.2em; height: 1.2em; object-fit: contain; vertical-align: -0.25em; margin-right: 3px; }

 
@media (min-width: 721px) {
    .dh-catbox-nav {
        display: grid;
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
    }
    .dh-catbox-nav .dh-catbox-item,
    .dh-catbox-nav .dh-catbox-pub { font-weight: 800; }
}

 
.dh-main { padding: 0; }

 
 
.dh-catbox-page { margin: 0 0 4px; border: 0; }
.dh-main > .dh-container > .dh-catbox-page + div:not([class]) { margin-top: 16px; }    

 
.dh-main > .dh-container > div:not([class]) {
    border: 0;
    padding: 0;
    margin-bottom: 20px;
    scroll-margin-top: 20px;
}
 
.dh-main > .dh-container > div:not([class]) > h2 {
    margin: 0;
    padding: 9px 14px;
    background: #e47653;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}
 
.dh-main > .dh-container > div:not([class]) > :not(h2) {
    background: #fff;
    color: var(--dh-text);
    padding: 14px;
}
.dh-main > .dh-container > div:not([class]) > p { margin: 0; }
.dh-main > .dh-container > div:not([class]) a { color: var(--dh-primary); text-decoration: underline; }

 
.dh-noticebar.dh-friendtip { margin: 0 0 16px; }

 
.dh-hero { margin: 0; padding: 0; border: 0; background: none; }
.dh-hero img { width: 100%; height: clamp(140px, 18vw, 260px); object-fit: cover; object-position: center; display: block; }

 
.dh-section { margin-bottom: 34px; }
.dh-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.dh-section-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.dh-section-bar { width: 4px; height: 18px; border-radius: 0; background: linear-gradient(180deg, var(--dh-primary), var(--dh-primary-2)); }

 
.dh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }

.dh-card {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--dh-card); border: 1px solid var(--dh-border);
    border-radius: var(--dh-radius); padding: 15px;
    box-shadow: var(--dh-shadow);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.dh-card:hover {
    transform: translateY(-3px);
    border-color: #f4c9d3;
    box-shadow: 0 6px 20px rgba(23, 31, 56, .10);
}
.dh-card-icon {
    width: 42px; height: 42px; flex: none; border-radius: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 1px;
}
.dh-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.dh-card-body { min-width: 0; flex: 1; }
.dh-card-title { font-size: 15px; font-weight: 600; margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-card-desc {
    margin: 0; color: var(--dh-muted); font-size: 12.5px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dh-card-tag { display: inline-block; margin-top: 7px; font-size: 11px; color: #8a93a6; background: #f3f5fa; border-radius: 0; padding: 1px 6px; }

 
 
.dh-textgrid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    border-top: 1px solid #e7ebf5;
    border-left: 1px solid #e7ebf5;
    background: #fff;
    overflow: hidden;
}
.dh-textlink {
    display: block;
    height: 38px;
    line-height: 37px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    color: #40485c;
    text-align: center;
    background: none;
    border-right: 1px solid #e7ebf5;
    border-bottom: 1px solid #e7ebf5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .15s, color .15s;
}
.dh-textlink:hover { background: #fdeef2; color: #e0577e; }
 
.dh-textlink-ads { font-weight: 800; }
.dh-textlink-ads.dh-ads-red { color: #e01b24; }
.dh-textlink-ads.dh-ads-blue { color: #1652f0; }

 
 
.dh-textgrid-icons { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.dh-textgrid-icons .dh-applink {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    text-align: center;
    border: 0;
    transition: background .15s;
}
.dh-textgrid-icons .dh-applink:hover { background: #f7f9ff; }
.dh-textgrid-icons .dh-applink-icon,
.dh-textgrid-icons .dh-applink .dh-card-icon {
    width: 44px; height: 44px; flex: none; border-radius: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 1px;
}
.dh-textgrid-icons .dh-applink-icon img,
.dh-textgrid-icons .dh-applink .dh-card-icon img { width: 100%; height: 100%; object-fit: contain; }
.dh-textgrid-icons .dh-applink-name {
    max-width: 100%;
    font-size: 13px;
    font-weight: 400;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

 
.dh-home-tools,
.dh-home-nav {
    position: fixed; bottom: 28px; z-index: 40;
}
 
.dh-home-tools {
    left: max(4px, calc(50% - 712px)); width: 68px;
    display: flex; flex-direction: column; gap: 3px;
}


.dh-float-btn {
    display: block; width: 100%; padding: 6px 3px;
    text-align: center; font-size: 11px; font-weight: 700; color: #fff;
    background: var(--dh-primary);
    border: 1px solid rgba(255, 255, 255, .55); border-radius: 0;
     
    font-family: inherit; line-height: inherit; cursor: pointer;
     
    letter-spacing: .3px; text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
    transition: background .15s, color .15s;
}
.dh-float-btn:hover { background: var(--dh-primary-2); color: #fff; }

.dh-home-nav {
    right: max(4px, calc(50% - 712px));
    width: 68px; padding: 0;
    background: none;
}
.dh-catnav-item {
    display: block; padding: 6px 3px; border-radius: 0;
    font-size: 11px; font-weight: 700; color: #fff; text-align: center;
    background: var(--dh-primary);
    border: 1px solid rgba(255, 255, 255, .55);
    letter-spacing: .3px; text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
    margin-top: -1px;  
    transition: background .15s, color .15s;
}
.dh-catnav-item:first-child { margin-top: 0; }
.dh-catnav-item:hover { background: var(--dh-primary-2); color: #fff; }


.dh-catnav-toggle { display: none; }
.dh-catnav-list { display: block; }


.dh-catnav-close { display: none; }
.dh-home-nav.is-open .dh-catnav-open { display: none; }
.dh-home-nav.is-open .dh-catnav-close { display: inline; }


.dh-lang-fixed {
    position: fixed;
    left: max(calc(4px + env(safe-area-inset-left, 0px)), calc(50% - 712px));
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    width: 68px;
    z-index: 35;
}

.dh-home-tools {
    bottom: calc(28px + 25px + 3px + env(safe-area-inset-bottom, 0px));
}

 

 
.dh-catblock { margin-bottom: 8px; scroll-margin-top: 20px; }
.dh-catblock-head {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 14px; border-radius: 0;
    color: #fff;  
}
.dh-catblock-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
 
.dh-catblock-desc { font-size: inherit; font-weight: inherit; color: inherit; }
.dh-catblock-body { padding: 0; }

 
.dh-rank-list { background: #fff; border: 1px solid var(--dh-border); border-radius: var(--dh-radius); box-shadow: var(--dh-shadow); overflow: hidden; }
.dh-rank-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f2f4f9; }
.dh-rank-item:last-child { border-bottom: 0; }
.dh-rank-item:hover { background: #fafbff; }
.dh-rank-no {
    width: 22px; height: 22px; flex: none; border-radius: 0; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; background: #f0f2f8; color: #8a93a6;
}
.dh-rank-item:nth-child(1) .dh-rank-no { background: #ffe9e3; color: #e2562b; }
.dh-rank-item:nth-child(2) .dh-rank-no { background: #fff2dc; color: #cf8b12; }
.dh-rank-item:nth-child(3) .dh-rank-no { background: #e9eaec; color: var(--dh-primary); }
.dh-rank-name { font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-rank-views { margin-left: auto; font-size: 12px; color: #9aa3b2; white-space: nowrap; }

 
.dh-site-head {
    display: flex; align-items: center; gap: 18px;
    background: #fff; border: 1px solid var(--dh-border); border-radius: 0;
    padding: 24px; box-shadow: var(--dh-shadow); margin-bottom: 20px;
}
.dh-site-head .dh-card-icon { width: 68px; height: 68px; border-radius: 0; font-size: 26px; }
.dh-site-head h1 { margin: 0 0 5px; font-size: 22px; font-weight: 700; }
.dh-site-head .dh-site-url { color: var(--dh-muted); font-size: 13px; word-break: break-all; }
.dh-site-head .dh-site-actions { margin-left: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.dh-site-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.dh-panel { background: #fff; border: 1px solid var(--dh-border); border-radius: var(--dh-radius); padding: 22px; box-shadow: var(--dh-shadow); margin-bottom: 20px; }
.dh-panel h2 { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.dh-panel p { margin: 0 0 12px; }
.dh-panel p:last-child { margin-bottom: 0; }

 
.dh-crumb { font-size: 13px; color: rgba(255, 255, 255, .92); margin-bottom: 14px; }
.dh-crumb a { color: rgba(255, 255, 255, .92); }
.dh-crumb a:hover { color: #fff; }
.dh-crumb span { margin: 0 6px; opacity: .6; }

 
.dh-empty { text-align: center; padding: 60px 20px; color: var(--dh-muted); }
.dh-empty strong { display: block; font-size: 17px; color: var(--dh-text); margin-bottom: 6px; }
.dh-empty .dh-btn { margin-top: 16px; }

 
.dh-pager { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.dh-pager .page-numbers {
    min-width: 36px; height: 36px; padding: 0 11px; border-radius: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--dh-border); font-size: 14px; color: #47506b;
}
.dh-pager .page-numbers.current { background: linear-gradient(135deg, var(--dh-primary), var(--dh-primary-2)); border-color: transparent; color: #fff; }
.dh-pager .page-numbers:hover { color: var(--dh-primary); border-color: var(--dh-primary); }
.dh-pager .page-numbers.current:hover { color: #fff; }

 
.dh-footer { background: none; border-top: 0; padding: 0; margin-top: 0; }
.dh-footer-inner { background: #fffce7; padding: 26px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: #6b5a1f; font-size: 13px; }
.dh-footer-copy { color: #453711; font-weight: 700; }
.dh-footer-nav { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.dh-footer-nav a { color: #6b5a1f; }
.dh-footer-nav a:hover { color: var(--dh-primary); }

 
.dh-noticebar { background: #fffce7; padding: 10px 12px; margin: 0 0 4px; }

 
.dh-noticebar-inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; }

.dh-noticebar-row { margin: 0; font-size: 13.5px; line-height: 1.9; color: #6b5a1f; }
.dh-noticebar-row strong { color: #453711; }
.dh-noticebar-row a { color: var(--dh-primary); font-weight: 700; text-decoration: underline; }
.dh-noticebar-row a:hover { color: var(--dh-primary-2); }
.dh-noticebar-row a + a { margin-left: 14px; }

 
.dh-noticebar-row .dh-copy-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: var(--dh-primary);
    font-weight: 700;
    text-decoration: underline;
}
.dh-noticebar-row .dh-copy-link:hover,
.dh-noticebar-row .dh-copy-link.dh-copied { color: var(--dh-primary-2); }
.dh-noticebar-latest .dh-copy-link + .dh-copy-link { margin-left: 8px; }

@media (max-width: 720px) {
    .dh-noticebar-inner { display: block; }
    .dh-noticebar-row + .dh-noticebar-row { margin-top: 4px; }
    .dh-noticebar-row { font-size: 12.5px; line-height: 1.8; }
    .dh-noticebar-row a + a { margin-left: 10px; }
}

 
.dh-adbar {
    display: grid; grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px; padding: 6px; margin: 0 0 4px;
    border: 1px solid var(--dh-border); background: #fffce7;
}
.dh-adbar-item {
    padding: 6px 4px; text-align: center;
    font-size: 13px; font-weight: 700; color: var(--dh-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color .15s, background .15s;
}
.dh-adbar-item.dh-ads-red { color: #e01b24; }
.dh-adbar-item.dh-ads-blue { color: #1652f0; }
.dh-adbar-item:hover { background: rgba(218, 99, 75, .1); }

@media (max-width: 720px) {
     
    .dh-adbar { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 4px; }
    .dh-adbar-item { padding: 5px 2px; font-size: 12px; }
}

 
.dh-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.dh-sidebar .dh-rank-list { position: sticky; top: 84px; }

 
 
@media (max-width: 1519px) {
    .dh-home-tools { display: none; }

    .dh-home-nav {
        display: flex; flex-direction: column;
        right: 4px; width: 36px;
        max-height: calc(100vh - 56px);
    }

     
    .dh-catnav-toggle {
        display: block; order: 2; width: 100%; flex: none;
        min-height: 64px;
        padding: 0; border: 0; border-radius: 0;
        background: #fffce7; color: var(--dh-primary);
        font-family: inherit; font-size: 15px; font-weight: 700;
        line-height: 1; letter-spacing: 3px; cursor: pointer;
        writing-mode: vertical-rl; text-align: center;
        box-shadow: -2px 2px 8px rgba(0, 0, 0, .18);
    }

     
    .dh-catnav-list { display: none; }

     
    .dh-home-nav.is-open { width: min(96px, 34vw); }
    .dh-home-nav.is-open .dh-catnav-toggle {
        writing-mode: horizontal-tb; letter-spacing: .5px;
        min-height: 32px;    
        box-shadow: none; border-bottom: 1px solid rgba(0, 0, 0, .1);
    }
    .dh-home-nav.is-open .dh-catnav-list {
        display: block;
        max-height: min(58vh, 440px);
        overflow-y: auto; -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        box-shadow: -2px 2px 10px rgba(0, 0, 0, .2);
    }
}
@media (max-width: 1024px) {
    .dh-layout { grid-template-columns: minmax(0, 1fr); }
    .dh-sidebar .dh-rank-list { position: static; }
    .dh-textgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .dh-container { padding: 0 8px; }
     
    .dh-footer-inner { padding: 24px 8px; }
     
    .dh-lang-fixed { display: none; }
     
    .dh-catbox { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px; gap: 4px; margin-top: 10px; border: 0; background: transparent; }
    .dh-catbox-item,
    .dh-catbox-pub { padding: 6px 4px; font-size: 13px; line-height: 1.2; background: #dd6d54; color: #fff; }
     
    .dh-catbox-item:hover, .dh-catbox-item:active,
    .dh-catbox-pub:hover, .dh-catbox-pub:active { background: rgba(255, 255, 255, .45); color: #fff; }
     
    .dh-catbox.dh-catbox-page { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    .dh-catbox-page .dh-catbox-item { padding: 6px 2px; font-size: 12px; }
    .dh-catblock { margin-bottom: 8px; }
    .dh-catblock-head { padding: 6px 11px; }
    .dh-catblock-head h2 { font-size: 15px; }
    .dh-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
    .dh-card { padding: 12px; gap: 10px; }
    .dh-card-icon { width: 36px; height: 36px; font-size: 15px; border-radius: 0; }
    .dh-card-desc { -webkit-line-clamp: 1; }
    .dh-site-head { flex-wrap: wrap; padding: 18px; }
    .dh-site-head .dh-site-actions { margin-left: 0; width: 100%; align-items: stretch; }
    .dh-site-head .dh-site-actions .dh-btn { width: 100%; }
    .dh-panel { padding: 17px; }
     
    .dh-textgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dh-textlink { height: 32px; line-height: 31px; font-size: 11.5px; }
     
    .dh-textgrid-icons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dh-textgrid-icons .dh-applink { padding: 10px 2px; }
    .dh-textgrid-icons .dh-applink-icon,
    .dh-textgrid-icons .dh-applink .dh-card-icon { width: 38px; height: 38px; font-size: 15px; }
    .dh-textgrid-icons .dh-applink-name { font-size: 11.5px; }
}

 
.dh-admin-views { display: inline-block; background: #f1f2f4; color: var(--dh-primary); border-radius: 5px; padding: 0 6px; font-size: 12px; }
