/* 科技感样式增强 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 科技感滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 26, 51, 0.8);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 170, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 170, 255, 0.8);
}

/* 数字流动画效果 */
@keyframes digital-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 脉冲动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 170, 255, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 170, 255, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 170, 255, 0);
    }
}

/* 呼吸灯效果 */
@keyframes breathe {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

/* 语音波形动画 */
@keyframes voice-wave {
    0% {
        transform: scaleY(0.5);
    }
    50% {
        transform: scaleY(1.5);
    }
    100% {
        transform: scaleY(0.5);
    }
}

/* 网格背景效果 */
body {
    background-image: 
        linear-gradient(rgba(0, 170, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 170, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center center;
}

/* 语音按钮动画 */
#voice-btn {
    position: relative;
    overflow: hidden;
}

#voice-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(0, 170, 255, 0) 0%,
        rgba(0, 170, 255, 0.2) 50%,
        rgba(0, 170, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* 语音识别中状态 */
#voice-btn.recording {
    animation: pulse 1.5s infinite;
    background-color: #ff4444;
}

#voice-btn.recording:hover {
    background-color: #ff6666;
}

/* 视频容器效果 */
#video-container {
    position: relative;
}

#video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 26, 51, 0.3) 0%,
        rgba(0, 51, 102, 0.3) 100%
    );
    pointer-events: none;
}

/* 信息卡片效果 */
.grid-cols-3-custom > div {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.grid-cols-3-custom > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 170, 255, 0.2);
}

.grid-cols-3-custom > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 170, 255, 1) 50%,
        transparent 100%
    );
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.grid-cols-3-custom > div:hover::before {
    transform: scaleX(1);
}

/* 图片悬停效果 */
.grid-cols-3-custom > div img {
    transition: transform 0.5s ease;
}

.grid-cols-3-custom > div:hover img {
    transform: scale(1.05);
}

/* 状态提示动画 */
#status-toast {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 数字人视频区域效果 */
#video-container {
    /* animation: breathe 4s infinite; */
}

/* 语音结果区域效果 */
#voice-result {
    position: relative;
    overflow: hidden;
}

#voice-result::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 170, 255, 0.5) 50%,
        transparent 100%
    );
    animation: slideLeft 2s infinite;
}

@keyframes slideLeft {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 响应式设计 */
@media (max-width: 1280px) {
    .grid-cols-3-custom {
        gap: 1px;
    }
    
    .grid-cols-3-custom > div img {
        object-fit: cover;
    }
}

@media (max-width: 1024px) {
    .grid-cols-3-custom {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }
    
    .col-span-3 {
        overflow-y: auto;
        padding: 1px;
    }
    
    #voice-btn {
        width: 48px;
        height: 48px;
    }
    
    #voice-btn i {
        font-size: 1.5rem;
    }
    
    #voice-status {
        font-size: 0.875rem;
    }
    
    #voice-result {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .col-span-1,
    .col-span-3 {
        grid-column: span 1 !important;
    }
    
    .grid-cols-3-custom {
        grid-template-columns: 1fr;
        gap: 3px;
    }
    
    #voice-recognition-container {
        max-width: 100%;
        padding: 12px;
    }
    
    #voice-btn {
        width: 40px;
        height: 40px;
    }
    
    #voice-btn i {
        font-size: 1.25rem;
    }
    
    #voice-status {
        font-size: 0.75rem;
    }
    
    #voice-result {
        font-size: 0.625rem;
        min-height: 30px;
    }
    
    .grid-cols-3-custom > div {
        min-height: 120px;
    }
    
    .grid-cols-3-custom > div p {
        font-size: 0.75rem;
    }
    
    #status-toast {
        bottom: 20px;
        right: 20px;
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    body {
        background-size: 15px 15px;
    }
    
    #video-container .text-center i {
        font-size: 2.5rem;
    }
    
    #video-container .text-center p {
        font-size: 0.875rem;
    }
    
    .grid-cols-3-custom > div {
        min-height: 100px;
    }
    
    .grid-cols-3-custom > div p {
        font-size: 0.625rem;
    }
    
    #voice-recognition-container {
        padding: 8px;
    }
    
    #voice-btn {
        width: 36px;
        height: 36px;
    }
    
    #voice-btn i {
        font-size: 1rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .grid-cols-3-custom > div {
        touch-action: manipulation;
    }
    
    #voice-btn {
        cursor: pointer;
    }
    
    #voice-btn:active {
        transform: scale(0.95);
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    position: relative;
    width: 20px;
    height: 20px;
}

.loading div {
    position: absolute;
    top: 8px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #00aaff;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading div:nth-child(1) {
    left: 2px;
    animation: loading1 0.6s infinite;
}

.loading div:nth-child(2) {
    left: 2px;
    animation: loading2 0.6s infinite;
}

.loading div:nth-child(3) {
    left: 8px;
    animation: loading2 0.6s infinite;
}

.loading div:nth-child(4) {
    left: 14px;
    animation: loading3 0.6s infinite;
}

@keyframes loading1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes loading3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes loading2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(6px, 0);
    }
}

/* 语音波形指示器 */
.voice-wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 20px;
    margin: 10px 0;
}

.voice-wave-bar {
    width: 2px;
    height: 100%;
    background-color: #00aaff;
    animation: voice-wave 1s infinite ease-in-out;
}

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

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

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

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

/* 科技感文字效果 */
.text-tech {
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #00aaff 50%,
        #ffffff 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShine 3s linear infinite;
}

@keyframes textShine {
    to {
        background-position: 200% center;
    }
}