/* =====================================================
   dh.cn 导航系统 - 响应式样式
   ===================================================== */

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f6fa;
    line-height: 1.6;
}
a { color: #333; text-decoration: none; transition: color .2s; }
a:hover { color: #1890ff; }
ul, ol { list-style: none; }
img { max-width: 100%; border: none; }
:focus { outline: none; }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==================== Header ==================== */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo a {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    color: #1890ff;
}
.logo i { margin-right: 8px; font-size: 26px; }
/* 后台「站点设置」上传的 LOGO 图片 */
.logo img { display: block; width: auto; height: auto; max-height: 44px; max-width: 200px; object-fit: contain; }

.nav { display: flex; gap: 5px; }
.nav a {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 15px;
    color: #555;
    transition: all .3s;
}
.nav a:hover, .nav a.active {
    background: #1890ff;
    color: #fff;
}

.user-nav { display: flex; align-items: center; gap: 10px; }
.user-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f0f7ff;
    color: #1890ff;
}
.user-dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 150px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    padding: 8px 0;
    display: none;
    z-index: 100;
}
.user-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #555;
    font-size: 14px;
}
.dropdown-menu a:hover { background: #f5f7fa; color: #1890ff; }

.login-btn, .register-btn {
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 14px;
}
.login-btn { color: #1890ff; }
.register-btn { background: #1890ff; color: #fff; }

.mobile-menu-toggle { display: none; font-size: 22px; cursor: pointer; }

/* ==================== Main Content ==================== */
.main-content {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-bottom: 40px;
}
.content-left { flex: 1; min-width: 0; }
.sidebar { width: 320px; flex-shrink: 0; }

/* ==================== Section Box ==================== */
.section-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.section-header {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f2f5;
}
.section-header i {
    color: #1890ff;
    margin-right: 8px;
    font-size: 20px;
}
.section-header .more {
    margin-left: auto;
    font-size: 13px;
    font-weight: 400;
    color: #999;
}
.section-header .more:hover { color: #1890ff; }

/* ==================== Top Sites (付费置顶) ==================== */
.top-sites-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.top-site-item {
    border: 1px solid #ffe58f;
    border-radius: 10px;
    overflow: hidden;
    transition: all .3s;
    background: linear-gradient(135deg, #fffbe6, #fff);
}
.top-site-item:hover {
    border-color: #faad14;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(250,173,20,.2);
}
.top-site-link {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 10px;
}
.top-site-ico { width: 32px; height: 32px; border-radius: 6px; }
.top-site-name { font-weight: 600; font-size: 15px; }
.top-site-desc { font-size: 12px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==================== Site Grid ==================== */
.site-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.site-card {
    border: 1px solid #eef0f3;
    border-radius: 10px;
    overflow: hidden;
    transition: all .3s;
    background: #fff;
}
.site-card:hover {
    border-color: #1890ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(24,144,255,.15);
}
.site-card a {
    display: block;
    padding: 14px;
    text-align: center;
}
.site-ico { width: 36px; height: 36px; border-radius: 8px; margin-bottom: 8px; }
.site-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.site-desc { font-size: 12px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.site-card.recommend {
    border-color: #b7eb8f;
    background: linear-gradient(135deg, #f6ffed, #fff);
}

/* ==================== Site List ==================== */
.site-list-item {
    border-bottom: 1px solid #f0f2f5;
    transition: background .2s;
}
.site-list-item:last-child { border-bottom: none; }
.site-list-item:hover { background: #fafbfc; }
.site-list-item a {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    gap: 12px;
}
.list-ico { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; }
.list-info { flex: 1; min-width: 0; }
.list-name { font-weight: 500; font-size: 14px; }
.list-desc { font-size: 12px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-clicks { font-size: 12px; color: #bbb; white-space: nowrap; }

/* ==================== Sidebar ==================== */
.side-box {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.side-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f2f5;
}
.side-title i { color: #1890ff; margin-right: 6px; }

.search-box { padding: 12px; }
.search-input { display: flex; }
.search-input input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    border-right: none;
}
.search-input button {
    padding: 10px 18px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 16px;
}
.search-input input:focus { border-color: #1890ff; }

/* Rank List */
.rank-list li {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    gap: 8px;
}
.rank-num {
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 4px;
    background: #f0f2f5;
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
}
.rank-num.top { background: #ff4d4f; color: #fff; font-weight: 600; }
.rank-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-clicks { font-size: 12px; color: #bbb; }

.article-list li { padding: 6px 0; }
.article-list a {
    font-size: 13px;
    color: #666;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.article-list a:hover { color: #1890ff; }

/* ==================== Ad Banners ==================== */
.ad-banner-top, .ad-banner-mid, .ad-banner-bottom {
    margin: 16px auto;
    text-align: center;
    max-width: 1200px;
    padding: 0 15px;
}
.ad-banner-top a, .ad-banner-mid a, .ad-banner-bottom a {
    display: block;
    border-radius: 8px;
    overflow: hidden;
}
.ad-banner-top img, .ad-banner-mid img, .ad-banner-bottom img {
    width: 100%;
    max-width: 960px;
    height: auto;
    border-radius: 8px;
}

/* Text Ads */
.text-ads {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 16px 0;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
}
.text-ad-item {
    padding: 6px 10px;
    font-size: 13px;
    color: #666;
    text-align: center;
    border-radius: 4px;
    background: #f8f9fa;
    transition: all .2s;
}
.text-ad-item:hover { background: #e6f7ff; color: #1890ff; }

/* 广告位标识角标（仅管理员登录可见），点击直达后台编辑该广告位 */
.ad-banner-top, .ad-banner-mid, .ad-banner-bottom, .text-ads { position: relative; }
.ad-slot-tag {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 9;
    font-size: 11px;
    line-height: 1.6;
    color: #b0b6bf;
    background: rgba(255, 255, 255, .85);
    border: 1px dashed #d9d9d9;
    border-radius: 4px;
    padding: 0 6px;
    text-decoration: none;
    transition: all .2s;
}
.ad-slot-tag:hover { color: #1890ff; border-color: #1890ff; }
.ad-slot-tag i { margin-right: 2px; }
.ad-slot-tag-inline { position: static; display: inline-block; margin-bottom: 8px; }

.sidebar-ad { padding: 8px; text-align: center; }
.sidebar-ad img { border-radius: 6px; }

/* ==================== Footer ==================== */
.footer {
    background: #1a1d29;
    color: #a0a5b1;
    padding: 40px 0 20px;
}
.friend-links { margin-bottom: 24px; }
.friend-links .section-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}
.friend-links .section-title i { color: #1890ff; margin-right: 6px; }
.links-list { display: flex; flex-wrap: wrap; gap: 10px; }
.links-list a {
    padding: 4px 12px;
    background: rgba(255,255,255,.06);
    border-radius: 4px;
    color: #a0a5b1;
    font-size: 13px;
}
.links-list a:hover { background: #1890ff; color: #fff; }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 16px;
}
.footer-nav a { color: #8b909c; font-size: 13px; }
.footer-nav a:hover { color: #1890ff; }

.footer-info { text-align: center; font-size: 13px; }
.footer-info p { margin: 4px 0; }
.footer-info a { color: #8b909c; }
.footer-info a:hover { color: #1890ff; }

/* Back to top */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 44px;
    height: 44px;
    line-height: 44px;
    text-align: center;
    background: #1890ff;
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(24,144,255,.4);
    display: none;
    z-index: 999;
}
.back-to-top:hover { background: #40a9ff; }

/* ==================== Forms ==================== */
.form-container {
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.form-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    color: #222;
}
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}
.form-group label .required { color: #ff4d4f; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color .3s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,.1);
}
.form-group textarea { min-height: 100px; resize: vertical; }
.btn-submit {
    width: 100%;
    padding: 12px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s;
}
.btn-submit:hover { background: #40a9ff; }
.form-tip {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}
.form-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}
.form-footer a { color: #1890ff; }

/* ==================== User Center ==================== */
.user-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-bottom: 40px;
}
.user-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.user-sidebar a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: #555;
    margin-bottom: 4px;
}
.user-sidebar a:hover, .user-sidebar a.active {
    background: #1890ff;
    color: #fff;
}
.user-sidebar a i { margin-right: 8px; width: 16px; text-align: center; }
.user-content { flex: 1; min-width: 0; }

.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.stat-card .num { font-size: 28px; font-weight: 700; color: #1890ff; }
.stat-card .label { font-size: 13px; color: #999; margin-top: 4px; }

/* ==================== Tables ==================== */
.data-table {
    width: 100%;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.data-table table { width: 100%; border-collapse: collapse; }
.data-table th {
    background: #fafbfc;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eef0f3;
}
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f2f5;
}
.data-table tr:hover td { background: #fafbfc; }
.status-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.status-badge.pending { background: #fff7e6; color: #fa8c16; }
.status-badge.passed { background: #f6ffed; color: #52c41a; }
.status-badge.rejected { background: #fff1f0; color: #ff4d4f; }

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 24px 0;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    background: #fff;
    color: #666;
    border: 1px solid #e8e8e8;
}
.pagination a:hover, .pagination .current {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .site-grid { grid-template-columns: repeat(3, 1fr); }
    .sidebar { width: 280px; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 10px; box-shadow: 0 4px 10px rgba(0,0,0,.1); }
    .nav.show { display: flex; }
    .nav a { padding: 12px; text-align: center; }
    .mobile-menu-toggle { display: block; }
    .main-content { flex-direction: column; }
    .sidebar { width: 100%; }
    .site-grid { grid-template-columns: repeat(2, 1fr); }
    .top-sites-grid { grid-template-columns: 1fr; }
    .text-ads { grid-template-columns: repeat(2, 1fr); }
    .user-layout { flex-direction: column; }
    .user-sidebar { width: 100%; display: flex; flex-wrap: wrap; }
    .user-sidebar a { flex: 1; min-width: 100px; text-align: center; margin: 2px; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .form-container { margin: 20px; padding: 20px; }
    .header .container { height: 56px; }
    .logo a { font-size: 18px; }
    .logo img { max-height: 34px; max-width: 140px; }
    .dropdown-menu { width: 130px; }
}

@media (max-width: 480px) {
    .site-grid { grid-template-columns: 1fr; }
    .text-ads { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: 1fr; }
    .section-box { padding: 14px; }
    .form-container { margin: 10px; padding: 16px; }
    .login-btn, .register-btn { padding: 5px 10px; font-size: 13px; }
    .user-btn span { display: none; }
}

/* ==================== Admin Layout ==================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 220px;
    background: #001529;
    color: #a6adb4;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    transition: width .3s;
    z-index: 100;
}
.admin-sidebar .logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #002140;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}
.admin-sidebar .logo i { margin-right: 8px; color: #1890ff; }
.admin-nav { padding: 10px 0; }
.admin-nav .nav-group-title {
    padding: 10px 20px 4px;
    font-size: 12px;
    color: #5c6b77;
    text-transform: uppercase;
}
.admin-nav a {
    display: block;
    padding: 10px 20px;
    color: #a6adb4;
    font-size: 14px;
    transition: all .2s;
    border-left: 3px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active {
    background: #1890ff;
    color: #fff;
    border-left-color: #fff;
}
.admin-nav a i { margin-right: 8px; width: 16px; text-align: center; }

.admin-main {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.admin-header {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 99;
}
.admin-header .toggle-btn {
    font-size: 20px;
    cursor: pointer;
    color: #666;
}
.admin-header .admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-header .admin-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1890ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.admin-content { padding: 20px; background: #f0f2f5; flex: 1; }

.admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    margin-bottom: 20px;
}
.admin-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f2f5;
}

/* Admin stats */
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.admin-stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    position: relative;
    overflow: hidden;
}
.admin-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
}
.admin-stat-card.blue::before { background: #1890ff; }
.admin-stat-card.green::before { background: #52c41a; }
.admin-stat-card.orange::before { background: #fa8c16; }
.admin-stat-card.red::before { background: #ff4d4f; }
.admin-stat-card .num { font-size: 26px; font-weight: 700; color: #222; }
.admin-stat-card .label { font-size: 13px; color: #999; margin-top: 4px; }
.admin-stat-card .icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    opacity: .15;
}

/* ==================== 视觉优化（前台） ==================== */

/* 站点图标：无 ICO / 加载失败时的首字母头像 */
.site-ico-letter,
.top-site-ico.site-ico-letter,
.list-ico.site-ico-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0;
    border-radius: 10px;
    flex-shrink: 0;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.site-ico-letter { width: 36px; height: 36px; font-size: 17px; margin-bottom: 8px; }
.top-site-ico.site-ico-letter { width: 40px; height: 40px; font-size: 18px; }
.list-ico.site-ico-letter { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }

/* 站点真实图标更精致 */
.site-ico,
.top-site-ico,
.list-ico {
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}
.list-ico { border-radius: 8px; }

/* 广告位招租占位（替代纯色演示图） */
.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 90px;
    border-radius: 10px;
    font-size: 15px;
    letter-spacing: .5px;
    color: #7a8aa0 !important;
    background:
        repeating-linear-gradient(135deg, rgba(24,144,255,.045) 0 12px, transparent 12px 24px),
        linear-gradient(135deg, #f7fafd, #eef4fb);
    border: 1px dashed #c8d8ea;
    transition: all .25s;
}
.ad-placeholder i { font-size: 18px; color: #9db4cc; }
.ad-placeholder:hover {
    border-color: #1890ff;
    color: #1890ff !important;
    box-shadow: 0 6px 18px rgba(24,144,255,.12);
    transform: translateY(-1px);
}
.ad-placeholder:hover i { color: #1890ff; }
.ad-placeholder-side {
    flex-direction: column;
    gap: 4px;
    height: 250px;
    font-size: 14px;
}
.ad-placeholder-side i { font-size: 34px; }
.ad-placeholder-side span { font-size: 15px; }
.ad-placeholder-side small { font-size: 12px; color: #a9bacd; }

/* 区块与卡片质感 */
.section-box {
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(16, 42, 67, .05);
    border: 1px solid #f0f3f7;
}
.section-header {
    border-bottom: 1px solid #f4f6f9;
    padding-bottom: 12px;
}
.section-header > i:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e6f4ff, #d3e9ff);
    color: #1890ff;
    font-size: 14px;
    margin-right: 8px;
}
.section-header > span { font-size: 16px; font-weight: 600; }
.section-header .more { font-size: 13px; color: #9aa7b5; }

.site-card {
    border-radius: 12px;
    border-color: #eef2f7;
}
.site-card:hover {
    border-color: #bae0ff;
    box-shadow: 0 8px 22px rgba(24, 144, 255, .13);
}
.site-name { color: #26334d; }
.site-card.recommend {
    border-color: #d9f0c4;
    background: linear-gradient(135deg, #fbfff7, #fff);
}

.top-sites-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.top-site-item {
    border-radius: 10px;
    background: linear-gradient(135deg, #fffdf5, #fff);
    border: 1px solid #fdf0d0;
}
.top-site-item:hover { border-color: #ffe08a; box-shadow: 0 6px 16px rgba(250, 173, 20, .14); }

/* 热门排行色带 */
.rank-num {
    border-radius: 8px;
    background: #f2f5f9;
    color: #8d9bab;
}
.rank-list li:nth-child(1) .rank-num { background: linear-gradient(135deg, #ff7875, #ff4d4f); color: #fff; }
.rank-list li:nth-child(2) .rank-num { background: linear-gradient(135deg, #ffb961, #fa8c16); color: #fff; }
.rank-list li:nth-child(3) .rank-num { background: linear-gradient(135deg, #73d13d, #52c41a); color: #fff; }

/* 文字广告 */
.text-ads {
    border-radius: 12px;
    border: 1px solid #f0f3f7;
    box-shadow: 0 2px 10px rgba(16, 42, 67, .05);
}
.text-ad-item {
    background: #f7f9fc;
    border-radius: 6px;
    color: #5b6b7f;
}
.text-ad-item:hover {
    background: linear-gradient(135deg, #e6f4ff, #f0f7ff);
    color: #1890ff;
    transform: translateY(-1px);
}

/* 侧边栏 */
.side-box {
    border-radius: 14px;
    border: 1px solid #f0f3f7;
    box-shadow: 0 2px 10px rgba(16, 42, 67, .05);
}
.side-title { font-size: 15px; font-weight: 600; color: #26334d; }

/* 顶部导航 */
.header { box-shadow: 0 2px 12px rgba(16, 42, 67, .07); }
.nav a { transition: all .2s; }
.nav a:hover, .nav a.active {
    background: linear-gradient(135deg, #40a9ff, #1890ff);
    box-shadow: 0 4px 12px rgba(24, 144, 255, .28);
}

/* ==================== 两栏页面通用布局（可响应） ==================== */
.page-container { padding: 20px 15px 40px; }
.page-layout { display: flex; gap: 20px; align-items: flex-start; }
.page-main { flex: 1; min-width: 0; }
.page-side { width: 320px; flex-shrink: 0; }
.panel {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.panel + .panel { margin-top: 20px; }

/* ==================== 文章正文排版 ==================== */
.article-detail { padding: 30px; }
.article-title { font-size: 26px; line-height: 1.4; margin-bottom: 16px; color: #222; }
.article-meta {
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 20px;
    font-size: 13px;
    color: #999;
}
.article-meta span + span { margin-left: 16px; }
.article-body {
    line-height: 1.9;
    font-size: 16px;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.article-body img { max-width: 100%; height: auto; }
.article-body p { margin-bottom: 16px; }
.article-body h2 { font-size: 20px; margin: 22px 0 12px; line-height: 1.4; }
.article-body h3 { font-size: 17px; margin: 20px 0 10px; line-height: 1.4; }
.article-body ul, .article-body ol { padding-left: 22px; margin-bottom: 16px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
    margin: 16px 0;
    padding: 10px 16px;
    border-left: 3px solid #bae0ff;
    background: #f7fbff;
    color: #5b6b7f;
    border-radius: 0 6px 6px 0;
}
.article-body pre {
    overflow-x: auto;
    padding: 14px;
    background: #f6f8fa;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.7;
}
.article-body code { background: #f6f8fa; padding: 1px 5px; border-radius: 4px; font-size: 14px; }
.article-body pre code { background: none; padding: 0; }
.article-body table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.article-body table th, .article-body table td { border: 1px solid #eef0f3; padding: 8px 10px; font-size: 14px; }
.article-body a { color: #1890ff; }

/* 文章列表项 */
.article-list-head { font-size: 22px; margin-bottom: 20px; }
.article-list-item { padding: 16px 0; border-bottom: 1px solid #f5f5f5; }
.article-list-item:last-child { border-bottom: none; }
.article-list-title { font-size: 18px; margin-bottom: 8px; line-height: 1.5; }
.article-list-desc { color: #666; font-size: 14px; line-height: 1.8; margin-bottom: 8px; }
.article-list-meta { font-size: 12px; color: #bbb; }
.article-list-meta span + span { margin-left: 12px; }

/* 侧栏列表 */
.side-list li { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.side-list li:last-child { border-bottom: none; }

/* ==================== 手机端排版优化 ==================== */
@media (max-width: 768px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .page-container { padding: 12px 12px 28px; }
    .page-layout { flex-direction: column; gap: 14px; }
    .page-main, .page-side { width: 100%; flex: none; }
    .panel { padding: 16px 14px; border-radius: 10px; }
    .panel + .panel { margin-top: 14px; }
    .side-title { font-size: 14px; }
    .page-side .side-box img { max-width: 100%; height: auto; }

    /* 文章详情 */
    .article-detail { padding: 18px 14px; }
    .article-title { font-size: 19px; margin-bottom: 10px; }
    .article-meta { font-size: 12px; padding: 10px 0; margin-bottom: 14px; }
    .article-meta span + span { margin-left: 10px; }
    .article-body { font-size: 16px; line-height: 1.85; }
    .article-body h2 { font-size: 18px; }
    .article-body h3 { font-size: 16px; }
    .article-body pre { font-size: 12px; padding: 12px; }
    .article-body table { display: block; overflow-x: auto; }

    /* 文章列表 */
    .article-list-head { font-size: 19px; margin-bottom: 14px; }
    .article-list-item { padding: 13px 0; }
    .article-list-title { font-size: 16px; }
    .article-list-desc { font-size: 13px; line-height: 1.7; }

    /* 宽表格横向滚动，避免撑破页面 */
    .admin-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .admin-card .data-table { min-width: 640px; }
    .admin-card table { min-width: 560px; }

    /* 覆盖前面在媒体查询之后才声明的网格规则 */
    .top-sites-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .page-container { padding: 10px 10px 24px; }
    .panel { padding: 14px 12px; }
    .article-title { font-size: 18px; }
    .article-body { font-size: 15.5px; }
    .article-list-head { font-size: 18px; }
    .article-list-title { font-size: 15px; }
}

/* ==================== 基础组件：按钮 ==================== */
.btn {
    display: inline-block;
    padding: 9px 18px;
    font-size: 14px;
    line-height: 1.4;
    color: #666;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    white-space: nowrap;
    cursor: pointer;
    transition: all .25s;
    -webkit-appearance: none;
    appearance: none;
}
.btn:hover { border-color: #1890ff; color: #1890ff; }
.btn i { margin-right: 4px; }

.btn-primary { background: #1890ff; border-color: #1890ff; color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: #40a9ff; border-color: #40a9ff; color: #fff; }

.btn-default { background: #fff; border-color: #d9d9d9; color: #666; }
.btn-default:hover { background: #f5f9ff; border-color: #1890ff; color: #1890ff; }

.btn-success { background: #52c41a; border-color: #52c41a; color: #fff; }
.btn-success:hover { background: #73d13d; border-color: #73d13d; color: #fff; }

.btn-warning { background: #faad14; border-color: #faad14; color: #fff; }
.btn-warning:hover { background: #ffc53d; border-color: #ffc53d; color: #fff; }

.btn-danger { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #ff7875; border-color: #ff7875; color: #fff; }

.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { display: block; width: 100%; }

/* 取消/次要操作按钮（置顶列表等） */
.btn-cancel {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    color: #ff4d4f;
    background: #fff1f0;
    border: 1px solid #ffccc7;
    border-radius: 6px;
    text-decoration: none;
    transition: all .25s;
}
.btn-cancel:hover { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }

/* ==================== 基础组件：表单行 ==================== */
.form-row { margin-bottom: 16px; }
.form-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    outline: none;
    transition: border-color .25s, box-shadow .25s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, .1);
}
.form-row textarea { min-height: 100px; resize: vertical; }
.form-row .form-tip { font-size: 12px; color: #999; margin-top: 4px; }

@media (max-width: 768px) {
    .btn { padding: 8px 14px; font-size: 13px; }
    .btn-lg { padding: 11px 22px; font-size: 15px; }
    .form-row { margin-bottom: 14px; }
    .form-row input, .form-row select, .form-row textarea { padding: 9px 12px; }
}
