/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    font-size: 15px; color: #333; background: #f0f2f5; line-height: 1.7; min-height: 100vh;
}
a { color: #4a90d9; text-decoration: none; transition: color 0.2s; }
a:hover { color: #2b6cb0; }
img { max-width: 100%; height: auto; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
.container { max-width: 1600px; margin: 0 auto; padding: 0 20px; }

/* ========== Header ========== */
.header { background: #fff; box-shadow: 0 1px 8px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; max-width: 1600px; margin: 0 auto; padding: 0 20px; }
.logo { font-size: 24px; font-weight: 700; color: #1a1a2e; display: flex; align-items: center; gap: 8px; }
.logo span { background: linear-gradient(135deg, #4a90d9, #357abd); color: #fff; padding: 2px 10px; border-radius: 5px; font-size: 18px; }
.logo:hover { color: #1a1a2e; }
.logo-img { max-width: 200px; max-height: 48px; width: auto; height: auto; object-fit: contain; vertical-align: middle; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 18px; border-radius: 5px; color: #555; font-size: 15px; font-weight: 500; transition: all 0.2s; }
.nav a:hover, .nav a.active { background: #f0f5ff; color: #4a90d9; }

/* ========== Hero / Search ========== */
.hero { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 60px 20px; text-align: center; color: #fff; }
.hero h1 { font-size: 36px; font-weight: 700; margin-bottom: 10px; }
.hero p { font-size: 17px; opacity: 0.85; margin-bottom: 30px; }
.search-box { max-width: 700px; margin: 0 auto; display: flex; background: #fff; border-radius: 50px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.search-box input { flex: 1; border: none; padding: 16px 24px; font-size: 16px; outline: none; }
.search-box button { border: none; padding: 16px 36px; background: linear-gradient(135deg, #4a90d9, #357abd); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; transition: opacity 0.2s; }
.search-box button:hover { opacity: 0.9; }

/* ========== Stats Bar ========== */
.stats-bar { background: #fff; padding: 18px 0; border-bottom: 1px solid #eee; }
.stats-bar .container { display: flex; gap: 32px; flex-wrap: wrap; }
.stats-item { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #666; }
.stats-item strong { color: #4a90d9; font-size: 18px; }

/* ========== Sections ========== */
.section { padding: 40px 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-title h2 { font-size: 22px; font-weight: 700; color: #1a1a2e; display: flex; align-items: center; gap: 10px; }
.section-title h2::before { content: ''; display: inline-block; width: 4px; height: 24px; background: linear-gradient(135deg, #4a90d9, #357abd); border-radius: 2px; }
.section-title .more { font-size: 14px; color: #999; }
.section-title .more:hover { color: #4a90d9; }

/* ========== Category Grid ========== */
.cat-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 16px; }
.cat-card { background: #fff; border-radius: 5px; padding: 24px 16px; text-align: center; transition: all 0.3s; cursor: pointer; border: 1px solid transparent; }
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(74,144,217,0.12); border-color: #4a90d9; }
.cat-card .cat-icon { font-size: 32px; margin-bottom: 10px; }
.cat-card .cat-name { font-size: 15px; font-weight: 600; color: #333; }
.cat-card .cat-count { font-size: 12px; color: #999; margin-top: 6px; }
.cat-card .cat-subs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 8px; }
.cat-sub-tag { display: inline-block; padding: 1px 8px; background: #f0f5ff; color: #4a90d9; border-radius: 3px; font-size: 11px; }
.cat-sub-tag:hover { background: #dbeafe; }
.cat-sub-more { font-size: 11px; color: #999; padding: 1px 6px; }

/* ========== Site Cards ========== */
.site-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.site-card { background: #fff; border-radius: 5px; padding: 20px; transition: all 0.3s; border: 1px solid #eee; position: relative; }
.site-card:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.08); transform: translateY(-2px); }
.site-card .site-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.site-card .site-logo { width: 40px; height: 40px; border-radius: 5px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.site-card .site-name { font-size: 16px; font-weight: 600; color: #1a1a2e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card .site-desc { font-size: 13px; color: #888; line-height: 1.6; height: 40px; overflow: hidden; margin-bottom: 12px; }
.site-card .site-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #bbb; }
.site-card .site-cat { background: #f0f5ff; color: #4a90d9; padding: 2px 8px; border-radius: 3px; }

/* ========== Hot & New Sidebar Layout ========== */
.content-layout { display: flex; gap: 24px; }
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 320px; flex-shrink: 0; }
.sidebar-section { background: #fff; border-radius: 5px; padding: 20px; margin-bottom: 20px; border: 1px solid #eee; }
.sidebar-section h3 { font-size: 17px; font-weight: 600; color: #1a1a2e; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid #f0f2f5; }
.sidebar-list li { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a { font-size: 14px; color: #555; display: flex; justify-content: space-between; }
.sidebar-list .count { color: #bbb; font-size: 12px; }
.site-rank { display: flex; align-items: center; gap: 8px; }
.site-rank .rank-num { width: 22px; height: 22px; border-radius: 5px; background: #e8e8e8; color: #888; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.site-rank:nth-child(-n+3) .rank-num { background: linear-gradient(135deg, #ff6b6b, #ee5837); color: #fff; }
.site-rank .rank-info { min-width: 0; flex: 1; display: flex; align-items: center; gap: 6px; }
.site-rank .rank-name { font-size: 13px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.site-rank .rank-clicks { font-size: 11px; color: #bbb; flex-shrink: 0; white-space: nowrap; }

/* ========== Article Grid ========== */
.article-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.article-card { background: #fff; border-radius: 5px; overflow: hidden; transition: all 0.3s; border: 1px solid #eee; }
.article-card:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.08); transform: translateY(-2px); }
.article-card .article-img { height: 160px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 40px; }
.article-card .article-body { padding: 18px; }
.article-card .article-title { font-size: 16px; font-weight: 600; color: #1a1a2e; margin-bottom: 8px; line-height: 1.5; height: 48px; overflow: hidden; }
.article-card .article-desc { font-size: 13px; color: #999; line-height: 1.6; height: 60px; overflow: hidden; margin-bottom: 12px; }
.article-card .article-time { font-size: 12px; color: #ccc; }

/* ========== Breadcrumb ========== */
.breadcrumb { background: #fff; padding: 14px 0; border-bottom: 1px solid #eee; }
.breadcrumb .container { font-size: 14px; color: #888; }
.breadcrumb a { color: #666; }
.breadcrumb span { color: #4a90d9; }

/* ========== Detail Page ========== */
.detail-section { padding: 30px 0; }
.detail-card { background: #fff; border-radius: 5px; padding: 30px; border: 1px solid #eee; }
.detail-site-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 2px solid #f0f2f5; }
.detail-logo { width: 80px; height: 80px; border-radius: 5px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; flex-shrink: 0; }
.detail-info h1 { font-size: 26px; color: #1a1a2e; margin-bottom: 8px; }
.detail-info .url { font-size: 14px; color: #4a90d9; }
.detail-info .meta { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; color: #999; }
.detail-action { margin-left: auto; }
.btn-visit { display: inline-block; padding: 12px 32px; background: linear-gradient(135deg, #4a90d9, #357abd); color: #fff; border-radius: 5px; font-size: 16px; font-weight: 600; transition: all 0.3s; }
.btn-visit:hover { opacity: 0.9; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(74,144,217,0.3); }

.detail-content { line-height: 1.9; font-size: 15px; color: #444; }
.detail-content h3 { font-size: 18px; margin: 20px 0 10px; color: #1a1a2e; }
.detail-content p { margin-bottom: 12px; }
.detail-content strong { color: #333; }
.article-detail-header { margin-bottom: 24px; }
.article-detail-header h1 { font-size: 28px; color: #1a1a2e; margin-bottom: 12px; }
.article-detail-header .meta { font-size: 13px; color: #999; }

/* ========== Article List ========== */
.article-list .article-item { display: flex; gap: 20px; background: #fff; border-radius: 5px; padding: 20px; margin-bottom: 16px; border: 1px solid #eee; transition: all 0.3s; }
.article-list .article-item:hover { box-shadow: 0 4px 15px rgba(0,0,0,0.06); }
.article-item-img { width: 200px; height: 130px; border-radius: 5px; background: linear-gradient(135deg, #667eea, #764ba2); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 36px; flex-shrink: 0; }
.article-item-info { flex: 1; min-width: 0; }
.article-item-info h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.article-item-info h3 a { color: #1a1a2e; }
.article-item-info h3 a:hover { color: #4a90d9; }
.article-item-info .desc { font-size: 14px; color: #888; line-height: 1.6; height: 42px; overflow: hidden; margin-bottom: 10px; }
.article-item-info .time { font-size: 12px; color: #ccc; }

/* ========== Apply Form ========== */
.apply-card { max-width: 700px; margin: 0 auto; background: #fff; border-radius: 5px; padding: 36px; border: 1px solid #eee; }
.apply-card h2 { text-align: center; font-size: 24px; color: #1a1a2e; margin-bottom: 8px; }
.apply-card .subtitle { text-align: center; font-size: 14px; color: #999; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #333; font-size: 14px; }
.form-group label .required { color: #e74c3c; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; transition: border-color 0.2s; outline: none; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: #4a90d9; box-shadow: 0 0 0 3px rgba(74,144,217,0.1); }
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group .hint { font-size: 12px; color: #bbb; margin-top: 4px; }
.btn-primary { display: inline-block; padding: 12px 36px; background: linear-gradient(135deg, #4a90d9, #357abd); color: #fff; border: none; border-radius: 5px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(74,144,217,0.3); }
.btn-secondary { display: inline-block; padding: 10px 24px; background: #f0f2f5; color: #555; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background: #e4e6e9; }
.btn-danger { display: inline-block; padding: 8px 18px; background: #e74c3c; color: #fff; border: none; border-radius: 5px; font-size: 13px; cursor: pointer; }
.btn-danger:hover { background: #c0392b; }
.btn-success { display: inline-block; padding: 8px 18px; background: #27ae60; color: #fff; border: none; border-radius: 5px; font-size: 13px; cursor: pointer; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ========== Pagination ========== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 30px; }
.pagination a, .pagination span { display: inline-block; padding: 8px 16px; border-radius: 5px; font-size: 14px; border: 1px solid #ddd; color: #555; transition: all 0.2s; background: #fff; }
.pagination a:hover { border-color: #4a90d9; color: #4a90d9; }
.pagination .current { background: #4a90d9; color: #fff; border-color: #4a90d9; }

/* ========== Footer ========== */
.footer { background: #1a1a2e; color: #888; padding: 40px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 24px; }
.footer-about h4 { color: #fff; font-size: 18px; margin-bottom: 12px; }
.footer-about p { font-size: 13px; line-height: 1.8; }
.footer-links h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.footer-links ul li { margin-bottom: 8px; }
.footer-links ul a { color: #999; font-size: 13px; }
.footer-links ul a:hover { color: #4a90d9; }
.footer-bottom { text-align: center; padding-top: 16px; border-top: 1px solid #2a2a3e; font-size: 12px; color: #666; }

/* ========== Alerts ========== */
.alert { padding: 12px 18px; border-radius: 5px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #eafaf1; color: #27ae60; border: 1px solid #a3e4bc; }
.alert-error { background: #fdecea; color: #e74c3c; border: 1px solid #f5c6cb; }
.alert-info { background: #eaf2fd; color: #4a90d9; border: 1px solid #b8d4f5; }

/* ========== Admin ========== */
.admin-wrapper { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar { width: 240px; background: #1a1a2e; flex-shrink: 0; padding: 20px 0; }
.admin-sidebar .admin-logo { padding: 0 20px 20px; font-size: 18px; font-weight: 700; color: #fff; border-bottom: 1px solid #2a2a3e; margin-bottom: 10px; }
.admin-menu a { display: block; padding: 12px 20px; color: #aab; font-size: 14px; transition: all 0.2s; border-left: 3px solid transparent; }
.admin-menu a:hover, .admin-menu a.active { color: #fff; background: rgba(255,255,255,0.05); border-left-color: #4a90d9; }
.admin-content { flex: 1; padding: 24px; background: #f0f2f5; min-width: 0; }
.admin-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-header-bar h2 { font-size: 20px; color: #1a1a2e; }
.admin-table { width: 100%; background: #fff; border-radius: 5px; overflow: hidden; border: 1px solid #eee; }
.admin-table table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f2f5; font-size: 14px; }
.admin-table th { background: #fafbfc; font-weight: 600; color: #555; font-size: 13px; }
.admin-table tr:hover td { background: #fafbfc; }
.admin-table .actions { display: flex; gap: 6px; }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 3px; font-size: 12px; }
.status-badge.on { background: #eafaf1; color: #27ae60; }
.status-badge.off { background: #fdecea; color: #e74c3c; }
.admin-card { background: #fff; border-radius: 5px; padding: 24px; border: 1px solid #eee; margin-bottom: 20px; }
.admin-form .form-row { display: flex; gap: 16px; }
.admin-form .form-group { flex: 1; }

/* ========== Login ========== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { background: #fff; border-radius: 5px; padding: 40px; width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); }
.login-card h2 { text-align: center; font-size: 24px; color: #1a1a2e; margin-bottom: 30px; }
.login-card .btn-primary { width: 100%; text-align: center; }

/* ========== Collect Page ========== */
.collect-engines { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.collect-engine { background: #fff; border-radius: 5px; padding: 16px; text-align: center; border: 2px solid #eee; cursor: pointer; transition: all 0.3s; }
.collect-engine.selected { border-color: #4a90d9; background: #f0f5ff; }
.collect-engine .engine-icon { font-size: 36px; margin-bottom: 8px; }
.collect-engine .engine-name { font-weight: 600; color: #333; }
.collect-result { margin-top: 20px; }
.collect-item { background: #fff; border-radius: 5px; padding: 14px 18px; margin-bottom: 10px; border: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.collect-item .site-title { font-weight: 600; color: #333; }
.collect-item .site-url2 { font-size: 13px; color: #4a90d9; }
.collect-item .import-btn { padding: 4px 14px; background: #27ae60; color: #fff; border: none; border-radius: 3px; font-size: 12px; cursor: pointer; }

/* ========== Responsive ========== */
@media (max-width: 1400px) {
    .cat-grid { grid-template-columns: repeat(4, 1fr); }
    .site-grid { grid-template-columns: repeat(4, 1fr); }
    .article-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .site-grid { grid-template-columns: repeat(3, 1fr); }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .content-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .site-grid { grid-template-columns: repeat(2, 1fr); }
    .article-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 26px; }
    .detail-site-header { flex-direction: column; text-align: center; }
    .detail-action { margin-left: 0; }
    .admin-wrapper { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .article-list .article-item { flex-direction: column; }
    .article-item-img { width: 100%; height: 160px; }
    .collect-engines { grid-template-columns: repeat(2, 1fr); }
}
