body { 
    font-family: Arial, sans-serif; 
    margin: 0; 
    padding: 0; 
}

/* Container for the chat icon and label */
#chatContainer {
    position: fixed;
    bottom: 7vh;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 99999;
}

/* Label above the icon */
#chatLabel {
    margin-bottom: 5px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.3);
}

/* Floating chat icon */
#chatIcon {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
#chatIcon:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 32px rgba(30, 58, 138, 0.6);
}

/* Chat Window - Now Covers 80% of Viewport */
#chatBox {
    position: fixed;
    width: 90vw; /* 80% of viewport width */
    height: 70vh; /* 80% of viewport height */
    bottom: 12vh; /* Center vertically */
    left: 10vw; /* Center horizontally */
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

/* Chat Header */
#chatHeader {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 15px;
    font-size: 18px;
    text-align: center;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
}

/* Chat Content Area */
#chatContent {
    padding: 15px;
    border: 1px solid #ddd;
    flex-grow: 1;
    overflow-y: auto;
}

/* Links inside chat content */
#chatContent a {
    color: #007bff !important;
    text-decoration: underline;
    word-break: break-all;
}

/* User and System Messages */
.user-message, .system-message {
    font-family: Arial, sans-serif;
    font-size: 14px;
    margin: 8px 0;
    max-width: 75%;
    padding: 10px;
    border-radius: 8px;
    word-wrap: break-word;
}

/* User message styling */
.user-message {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
}

/* System message styling */
.system-message {
    background-color: #f1f1f1;
    color: black;
    align-self: flex-start;
}

/* Input Area */
#chatInput {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(30, 58, 138, 0.1);
    padding: 20px;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    border-radius: 0 0 10px 10px;
}

#chatInput textarea {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    outline: none;
    resize: none;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-height: 20px;
    max-height: 120px;
    line-height: 1.4;
}

#chatInput textarea:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
    transform: translateY(-1px);
}

#chatInput textarea::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Send Button - 现代化设计 */
#chatInput button {
    padding: 16px 24px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    border-radius: 16px;
    font-weight: 600;
    font-size: 15px;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.3);
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

#chatInput button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#chatInput button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(30, 58, 138, 0.4);
}

#chatInput button:hover::before {
    left: 100%;
}

#chatInput button:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

/* 添加发送图标 */
#chatInput button::after {
    content: '→';
    font-size: 18px;
    font-weight: bold;
    margin-left: 4px;
}

/* Images inside messages */
#chatContent img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* Tables inside chat */
#chatContent table {
    width: 100%;
    border-collapse: collapse;
}

#chatContent th, #chatContent td {
    padding: 8px;
    border: 1px solid #ccc;
}

.hidden {
    display: none;
}
