/* ===== 全部样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a {
    text-decoration: none;
    color: inherit;
}
ul {
    list-style: none;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}
.main-sidebar {
    width: 230px;
    background: #fff;
    border-right: 1px solid #e8ecf1;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
}
.main-sidebar.active {
    transform: translateX(0);
}
.sidebar-logo {
    text-align: center;
    padding: 0 20px 24px;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 8px;
}
.sidebar-logo img {
    max-height: 38px;
    width: auto;
}
.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 8px 24px;
    color: #555;
    font-size: 14px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    margin: 2px 0;
}
.sidebar-menu li a:hover,
.sidebar-menu li a.on {
    background: #f0f5ff;
    color: #4a6cf7;
    border-left-color: #4a6cf7;
}
.sidebar-menu li a .dh-item-icon {
    margin-right: 14px;
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: #888;
}
.sidebar-menu.sidebar-bottom {
    margin-top: 24px;
    border-top: 1px solid #f0f2f5;
    padding-top: 12px;
}
.main-content {
    margin-left: 0;
    flex: 1;
    padding: 0 16px 40px;
    min-height: 100vh;
    background: #f5f7fa;
}
.dh-header {
    padding: 12px 0 0;
}
.dh-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dh-navbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-left-btn {
    font-size: 26px;
    cursor: pointer;
    padding: 4px 8px;
    display: none;
    color: #333;
}
#dh-nav {
    display: flex;
    gap: 20px;
}
#dh-nav .navbar-item a {
    font-size: 15px;
    padding: 6px 0;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}
#dh-nav .navbar-item a.on,
#dh-nav .navbar-item a:hover {
    color: #4a6cf7;
    border-bottom-color: #4a6cf7;
}
.dh-search {
    max-width: 600px;
    margin: 20px auto 28px;
    padding: 0 4px;
}
.dh-search-engines {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
    justify-content: center;
}
.dh-search-engines .engine-label {
    color: #999;
    margin-right: 4px;
    font-weight: 500;
}
.dh-search-engines .engine-item {
    cursor: pointer;
    padding: 2px 12px;
    border-radius: 20px;
    transition: 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
    user-select: none;
}
.dh-search-engines .engine-item:hover {
    background: #eef0f3;
}
.dh-search-engines .engine-item.active {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
}
.search-form {
    display: flex;
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid #e4e7ed;
    transition: border-color 0.2s;
}
.search-form:focus-within {
    border-color: #4a6cf7;
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.12);
}
.search-input {
    flex: 1;
    border: none;
    padding: 13px 22px;
    font-size: 15px;
    outline: none;
    background: transparent;
    color: #333;
}
.search-input::placeholder {
    color: #b0b8c4;
}
.search-btn {
    border: none;
    background: #4a6cf7;
    color: #fff;
    padding: 0 22px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dh-content {
    max-width: 1200px;
    margin: 0 auto;
}
.content-item {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.content-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.content-item-head-left h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}
.content-item-head-left h4 i {
    margin-right: 8px;
    color: #4a6cf7;
}
.content-item-head a {
    color: #b0b8c4;
    font-size: 18px;
    transition: color 0.2s;
}
.content-item-head a:hover {
    color: #4a6cf7;
}
.content-item-urls {
    display: grid;
    gap: 10px;
}
@media (min-width: 1025px) {
    .content-item-urls {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .content-item-urls {
        grid-template-columns: repeat(3, 1fr);
    }
}
.content-urls-card {
    position: relative;
    border: 1px solid #f0f2f5;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fafbfc;
    display: flex;
    align-items: center;
    min-height: 60px;
    transition: 0.2s;
}
.content-urls-card:hover {
    border-color: #4a6cf7;
    box-shadow: 0 2px 10px rgba(74, 108, 247, 0.08);
    background: #fff;
}
.content-urls-card.is-recommend {
    border-color: #ffd93d;
    background: #fffcf0;
}
.card-badge-recommend {
    position: absolute;
    top: -7px;
    right: 8px;
    background: #ff6b6b;
    color: #fff;
    font-size: 10px;
    padding: 0 10px;
    border-radius: 12px;
    line-height: 18px;
    height: 18px;
    font-weight: 500;
}
.content-urls-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.content-url-flex {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.content-card-body {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}
.content-url-img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 12px;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.content-url-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.content-url-info {
    flex: 1;
    min-width: 0;
}
.content-url-info strong {
    font-size: 14px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1a1a2e;
    font-weight: 500;
}
.content-url-info p {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.content-url-togo {
    flex-shrink: 0;
    margin-left: 6px;
    color: #ccc;
    transition: 0.2s;
    display: flex;
    align-items: center;
}
.content-url-togo:hover {
    color: #4a6cf7;
}
.content-url-togo svg {
    stroke: currentColor;
    width: 18px;
    height: 18px;
}

/* ===== 分页条 ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f2f5;
    font-size: 14px;
    justify-content: center;
}
.pagination .pagination-total {
    color: #999;
    margin-right: 12px;
    font-size: 13px;
}
.pagination a {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    color: #4a6cf7;
    text-decoration: none;
    transition: 0.2s;
    border: 1px solid transparent;
}
.pagination a:hover {
    background: #f0f5ff;
    border-color: #d0d9f0;
}
.pagination .pagination-page {
    min-width: 32px;
    text-align: center;
}
.pagination .pagination-page.active {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
    cursor: default;
}
.pagination .pagination-prev,
.pagination .pagination-next {
    color: #666;
}
.pagination .pagination-prev:hover,
.pagination .pagination-next:hover {
    background: #f0f2f5;
    border-color: #e4e7ed;
}

/* ===== 移动端 ===== */
@media (max-width: 768px) {
    .navbar-left-btn {
        display: block;
    }
    #dh-nav {
        display: none;
    }
    .main-content {
        margin-left: 0;
        padding: 0 10px 30px;
    }
    .dh-search {
        margin: 12px auto 18px;
        padding: 0;
    }
    .dh-search-engines {
        gap: 4px 6px;
        font-size: 12px;
        justify-content: flex-start;
        padding: 0 2px;
    }
    .dh-search-engines .engine-item {
        padding: 2px 8px;
    }
    .search-input {
        padding: 10px 16px;
        font-size: 14px;
    }
    .search-btn {
        padding: 0 16px;
        font-size: 18px;
    }
    .content-item {
        padding: 12px 12px;
        margin-bottom: 14px;
        border-radius: 10px;
    }
    .content-item-head {
        margin-bottom: 10px;
    }
    .content-item-head h4 {
        font-size: 14px;
    }
    .content-item-urls {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .content-urls-card {
        padding: 6px 8px;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        border-radius: 8px;
    }
    .content-urls-body {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }
    .content-url-flex {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }
    .content-card-body {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }
    .content-url-img {
        width: 32px;
        height: 32px;
        margin-right: 8px;
        margin-bottom: 0;
        border-radius: 6px;
        flex-shrink: 0;
    }
    .content-url-info {
        text-align: left;
        width: auto;
        flex: 1;
        min-width: 0;
    }
    .content-url-info strong {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3;
    }
    .content-url-info p {
        display: none !important;
    }
    .content-url-togo {
        display: none !important;
    }
    .card-badge-recommend {
        font-size: 8px;
        line-height: 14px;
        height: 14px;
        top: -5px;
        right: 4px;
        padding: 0 6px;
    }
    .content-urls-card.is-recommend {
        background: #fffcf0;
    }
    .sidebar-logo {
        display: block !important;
        padding: 0 10px 16px !important;
    }
    .sidebar-logo img {
        display: block !important;
        max-width: 80%;
        height: auto;
        margin: 0 auto;
        max-height: 40px;
    }
    /* 分页移动端 */
    .pagination {
        gap: 4px;
        font-size: 13px;
        justify-content: center;
    }
    .pagination .pagination-total {
        width: 100%;
        text-align: center;
        margin-right: 0;
        margin-bottom: 4px;
        font-size: 12px;
    }
    .pagination a {
        padding: 2px 8px;
        font-size: 12px;
    }
    .pagination .pagination-page {
        min-width: 28px;
    }
}
@media (max-width: 420px) {
    .content-item {
        padding: 8px 8px;
        margin-bottom: 10px;
    }
    .content-urls-card {
        padding: 4px 6px;
    }
    .content-url-img {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }
    .content-url-info strong {
        font-size: 11px;
    }
    .dh-search-engines {
        gap: 3px 4px;
        font-size: 11px;
    }
    .dh-search-engines .engine-item {
        padding: 1px 6px;
    }
    .pagination a {
        padding: 2px 6px;
        font-size: 11px;
    }
    .pagination .pagination-page {
        min-width: 24px;
    }
}
@media (min-width: 769px) {
    .main-sidebar {
        transform: translateX(0);
        box-shadow: none;
        border-right: 1px solid #e8ecf1;
    }
    .main-content {
        margin-left: 230px;
        padding: 0 28px 40px;
    }
    .sidebar-overlay {
        display: none !important;
    }
    .navbar-left-btn {
        display: none;
    }
}