/* 基础重置与全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
}

/* 动态海洋科技风背景 */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a192f, #112940, #0f3460);
    overflow: hidden;
    z-index: -1;
}
.wave {
    position: absolute;
    width: 200%;
    height: 200%;
    border-radius: 45%;
    background: rgba(30, 136, 229, 0.1);
    animation: wave 20s linear infinite;
}
.wave:nth-child(1) {
    top: -150%;
    left: -50%;
    animation-duration: 15s;
}
.wave:nth-child(2) {
    top: -140%;
    left: -50%;
    animation-duration: 25s;
    animation-delay: 2s;
}
.wave:nth-child(3) {
    top: -130%;
    left: -50%;
    animation-duration: 20s;
    animation-delay: 5s;
}
.glow-point {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(100, 181, 246, 0.8);
    border-radius: 50%;
    animation: glow 3s infinite alternate;
}
@keyframes wave {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(100, 181, 246, 0.5); }
    100% { box-shadow: 0 0 15px rgba(100, 181, 246, 0.9); }
}

/* 头部导航 */
header {
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 25, 47, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(66, 165, 245, 0.3);
}
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}
.logo-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.logo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.logo-text {
    color: #e3f2fd;
    font-size: 24px;
    font-weight: 700;
}
.nav-menu {
    display: flex;
    gap: 30px;
}
.nav-item {
    color: #bbdefb;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}
.nav-item:hover {
    color: #e3f2fd;
    background: rgba(66, 165, 245, 0.2);
}
.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #42a5f5;
    transition: width 0.3s ease;
}
.nav-item:hover::after {
    width: 100%;
}
.nav-item.active {
    color: #e3f2fd;
    background: rgba(66, 165, 245, 0.2);
}
.nav-item.active::after {
    width: 100%;
}
.mobile-menu-btn {
    display: none;
    font-size: 24px;
    color: #e3f2fd;
    background: none;
    border: none;
    cursor: pointer;
}

/* 页面主体样式 */
.interaction-main {
    width: 90%;
    margin: 40px auto;
    padding-bottom: 80px;
}

/* 页面标题区 */
.interaction-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}
.interaction-title {
    color: #e3f2fd;
    font-size: 32px;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(30, 136, 229, 0.4);
}
.interaction-subtitle {
    color: #bbdefb;
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 核心功能区 */
.interaction-core {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    margin-bottom: 50px;
}

/* 通用卡片样式 */
.card-title {
    color: #e3f2fd;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(66, 165, 245, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title i {
    color: #42a5f5;
    font-size: 20px;
}
.mode-card, .text-interact-card, .voice-interact-card, .faq-card, .chat-card, .history-card {
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(66, 165, 245, 0.3);
    padding: 25px;
    margin-bottom: 30px;
}

/* 左侧操作区 */
.mode-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mode-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(10, 25, 47, 0.4);
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #bbdefb;
}
.mode-item.active {
    border-color: #42a5f5;
    background: rgba(66, 165, 245, 0.1);
}
.mode-item:hover {
    background: rgba(10, 25, 47, 0.5);
}
.mode-item input {
    accent-color: #2196f3;
    width: 18px;
    height: 18px;
}
.mode-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(66, 165, 245, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #42a5f5;
    font-size: 20px;
}
.mode-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mode-name {
    color: #e3f2fd;
    font-size: 16px;
    font-weight: 500;
}
.mode-desc {
    font-size: 13px;
    color: #90caf9;
}

/* 文本交互区 */
.text-input-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.text-input {
    background: rgba(10, 25, 47, 0.8);
    border: 1px solid rgba(66, 165, 245, 0.3);
    color: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    resize: none;
    min-height: 120px;
}
.text-input::placeholder {
    color: #90caf9;
    opacity: 0.7;
}
.text-input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    align-items: center;
}
.clear-btn {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: rgba(66, 165, 245, 0.1);
    border: 1px solid rgba(66, 165, 245, 0.3);
    color: #42a5f5;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.clear-btn:hover {
    background: rgba(66, 165, 245, 0.2);
    color: #e3f2fd;
}
.send-btn {
    padding: 10px 24px;
    background: #2196f3;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.send-btn:hover {
    background: #1976d2;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(33, 150, 243, 0.3);
}
.send-btn:disabled {
    background: rgba(66, 165, 245, 0.2);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 语音交互区 */
.voice-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 15px 0;
}
.voice-status {
    color: #bbdefb;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.voice-status i {
    color: #42a5f5;
}
.voice-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(66, 165, 245, 0.1);
    border: 2px solid #42a5f5;
    color: #42a5f5;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.voice-btn:hover {
    background: #2196f3;
    color: #fff;
}
.voice-btn.recording {
    background: #ef5350;
    border-color: #ef5350;
    color: #fff;
    animation: pulse 1.5s infinite alternate;
}
@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}
.voice-hint {
    color: #90caf9;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    width: 100%;
}

/* 常见问题快捷入口 */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.faq-item {
    background: rgba(10, 25, 47, 0.4);
    border: 1px solid rgba(66, 165, 245, 0.2);
    border-radius: 8px;
    padding: 12px 15px;
    color: #bbdefb;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.faq-item:hover {
    background: rgba(10, 25, 47, 0.5);
    border-color: #42a5f5;
}
.faq-item i {
    color: #42a5f5;
    font-size: 12px;
}

