/* =====================================================
   畜博导航 — 纯 HTML 原生版样式
   ===================================================== */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", sans-serif;
    -webkit-font-smoothing: antialiased;
    background: #f6f7f7;
    color: #333;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* --- Layout --- */
.page-wrap { display: flex; flex-direction: column; min-height: 100vh; padding-top: 176px; padding-bottom: 56px; }
.page-wrap:has(.hot-links:not(:empty)) { padding-top: 196px; }
.page-wrap-inner { padding-top: 64px; }
.page-wrap-inner .header-fixed { background: #fff; }


/* ==================== Title Bar ==================== */
.header-fixed {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    background: #fac230;
}
.title-bar {
    background: #fff;
    padding: 0 6%;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.title-bar-left { display: flex; align-items: center; gap: 30px; }
.logo { display: flex; align-items: center; cursor: pointer; gap: 12px; }
.logo img { width: 36px; height: 36px; border-radius: 4px; }
.logo .site-name { font-size: 20px; font-weight: 600; color: #222; white-space: nowrap; }
.city-selector { position: relative; cursor: pointer; }
.city-selector .city-name { font-size: 14px; color: #555; }
.city-selector .city-name:hover { color: #fac230; }
.city-selector .city-weather { font-size: 13px; color: #888; margin-left: 8px; }
.city-selector .city-weather img { width: 16px; height: 16px; display: inline; vertical-align: middle; margin-right: 4px; }
.city-selector .city-dropdown {
    display: none; position: absolute; top: 30px; left: 0; z-index: 200;
    background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.12); border-radius: 4px;
    padding: 8px; min-width: 200px;
}
.city-selector .city-dropdown.show { display: block; }
.city-selector .city-dropdown select {
    width: 100%; padding: 6px 8px; border: 1px solid #ddd; border-radius: 4px;
    font-size: 13px; outline: none;
}
.time-area { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #888; white-space: nowrap; }

/* ==================== Search Area ==================== */
.search-area {
    padding: 32px 6%;
    display: flex; flex-direction: column; align-items: center; flex-shrink: 0;
}
.search-box {
    width: 100%; max-width: 780px; height: 48px; display: flex; border-radius: 6px;
}
.search-left {
    flex: 1; background: #fff; display: flex; align-items: center; padding: 0 16px;
}
.search-engine-btn {
    display: flex; align-items: center; gap: 6px; cursor: pointer; padding-right: 14px;
    border-right: 1px solid #eee; position: relative; flex-shrink: 0;
    border-radius: 6px 0 0 6px;
}
.search-engine-btn img { width: 18px; height: 18px; }
.search-engine-btn .arrow { font-size: 10px; color: #999; }
.engine-menu {
    display: none; position: absolute; top: 36px; left: 0; z-index: 200;
    background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.12); border-radius: 4px;
    width: 140px; padding: 4px 0;
}
.engine-menu.show { display: block; }
.engine-menu-item {
    padding: 10px 20px; cursor: pointer; font-size: 14px; text-align: center;
}
.engine-menu-item:hover { background: #f5f5f5; }
.search-input {
    flex: 1; border: none; outline: none; font-size: 14px; padding: 0 12px;
}
.search-btn {
    background: #1a73e8; color: #fff; border: none; padding: 0 28px;
    font-size: 15px; cursor: pointer; white-space: nowrap;
    border-radius: 0 6px 6px 0;
}
.search-btn:hover { background: #1558b0; }
.hot-links {
    display: flex; flex-wrap: nowrap; overflow: hidden;
    gap: 0 16px; width: 100%; white-space: nowrap;
}
.hot-links:not(:empty) {
    margin-top: 16px;
}
.search-area:has(.hot-links:not(:empty)) {
    padding-bottom: 16px;
}
.hot-links span {
    font-size: 13px; color: #fff; cursor: pointer; transition: color .15s;
}
.hot-links span:hover { color: #f0f0f0; }

/* ==================== Main Content ==================== */
.main-content {
    flex: 1; padding: 20px 6%; display: flex; gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 170px; min-width: 170px; background: #fff; border-radius: 6px;
    border: 1px solid #f0f0f0; padding: 6px 0; height: fit-content;
    position: sticky; top: 180px; align-self: flex-start;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-item {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    cursor: pointer; font-size: 16px; color: #444; border-radius: 4px; margin: 3px 6px;
    transition: background .15s;
}
.sidebar-item:hover { background: #f2f2f2; }
.sidebar-item.active { background: #fac230; color: #fff; font-weight: 600; }
.sidebar-item img { width: 20px; height: 20px; flex-shrink: 0; }

/* Right Content */
.content-right {
    flex: 1;
}

.category-section {
    background: #fff; border-radius: 6px; padding: 24px 28px; margin-bottom: 20px;
    border: 1px solid #f0f0f0;
}
.category-title {
    font-size: 20px; font-weight: 600; color: #333; margin-bottom: 16px;
    padding-bottom: 10px; border-bottom: 2px solid #fac230; display: inline-block;
}
.link-grid {
    display: flex; flex-wrap: wrap; gap: 8px 0;
}
.link-item {
    width: 10%; min-width: 90px; display: flex; align-items: center; gap: 10px;
    padding: 10px 8px; cursor: pointer; font-size: 16px; color: #444;
    transition: color .15s;
}
.link-item:hover { color: #fac230; }
.link-item img { width: 32px; height: 32px; flex-shrink: 0; border-radius: 4px; }
.link-item span {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: calc(100% - 42px);
}

/* ==================== List / Detail / About ==================== */
.inner-page-content {
    flex: 1; padding: 20px 6%; overflow-y: auto;
}
.breadcrumb { font-size: 13px; color: #888; margin-bottom: 16px; cursor: pointer; }
.breadcrumb span:hover { color: #fac230; }
.breadcrumb .arrow { margin: 0 6px; color: #ccc; }

/* Card Grid */
.card-grid {
    display: flex; flex-wrap: wrap; gap: 20px;
}
.card-item {
    width: calc(33.333% - 12px); min-width: 220px; flex: 1 1 auto;
    padding: 24px; background: #fff; border-radius: 8px;
    border: 1px solid #eee; cursor: pointer;
    transition: box-shadow .15s, transform .15s;
}
.card-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    transform: translateY(-2px);
}
.card-title {
    font-size: 18px; font-weight: 600; color: #222; margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-content {
    font-size: 16px; color: #666; line-height: 1.8;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.search-results { max-width: 900px; margin: 0 auto; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 30px 0 10px; flex-wrap: wrap; }
.pagination button {
    padding: 6px 14px; border: 1px solid #ddd; background: #fff; border-radius: 4px;
    cursor: pointer; font-size: 13px; color: #555;
}
.pagination button:hover { border-color: #fac230; color: #fac230; }
.pagination button.active { background: #fac230; color: #fff; border-color: #fac230; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: #999; margin-left: 10px; }

/* Detail */
.detail-page { max-width: 800px; margin: 0 auto; }
.detail-title { font-size: 24px; font-weight: 700; color: #222; margin-bottom: 20px; }
.detail-content { font-size: 15px; line-height: 1.8; color: #444; }
.detail-content p { margin-bottom: 12px; }


/* About */
.about-content { max-width: 800px; margin: 0 auto; line-height: 1.8; font-size: 15px; color: #444; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: #999; font-size: 15px; }

/* ==================== Footer ==================== */
.footer {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: #fff; border-top: 1px solid #eee; padding: 16px 6%;
    display: flex; justify-content: center; align-items: center; gap: 12px;
    font-size: 13px; color: #888; flex-wrap: wrap;
}
.footer span { cursor: pointer; }
.footer span:hover { color: #fac230; }

/* ==================== Modal (Apply Dialog) ==================== */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.4); z-index: 1000; justify-content: center; align-items: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 8px; padding: 30px; width: 90%; max-width: 420px;
    position: relative; max-height: 90vh; overflow-y: auto;
}
.modal-close {
    position: absolute; top: 12px; right: 16px; background: none; border: none;
    font-size: 24px; cursor: pointer; color: #999;
}
.modal-close:hover { color: #333; }
.modal-box h3 { font-size: 18px; margin-bottom: 20px; text-align: center; }

/* Detail Modal */
.detail-modal-title {
    font-size: 20px; font-weight: 700; color: #222; margin-bottom: 12px;
    padding-right: 30px;
}
.detail-modal-meta {
    font-size: 13px; color: #999; margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.detail-modal-meta .meta-item {
    margin-right: 20px;
}
.detail-modal-body {
    font-size: 15px; line-height: 1.8; color: #444; max-height: 60vh; overflow-y: auto;
}
.detail-modal-body p { margin-bottom: 12px; }
#detailModal .modal-box {
    max-width: 600px; /* wider for article content */
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; color: #555; margin-bottom: 6px; }
.form-group input, .form-group select {
    width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 4px;
    font-size: 14px; outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: #fac230; }
.form-submit {
    width: 100%; padding: 12px; background: #fac230; color: #222; border: none;
    border-radius: 4px; font-size: 15px; cursor: pointer; font-weight: 600;
}
.form-submit:hover { background: #f0b81c; }
.form-submit:disabled { opacity: .6; cursor: not-allowed; }

/* Phone + send code row */
.phone-row {
    display: flex; gap: 8px; align-items: stretch;
}
.send-code-btn {
    white-space: nowrap; padding: 0 14px; border: 1px solid #fac230;
    background: #fff; color: #c99800; border-radius: 4px;
    font-size: 13px; cursor: pointer; outline: none;
}
.send-code-btn:hover { background: #fac230; color: #222; }
.send-code-btn:disabled {
    background: #f5f5f5; border-color: #ddd; color: #999; cursor: not-allowed;
}

/* About modal content */
.about-modal-content {
    font-size: 15px; line-height: 1.8; color: #444;
    max-height: 60vh; overflow-y: auto;
}

/* ==================== Back to Top ==================== */
.back-top {
    position: fixed; bottom: 30px; right: 30px; width: 40px; height: 40px;
    background: #fac230; color: #222; border: none; border-radius: 50%;
    font-size: 20px; cursor: pointer; display: none; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 999;
}
.back-top.show { display: flex; }
.back-top:hover { background: #f0b81c; }

/* ==================== Responsive ==================== */
@media (max-width: 960px) {
    .title-bar { padding: 0 4%; }
    .search-area { padding: 16px 4%; }
    .main-content { padding: 20px 4%; flex-direction: column; }
    .sidebar { width: 100%; min-width: unset; flex-direction: row; position: static !important;
        max-height: unset; overflow-x: auto; display: flex; padding: 4px; gap: 4px;
    }
    .sidebar-item { white-space: nowrap; flex-shrink: 0; }
    .link-item { width: 20%; min-width: 90px; }
    .search-area:has(.hot-links:not(:empty)) { padding-bottom: 16px; }
    .inner-page-content { padding: 16px 4%; }
    .time-area { display: none; }
    .page-wrap { padding-top: 144px; }
    .page-wrap:has(.hot-links:not(:empty)) { padding-top: 180px; }
    .page-wrap-inner { padding-top: 64px; }
}
@media (max-width: 600px) {
    .link-item { width: 33%; }
    .page-wrap { padding-top: 128px; }
    .page-wrap:has(.hot-links:not(:empty)) { padding-top: 164px; }
    .page-wrap-inner { padding-top: 56px; }
    .title-bar { height: 56px; }
    .logo .site-name { font-size: 16px; }
    .card-item { width: calc(50% - 10px); min-width: 160px; padding: 16px; }
    .search-btn { padding: 0 16px; font-size: 14px; }
    .search-area { padding: 12px 4%; }
    .search-area:has(.hot-links:not(:empty)) { padding-bottom: 12px; }
    .main-content { padding-top: 20px; }
    .category-section { padding: 16px; }
}
