/* static/css/navbar.css */
.navbar {
    background: #1a2332;
    display: flex;
    align-items: center;
    margin: -18px -22px 16px -22px;
    padding: 0 28px;
    height: 68px;
    border-radius: 32px 32px 0 0;
    gap: 24px;
    position: relative;
    flex-shrink: 0;
}

.logo-area { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-icon { color: #e74c3c; font-size: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; }
.brand { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: 1px; white-space: nowrap; }

.nav-content { display: flex; align-items: center; justify-content: flex-end; flex: 1; gap: 24px; }
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; flex-shrink: 0; }
.nav-links a { color: #e8eef5; text-decoration: none; font-size: 14px; font-weight: 500; padding: 9px 18px; border-radius: 4px; cursor: pointer; white-space: nowrap; transition: all 0.2s; display: flex; align-items: center; gap: 6px; }
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-links a.active { color: #fff; background: rgba(255,255,255,0.14); }
.nav-links a i { font-size: 13px; }

.search-box { display: flex; align-items: stretch; height: 40px; flex-shrink: 0; border-radius: 4px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.search-box input { width: 230px; padding: 0 16px; border: none; outline: none; font-size: 13px; background: #fff; color: #1f3a57; transition: width 0.3s ease; }
.search-box input::placeholder { color: #8aa3bc; }
.search-box button { padding: 0 22px; background: #1a4a7a; color: #fff; border: none; cursor: pointer; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; transition: background 0.2s; }
.search-box button:hover { background: #0f3457; }

.menu-toggle { display: none; background: transparent; border: 1.5px solid rgba(255,255,255,0.45); color: #fff; font-size: 18px; cursor: pointer; width: 40px; height: 40px; border-radius: 6px; align-items: center; justify-content: center; margin-left: auto; flex-shrink: 0; }
.menu-toggle:hover { background: rgba(255,255,255,0.1); }

/* ★ 新增：1400px 时，缩减搜索框宽度，保证菜单文字完整 */
@media (max-width: 1400px) {
    .navbar { padding: 0 16px; gap: 12px; }
    .nav-links a { padding: 9px 12px; font-size: 13.5px; }
    .nav-content { gap: 12px; }
    /* 把搜索框缩短 */
    .search-box input { width: 130px; padding: 0 10px; font-size: 12px; }
    .search-box button { padding: 0 14px; }
}

/* ★ 1100px 以下：搜索框折叠为放大镜 */
@media (max-width: 1100px) {
    .search-box input { display: none; width: 0; padding: 0; }
    .search-box button { padding: 0 14px; border-radius: 4px; }
    .search-box button .btn-text { display: none; }
    .search-box button i { margin: 0; font-size: 16px; }

    /* 展开时显示输入框 */
    .search-box.expanded input { display: block; width: 180px; padding: 0 16px; }
    .search-box.expanded button { padding: 0 22px; }
    .search-box.expanded button .btn-text { display: inline; }
}

/* 小于 900px 进入完全的手机端适配 */
@media (max-width: 900px) {
    .navbar { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 0; border-radius: 0; }
    .logo-area { flex: 0 1 auto; min-width: 0; }
    .brand { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
    .menu-toggle { display: flex; }
    .nav-content { display: none; width: 100%; flex-direction: column; align-items: stretch; margin-top: 14px; gap: 0; }
    .nav-content.open { display: flex; }
    .nav-links { flex-direction: column; gap: 0; width: 100%; }
    .nav-links a { padding: 16px 6px; border-bottom: 1px solid rgba(255,255,255,0.08); border-radius: 0; width: 100%; font-size: 15px; }
    .nav-links a:last-child { border-bottom: none; }
    .search-box { margin-top: 14px; height: 44px; width: 100%; }
    
    /* 恢复手机端搜索框 */
    .search-box input { display: block; flex: 1; width: auto; padding: 0 16px; }
    .search-box button { padding: 0 22px; }
    .search-box button .btn-text { display: inline; }
    .search-box button i { font-size: 13px; }
}