/**
 * SNOWLING 官网扩展样式
 * 覆盖：语言切换器 / 导航登录态 / WhatsApp 浮动按钮 / 搜索类型选择 / 登录门控提示 /
 *      注册登录页（account.html）/ 询盘页（inquiry.html）
 * 依赖各页面既有的 css/style.css 变量与配色（主色 #0056b3）
 */

/* ==================== 导航：布局压缩（防止 7+2 项菜单溢出错位） ==================== */
.main-nav .nav-menu {
    gap: 8px;
    flex-wrap: nowrap;
    align-items: stretch;
}

/* 菜单项与语言下拉/登录入口保持同一水平线（li 内垂直居中） */
.main-nav .nav-menu > li {
    display: flex;
    align-items: center;
}

.main-nav .nav-menu > li > .nav-link {
    white-space: nowrap;
    font-size: 12.5px;
    padding: 9px 5px;
    letter-spacing: 0;
}

/* ==================== 导航：语言切换器（下拉选择） ==================== */
.nav-item-lang {
    display: flex;
    align-items: center;
}

.nav-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f7fa;
    border: 1px solid #e3e8ef;
    border-radius: 20px;
    padding: 4px 6px 4px 10px;
    white-space: nowrap;
}

.nav-lang-switcher .lang-globe {
    display: inline-flex;
    align-items: center;
    color: #0056b3;
}

.nav-lang-select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 18px 4px 2px;
    cursor: pointer;
    outline: none;
    /* 下拉箭头 */
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
}

.nav-lang-select:hover {
    color: #0056b3;
}

.nav-lang-select option {
    color: #333;
    font-weight: 400;
}

/* ==================== 导航：登录态 ==================== */
.nav-auth-holder {
    display: flex;
    align-items: center;
}

.nav-auth-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.nav-auth-item .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: none;
    font-size: 13px;
    padding: 8px 6px;
    white-space: nowrap;
}

/* 已登录用户名过长时省略，避免撑爆导航 */
.nav-auth-item .nav-user-link {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-user-icon {
    font-size: 15px;
    line-height: 1;
}

.nav-logout-link {
    color: #999;
}

.nav-logout-link:hover {
    color: #d9534f;
    background: rgba(217, 83, 79, 0.08);
}

/* ==================== WhatsApp 常驻浮动按钮 ==================== */
.whatsapp-float {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-float svg {
    display: block;
}

@media (max-width: 768px) {
    .whatsapp-float {
        right: 14px;
        bottom: 14px;
        width: 50px;
        height: 50px;
    }
    .whatsapp-float svg {
        width: 26px;
        height: 26px;
    }
}

/* ==================== 移动端导航中的语言/登录项 ==================== */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
    }
    /* 展开的移动端菜单需容纳 7 个导航项 + 语言下拉 + 登录项 */
    .main-nav .nav-menu.active {
        max-height: 560px;
    }
    .nav-menu .nav-item-lang,
    .nav-menu .nav-auth-holder {
        width: 100%;
        justify-content: center;
        padding: 8px 0;
    }
    .nav-lang-switcher {
        background: transparent;
        border: none;
        padding: 0;
    }
    .nav-lang-select {
        font-size: 14px;
        padding: 6px 20px 6px 2px;
    }
    .nav-auth-item .nav-link {
        padding: 10px 12px;
    }
    .nav-auth-item .nav-user-link {
        max-width: 200px;
    }
}

