* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f7;
    color: #333;
    line-height: 1.6;
}

/* ========== 头部导航 ========== */
.site-header {
    background: #fff;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: #222;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

.header-nav a {
    margin-left: 24px;
    color: #555;
    text-decoration: none;
    font-size: 15px;
}

.header-nav a.active {
    color: #222;
    font-weight: 600;
}

/* ========== 搜索区域 ========== */
.search-section {
    position: relative;
    margin: 24px 40px;
    border-radius: 12px;
    overflow: hidden;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.search-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
}

.search-engine-tabs {
    display: flex;
    gap: 24px;
    color: #fff;
    font-size: 15px;
}

.search-engine-tabs span {
    cursor: pointer;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.search-engine-tabs span.active {
    border-bottom-color: #fff;
    font-weight: 600;
}

.search-box {
    width: 60%;
    max-width: 700px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    /* 毛玻璃效果 */
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.search-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* ========== 主内容区 ========== */
.main-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    padding: 0 40px 40px;
}

/* 分类Tab */
.category-tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.category-tabs a {
    padding: 10px 0;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.category-tabs a.active {
    color: #222;
    font-weight: 600;
    border-bottom-color: #222;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #f0f0f0;
}

.card-body {
    padding: 14px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #222;
}

.card-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 侧边栏 ========== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    border: 1px solid #eee;
}

.widget-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #409eff;
}

.widget-list {
    list-style: none;
}

.widget-list li {
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    border-bottom: 1px dashed #f0f0f0;
}

.widget-list li:last-child {
    border-bottom: none;
}

.widget-list .item-title {
    color: #333;
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.widget-list .item-cat {
    color: #999;
    font-size: 12px;
    margin-left: 10px;
    flex-shrink: 0;
}

.hot-rank li {
    counter-increment: rank;
}

.hot-rank li::before {
    content: counter(rank);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #999;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
}

.hot-rank li:nth-child(1)::before { background: #f56c6c; color: #fff; }
.hot-rank li:nth-child(2)::before { background: #e6a23c; color: #fff; }
.hot-rank li:nth-child(3)::before { background: #f0c78a; color: #fff; }

/* ========== 弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    z-index: 10;
}

.modal-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.modal-body {
    padding: 20px 24px 24px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #222;
}

.modal-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.modal-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f5f7fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.modal-link-item:hover {
    background: #eef1f6;
}

.modal-link-name {
    font-weight: 500;
}

.modal-link-btn {
    padding: 4px 12px;
    background: #409eff;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
}

/* ========== 底部 ========== */
.site-footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 24px 40px;
    margin-top: 20px;
}

.footer-links {
    margin-bottom: 16px;
}

.footer-links h4 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 13px;
    margin-right: 16px;
}

.footer-links a:hover {
    color: #409eff;
}

.footer-info {
    text-align: center;
    color: #999;
    font-size: 12px;
    line-height: 1.8;
}

.footer-info a {
    color: #999;
    text-decoration: none;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    .search-box { width: 85%; }
    .site-header, .search-section, .main-container, .site-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}