* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    background: linear-gradient(145deg, #f6f9fc 0%, #e6f0f5 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.app-container {
    max-width: 1000px;
    width: 100%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.4);
    overflow: hidden;
}

.app-header {
    background: linear-gradient(135deg, #0a2b4e, #1b4a7a);
    color: white;
    padding: 30px 40px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.app-header h1 {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.main-content {
    padding: 30px 40px;
}

.chat-box {
    background: white;
    border-radius: 24px;
    padding: 20px;
    height: 320px;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.03), 0 8px 18px rgba(0,20,40,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 25px;
    scroll-behavior: smooth;
}

.message {
    margin: 12px 0;
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.message.user {
    background: linear-gradient(135deg, #d9e9ff, #c0dcff);
    color: #003366;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(0,60,130,0.1);
}

.message.bot {
    background: linear-gradient(135deg, #f0f4fa, #e2eaf3);
    color: #1a2b3c;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0,0,0,0.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chart-container {
    background: white;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(0,20,40,0.08);
    border: 1px solid rgba(255,255,255,0.8);
}

.input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

#user-input {
    flex: 1;
    padding: 16px 22px;
    border: none;
    border-radius: 60px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,20,40,0.08), inset 0 1px 3px rgba(0,0,0,0.05);
    font-size: 1rem;
    transition: all 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
}

#user-input:focus {
    outline: none;
    box-shadow: 0 8px 18px rgba(26, 74, 128, 0.15), inset 0 1px 3px #fff;
    border-color: #1b4a7a;
}

#send-btn {
    background: linear-gradient(145deg, #1b4a7a, #0f2f4f);
    color: white;
    border: none;
    border-radius: 60px;
    padding: 0 36px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0,30,60,0.3);
    transition: transform 0.15s, box-shadow 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
}

#send-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0,40,80,0.4);
}

#send-btn:active {
    transform: scale(0.98);
}

.trace-panel {
    background: rgba(10, 20, 30, 0.05);
    border-radius: 20px;
    padding: 18px 22px;
    font-size: 0.9rem;
    color: #2c3e50;
    border-left: 4px solid #1b4a7a;
    backdrop-filter: blur(4px);
    box-shadow: inset 0 1px 4px rgba(255,255,255,0.5);
}

.trace-panel h3 {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1b4a7a;
}

.trace-panel ul {
    list-style: none;
    padding-left: 0;
}

.trace-panel li {
    padding: 6px 0 6px 24px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%231b4a7a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>') left center no-repeat;
    background-size: 16px;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
}

.trace-panel li:last-child {
    border-bottom: none;
}

.app-footer {
    background: #eef3f8;
    padding: 15px 40px;
    text-align: center;
    font-size: 0.9rem;
    color: #3a5670;
    border-top: 1px solid rgba(255,255,255,0.6);
}

/* Scrollbar */
.chat-box::-webkit-scrollbar {
    width: 8px;
}
.chat-box::-webkit-scrollbar-track {
    background: #eef3f8;
    border-radius: 10px;
}
.chat-box::-webkit-scrollbar-thumb {
    background: #b0c6da;
    border-radius: 10px;
}