/**
 * 数学符号输入栏样式
 * 为不擅长使用电子设备的用户提供便捷的数学符号输入
 */

.math-symbols-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.math-symbols-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.math-symbols-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    color: white;
}

.math-symbols-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.math-symbols-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.math-symbols-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.math-symbols-content {
    display: none;
    animation: slideDown 0.3s ease;
}

.math-symbols-content.expanded {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.math-symbols-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.symbol-category {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 15px;
    flex: 1;
    min-width: 200px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-title {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.symbols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 8px;
}

.symbol-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2c3e50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.symbol-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.symbol-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.symbol-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.symbol-btn:active::after {
    width: 100px;
    height: 100px;
}

.symbol-description {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 8px;
    text-align: center;
    line-height: 1.2;
}

.quick-insert-area {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.quick-insert-title {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.common-expressions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.expression-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.expression-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.usage-tips {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin-top: 15px;
    border-left: 4px solid rgba(255, 255, 255, 0.5);
}

.usage-tips-title {
    color: white;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.usage-tips-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .math-symbols-categories {
        flex-direction: column;
    }
    
    .symbol-category {
        min-width: auto;
    }
    
    .symbols-grid {
        grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
        gap: 6px;
    }
    
    .symbol-btn {
        padding: 8px;
        font-size: 16px;
    }
    
    .common-expressions {
        justify-content: center;
    }
}

/* 动画效果 */
.symbol-inserted {
    animation: symbolInserted 0.5s ease;
}

@keyframes symbolInserted {
    0% {
        background: #4CAF50;
        transform: scale(1.2);
    }
    100% {
        background: rgba(255, 255, 255, 0.9);
        transform: scale(1);
    }
}

/* 工具提示 */
.symbol-btn[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.symbol-btn[title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    margin-bottom: 1px;
}