* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

#plugin-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #f7f7f7;
    border-bottom: 1px solid #eaeaea;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    z-index: 1001;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#plugin-container .mini-program-menu {
    position: relative;
}

#plugin-container .menu-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #07c160;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #07c160;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(7, 193, 96, 0.1);
}

#plugin-container .menu-toggle:hover {
    background-color: #07c160;
    color: #fff;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.2);
}

#plugin-container .menu-toggle:active {
    background-color: #06ad56;
    transform: scale(0.98);
}

#plugin-container .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    padding: 8px 0;
}

#plugin-container .sub-menu.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#plugin-container .mini-program-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    cursor: pointer;
}

#plugin-container .mini-program-item:hover {
    background-color: #f7f7f7;
}

#plugin-container .mini-program-item:active {
    background-color: #f0f0f0;
    transform: scale(0.98);
}

#plugin-container .mini-program-item img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #f0f0f0;
}

#plugin-container .mini-program-item span {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#plugin-container .no-mini-programs {
    padding: 20px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

#plugin-container .weather-widget {
    position: relative;
}

#plugin-container .weather-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#plugin-container .weather-toggle:hover {
    background-color: #ffe7ba;
    border-color: #ffa940;
}

#plugin-container .weather-toggle:active {
    background-color: #ffd591;
    transform: scale(0.98);
}

#plugin-container .weather-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    min-width: 280px;
    max-width: 320px;
    z-index: 1001;
    display: none;
    padding: 12px;
}

#plugin-container .weather-panel.show {
    display: block;
    animation: slideDown 0.3s ease;
}

#plugin-container .weather-search {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

#plugin-container .weather-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    font-size: 14px;
    outline: none;
}

#plugin-container .weather-input:focus {
    border-color: #ffa940;
}

#plugin-container .weather-search-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: #ffa940;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#plugin-container .weather-search-btn:hover {
    background-color: #ff9c6e;
}

#plugin-container .weather-content {
    min-height: 150px;
}

#plugin-container .weather-loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

#plugin-container .weather-current {
    text-align: center;
    padding: 12px 0;
}

#plugin-container .weather-current-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

#plugin-container .weather-current-temp {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

#plugin-container .weather-current-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

#plugin-container .weather-location {
    font-size: 12px;
    color: #999;
}

#plugin-container .weather-error {
    text-align: center;
    padding: 20px;
    color: #ff4d4f;
    font-size: 14px;
}

.container {
    min-height: 100vh;
    padding: 20px;
}

.page-content {
    text-align: center;
    padding: 40px 20px;
}

.page-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.page-desc {
    font-size: 16px;
    color: #666;
}

.float-btn {
    position: fixed;
    width: 60px;
    height: 60px;
    background-color: #07c160;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 999;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.float-btn:active {
    transform: translate(-50%, -50%) scale(0.9);
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.btn-image {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-bottom: 4px;
    object-fit: cover;
    display: block;
}

.btn-text {
    font-size: 10px;
    color: #fff;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.chat-window {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 80%;
    max-width: 90vw;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    will-change: transform;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #fafafa;
    border-radius: 10px 10px 0 0;
}

.header-info {
    display: flex;
    align-items: center;
}

.header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background-color: #f0f0f0;
    overflow: hidden;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-text {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.header-status {
    font-size: 12px;
    color: #07c160;
    margin-top: 2px;
}

.loading-indicator {
    display: flex;
    align-items: center;
    margin-top: 4px;
    padding: 3px 6px;
    background-color: rgba(7, 193, 96, 0.08);
    border-radius: 6px;
    font-size: 11px;
    color: #666;
}

.loading-spinner {
    width: 10px;
    height: 10px;
    margin-right: 4px;
    border: 1px solid rgba(7, 193, 96, 0.3);
    border-top: 1px solid #07c160;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    will-change: transform;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #07c160;
    font-size: 11px;
    font-weight: 500;
}

.header-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.close-icon {
    font-size: 24px;
    color: #999;
    font-weight: bold;
}

.close-icon:active {
    color: #666;
}

.message-list {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #fafafa;
    overflow-anchor: none;
}

.message-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    position: relative;
}

.message-time {
    width: 100%;
    text-align: center;
    margin-top: 5px;
    order: 2;
}

.message-time .time-text {
    font-size: 10px;
    color: #999;
    background-color: #f0f0f0;
    padding: 2px 10px;
    border-radius: 5px;
}

.message-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    padding: 0 16px 0 8px;
    min-height: 40px;
    margin-bottom: 14px;
}

