/* ========== 右侧悬浮工具栏 ========== */

.floating-widget {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.widget-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    background: #3a9bfc;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    transition: background 0.2s;
    outline: none;
    padding: 6px 0;
}

.widget-btn:hover {
    background: #2b86e0;
}

.widget-btn:active {
    background: #1f6fc4;
}

/* 图标 */
.widget-btn i {
    display: block;
    width: 24px;
    height: 24px;
    margin-bottom: 3px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

/* 用 SVG data URI 做图标 */
.widget-btn .icon-chat {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z'/%3E%3Ccircle cx='8' cy='10' r='1.5'/%3E%3Ccircle cx='12' cy='10' r='1.5'/%3E%3Ccircle cx='16' cy='10' r='1.5'/%3E%3C/svg%3E");
    filter: none;
}

.widget-btn .icon-msg {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h12l4 4V4c0-1.1-.9-2-2-2zm-1 11H7v-2h12v2zm0-4H7V7h12v2z'/%3E%3C/svg%3E");
    filter: none;
}

.widget-btn .icon-phone {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.1.6-.1.9 0 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.6 21 3 13.4 3 4c0-.6.4-1 1-1h3.3c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .6 0 .9l-2.3 2.3z'/%3E%3C/svg%3E");
    filter: none;
}

/* 文字 */
.widget-btn span {
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0;
}

/* 提示气泡（非留言按钮） */
.widget-tip {
    position: absolute;
    right: 66px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s;
    pointer-events: none;
}

.widget-btn:hover .widget-tip {
    opacity: 1;
    visibility: visible;
}

.widget-tip::after {
    content: "";
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-left-color: rgba(0,0,0,0.7);
    border-right: 0;
}

/* ========== 留言弹窗 ========== */
.widget-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s;
}

.widget-overlay.active {
    opacity: 1;
    visibility: visible;
}

.widget-dialog {
    position: fixed;
    right: 72px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    z-index: 10001;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    padding: 24px 22px 20px;
    width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.25s;
}

.widget-dialog.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dialog-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0;
}

.dialog-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.dialog-close:hover {
    background: #eee;
    color: #666;
}

.dialog-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.dialog-input:focus {
    border-color: #3a9bfc;
}

.dialog-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    resize: vertical;
    min-height: 64px;
    font-family: inherit;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.dialog-textarea:focus {
    border-color: #3a9bfc;
}

.dialog-submit {
    width: 100%;
    padding: 11px 0;
    background: #3a9bfc;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.dialog-submit:hover {
    background: #2b86e0;
}