/* ==================== 中等宽度（平板/窄笔记本）：菜单收进汉堡，防止溢出错位 ==================== */
/* responsive.css 以 min-width:769 + !important 锁死桌面布局，这里用更高优先级覆盖（769–1024px） */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-nav .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
        flex-shrink: 0;
        position: relative;
    }

    .main-nav .mobile-menu-toggle span {
        width: 100%;
        height: 3px;
        background: #333;
        border-radius: 3px;
        transition: all 0.3s ease;
        position: relative;
        display: block;
    }

    .main-nav .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .main-nav .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .main-nav .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .main-nav .nav-menu {
        display: flex !important;
        position: absolute !important;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column !important;
        width: 100% !important;
        background: #fff !important;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1) !important;
        max-height: 0 !important;
        overflow: hidden !important;
        gap: 0 !important;
        transition: max-height 0.3s ease;
        z-index: 1000;
    }

    .main-nav .nav-menu.active {
        max-height: 560px !important;
        overflow-y: auto !important;
    }

    .main-nav .nav-menu li {
        border-bottom: 1px solid #f0f0f0 !important;
        width: 100% !important;
    }

    .main-nav .nav-menu .nav-link {
        width: 100% !important;
        text-align: center;
        padding: 13px 16px !important;
        border-radius: 0;
        display: block;
    }

    .main-nav .nav-menu .nav-item-lang,
    .main-nav .nav-menu .nav-auth-holder {
        justify-content: center;
        padding: 8px 0;
    }

    .main-nav .nav-auth-item .nav-link {
        padding: 10px 12px;
    }
}

/* ==================== 产品搜索：搜索类型选择 ==================== */
.search-type-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.search-type-row .search-type-label {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.search-type-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #dce1e8;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #333;
    outline: none;
}

.search-type-select:focus {
    border-color: #0056b3;
}

/* ==================== 产品搜索：登录门控提示 ==================== */
.login-required-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafd;
    border: 1px dashed #c9d6e8;
    border-radius: 10px;
}

.login-required-state .lock-icon {
    font-size: 44px;
    margin-bottom: 12px;
}

.login-required-state h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.login-required-state p {
    color: #777;
    max-width: 520px;
    margin: 0 auto 20px;
    line-height: 1.7;
}

.login-required-state .login-required-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary-ext,
.btn-outline-ext {
    display: inline-block;
    padding: 11px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-primary-ext {
    background: #0056b3;
    color: #fff;
    border: 1px solid #0056b3;
}

.btn-primary-ext:hover {
    background: #004492;
}

.btn-outline-ext {
    background: #fff;
    color: #0056b3;
    border: 1px solid #0056b3;
}

.btn-outline-ext:hover {
    background: rgba(0, 86, 179, 0.08);
}

/* ==================== 注册 / 登录页（account.html） ==================== */
.account-section {
    padding: 50px 0 70px;
    background: #f7f9fc;
}

.account-card {
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(30, 50, 80, 0.08);
    overflow: hidden;
}

.auth-tabs {
    display: flex;
}

.auth-tab {
    flex: 1;
    padding: 15px 0;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #777;
    background: #f2f5f9;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-tab.active {
    background: #fff;
    color: #0056b3;
    box-shadow: inset 0 -3px 0 #0056b3;
}

.auth-body {
    padding: 30px 34px 36px;
}

.auth-title {
    font-size: 22px;
    color: #222;
    margin-bottom: 6px;
}

.auth-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 22px;
    line-height: 1.6;
}

.ext-form-group {
    margin-bottom: 16px;
}

.ext-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.ext-form-group label .required-mark {
    color: #d9534f;
    margin-left: 2px;
}

.ext-form-group input,
.ext-form-group select,
.ext-form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #dce1e8;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.ext-form-group input:focus,
.ext-form-group select:focus,
.ext-form-group textarea:focus {
    border-color: #0056b3;
}

.ext-form-group textarea {
    resize: vertical;
    min-height: 110px;
}

.upload-sub-inline {
    font-weight: 400;
    color: #aaa;
    font-size: 12px;
    margin-left: 6px;
}

.ext-form-row {
    display: flex;
    gap: 14px;
}

.ext-form-row .ext-form-group {
    flex: 1;
}

.auth-submit-btn {
    width: 100%;
    padding: 13px 0;
    background: #0056b3;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.25s ease;
    margin-top: 6px;
}