.message-row.user {
    flex-direction: row-reverse;
    padding-right: 8px;
}

.message-row.service {
    flex-direction: row;
    padding-left: 8px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background-color: #f0f0f0;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.message-content {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    flex-shrink: 1;
}

.message-content.user {
    margin-right: 8px;
    max-width: 72%;
}

.message-content.service {
    margin-left: 8px;
    max-width: 72%;
}

.message-bubble {
    max-width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    word-wrap: break-word;
    position: relative;
    white-space: normal;
    overflow: hidden;
    display: inline-block;
    vertical-align: top;
    text-align: left;
    transition: all 0.2s ease;
    font-size: 15px;
    line-height: 1.6;
}

.message-bubble.user {
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: #fff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 1px 3px rgba(7, 193, 96, 0.12);
}

.message-bubble.service {
    background-color: #fff;
    color: #333;
    border-bottom-left-radius: 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.message-text {
    font-size: 14px;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    word-break: break-word;
    white-space: normal;
    text-align: left;
    letter-spacing: 0.1px;
    color: inherit;
    font-weight: 400;
}

.message-bubble.user .message-text {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 消息中的图片样式 */
.message-image {
    margin: 8px 0;
    display: block;
}

.message-image img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 0;
    margin-top: 5px;
    flex-wrap: wrap;
}

.loading-message .loading-spinner {
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 2px solid rgba(7, 193, 96, 0.3);
    border-top: 2px solid #07c160;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-message .loading-text {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #07c160;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
    will-change: transform, opacity;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingBounce {
    0%, 70%, 100% {
        transform: scale(0.5);
        opacity: 0.4;
    }
    35% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-text {
    font-size: 13px;
    color: #666;
    margin-left: 8px;
    font-weight: 500;
}

.pulse-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin: 10px 0;
}

.pulse-circle {
    width: 12px;
    height: 12px;
    background-color: #07c160;
    border-radius: 50%;
    animation: pulse 1.5s infinite ease-in-out;
}

.pulse-circle:nth-child(2) {
    animation-delay: 0.2s;
}

.pulse-circle:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.wave-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 12px 16px;
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin: 10px 0;
}

.wave-bar {
    width: 4px;
    height: 20px;
    background-color: #07c160;
    border-radius: 2px;
    transform-origin: bottom;
    animation: wave 1.2s infinite ease-in-out;
}

.wave-bar:nth-child(1) {
    animation-delay: 0s;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes wave {
    0%, 100% {
        transform: scaleY(0.4);
        opacity: 0.5;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.smart-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f9f4 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #d9f2e6;
    box-shadow: 0 1px 4px rgba(7, 193, 96, 0.08);
    margin: 10px 0;
}

.smart-icon {
    width: 24px;
    height: 24px;
    background-color: #07c160;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: smartPulse 2s infinite ease-in-out;
}

.smart-icon::before {
    content: '';
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes smartPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(7, 193, 96, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(7, 193, 96, 0);
    }
}

.smart-text {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.smart-subtext {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.link-wrapper {
    display: inline-block;
    cursor: pointer;
    position: relative;
    padding: 2px 3px;
    margin: 0;
    border-radius: 4px;
    background-color: transparent;
    transition: all 0.2s ease;
}

.link-wrapper:active {
    background-color: rgba(24, 144, 255, 0.15);
    transform: scale(0.98);
}

.link-text {
    color: #1890ff;
    text-decoration: underline;
    text-decoration-color: #1890ff;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    font-weight: 500;
}

.link-text:active {
    color: #096dd9;
    text-decoration-color: #096dd9;
    opacity: 0.85;
}

.message-bubble.user .link-text {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.message-bubble.user .link-text:active {
    color: rgba(255, 255, 255, 0.9);
    text-decoration-color: rgba(255, 255, 255, 0.6);
}

.input-area {
    display: flex;
    align-items: center;
    padding: 0 12px 8px 12px;
    border-top: 1px solid #f0f0f0;
    background-color: #fafafa;
    border-radius: 0 0 10px 10px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.input-box {
    flex: 1;
    min-height: 36px;
    max-height: 120px;
    padding: 6px 12px;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    font-size: 16px;
    margin-right: 8px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.2;
    resize: none;
    overflow-y: auto;
    -webkit-tap-highlight-color: transparent;
    caret-color: #07c160;
    box-sizing: border-box;
    height: 36px;
    vertical-align: middle;
}

.input-box:focus {
    border-color: #07c160;
}

.input-box::placeholder {
    color: #999;
    font-size: 16px;
}

.voice-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    margin-right: 8px;
    background-color: #f0f9ff;
    color: #1890ff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6f7ff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.voice-btn:active {
    background-color: #e6f7ff;
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.voice-btn:hover {
    background-color: #e6f7ff;
    box-shadow: 0 4px 8px rgba(24, 144, 255, 0.2);
}

.voice-btn.recording {
    background-color: #fff1f0;
    color: #ff4d4f;
    border-color: #ffccc7;
    animation: pulse 1.5s infinite;
    box-shadow: 0 4px 8px rgba(255, 77, 79, 0.2);
}

.send-btn {
    width: 48px;
    height: 36px;
    border-radius: 18px;
    font-size: 12px;
    line-height: 36px;
    padding: 0;
    margin: 0;
    background-color: #07c160;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-weight: 500;
    cursor: pointer;
}

.send-btn:active {
    background-color: #06ad56;
}

.send-btn.disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.stop-btn {
    width: auto;
    min-width: 36px;
    padding: 0 12px;
    height: 36px;
    border-radius: 18px;
    background-color: #ff6b6b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
    gap: 0;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.stop-btn svg {
    flex-shrink: 0;
}

.stop-btn span {
    flex-shrink: 0;
    white-space: nowrap;
}

.stop-btn:active {
    background-color: #ee5a52;
    transform: scale(0.95);
}

.stop-btn:hover {
    background-color: #ee5a52;
}

.stop-btn.disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.stop-btn.disabled:hover {
    background-color: #cccccc;
}

/* 微信环境兼容性样式 */
.Weixin .stop-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    font-smoothing: antialiased;
    width: auto !important;
    min-width: 36px !important;
    padding: 0 12px !important;
    height: 36px !important;
    border-radius: 18px !important;
    background-color: #ff6b6b !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    cursor: pointer !important;
    gap: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: transparent !important;
    box-sizing: border-box !important;
}

.Weixin .stop-btn:active {
    background-color: #ee5a52 !important;
    transform: scale(0.95) !important;
}

.Weixin .stop-btn:hover {
    background-color: #ee5a52 !important;
}

.Weixin .stop-btn.disabled {
    background-color: #cccccc !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.Weixin .stop-btn.disabled:hover {
    background-color: #cccccc !important;
}

.clear-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f9ff;
    color: #1890ff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6f7ff;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.clear-btn:active {
    background-color: #e6f7ff;
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.clear-btn:hover {
    background-color: #e6f7ff;
    box-shadow: 0 4px 8px rgba(24, 144, 255, 0.2);
}

.clear-btn.disabled {
    background-color: #f5f5f5;
    color: #d9d9d9;
    border-color: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.clear-btn.disabled:hover {
    background-color: #f5f5f5;
    box-shadow: none;
}

.mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    transition: opacity 0.3s;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
}

.toast-show {
    opacity: 1;
    animation: toastSlideIn 0.3s ease;
}

@keyframes toastSlideIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-show {
    opacity: 1;
}

.modal {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 80%;
    max-width: 320px;
    text-align: center;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.modal-content {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    white-space: pre-line;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    flex: 1;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-cancel {
    background-color: #f0f0f0;
    color: #666;
}

.modal-cancel:active {
    background-color: #e0e0e0;
}

.modal-confirm {
    background-color: #07c160;
    color: #fff;
}

.modal-confirm:active {
    background-color: #06ad56;
}

.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.confirm-dialog {
    background-color: #fff;
    border-radius: 12px;
    width: 80%;
    max-width: 320px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.confirm-dialog-header {
    padding: 16px 20px 8px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.confirm-dialog-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.confirm-dialog-body {
    padding: 16px 20px;
}

.confirm-dialog-body p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.confirm-dialog-footer {
    padding: 12px 20px 16px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}

.confirm-btn.cancel {
    background-color: #f0f0f0;
    color: #666;
}

.confirm-btn.cancel:active {
    background-color: #e0e0e0;
}

.confirm-btn.confirm {
    background-color: #07c160;
    color: #fff;
}

.confirm-btn.confirm:active {
    background-color: #06ad56;
}

/* 常用回复区域样式 */
.common-replies-area {
    padding: 8px 12px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    background-color: #fafafa;
}

.common-replies-header {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.common-replies-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.common-reply-item {
    padding: 6px 12px;
    background-color: #fff;
    color: #333;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    transition: all 0.2s ease;
}

.common-reply-item:hover {
    background-color: #f0f0f0;
    border-color: #07c160;
}

.common-reply-item:active {
    background-color: #e6f7ef;
    border-color: #06ad56;
}

.loading-replies,
.no-replies {
    font-size: 12px;
    color: #999;
    padding: 4px 0;
}

/* 消息发送动画 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-item {
    animation: messageSlideIn 0.3s ease-out forwards;
    will-change: transform, opacity;
}

/* 输入反馈动画 */
.input-feedback {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-feedback.visible {
    opacity: 1;
}

/* 常用回复按钮动画 */
.common-reply-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.common-reply-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.common-reply-item:active {
    transform: translateY(0);
}

/* 滚动条美化 */
.message-list::-webkit-scrollbar {
    width: 6px;
}

.message-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.message-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.message-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 打字机效果光标 */
.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background-color: #07c160;
    animation: blink 1s infinite;
    margin-left: 4px;
    vertical-align: middle;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 响应式适配 */
@media (max-width: 480px) {
    .chat-window {
        height: 85%;
        max-height: 85vh;
    }
    
    .input-area {
        padding: 8px 10px 8px 10px;
    }
    
    .input-box {
        min-height: 40px;
        max-height: 100px;
        line-height: 1.2;
        font-size: 16px;
        border-radius: 20px;
        height: 40px;
        vertical-align: middle;
    }
    
    .voice-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin-right: 6px;
        background-color: #f0f9ff;
        color: #1890ff;
        border: 1px solid #e6f7ff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .send-btn {
        height: 40px;
        line-height: 40px;
        border-radius: 20px;
    }
    
    .clear-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: #f0f9ff;
        color: #1890ff;
        border: 1px solid #e6f7ff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .stop-btn {
        width: 40px;
        height: 40px;
        border-radius: 20px;
    }
    
    .message-row.user {
        padding-right: 6px;
    }
    
    .message-row.service {
        padding-left: 6px;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .message-content.user {
        margin-right: 6px;
        max-width: 74%;
    }
    
    .message-content.service {
        margin-left: 6px;
        max-width: 74%;
    }
    
    .message-bubble {
        padding: 10px 14px;
        font-size: 14px;
    }
}

@media (max-width: 375px) {
    .chat-window {
        height: 90%;
        max-height: 90vh;
    }
    
    .input-area {
        padding: 0 8px 8px 8px;
    }
    
    .voice-btn {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        margin-right: 6px;
        background-color: #f0f9ff;
        color: #1890ff;
        border: 1px solid #e6f7ff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .input-box {
        height: 44px;
        line-height: 44px;
        font-size: 16px;
        border-radius: 22px;
        vertical-align: middle;
    }
    
    .send-btn {
        height: 44px;
        line-height: 44px;
        border-radius: 22px;
    }
    
    .message-row.user {
        padding-right: 4px;
    }
    
    .message-row.service {
        padding-left: 4px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .message-content.user {
        margin-right: 4px;
        max-width: 76%;
    }
    
    .message-content.service {
        margin-left: 4px;
        max-width: 76%;
    }
    
    .message-bubble {
        padding: 8px 12px;
        font-size: 13px;
    }
}
