body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    position: relative;
    overflow: hidden;
}

/* 動的背景 - PC表示のみ */
@media (min-width: 769px) {
    .background-animation {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 0;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f1f3f5 100%);
        overflow: hidden;
    }
    
    .background-animation::before {
        content: '';
        position: absolute;
        width: 200%;
        height: 200%;
        top: -50%;
        left: -50%;
        background-image: 
            radial-gradient(circle at 20% 80%, rgba(200, 220, 255, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(220, 200, 255, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 40% 40%, rgba(210, 210, 230, 0.2) 0%, transparent 50%),
            radial-gradient(circle at 60% 60%, rgba(230, 210, 240, 0.2) 0%, transparent 50%);
        animation: backgroundMove 20s ease-in-out infinite;
    }
    
    @keyframes backgroundMove {
        0%, 100% {
            transform: translate(0, 0) rotate(0deg);
        }
        25% {
            transform: translate(5%, 5%) rotate(1deg);
        }
        50% {
            transform: translate(-3%, 3%) rotate(-1deg);
        }
        75% {
            transform: translate(3%, -5%) rotate(0.5deg);
        }
    }
    
    .floating-shapes {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
    }
    
    .shape {
        position: absolute;
        border-radius: 50%;
        background: rgba(102, 126, 234, 0.25);
        backdrop-filter: blur(2px);
    }
    
    .shape:nth-child(1) {
        width: 300px;
        height: 300px;
        top: 10%;
        left: 10%;
        animation: float 15s ease-in-out infinite;
    }
    
    .shape:nth-child(2) {
        width: 200px;
        height: 200px;
        top: 60%;
        right: 10%;
        animation: float 12s ease-in-out infinite 2s;
    }
    
    .shape:nth-child(3) {
        width: 150px;
        height: 150px;
        bottom: 20%;
        left: 15%;
        animation: float 18s ease-in-out infinite 4s;
    }
    
    .shape:nth-child(4) {
        width: 250px;
        height: 250px;
        top: 40%;
        right: 20%;
        animation: float 14s ease-in-out infinite 1s;
    }
    
    .shape:nth-child(5) {
        width: 180px;
        height: 180px;
        bottom: 10%;
        right: 30%;
        animation: float 16s ease-in-out infinite 3s;
    }
    
    .shape:nth-child(6) {
        width: 120px;
        height: 120px;
        top: 25%;
        left: 40%;
        animation: float 13s ease-in-out infinite 5s;
    }
    
    @keyframes float {
        0%, 100% {
            transform: translate(0, 0) scale(1);
            opacity: 0.3;
        }
        25% {
            transform: translate(30px, -30px) scale(1.1);
            opacity: 0.4;
        }
        50% {
            transform: translate(-20px, 20px) scale(0.9);
            opacity: 0.35;
        }
        75% {
            transform: translate(20px, 30px) scale(1.05);
            opacity: 0.4;
        }
    }
    
    .particles {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
    }
    
    .particle {
        position: absolute;
        width: 3px;
        height: 3px;
        background: rgba(102, 126, 234, 0.8);
        border-radius: 50%;
    }
    
    .particle:nth-child(1) { top: 20%; left: 10%; animation: particleFloat 8s ease-in-out infinite; }
    .particle:nth-child(2) { top: 40%; left: 20%; animation: particleFloat 10s ease-in-out infinite 1s; }
    .particle:nth-child(3) { top: 60%; left: 30%; animation: particleFloat 12s ease-in-out infinite 2s; }
    .particle:nth-child(4) { top: 80%; left: 40%; animation: particleFloat 9s ease-in-out infinite 3s; }
    .particle:nth-child(5) { top: 30%; right: 10%; animation: particleFloat 11s ease-in-out infinite 4s; }
    .particle:nth-child(6) { top: 50%; right: 20%; animation: particleFloat 13s ease-in-out infinite 5s; }
    .particle:nth-child(7) { top: 70%; right: 30%; animation: particleFloat 10s ease-in-out infinite 1.5s; }
    .particle:nth-child(8) { top: 15%; left: 50%; animation: particleFloat 14s ease-in-out infinite 2.5s; }
    .particle:nth-child(9) { top: 85%; left: 60%; animation: particleFloat 9s ease-in-out infinite 3.5s; }
    .particle:nth-child(10) { top: 45%; right: 40%; animation: particleFloat 11s ease-in-out infinite 4.5s; }
    
    @keyframes particleFloat {
        0%, 100% {
            transform: translateY(0) translateX(0);
            opacity: 0.6;
        }
        25% {
            transform: translateY(-40px) translateX(20px);
            opacity: 1;
        }
        50% {
            transform: translateY(-80px) translateX(-10px);
            opacity: 0.8;
        }
        75% {
            transform: translateY(-40px) translateX(30px);
            opacity: 1;
        }
    }
}

/* モバイルでは通常の背景 */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    position: relative;
    z-index: 1;
}

/* PC表示時は背景を透明に */
@media (min-width: 769px) {
    .chat-container {
        background-color: rgba(255, 255, 255, 0.95);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
        backdrop-filter: blur(10px);
    }
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header .header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header .c-logo {
    display: flex;
    align-items: center;
}

.chat-header .c-logo img {
    width: 87px;
    height: 21px;
}

.chat-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.chat-header .back-btn {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    transition: background 0.3s;
}

.chat-header .back-btn:hover {
    background: rgba(255,255,255,0.3);
}

@media (max-width: 768px) {
    .chat-header .header-left {
        gap: 10px;
    }
    
    .chat-header .c-logo img {
        width: 87px;
        height: 21px;
    }
    
    .chat-header h1 {
        font-size: 14px;
    }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

/* PC表示時は背景を透明に */
@media (min-width: 769px) {
    .chat-messages {
        background: transparent;
    }
}

.message {
    margin-bottom: 15px;
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    justify-content: flex-end;
}

.message.bot {
    justify-content: flex-start;
    align-items: flex-end;
    gap: 8px;
}

.message.bot .profile-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #667eea;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    border: 2px solid #667eea;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 5px;
}

.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    border: 2px solid #667eea;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    align-items: center;
}

.typing-indicator.active {
    display: flex;
}

.message.bot .typing-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.typing-indicator .typing-text {
    font-size: 14px;
    color: #667eea;
    margin-right: 8px;
    font-weight: 500;
}

.typing-indicator .typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-indicator .typing-dots span {
    height: 8px;
    width: 8px;
    background: #667eea;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.3s linear infinite;
}

.typing-indicator .typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator .typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator .typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chat-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #667eea;
}

.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.3s;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.welcome-message .operator-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 3px solid #667eea;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.welcome-message .operator-name {
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 20px;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #667eea;
    color: #667eea;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-reply-btn:hover {
    background: #667eea;
    color: white;
}

@media (max-width: 768px) {
    .chat-container {
        max-width: 100%;
    }
    
    .message-content {
        max-width: 85%;
    }
}