/* 右侧对话与历史区 */
.chat-card {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}
.chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 25px;
    color: #bbdefb;
    padding: 20px;
}
.placeholder-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(66, 165, 245, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #42a5f5;
    font-size: 40px;
}
.placeholder-text {
    text-align: center;
    font-size: 16px;
    line-height: 1.8;
}
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.chat-container::-webkit-scrollbar {
    width: 6px;
}
.chat-container::-webkit-scrollbar-track {
    background: rgba(10, 25, 47, 0.4);
    border-radius: 3px;
}
.chat-container::-webkit-scrollbar-thumb {
    background: rgba(66, 165, 245, 0.3);
    border-radius: 3px;
}
.chat-container::-webkit-scrollbar-thumb:hover {
    background: #42a5f5;
}
.chat-message {
    display: flex;
    gap: 15px;
    max-width: 90%;
}
.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(66, 165, 245, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-avatar.user {
    background: rgba(76, 175, 80, 0.1);
}
.chat-avatar i {
    color: #42a5f5;
    font-size: 20px;
}
.chat-avatar.user i {
    color: #4caf50;
}
.chat-content {
    background: rgba(10, 25, 47, 0.4);
    border-radius: 12px;
    padding: 15px;
    position: relative;
}
.chat-message.user .chat-content {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.chat-message.bot .chat-content {
    border: 1px solid rgba(66, 165, 245, 0.3);
}
.chat-text {
    color: #bbdefb;
    font-size: 14px;
    line-height: 1.6;
}
.chat-time {
    color: #90caf9;
    font-size: 12px;
    margin-top: 8px;
    text-align: right;
}
.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 15px;
    color: #bbdefb;
}
.loading-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(66, 165, 245, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #42a5f5;
    font-size: 20px;
}
.loading-icon i {
    animation: spin 2s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-text {
    font-size: 16px;
}

/* 历史记录卡片 */
.history-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}
.clear-all {
    padding: 6px 16px;
    background: rgba(66, 165, 245, 0.1);
    color: #42a5f5;
    border: 1px solid rgba(66, 165, 245, 0.3);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.clear-all:hover {
    background: rgba(239, 83, 80, 0.1);
    color: #ef5350;
    border-color: rgba(239, 83, 80, 0.3);
}
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 10px;
}
.history-list::-webkit-scrollbar {
    width: 6px;
}
.history-list::-webkit-scrollbar-track {
    background: rgba(10, 25, 47, 0.4);
    border-radius: 3px;
}
.history-list::-webkit-scrollbar-thumb {
    background: rgba(66, 165, 245, 0.3);
    border-radius: 3px;
}
.history-list::-webkit-scrollbar-thumb:hover {
    background: #42a5f5;
}
.history-item {
    background: rgba(10, 25, 47, 0.4);
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}
.history-item:hover {
    background: rgba(10, 25, 47, 0.5);
    border: 1px solid rgba(66, 165, 245, 0.3);
}
.history-question {
    color: #bbdefb;
    font-size: 14px;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-time {
    color: #90caf9;
    font-size: 12px;
    margin-left: 10px;
}
.history-actions {
    display: flex;
    gap: 8px;
}
.history-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #90caf9;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.history-action-btn:hover {
    background: rgba(66, 165, 245, 0.1);
    color: #e3f2fd;
}
.history-action-btn.delete-btn:hover {
    color: #ef5350;
}

/* 交互技能库 */
.skill-library {
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(66, 165, 245, 0.3);
    padding: 25px;
}
.library-title {
    color: #e3f2fd;
    font-size: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.library-title i {
    color: #42a5f5;
    font-size: 24px;
}
.skill-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.skill-item {
    background: rgba(10, 25, 47, 0.4);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    gap: 15px;
}
.skill-item:hover {
    transform: translateY(-5px);
    border: 1px solid rgba(66, 165, 245, 0.5);
    box-shadow: 0 10px 20px rgba(30, 136, 229, 0.15);
}
.skill-icon {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(66, 165, 245, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #42a5f5;
    font-size: 24px;
}
.skill-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.skill-name {
    color: #e3f2fd;
    font-size: 16px;
    font-weight: 500;
}
.skill-desc {
    color: #bbdefb;
    font-size: 14px;
    line-height: 1.5;
}
.skill-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.skill-tag {
    font-size: 12px;
    padding: 3px 8px;
    background: rgba(66, 165, 245, 0.1);
    color: #90caf9;
    border-radius: 10px;
}

/* 底部样式 */
footer {
    width: 100%;
    padding: 40px 5%;
    background: rgba(10, 25, 47, 0.8);
    border-top: 1px solid rgba(66, 165, 245, 0.3);
    margin-top: 80px;
}
.footer-content {
    color: #bbdefb;
    text-align: center;
    font-size: 14px;
    line-height: 1.8;
}

/* 响应式适配 */
@media (max-width: 1200px) {
    .interaction-core {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100px;
        right: 5%;
        background: rgba(10, 25, 47, 0.9);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        padding: 20px;
        border: 1px solid rgba(66, 165, 245, 0.3);
        z-index: 999;
    }
    .nav-menu.active {
        display: flex;
    }
    .mobile-menu-btn {
        display: block;
    }
    .interaction-header {
        margin-bottom: 30px;
    }
    .interaction-title {
        font-size: 28px;
    }
    .skill-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    .chat-message {
        max-width: 95%;
    }
}
@media (max-width: 480px) {
    .interaction-subtitle {
        font-size: 16px;
    }
    .mode-card, .text-interact-card, .voice-interact-card, .faq-card, .chat-card, .history-card {
        padding: 15px;
    }
    .card-title {
        font-size: 16px;
    }
    .text-input-actions {
        flex-direction: column;
        align-items: flex-end;
    }
    .send-btn {
        width: 100%;
        justify-content: center;
    }
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .history-question {
        max-width: 100%;
        white-space: normal;
    }
    .history-actions {
        align-self: flex-end;
    }
}