.auth-submit-btn:hover {
    background: #004492;
}

.auth-submit-btn:disabled {
    background: #9bb8d8;
    cursor: not-allowed;
}

.auth-switch-tip {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: #888;
}

.auth-switch-tip a {
    color: #0056b3;
    font-weight: 600;
    text-decoration: none;
}

.auth-error-tip {
    background: #fdf0f0;
    border: 1px solid #f5c6cb;
    color: #a94442;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* 已登录面板 */
.user-panel {
    text-align: center;
    padding: 10px 0;
}

.user-panel .user-avatar {
    width: 68px;
    height: 68px;
    line-height: 68px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(0, 86, 179, 0.1);
    color: #0056b3;
    font-size: 30px;
}

.user-panel h3 {
    font-size: 19px;
    color: #222;
    margin-bottom: 18px;
    word-break: break-all;
}

.user-info-list {
    text-align: left;
    background: #f8fafd;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.user-info-list .user-info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    padding: 5px 0;
}

.user-info-list .user-info-row .info-label {
    color: #999;
    white-space: nowrap;
}

.user-info-list .user-info-row .info-value {
    color: #333;
    word-break: break-all;
    text-align: right;
}

.user-panel-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.user-panel-actions .btn-primary-ext,
.user-panel-actions .btn-outline-ext {
    flex: 1;
    min-width: 150px;
}

.user-panel-actions .btn-logout-ext {
    background: #fff;
    color: #d9534f;
    border: 1px solid #d9534f;
}

.user-panel-actions .btn-logout-ext:hover {
    background: #fdf0f0;
}

/* ==================== 询盘页（inquiry.html） ==================== */
.inquiry-section {
    padding: 50px 0 70px;
    background: #f7f9fc;
}

.inquiry-wrapper {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(30, 50, 80, 0.08);
    padding: 36px 40px 42px;
}

.inquiry-head {
    margin-bottom: 24px;
}

.inquiry-head h2 {
    font-size: 24px;
    color: #222;
    margin-bottom: 8px;
}

.inquiry-head p {
    font-size: 14px;
    color: #777;
    line-height: 1.7;
}

.inquiry-form .ext-form-group textarea {
    min-height: 130px;
}

/* 铭牌图片上传 */
.image-upload-box {
    border: 2px dashed #cdd8e6;
    border-radius: 8px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    background: #fbfcfe;
}

.image-upload-box:hover {
    border-color: #0056b3;
}

.image-upload-box .upload-preview {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    object-fit: cover;
    background: #eef2f7;
    flex-shrink: 0;
}

.image-upload-box .upload-preview-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    background: #eef2f7;
    color: #aab6c5;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.image-upload-box .upload-texts .upload-main {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.image-upload-box .upload-texts .upload-sub {
    font-size: 12px;
    color: #999;
}

.inquiry-submit-btn {
    width: 100%;
    padding: 14px 0;
    background: #0056b3;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.25s ease;
    margin-top: 10px;
}

.inquiry-submit-btn:hover {
    background: #004492;
}

.inquiry-submit-btn:disabled {
    background: #9bb8d8;
    cursor: not-allowed;
}

/* 询盘提交成功面板 */
.inquiry-success-panel {
    text-align: center;
    padding: 40px 10px;
}

.inquiry-success-panel .success-icon {
    width: 74px;
    height: 74px;
    line-height: 74px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
    font-size: 36px;
}

.inquiry-success-panel h3 {
    font-size: 22px;
    color: #222;
    margin-bottom: 10px;
}

.inquiry-success-panel p {
    color: #777;
    font-size: 14px;
    line-height: 1.7;
    max-width: 460px;
    margin: 0 auto 24px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .auth-body {
        padding: 24px 20px 30px;
    }
    .inquiry-wrapper {
        padding: 26px 20px 32px;
        margin: 0 14px;
    }
    .ext-form-row {
        flex-direction: column;
        gap: 0;
    }
}
