/* 表单布局 */
.topsidebar-form .wpforms-container .wpforms-field-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4%;
}

.topsidebar-form .form-layout {
    width: 48% !important;
}

/* 多行文本独占一行 */
.topsidebar-form .textarea-layout {
    width: 100% !important;
}

/* 移动端单列 */
@media (max-width: 767px) {
    .topsidebar-form .form-layout {
        width: 100% !important;
    }
}

/* 浮动侧边栏样式 */
.topsidebar-sidebar {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 10px 0 0 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 9999;
    overflow: hidden;
    max-width: 65px;
    width: 100%;
}

.topsidebar-sidebar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
}

.topsidebar-sidebar a img {
    width: 20px;
    height: 20px;
    margin-bottom: 4px;
}

.topsidebar-sidebar a span {
    font-size: 11px;
}

/* 悬浮/激活效果 */
.topsidebar-sidebar a:hover,
.topsidebar-sidebar a.active {
    background-color: #3b82f6;
    color: #fff;
}

.topsidebar-sidebar a:hover img,
.topsidebar-sidebar a.active img {
    filter: brightness(0) invert(1);
}

/* 弹窗样式 */
#topsidebar-popup-wrapper {
    display: none;
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.topsidebar-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.topsidebar-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    max-width: 720px;
    width: 90%;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* 弹窗头部 */
.topsidebar-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.topsidebar-popup-header h3 {
    margin: 0;
    font-size: 20px;
}

.topsidebar-popup-header .topsidebar-icons a {
    margin-left: 10px;
    display: inline-block;
}

.topsidebar-popup-header .topsidebar-icons img {
    width: 20px;
    height: 20px;
}

.topsidebar-close {
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* 按钮样式 */
.topsidebar-form .wpforms-submit-container {
    display: flex !important;
    gap: 15px !important;
    flex-wrap: wrap;
    justify-content: center;
    margin: 40px 0 !important;
}

.topsidebar-form .wpforms-submit {
    padding: 5px 20px !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    line-height: 30px !important;
    border-radius: 50px !important;
    height: auto !important;
}

.topsidebar-form .form-custom-reset-btn {
    order: 2;
    background-color: #182B5E !important;
    transition: all 0.3s ease;
    padding: 5px 70px !important;
    font-size: 20px !important;
    font-weight: 400;
    line-height: 30px !important;
    border-radius: 50px !important;
    margin-left: 20px !important;
}

/* 响应式调整 */
@media (max-width: 991.98px) {
    .topsidebar-sidebar {
        top: auto;
        bottom: 100px;
        right: 10px;
        transform: none;
        border-radius: 12px;
        max-width: none;
        width: auto;
    }

    .topsidebar-sidebar a {
        flex-direction: row;
        justify-content: flex-start;
        gap: 6px;
        padding: 10px;
        font-size: 14px;
    }

    .topsidebar-sidebar a img {
        width: 22px;
        height: 22px;
        margin-bottom: 0;
    }

    .topsidebar-sidebar a span {
        font-size: 14px;
    }
}

@media (max-width: 767px) {
    .topsidebar-form .wpforms-submit-container {
        flex-direction: row;
    }

    .topsidebar-form .wpforms-submit,
    .form-custom-reset-btn {
        width: 40% !important;
    }
}

/* 表单标签 */
.topsidebar-form label {
    color: #333333 !important;
}

/* 按钮hover效果 */
#wpforms-submit-3881:hover,
.form-custom-reset-btn:hover {
    background-color: #1462AF !important;
}